Files
libcoap/scripts/fix_version.sh.in
T
Jon Shallow 83718a6d2f Cleanup building header files for different OS
'make distclean' removes header files built from the .in files, which
means that they are not available for different OS builds.

The same is true for CMakeLists.txt.

Remove the need for the .in files and update for libcoap revisions
by using a new script scripts/fix_version.sh created from
scripts/fix_version.sh.in.

CI has been updated to check revisions have been updated in the
appropriate places.

Do not remove libcoap-3.sym and libcoap-3.map when doing 'make distclean'
as they are git tracked files.
2024-08-06 16:56:19 +01:00

25 lines
1.2 KiB
Bash
Executable File

#/bin/sh
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"
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_STRING ".*"/#define LIBCOAP_PACKAGE_STRING "@PACKAGE_STRING@"/g'
sed -i $file -e 's/#define LIBCOAP_PACKAGE_VERSION ".*"/#define LIBCOAP_PACKAGE_VERSION "@PACKAGE_VERSION@"/g'
done
for file in CMakeLists.txt ; do
sed -i $file -e 's/^ VERSION .*$/ VERSION @LIBCOAP_PACKAGE_BASE@/g'
sed -i $file -e 's/set(LIBCOAP_API_VERSION .*)$/set(LIBCOAP_API_VERSION @LIBCOAP_API_VERSION@)/g'
sed -i $file -e 's/set(LIBCOAP_ABI_VERSION .*)$/set(LIBCOAP_ABI_VERSION @LIBCOAP_ABI_VERSION@)/g'
done