diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-09-11 12:48:33 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-09-11 16:50:56 +0200 |
commit | 83409e5b79ab224372dd8486249c668b2998a0a4 (patch) | |
tree | b7e66189368f9840ea6d8ca72d2c270a19868a38 /scripts | |
parent | 3bc6627dcc7d473d724b4d5c3af9a02151de587b (diff) |
Use CMake XCompile and collect host-triplet from ${CC}.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/get-and-build-libndpi.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/get-and-build-libndpi.sh b/scripts/get-and-build-libndpi.sh index 518ae820a..75158b43c 100755 --- a/scripts/get-and-build-libndpi.sh +++ b/scripts/get-and-build-libndpi.sh @@ -10,8 +10,13 @@ flock -x -n 42 || { exit 1; } +if [ ! -z "${CC}" ]; then + HOST_TRIPLET="$(${CC} ${CFLAGS} -dumpmachine)" +fi + cat <<EOF ------ environment variables ------ +HOST_TRIPLET=${HOST_TRIPLET} CC=${CC:-} CXX=${CXX:-} AR=${AR:-} @@ -19,7 +24,6 @@ RANLIB=${RANLIB:-} PKG_CONFIG=${PKG_CONFIG:-} CFLAGS=${CFLAGS:-} LDFLAGS=${LDFLAGS:-} -CROSS_COMPILE_TRIPLET=${CROSS_COMPILE_TRIPLET:-} ADDITIONAL_ARGS=${ADDITIONAL_ARGS:-} MAKE_PROGRAM=${MAKE_PROGRAM:-} DEST_INSTALL=${DEST_INSTALL:-} @@ -37,11 +41,7 @@ cd ./libnDPI test -r Makefile && make distclean DEST_INSTALL="${DEST_INSTALL:-$(realpath ./install)}" MAKE_PROGRAM="${MAKE_PROGRAM:-make -j4}" -if [ ! -z "${CROSS_COMPILE_TRIPLET}" ]; then - HOST_ARG="--host=${CROSS_COMPILE_TRIPLET}" -else - HOST_ARG="" -fi +HOST_ARG="--host=${HOST_TRIPLET}" ./autogen.sh --enable-option-checking=fatal \ --prefix="${DEST_INSTALL}" --exec-prefix="${DEST_INSTALL}" \ --includedir="${DEST_INSTALL}/include" --libdir="${DEST_INSTALL}/lib" \ |