coap.h: Remove need for different coap.h files for different OS

./autogen.sh and ./configure no longer need to be run prior to running
make for Contiki, LwIP or RIOT from the appropriate examples sub-directory.

scripts/fix_version.sh now handles updating coap.h for the different
LIBCOAP_ and PACKAGE_ definitions.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2024-08-23 10:39:37 +01:00
1 parent 8899063a4a
commit e220c371be
15 files changed
+37 -211

No files matched your search

+6 -4
View File
@@ -3,18 +3,20 @@
FILES="coap_config.h.contiki \
coap_config.h.riot \
coap_config.h.windows \
include/coap@LIBCOAP_API_VERSION@/coap.h.riot \
include/coap@LIBCOAP_API_VERSION@/coap.h.windows \
examples/lwip/config/coap_config.h"
examples/lwip/config/coap_config.h \
include/coap@LIBCOAP_API_VERSION@/coap.h"
for file in $FILES ; do
sed -i $file -e 's/#define PACKAGE_NAME ".*"/#define PACKAGE_NAME "@PACKAGE_NAME@"/g'
sed -i $file -e 's/#define PACKAGE_STRING ".*"/#define PACKAGE_STRING "@PACKAGE_STRING@"/g'
sed -i $file -e 's/#define PACKAGE_VERSION ".*"/#define PACKAGE_VERSION "@PACKAGE_VERSION@"/g'
sed -i $file -e 's/#define PACKAGE_TARNAME ".*"/#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"/g'
sed -i $file -e 's/#define LIBCOAP_VERSION (.*)/#define LIBCOAP_VERSION (@LIBCOAP_VERSION@U)/g'
sed -i $file -e 's/#define LIBCOAP_PACKAGE_BUGREPORT (.*)/#define LIBCOAP_PACKAGE_BUGREPORT (@PACKAGE_BUGREPORT@)/g'
sed -i $file -e 's/#define LIBCOAP_PACKAGE_STRING ".*"/#define LIBCOAP_PACKAGE_STRING "@PACKAGE_STRING@"/g'
sed -i $file -e 's^#define LIBCOAP_PACKAGE_URL ".*"^#define LIBCOAP_PACKAGE_URL "@PACKAGE_URL@"^g'
sed -i $file -e 's/#define LIBCOAP_PACKAGE_VERSION ".*"/#define LIBCOAP_PACKAGE_VERSION "@PACKAGE_VERSION@"/g'
sed -i $file -e 's/#define LIBCOAP_VERSION (.*)/#define LIBCOAP_VERSION (@LIBCOAP_VERSION@ULL)/g'
done
for file in CMakeLists.txt ; do
+25 -10
View File
@@ -15,21 +15,36 @@ 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 && \
$DIR/configure $PREFIX --enable-tests --enable-silent-rules --enable-documentation --enable-examples --disable-dtls && \
make EXTRA_CFLAGS=-Werror && make install EXTRA_CFLAGS=-Werror
err=$?
tar xaf $ARCHIVE && cd $DIR
err=$terr
# LwIP
make -C $DIR/examples/lwip EXTRA_CFLAGS=-Werror
terr=$?
if [ $err = 0 ] ; then
make -C $DIR/examples/lwip EXTRA_CFLAGS=-Werror
err=$?
err=$terr
fi
# Contiki
make -C $DIR/examples/contiki
terr=$?
if [ $err = 0 ] ; then
make -C $DIR/examples/contiki
err=$?
err=$terr
fi
# RIOT
make -C $DIR/examples/riot
terr=$?
if [ $err = 0 ] ; then
make -C $DIR/examples/riot
err=$?
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