From 34886e86c64f219b0ef42c78458b89e3411a67da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bobot?= Date: Sat, 11 Feb 2023 10:23:43 +0100 Subject: [PATCH] [configure] add --with-pkg-config --- configure | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 2533625..69ff9c0 100755 --- a/configure +++ b/configure @@ -34,6 +34,7 @@ BUILD= EXTENSIONS= EXT_MODS= EXTRA_BUILD= +USE_PKG_CONFIG=0 usage() { @@ -48,6 +49,7 @@ usage() echo " --with-flint= Specify location of FLINT (default: /usr/local)" echo " --with-arb= Specify location of ARB (default: /usr/local)" echo " --with-antic= Specify location of ANTIC (default: /usr/local)" + echo " --with-pkg-config Use pkg-config for finding libraries" echo " --build=arch-os Specify architecture/OS combination rather than use values from uname -m/-s" echo " --enable-shared Build a shared library (default)" echo " --disable-shared Do not build a shared library" @@ -108,6 +110,9 @@ while [ "$1" != "" ]; do --with-antic) ANTIC_DIR=$(absolute_path "$VALUE") ;; + --with-pkg-config) + USE_PKG_CONFIG=1 + ;; --build) BUILD="$VALUE" ;; @@ -177,7 +182,10 @@ done LIBS="m" -if [ -d "${GMP_DIR}/lib" ]; then +if [ "${USE_PKG_CONFIG}" = "1" ]; then + GMP_LIB_DIR=$(pkg-config --variable=libdir gmp) + GMP_INC_DIR=$(pkg-config --variable=includedir gmp) +elif [ -d "${GMP_DIR}/lib" ]; then GMP_LIB_DIR="${GMP_DIR}/lib" GMP_INC_DIR="${GMP_DIR}/include" elif [ -d "${GMP_DIR}/lib64" ]; then @@ -194,7 +202,10 @@ LIB_DIRS="${LIB_DIRS} ${GMP_LIB_DIR}" INC_DIRS="${INC_DIRS} ${GMP_INC_DIR}" LIBS="${LIBS} gmp" -if [ -d "${MPFR_DIR}/lib" ]; then +if [ "${USE_PKG_CONFIG}" = "1" ]; then + MPFR_LIB_DIR=$(pkg-config --variable=libdir mpfr) + MPFR_INC_DIR=$(pkg-config --variable=includedir mpfr) +elif [ -d "${MPFR_DIR}/lib" ]; then MPFR_LIB_DIR="${MPFR_DIR}/lib" MPFR_INC_DIR="${MPFR_DIR}/include" elif [ -d "${MPFR_DIR}/lib64" ]; then