Commit 13c902bd authored by ulrich_y's avatar ulrich_y

Added pkg-config (gfortran has no default install path)

parent 5de82067
......@@ -14,6 +14,7 @@ checks/stats.txt
build/mcc*
build/*.c
handyg
handyg.pc
*.out
*.o
*.mod
......
......@@ -123,7 +123,6 @@ gnuflags() {
eval addflag FFLAGS -ffree-line-length-0
}
findprog pkg-config PKGCONFIG pkg-config
if [ -z $FC ]; then
findprog fortran FC ifort gfortran || exit 1
......@@ -133,11 +132,11 @@ fi
set -- `eval $CONF_FC --version -c | sed '/^$/d;s/([^)]*)//;q' 2>&1`
case "$1,$2,$3" in
GNU,Fortran,[123].*)
echo "Only version >= 4 are supported"
echo "Only version >= 4 are supported" 1>&3
exit
;;
GNU,Fortran,4.*)
echo "Code optimisation is *not* suported on gfortran 4"
echo "Code optimisation is *not* suported on gfortran 4" 1>&3
gnuflags
eval addflag $CONF_BITS
if $DEBUG ; then
......@@ -180,16 +179,16 @@ case "$1,$2,$3" in
$NATIVE && eval addflag FFLAGS -xHost
fi
if HAVE_GINAC ; then
echo "Option --with-ginac is incompatible with ifort, disabling"
echo "Option --with-ginac is incompatible with ifort, disabling" 1>&3
HAVE_GINAC=false
fi
if HAVE_MCC ; then
echo "Option --with-mcc is incompatible with ifort, disabling"
echo "Option --with-mcc is incompatible with ifort, disabling" 1>&3
HAVE_MCC=false
fi
;;
*)
echo "Unknown compiler"
echo "Unknown compiler" 1>&3
exit
;;
esac
......@@ -232,6 +231,18 @@ echo "ok" 1>&3
eval addflag LFLAGS "$LDFLAGS $CONF_LDFLAGS $FLDFLAGS -L$CONF_PREFIX/lib"
findprog pkg-config PKGCONFIG pkg-config
if [[ -z "$CONF_PKGCONFIG" ]]; then
echo "*************************************************" 1>&3
echo "Warning! pkg-config not found! This may lead to " 1>&3
echo "difficulties when you try to compile your own " 1>&3
echo "code. You will need to run " 1>&3
echo " " 1>&3
echo " $CONF_FC -I$CONF_PREFIX/include " 1>&3
echo " " 1>&3
echo "every time. " 1>&3
echo "*************************************************" 1>&3
fi
if ( $HAVE_GINAC || $HAVE_MCC ); then
findprog gcc CC clang gcc || exit 1
......@@ -432,6 +443,22 @@ if $HAVE_GINAC && $HAVE_MCC; then
eval addflag LFLAGS -lrt
fi
if [[ ! -z "$CONF_PKGCONFIG" ]]; then
cat > handyg.pc <<EOF
prefix=$CONF_PREFIX
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: handyG
Description: Numerical evaluation of GPL
Version: 0.1.0
Libs: -L\${libdir} -lhandyg
Cflags: -I\${includedir}
EOF
fi
echo "creating makefile" 1>&3
......@@ -541,6 +568,12 @@ $HAVE_MCC && cat >> makefile <<EOF
mkdir -p \$(MMPREFIX)
cp handyg \$(MMPREFIX)
EOF
if [[ ! -z "$CONF_PKGCONFIG" ]]; then
cat >> makefile <<EOF
mkdir -p \$(PREFIX)/lib/pkgconfig
cp handyg.pc \$(PREFIX)/lib/pkgconfig
EOF
fi
echo "uninstall:" >> makefile
echo -ne "\t\trm -i " >> makefile
......@@ -548,6 +581,9 @@ echo -n "\$(PREFIX)/lib/libhandyg.a " >> makefile
echo -n "\$(PREFIX)/include/handyg.mod " >> makefile
echo -n "\$(PREFIX)/bin/geval " >> makefile
$HAVE_MCC && echo -n "\$(MMPREFIX)/handyg" >> makefile
if [[ ! -z "$CONF_PKGCONFIG" ]]; then
echo -n "\$(PREFIX)/lib/pkgconfig " >> makefile
fi
cat >> makefile <<EOF
......@@ -563,5 +599,5 @@ distclean:
@rm -f build/*.o build/*.mod build/*.c build/mcc.internals*
@rm -f test geval libhandyg.a handyg
@rm -f checks/test-chen.f90 checks/test-muone.f90 checks/test-muoneNP.f90
@rm -f makefile
@rm -f makefile handyg.pc
EOF
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