Commit ced1cad1 authored by ulrich_y's avatar ulrich_y

Use pkg-config to find GiNaC

parent 00a1647f
......@@ -122,6 +122,8 @@ gnuflags() {
eval addflag FFLAGS -Wno-uninitialized
}
findprog pkg-config PKGCONFIG pkg-config
if [ -z $FC ]; then
findprog fortran FC ifort gfortran || exit 1
fi
......@@ -368,7 +370,25 @@ CONF_LD=${LD:-$CONF_FC}
if $HAVE_GINAC ; then
eval addflag CPPFLAGS "-std=c++11"
if findlib ginac GINAC && findlib cln CLN ; then
if [[ ! -z "$CONF_PKGCONFIG" ]]; then
echo -n "Does pkg-config know about GiNaC... " 1>&3
if $CONF_PKGCONFIG --exists ginac ; then
echo "yes" 1>&3
eval addflag CPPFLAGS `$CONF_PKGCONFIG --cflags ginac`
eval addflag LFLAGS `$CONF_PKGCONFIG --libs ginac`
FOUND_GINAC=true
else
echo "no" 1>&3
FOUND_GINAC=false
fi
fi
if ! $FOUNDGINAC ; then
FOUNDGINAC=`findlib ginac GINAC && findlib cln CLN`
eval addflag LFLAGS "-L`dirname $CONF_GINAC`"
eval addflag LFLAGS "-L`dirname $CONF_CLN`"
eval addflag LFLAGS "-lginac -lcln"
fi
if $FOUNDGINAC; then
CONF_LD=${LD:-$CONF_CXX}
echo -n "Checking if GiNaC works... " 1>&3
tee $test.ginac.cpp << _EOF_ 1>&2
......@@ -385,9 +405,6 @@ int main() {
return 1;
}
_EOF_
eval addflag LFLAGS "-L`dirname $CONF_GINAC`"
eval addflag LFLAGS "-L`dirname $CONF_CLN`"
eval addflag LFLAGS "-lginac -lcln"
$CONF_CXX $CONF_CPPFLAGS $CONF_BITS -c $test.ginac.cpp
$CONF_LD -o $test.ginac $test.ginac.o $CONF_LFLAGS
./$test.ginac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment