Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[configure] add --with-pkg-config #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ BUILD=
EXTENSIONS=
EXT_MODS=
EXTRA_BUILD=
USE_PKG_CONFIG=0

usage()
{
Expand All @@ -48,6 +49,7 @@ usage()
echo " --with-flint=<path> Specify location of FLINT (default: /usr/local)"
echo " --with-arb=<path> Specify location of ARB (default: /usr/local)"
echo " --with-antic=<path> 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"
Expand Down Expand Up @@ -108,6 +110,9 @@ while [ "$1" != "" ]; do
--with-antic)
ANTIC_DIR=$(absolute_path "$VALUE")
;;
--with-pkg-config)
USE_PKG_CONFIG=1
;;
--build)
BUILD="$VALUE"
;;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down