diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-10-03 15:56:27 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-03 16:35:25 +0200 |
commit | 1ac90199e52c0db2a6a49790c68c3aeb319b1b2b (patch) | |
tree | 338cc09569fbc654fb229e979a7570f5e3d19284 /scripts/build.sh | |
parent | 42eae7e48bd4d4887d58d794548540f215bbc9b1 (diff) | |
download | subsurface-1ac90199e52c0db2a6a49790c68c3aeb319b1b2b.tar.gz |
build-system: fix libdivecomputer build on macOS
In some Mac environments autotools somehow think that we have clock_gettime(),
even though it isn't supported. Somehow the previous workaround stopped working
as make ended up re-running ../configure and overwriting our change. This tries
to work around that problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-x | scripts/build.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index 21d1b2472..54c194b10 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -346,14 +346,22 @@ if [ ! -f ../configure ] ; then fi CFLAGS="$OLDER_MAC -I$INSTALL_ROOT/include $LIBDC_CFLAGS" ../configure --prefix=$INSTALL_ROOT --disable-examples if [ $PLATFORM = Darwin ] ; then - # it seems that on my Mac some of the configure tests for libdivecomputer - # pass even though the feature tested for is actually missing - # let's hack around that - sed -i .bak 's/^#define HAVE_CLOCK_GETTIME 1/\/* #undef HAVE_CLOCK_GETTIME *\//' config.h + # remove some copmpiler options that aren't supported on Mac + # otherwise the log gets very noisy for i in $(find . -name Makefile) do sed -i .bak 's/-Wrestrict//;s/-Wno-unused-but-set-variable//' $i done + # it seems that on my Mac some of the configure tests for libdivecomputer + # pass even though the feature tested for is actually missing + # let's hack around that + # touch config.status, recreate config.h and then disable HAVE_CLOCK_GETTIME + # this seems to work so that the Makefile doesn't re-run the + # configure process and overwrite all the changes we just made + touch config.status + make config.h + grep CLOCK_GETTIME config.h + sed -i .bak 's/^#define HAVE_CLOCK_GETTIME 1/#undef HAVE_CLOCK_GETTIME /' config.h fi make -j4 make install |