From d943a843e50f88594d8a61c8438fbaf1fdb57d61 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 15 Jul 2017 14:18:33 -0700 Subject: 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 and 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 --- scripts/build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') 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 -- cgit v1.2.3-70-g09d2