From 8d621cb8431cc70645071fa2c0da5b7c01d5082e Mon Sep 17 00:00:00 2001 From: eschnett Date: Sat, 1 Nov 2014 00:51:43 +0000 Subject: Update handling standard include/library paths git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/GSL/trunk@48 9e23cc15-e5c8-4d65-9080-beda90ea645b --- configure.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/configure.sh b/configure.sh index a2f5c32..f13a9a6 100644 --- a/configure.sh +++ b/configure.sh @@ -80,7 +80,7 @@ then # Set locations THORN=GSL NAME=gsl-1.16 - SRCDIR=$(dirname $0) + SRCDIR="$(dirname $0)" BUILD_DIR=${SCRATCH_BUILD}/build/${THORN} if [ -z "${GSL_INSTALL_DIR}" ]; then INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN} @@ -163,20 +163,23 @@ fi # Set options if [ -x ${GSL_DIR}/bin/gsl-config ]; then - # Obtain configuration options from GSL's configuration: - # - for INC_DIRS, remove "standard" directories, and remove -I - # prefix from flags - # - for LIB_DIRS, remove all -l flags, and remove "standard" - # directories, and remove -L prefix from flags + inc_dirs="$(${GSL_DIR}/bin/gsl-config --cflags)" + lib_dirs="$(${GSL_DIR}/bin/gsl-config --libs)" + libs="$(${GSL_DIR}/bin/gsl-config --libs)" + # Translate option flags into Cactus options: + # - for INC_DIRS, remove -I prefix from flags + # - for LIB_DIRS, remove all -l flags, and remove -L prefix from flags # - for LIBS, keep only -l flags, and remove -l prefix from flags - GSL_INC_DIRS="$(echo '' $(${GSL_DIR}/bin/gsl-config --cflags) '' | sed -e 's+ -I/include + +g;s+ -I/usr/include + +g;s+ -I/usr/local/include + +g' | sed -e 's/ -I/ /g')" - GSL_LIB_DIRS="$(echo '' $(${GSL_DIR}/bin/gsl-config --libs) '' | sed -e 's/ -l[^ ]*/ /g' | sed -e 's+ -L/lib + +g;s+ -L/lib64 + +g;s+ -L/usr/lib + +g;s+ -L/usr/lib64 + +g;s+ -L/usr/local/lib + +g;s+ -L/usr/local/lib64 + +g' | sed -e 's/ -L/ /g')" - GSL_LIBS="$(echo '' $(${GSL_DIR}/bin/gsl-config --libs) '' | sed -e 's/ -[^l][^ ]*/ /g' | sed -e 's/ -l/ /g')" + GSL_INC_DIRS="$(echo '' $(for flag in $inc_dirs; do echo '' $flag; done | sed -e 's/^ -I//'))" + GSL_LIB_DIRS="$(echo '' $(for flag in $lib_dirs; do echo '' $flag; done | grep -v '^ -l' | sed -e 's/^ -L//'))" + GSL_LIBS="$(echo '' $(for flag in $libs; do echo '' $flag; done | grep '^ -l' | sed -e 's/^ -l//'))" fi +GSL_INC_DIRS="$(${CCTK_HOME}/lib/sbin/strip-incdirs.sh ${GSL_INC_DIRS})" +GSL_LIB_DIRS="$(${CCTK_HOME}/lib/sbin/strip-libdirs.sh ${GSL_LIB_DIRS})" + # Pass options to Cactus echo "BEGIN MAKE_DEFINITION" -echo "HAVE_GSL = 1" echo "GSL_DIR = ${GSL_DIR}" echo "GSL_INC_DIRS = ${GSL_INC_DIRS}" echo "GSL_LIB_DIRS = ${GSL_LIB_DIRS}" -- cgit v1.2.3