diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-05-11 21:07:58 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-05-11 21:08:41 -0700 |
commit | 387aee4cdf5f6c7255312d144346e37905315426 (patch) | |
tree | d98c16e44b159b7e2be9b3e385563b9fc23332db /scripts/build.sh | |
parent | 240813401429709c3b53d144b4d25744ec65756f (diff) | |
download | subsurface-387aee4cdf5f6c7255312d144346e37905315426.tar.gz |
Mac: update build.sh to hack around autotools problem
For reasons I cannot explain, running configure for libdivecomputer claims that
certain feature tests pass, even though those features demonstrably aren't
there. This is happening for two compiler warning flags (-Wrestrict &
-Wno-unused-but-set-variable) as well as the test for clock_gettime.
To work around this, we manually edit the config.h file and the created
Makefile before building libdivecomputer.
This happened on macOS 10.11.6 with clang-800.0.42.1 (part of Xcode 8.2.1).
Tangentially related to:
See #1263
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-x | scripts/build.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index da9e192e5..f0f3f2f61 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -362,6 +362,16 @@ if [ ! -f ../configure ] ; then autoreconf --install .. 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 + for i in $(find . -name Makefile) + do + sed -i .bak 's/-Wrestrict//;s/-Wno-unused-but-set-variable//' $i + done +fi make -j4 make install |