aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-15 14:18:33 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-15 14:18:33 -0700
commitd943a843e50f88594d8a61c8438fbaf1fdb57d61 (patch)
tree55ab86f9e2866710d4950b77e437e16da88d826d /scripts
parent5656509f6169342b8bab3663a0a5da3a042ee8cb (diff)
downloadsubsurface-d943a843e50f88594d8a61c8438fbaf1fdb57d61.tar.gz
Mac build: deal with libdivecomputer and pkg-config
libdivecomputer asks pkg-config for the include paths for libusb-1.0 and hidapi, but then uses #include <libusb-1.0/libusb.h> and <hidapi/hidapi.h> which fails as those directories are part of the include path. So we manually add include paths without that last directory as well as a work around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index c67004bb6..2457b4c8f 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -211,6 +211,13 @@ if [[ $PLATFORM = Darwin || "$LIBGIT" < "24" ]] ; then
cmake $OLDER_MAC_CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_ROOT -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF ..
make -j4
make install
+ else
+ # we are getting libusb and hidapi from pkg-config and that goes wrong
+ # or more specifically, the way libdivecomputer references
+ # the include files goes wrong
+ LIBDC_CFLAGS=-I$(dirname $(pkg-config --cflags libusb-1.0 | sed -e 's/^-I//'))
+ LIBDC_CFLAGS="${LIBDC_CFLAGS} -I$(dirname $(pkg-config --cflags hidapi | sed -e 's/^-I//'))"
+ echo $LIBDC_CFLAGS
fi
LIBGIT_ARGS=" -DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include -DLIBGIT2_LIBRARIES=$INSTALL_ROOT/lib/libgit2.$SH_LIB_EXT "
@@ -276,7 +283,7 @@ if [ ! -f ../configure ] ; then
autoreconf --install ..
autoreconf --install ..
fi
-CFLAGS="$OLDER_MAC -I$INSTALL_ROOT/include" ../configure --prefix=$INSTALL_ROOT --disable-examples
+CFLAGS="$OLDER_MAC -I$INSTALL_ROOT/include $LIBDC_CFLAGS" ../configure --prefix=$INSTALL_ROOT --disable-examples
make -j4
make install