File: github_dist.sh

package info (click to toggle)
libcoap3 4.3.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,368 kB
  • sloc: ansic: 60,037; makefile: 1,280; sh: 938; python: 6
file content (51 lines) | stat: -rwxr-xr-x 1,181 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/sh

# This script creates a libcoap archive, unpacks it and does an
# out-of-tree build and installation afterwards.
#
# Copyright (C) 2021-2024 Olaf Bergmann <bergmann@tzi.org>
#
# This file is part of the CoAP C library libcoap. Please see README
# and COPYING for terms of use.
#

PREFIX=--prefix=`pwd`/libcoap-install
ARCHIVE=`ls -1t libcoap-*.tar.bz2 |head -1`
err=$?
echo $ARCHIVE
if test $err = 0 -a "x$ARCHIVE" != "x"; then
    DIR=`pwd`/`tar taf $ARCHIVE |cut -d/ -f1|head -1`
    tar xaf $ARCHIVE && cd $DIR
    err=$terr

    # LwIP
    make -C $DIR/examples/lwip EXTRA_CFLAGS=-Werror
    terr=$?
    if [ $err = 0 ] ; then
        err=$terr
    fi

    # Contiki
    make -C $DIR/examples/contiki
    terr=$?
    if [ $err = 0 ] ; then
        err=$terr
    fi

    # RIOT
    make -C $DIR/examples/riot
    terr=$?
    if [ $err = 0 ] ; then
        err=$terr
    fi

    # Standard build
    $DIR/configure $PREFIX --enable-tests  --enable-silent-rules --enable-documentation --enable-examples --disable-dtls && \
    make EXTRA_CFLAGS=-Werror && make install EXTRA_CFLAGS=-Werror
    terr=$?
    if [ $err = 0 ] ; then
        err=$terr
    fi
fi

exit $err