• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2
3# This script creates a libcoap archive, unpacks it and does an
4# out-of-tree build and installation afterwards.
5#
6# Copyright (C) 2021-2023 Olaf Bergmann <bergmann@tzi.org>
7#
8# This file is part of the CoAP C library libcoap. Please see README
9# and COPYING for terms of use.
10#
11
12PREFIX=--prefix=`pwd`/libcoap-install
13ARCHIVE=`ls -1t libcoap-*.tar.bz2 |head -1`
14err=$?
15echo $ARCHIVE
16if test $err = 0 -a "x$ARCHIVE" != "x"; then
17    DIR=`pwd`/`tar taf $ARCHIVE |cut -d/ -f1|head -1`
18    tar xaf $ARCHIVE && cd $DIR && \
19        $DIR/configure $PREFIX --enable-tests  --enable-silent-rules --enable-documentation --enable-examples --disable-dtls && \
20        make EXTRA_CFLAGS=-Werror && make install EXTRA_CFLAGS=-Werror
21    err=$?
22    if [ $err = 0 ] ; then
23        make -C $DIR/examples/lwip EXTRA_CFLAGS=-Werror
24        err=$?
25    fi
26    if [ $err = 0 ] ; then
27        make -C $DIR/examples/contiki
28        err=$?
29    fi
30    if [ $err = 0 ] ; then
31        make -C $DIR/examples/riot
32        err=$?
33    fi
34fi
35
36exit $err
37