Fix liblzma, liblz4, and libssh builds with minimum deployment version and SDK.

liblzma is used by libxml2, which is used by libwireshark, so we need
it.  It's build by xz, so we need to do the xz build with the
minimum-version and SDK flags.

liblz4 does its builds in its own unique way; it appears we need to set
MOREFLAGS to include the relevant flas.

libssh is built with CMake, so you have to do special magic to set the
SDK path; do it by running cmake with the MACOSX_DEPLOYMENT_TARGET and
SDKROOT environment variables.

Change-Id: Ia588632e5047c4a8a22fe6ef3a0844cfe7722df2
Reviewed-on: https://code.wireshark.org/review/32171
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2019-02-23 11:21:06 -08:00
parent c1a7b8ba7c
commit 1048b82ca3
1 changed files with 14 additions and 4 deletions

View File

@ -225,7 +225,12 @@ install_xz() {
$no_build && echo "Skipping installation" && return
bzcat xz-$XZ_VERSION.tar.bz2 | tar xf - || exit 1
cd xz-$XZ_VERSION
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0" ./configure || exit 1
#
# This builds and installs liblzma, which libxml2 uses, and
# Wireshark uses liblzma, so we need to build this with
# all the minimum-deployment-version and SDK stuff.
#
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0 $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
make $MAKE_BUILD_OPTS || exit 1
$DO_MAKE_INSTALL || exit 1
cd ..
@ -1303,8 +1308,13 @@ install_lz4() {
$no_build && echo "Skipping installation" && return
gzcat lz4-$LZ4_VERSION.tar.gz | tar xf - || exit 1
cd lz4-$LZ4_VERSION
# CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0 $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=0 $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" ./configure || exit 1
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=0 $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=0 $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" make $MAKE_BUILD_OPTS || exit 1
#
# No configure script here, but it appears that if MOREFLAGS is
# set, that's added to CFLAGS, and those are combined with LDFLAGS
# and CXXFLAGS into FLAGS, which is used when building source
# files and libraries.
#
MOREFLAGS="-D_FORTIFY_SOURCE=0 $VERSION_MIN_FLAGS $SDKFLAGS" make $MAKE_BUILD_OPTS || exit 1
$DO_MAKE_INSTALL || exit 1
cd ..
touch lz4-$LZ4_VERSION-done
@ -1461,7 +1471,7 @@ install_libssh() {
cd libssh-$LIBSSH_VERSION
mkdir build
cd build
CFLAGS="$CFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" CXXFLAGS="$CXXFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" LDFLAGS="$LDFLAGS $VERSION_MIN_FLAGS $SDKFLAGS" cmake -DWITH_GCRYPT=1 ../ || exit 1
MACOSX_DEPLOYMENT_TARGET=$min_osx_target SDKROOT="$SDKPATH" cmake -DWITH_GCRYPT=1 ../ || exit 1
make $MAKE_BUILD_OPTS || exit 1
$DO_MAKE_INSTALL || exit 1
cd ../..