From 387aee4cdf5f6c7255312d144346e37905315426 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 11 May 2018 21:07:58 -0700 Subject: 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 --- scripts/build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts') 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 -- cgit v1.2.3-70-g09d2