Page MenuHomeHEPForge

No OneTemporary

diff --git a/m4/lhapdf.m4 b/m4/lhapdf.m4
new file mode 100644
--- /dev/null
+++ b/m4/lhapdf.m4
@@ -0,0 +1,62 @@
+# lhapdf.m4 based on fastjet.m4
+# D.Grellscheid 2013-06-20
+
+# Search for LHAPDF and g77 compiler in standard directories
+AC_DEFUN([THEPEG_SEARCH_LHAPDF],
+[
+dnl ckeck if a directory is specified for LHAPDF
+AC_ARG_WITH(lhapdf,
+ [AC_HELP_STRING([--with-lhapdf=dir],
+ [Assume the given directory for LHAPDF])])
+
+dnl search for the lhapdf-config script
+if test "$with_lhapdf" = ""; then
+ AC_PATH_PROG(lhaconfig, lhapdf-config, no)
+else
+ AC_PATH_PROG(lhaconfig, lhapdf-config, no, ${with_lhapdf}/bin)
+fi
+
+LOAD_LHAPDF=""
+
+if test "${lhaconfig}" = "no"; then
+ AC_MSG_CHECKING([LHAPDF])
+ AC_MSG_RESULT([no]);
+ $2
+else
+
+ dnl now see if LHAPDF is functional
+ save_LDFLAGS="$LDFLAGS"
+ save_LIBS="$LIBS"
+
+ LDFLAGS="${LDFLAGS} -L`${lhaconfig} --libdir`"
+ LIBS="${LIBS} -lLHAPDF"
+
+ AC_MSG_CHECKING([if LHAPDF is functional])
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { void initpdf_(int&); }]],
+ [[int i = 1; initpdf_(i);]])],
+ [lhaok='yes'], [lhaok='no'])
+ AC_MSG_RESULT([$lhaok])
+ AC_LANG_POP()
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+
+ AC_MSG_CHECKING([LHAPDF])
+ if test "${lhaok}" = "yes"; then
+ LHAPDF_LDFLAGS="-L`${lhaconfig} --libdir`"
+ LHAPDF_LIBS="-lLHAPDF"
+ LOAD_LHAPDF="library ThePEGLHAPDF.so"
+ AC_MSG_RESULT(yes)
+ $1
+ else
+ AC_MSG_RESULT(no)
+ $2
+ fi
+fi
+
+AC_SUBST([LHAPDF_LIBS])
+AC_SUBST(LOAD_LHAPDF)
+AC_SUBST(LHAPDF_LDFLAGS)
+AC_SUBST(LHAPDF_PKGDATADIR,[`${lhaconfig} --datadir`])
+AM_CONDITIONAL(USELHAPDF,[test "x$LOAD_LHAPDF" = "xlibrary ThePEGLHAPDF.so"])
+])
diff --git a/m4/thepeg.m4 b/m4/thepeg.m4
--- a/m4/thepeg.m4
+++ b/m4/thepeg.m4
@@ -1,513 +1,450 @@
# check for gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130
AC_DEFUN([THEPEG_CHECK_ABS_BUG],
[
if test "$GCC" = "yes"; then
AC_MSG_CHECKING([for gcc abs bug])
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[ int foo (int i) { return -2 * __builtin_abs(i - 2); } ]],
[[ if ( foo(1) != -2 || foo(3) != -2 ) return 1; ]]
)],
[ AC_MSG_RESULT([not found. Compiler is ok.]) ],
[
AC_MSG_RESULT([found. Builtin abs() is buggy.])
AC_MSG_CHECKING([if -fno-builtin-abs works])
oldcxxflags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -fno-builtin-abs"
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[
#include <cstdlib>
int foo (int i) { return -2 * std::abs(i - 2); }
]],
[[
if (foo(1) != -2 || foo(3) != -2) return 1;
]]
)],
[
AC_MSG_RESULT([yes. Setting -fno-builtin-abs.])
AM_CXXFLAGS="$AM_CXXFLAGS -fno-builtin-abs"
AM_CFLAGS="$AM_CFLAGS -fno-builtin-abs"
],
[
AC_MSG_RESULT([no. Setting -fno-builtin.])
AC_MSG_WARN([
*****************************************************************************
For this version of gcc, -fno-builtin-abs alone did not work to avoid the
gcc abs() bug. Instead, all gcc builtin functions are now disabled.
Update gcc if possible.
*****************************************************************************])
AM_CXXFLAGS="$AM_CXXFLAGS -fno-builtin"
AM_CFLAGS="$AM_CFLAGS -fno-builtin"
]
)
CXXFLAGS=$oldcxxflags
]
)
fi
])
-# Search for LHAPDF and g77 compiler in standard directories
-AC_DEFUN([THEPEG_SEARCH_LHAPDF],
-[
-AC_MSG_CHECKING([if LHAPDF is present and works])
-HAS_LHAPDF="yes"
-LHAPDF_LIBDIR=""
-LOAD_LHAPDF=""
-AC_ARG_WITH(LHAPDF,[ --without-LHAPDF do not use LHAPDF package (requires g77 compiler)
- (included by default --with-LHAPDF=path to specify
- where the LHAPDF shared library is located)], [if test -n "$with_LHAPDF" -a "x$with_LHAPDF" != "xyes" -a "x$with_LHAPDF" != "xno"; then LHAPDF_LIBDIR="$with_LHAPDF"; elif test "x$with_LHAPDF" == "xno"; then HAS_LHAPDF="no"; fi])
-
-
-LHAPDF_LDFLAGS=""
-if test -n "$LHAPDF_LIBDIR"; then
- if test -e $LHAPDF_LIBDIR/libLHAPDF.so -o -e $LHAPDF_LIBDIR/libLHAPDF.dylib
- then
- LHAPDF_LDFLAGS="-L$LHAPDF_LIBDIR"
- elif test "${host_cpu}" == "x86_64" -a -e $LHAPDF_LIBDIR/lib64/libLHAPDF.so
- then
- LHAPDF_LDFLAGS="-L$LHAPDF_LIBDIR/lib64"
- elif test -e $LHAPDF_LIBDIR/lib/libLHAPDF.so -o -e $LHAPDF_LIBDIR/lib/libLHAPDF.dylib
- then
- LHAPDF_LDFLAGS="-L$LHAPDF_LIBDIR/lib"
- else
- HAS_LHAPDF="no"
- fi
-fi
-
-LHAPDF_LIBS="-lLHAPDF"
-
-oldLIB="$LIBS"
-oldLDFLAGS="$LDFLAGS"
-
-if test "$HAS_LHAPDF" == "yes"; then
-dnl Now lets see if the libraries work properly
- LIBS="$LIBS $LHAPDF_LIBS"
- LDFLAGS="$LDFLAGS $LHAPDF_LDFLAGS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { void initpdf_(int&); }]],
- [[int i = 1; initpdf_(i);]])], ,
- HAS_LHAPDF="no")
-fi
-
-LIBS="$oldLIB"
-LDFLAGS="$oldLDFLAGS"
-
-if test "$HAS_LHAPDF" == "yes"; then
- AC_MSG_RESULT([yes])
- LHAPDF_PKGDATADIR="$LHAPDF_LIBDIR/../share/lhapdf"
- LOAD_LHAPDF="library ThePEGLHAPDF.so"
- dnl don't need to check for existence of LHAPDF_PKGDATADIR
- dnl if this location is invalid, we'll use ThePEG's index file anyway
-elif test "x$with_LHAPDF" == "xno" -o "x$with_LHAPDF" == "x"; then
- AC_MSG_RESULT([no])
-else
- AC_MSG_ERROR([LHAPDF was requested but the library was not found.])
-fi
-
-AC_SUBST(LHAPDF_LIBS)
-AC_SUBST(LOAD_LHAPDF)
-AC_SUBST(LHAPDF_LDFLAGS)
-AC_SUBST(LHAPDF_PKGDATADIR)
-AM_CONDITIONAL([USELHAPDF], [test "x$HAS_LHAPDF" == "xyes"])
-])
# Check for ThePEG.
AC_DEFUN([THEPEG_CHECK_THEPEG],
[THEPEGBUILD="no"
AC_MSG_CHECKING([if THEPEGPATH is set])
if test -z "$THEPEGPATH"; then
if test -f "../ThePEG/Config/config.h"; then
THEPEGPATH="\$(top_builddir)/../ThePEG"
THEPEGBUILD="yes"
AC_MSG_RESULT([no (using ../ThePEG)])
AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_builddir)/../ThePEG/include "
SETUPTHEPEG="$THEPEGPATH/src/setupThePEG -L $THEPEGPATH/lib"
RUNTHEPEG="$THEPEGPATH/src/runThePEG -L $THEPEGPATH/lib"
THEPEGDOC="\$(top_builddir)/../ThePEG/Doc"
THEPEGLIB="\$(top_builddir)/../ThePEG/lib"
else
if test "x$prefix" == "xNONE"; then
THEPEGPATH=$ac_default_prefix
else
THEPEGPATH=$prefix
fi
AC_MSG_RESULT([no (using $THEPEGPATH)])
fi
else
AC_MSG_RESULT([yes ($THEPEGPATH)])
fi
if test "$THEPEGBUILD" == "no"; then
AM_CPPFLAGS="-I\$(top_builddir)/include -I$THEPEGPATH/include "
SETUPTHEPEG="$THEPEGPATH/bin/setupThePEG"
RUNTHEPEG="$THEPEGPATH/bin/runThePEG"
THEPEGDOC="$THEPEGPATH/share/ThePEG/Doc"
THEPEGLIB="$THEPEGPATH/lib/ThePEG"
AC_MSG_CHECKING([if the installed ThePEG works])
if test -x $SETUPTHEPEG && $SETUPTHEPEG /dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(ThePEG must be installed and THEPEGPATH set properly.)
fi
fi
AC_ARG_VAR(THEPEGPATH,[The path to where ThePEG is installed. Default is $prefix unless we are working in a sister of the build directory of ThePEG.])
pkglibdir="\$(libdir)/ThePEG"
AC_SUBST(pkglibdir)
AC_SUBST(THEPEGPATH)
AC_SUBST(THEPEGINCLUDE)
AC_SUBST(THEPEGDOC)
AC_SUBST(THEPEGLIB)
AC_SUBST(SETUPTHEPEG)
AC_SUBST(RUNTHEPEG)
AC_SUBST(AM_CPPFLAGS)
])
# Search for ThePEG in standard places.
AC_DEFUN([THEPEG_SEARCH_THEPEG],
[THEPEGBUILD="no"
AC_MSG_CHECKING([if THEPEGPATH is set])
if test -z "$THEPEGPATH"; then
if test -f "../ThePEG/Config/config.h"; then
THEPEGPATH="\$(top_builddir)/../ThePEG"
THEPEGBUILD="yes"
AC_MSG_RESULT([no (found ../ThePEG)])
AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_builddir)/../ThePEG/include "
SETUPTHEPEG="$THEPEGPATH/src/setupThePEG -L $THEPEGPATH/lib"
RUNTHEPEG="$THEPEGPATH/src/runThePEG -L $THEPEGPATH/lib"
THEPEGDOC="\$(top_builddir)/../ThePEG/Doc"
THEPEGLIB="\$(top_builddir)/../ThePEG/lib"
else
for dirbase in / /usr $ac_default_prefix $prefix; do
if test -f $dirbase/include/ThePEG/Config/config.h; then
THEPEGPATH=$dirbase
fi
done
if test -z "$THEPEGPATH"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR(Could not find a valid ThePEG installation or build directory)
else
AC_MSG_RESULT([no (found $THEPEGPATH)])
fi
fi
else
AC_MSG_RESULT([yes ($THEPEGPATH)])
fi
if test "$THEPEGBUILD" == "no"; then
AM_CPPFLAGS="-I\$(top_builddir)/include -I$THEPEGPATH/include "
SETUPTHEPEG="$THEPEGPATH/bin/setupThePEG"
RUNTHEPEG="$THEPEGPATH/bin/runThePEG"
THEPEGDOC="$THEPEGPATH/share/ThePEG/Doc"
THEPEGLIB="$THEPEGPATH/lib/ThePEG"
AC_MSG_CHECKING([if the installed ThePEG works])
if test -x $SETUPTHEPEG && $SETUPTHEPEG /dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(ThePEG must be installed and THEPEGPATH set properly.)
fi
fi
AC_ARG_VAR(THEPEGPATH,[The path to where ThePEG is installed. Default is $prefix unless we are working in a sister of the build directory of ThePEG.])
pkglibdir="\$(libdir)/ThePEG"
AC_SUBST(pkglibdir)
AC_SUBST(THEPEGPATH)
AC_SUBST(THEPEGINCLUDE)
AC_SUBST(THEPEGDOC)
AC_SUBST(THEPEGLIB)
AC_SUBST(SETUPTHEPEG)
AC_SUBST(RUNTHEPEG)
AC_SUBST(AM_CPPFLAGS)
])
AC_DEFUN([THEPEG_EMPTY_SUBST],
[EMPTY=""
AC_SUBST(EMPTY)
])
AC_DEFUN([THEPEG_SEARCH_PREFIXDIR_FILES],
[AC_MSG_CHECKING([if $1 and $2 is set])
if test -z "$$1"; then
for dirbase in / /usr $ac_default_prefix $prefix; do
if test -z "$$2"; then
for filename in $4; do
if test -f $dirbase/$3/$filename; then
$1=$dirbase/$3
$2=$filename
fi
done
else
if test -f $dirbase/$3/$$2; then
$1=$dirbase/$3
fi
fi
done
if test -z "$$1" -o -z "$$2"; then
AC_MSG_ERROR(no. Could not guess appropriate value for $1 and $2)
else
AC_MSG_RESULT([no (found $$1 and $$2)])
fi
else
if test -z "$$2"; then
for filename in $4; do
if test -f $$1/$filename; then
$2=$filename
fi
done
AC_MSG_RESULT([no (found $$1 and $$2)])
else
if test -f $$1/$$2; then
AC_MSG_RESULT([yes ($$1 and $$2)])
else
AC_MSG_ERROR(no. Could not guess appropriate value for $1 and $2)
fi
fi
fi
AC_ARG_VAR($1,[$5])
AC_ARG_VAR($2,[$6])
])
AC_DEFUN([THEPEG_CHECK_PREFIXDIR],
[AC_MSG_CHECKING([if $1 is set])
if test -z "$$1"; then
if test -d $prefix/$2; then
$1=$prefix/$2
elif test -d $ac_default_prefix/$2; then
$1=$ac_default_prefix/$2
elif test -d /usr/$2; then
$1=/usr/$2
elif test -d /$2; then
$1=/$2
else
AC_MSG_ERROR(no. Could not guess appropriate value for $1)
fi
AC_MSG_RESULT([no (using $$1)])
else
AC_MSG_RESULT([yes ($$1)])
fi
AC_ARG_VAR($1,[$3])
])
AC_DEFUN([THEPEG_CHECK_ENVDEFAULT],
[AC_MSG_CHECKING([if $1 is set])
if test -z "$$1"; then
$1="$2"
AC_MSG_RESULT([no (using $$1)])
else
AC_MSG_RESULT([yes ($$1)])
fi
AC_ARG_VAR($1,[$3])
])
AC_DEFUN([THEPEG_DEFINE_ENVDEFAULT],
[AC_MSG_CHECKING([if $2 is set])
if test -z "$$2"; then
$2="$3"
AC_MSG_RESULT([no (using $$2)])
else
AC_MSG_RESULT([yes ($$2)])
fi
AC_ARG_VAR($2,[$4])
AC_DEFINE_UNQUOTED($1,"$$2",[$4])
])
AC_DEFUN([THEPEG_CHECK_EXPM1],
[echo $ECHO_N "checking for expm1... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cmath>
]], [[expm1(1.0);
]])],[AC_DEFINE(ThePEG_HAS_EXPM1,1,define if expm1 is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_LOG1P],
[echo $ECHO_N "checking for log1p... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cmath>
]], [[log1p(1.0);
]])],[AC_DEFINE(ThePEG_HAS_LOG1P,1,define if log1p is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_AIDA],
[
AC_REQUIRE([THEPEG_CHECK_RIVET])
echo $ECHO_N "checking for installed AIDA headers... $ECHO_C" 1>&6
dnl if test "x$with_rivet" != "xno"; then
dnl echo "using rivet aida"
dnl LWHINCLUDE="\$(RIVETINCLUDE)/LWH"
dnl else
LWHINCLUDE="-I\$(top_builddir)/include/ThePEG/Analysis/LWH"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "AIDA/IAnalysisFactory.h"
]], [[AIDA::IAnalysisFactory * af;
]])],[AC_DEFINE(LWH_USING_AIDA,1,define if AIDA headers are installed)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])
dnl fi
AC_SUBST([LWHINCLUDE])
])
AC_DEFUN([THEPEG_CHECK_DLOPEN],
[echo $ECHO_N "checking for dlopen... $ECHO_C" 1>&6
# do this with libtool!
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dlfcn.h>
]], [[dlopen("", 1);
]])],[AC_DEFINE(ThePEG_HAS_DLOPEN,1,define if dlopen is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_SSTREAM],
[echo $ECHO_N "checking for <sstream>... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sstream>
]], [[std::ostringstream os;
]])],[AC_DEFINE(ThePEG_HAS_SSTREAM,1,define if sstream is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_FPUCONTROL],
[echo $ECHO_N "checking for <fpu_control>... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fpu_control.h>
]], [[fpu_control_t cw; _FPU_GETCW(cw); cw &= ~(_FPU_MASK_IM|_FPU_MASK_DM|_FPU_MASK_ZM|_FPU_MASK_OM); _FPU_SETCW(cw);
]])],[AC_DEFINE(ThePEG_HAS_FPU_CONTROL,1,define if fpucontrol is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_CHECK_FENV],
[echo $ECHO_N "checking for <fenv.h>... $ECHO_C" 1>&6
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fenv.h>
]], [[feenableexcept(FE_DIVBYZERO|FE_OVERFLOW|FE_INVALID);]])],[AC_DEFINE(ThePEG_HAS_FENV,1,define if fenv is available)
echo "${ECHO_T}yes" 1>&6
],[echo "${ECHO_T}no" 1>&6])])
AC_DEFUN([THEPEG_ADD_THEPEG_PATH],
[if test "$THEPEGBUILD" == "yes"; then
if test -f "../$2/Config/config.h"; then
$1="\$(top_builddir)/../$2/lib"
SETUPTHEPEG="$SETUPTHEPEG -L\$(top_builddir)/../$2/lib"
RUNTHEPEG="$RUNTHEPEG -L\$(top_builddir)/../$2/lib"
AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_builddir)/../$2/include"
fi
else
$1="$THEPEGLIB"
fi
AC_SUBST($1)
])
AC_DEFUN([THEPEG_HAS_JAVA],
[ hasjava=yes
AC_PATH_PROG(JAVAC, javac)
AC_PATH_PROG(JAVA, java)
AC_PATH_PROG(JAR, jar)
if test -z "$JAR" -o -z "$JAVA" -o -z "$JAVAC"; then hasjava=no; else
AC_MSG_CHECKING([if java works])
echo 'public class conftest { public static void main(String[[]]arg){}}' > conftest.java
$JAVAC -source $1 conftest.java 1>&5 2>&5
if test $? -ne 0; then hasjava=no; fi
echo "Main-Class: conftest" > conftest.manifest
$JAR cmf conftest.manifest conftest.jar conftest.class 1>&5 2>&5
if test $? -ne 0; then hasjava=no; fi
$JAVA -jar conftest.jar 1>&5 2>&5
if test $? -ne 0; then hasjava=no; fi
rm -f conftest.java conftest.err conftest.class conftest.manifest conftest.jar
fi
if test "x$hasjava" != "xno"; then
AC_MSG_RESULT([yes])
$2
else
AC_MSG_RESULT([no])
$3
fi
])
AC_DEFUN([THEPEG_LIBTOOL_VERSION_INFO],
[ LIBTOOLVERSIONINFO="-version-info $1:$2:$3"
AC_SUBST(LIBTOOLVERSIONINFO)])
AC_DEFUN([THEPEG_UNIT_CHECKING],
[
AC_MSG_CHECKING([whether to include dimension checking])
AC_ARG_ENABLE(unitchecks,
AC_HELP_STRING([--enable-unitchecks],[turns on dimension checking for physical quantities.]),
[],
[enable_unitchecks=no]
)
AC_MSG_RESULT([$enable_unitchecks])
if test "x$enable_unitchecks" = "xyes"; then
AC_DEFINE([ThePEG_HAS_UNITS_CHECKING],[1],[define if units should be checked])
fi
])
AC_DEFUN([THEPEG_CHECK_GSL],
[
AC_MSG_CHECKING([for gsl location])
GSLINCLUDE=""
GSLLIBS=""
AC_ARG_WITH(gsl,
AC_HELP_STRING([--with-gsl=path],[location of gsl installation. Default: system lib]),
[],
[with_gsl=system])
if test "x$with_gsl" = "xno"; then
AC_MSG_ERROR([libgsl is required. Please install the GNU scientific library and header files.])
fi
if test "x$with_gsl" = "xsystem"; then
AC_MSG_RESULT([in system libraries])
oldlibs="$LIBS"
AC_CHECK_LIB(m,sqrt)
AC_CHECK_LIB(gslcblas,cblas_srot)
AC_CHECK_LIB(gsl,gsl_ran_poisson,[],
[
AC_MSG_ERROR([Cannot find libgsl. Please install the GNU scientific library.])
]
)
GSLLIBS="$LIBS"
LIBS=$oldlibs
else
if test "`uname -m`" = "x86_64" -a -e "$with_gsl/lib64/libgsl.a" -a -d "$with_gsl/include/gsl"; then
AC_MSG_RESULT([found in $with_gsl])
GSLLIBS="-L$with_gsl/lib64 -R$with_gsl/lib64 -lgsl -lgslcblas"
GSLINCLUDE="-I$with_gsl/include"
elif test -e "$with_gsl/lib/libgsl.a" -a -d "$with_gsl/include/gsl"; then
AC_MSG_RESULT([found in $with_gsl])
GSLLIBS="-L$with_gsl/lib -R$with_gsl/lib -lgsl -lgslcblas"
GSLINCLUDE="-I$with_gsl/include"
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Can't find $with_gsl/lib/libgsl.a or the headers in $with_gsl/include])
fi
fi
dnl AM_CONDITIONAL(HAVE_GSL,[test "x$with_HepMC" != "xno"])
AC_SUBST(GSLINCLUDE)
AC_SUBST(GSLLIBS)
])
AC_DEFUN([THEPEG_OVERVIEW],
[
CXXSTRING=`$CXX --version | head -1`
cat << _THEPEG_EOF_ > config.thepeg
*****************************************************
*** $PACKAGE_STRING configuration summary
*** Please include this information in bug reports!
***--------------------------------------------------
*** Prefix: $prefix
***
*** Dimension checks: $enable_unitchecks
***
*** GSL: $with_gsl
***
-*** LHAPDF: $with_LHAPDF
+*** LHAPDF: $lhaconfig
*** HepMC: $with_hepmc
*** Rivet: $with_rivet
-*** FastJet: $with_fastjet
+*** FastJet: $fjconfig
***
*** Host: $host
*** CXX: $CXXSTRING
*****************************************************
_THEPEG_EOF_
])
diff --git a/m4/zlib.m4 b/m4/zlib.m4
--- a/m4/zlib.m4
+++ b/m4/zlib.m4
@@ -1,125 +1,149 @@
# ===========================================================================
-# http://www.nongnu.org/autoconf-archive/ax_check_zlib.html
+# http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
# ===========================================================================
#
# SYNOPSIS
#
-# AX_CHECK_ZLIB()
+# AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
#
# DESCRIPTION
#
# This macro searches for an installed zlib library. If nothing was
# specified when calling configure, it searches first in /usr/local and
-# then in /usr. If the --with-zlib=DIR is specified, it will try to find
-# it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib is
-# specified, the library is not searched at all.
+# then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
+# it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
+# --without-zlib is specified, the library is not searched at all.
#
# If either the header file (zlib.h) or the library (libz) is not found,
-# the configuration exits on error, asking for a valid zlib installation
-# directory or --without-zlib.
+# shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
+# not specified, the configuration exits on error, asking for a valid zlib
+# installation directory or --without-zlib.
#
-# The macro defines the symbol HAVE_LIBZ if the library is found. You
-# should use autoheader to include a definition for this symbol in a
-# config.h file. Sample usage in a C/C++ source is as follows:
+# If both header file and library are found, shell commands
+# 'action-if-found' is run. If 'action-if-found' is not specified, the
+# default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
+# '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
+# AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
+# for this symbol in a config.h file. Sample usage in a C/C++ source is as
+# follows:
#
# #ifdef HAVE_LIBZ
# #include <zlib.h>
# #endif /* HAVE_LIBZ */
#
# LICENSE
#
# Copyright (c) 2008 Loic Dachary <loic@senga.org>
+# Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
+# Mods for ThePEG Copyright (c) 2013 David Grellscheid <david.grellscheid@durham.ac.uk>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 4
+#serial 14
AU_ALIAS([CHECK_ZLIB], [AX_CHECK_ZLIB])
AC_DEFUN([AX_CHECK_ZLIB],
#
# Handle user hints
#
[AC_MSG_CHECKING(if zlib is wanted)
-AC_ARG_WITH(zlib,
-[ --with-zlib=DIR root directory path of zlib installation [defaults to
- /usr/local or /usr if not found in /usr/local]
- --without-zlib to disable zlib usage completely],
+zlib_places="/usr/local /usr /opt/local /sw"
+withval_result=
+AC_ARG_WITH([zlib],
+[ --with-zlib=DIR root directory path of zlib installation @<:@defaults to
+ /usr/local or /usr if not found in /usr/local@:>@
+ --without-zlib to disable zlib usage completely],
[if test "$withval" != no ; then
AC_MSG_RESULT(yes)
if test -d "$withval"
then
- ZLIB_HOME="$withval"
+ zlib_places="$withval $zlib_places"
else
AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
fi
+ withval_result="$withval"
else
+ zlib_places=
AC_MSG_RESULT(no)
-fi])
-
-ZLIB_HOME=/usr/local
-if test ! -f "${ZLIB_HOME}/include/zlib.h"
-then
- ZLIB_HOME=/usr
-fi
+fi],
+[AC_MSG_RESULT(yes)])
#
# Locate zlib, if wanted
#
-if test -n "${ZLIB_HOME}"
+if test -n "${zlib_places}"
then
- ZLIB_OLD_LDFLAGS=$LDFLAGS
- ZLIB_OLD_CPPFLAGS=$CPPFLAGS
- if test "$ZLIB_HOME" != "/usr"; then
- LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
- CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
- fi
- AC_LANG_SAVE
- AC_LANG_C
- AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
- AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
- AC_LANG_RESTORE
- if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
- then
- #
- # If both library and header were found, use them
- #
- AC_CHECK_LIB(z, inflateEnd)
- AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
- AC_MSG_RESULT(ok)
- else
- #
- # If either header or library was not found, revert and bomb
- #
- AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
+ # check the user supplied or any other more or less 'standard' place:
+ # Most UNIX systems : /usr/local and /usr
+ # MacPorts / Fink on OSX : /opt/local respectively /sw
+ for ZLIB_HOME in ${zlib_places} ; do
+ if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
+ ZLIB_HOME=""
+ done
+
+ ZLIB_OLD_LDFLAGS=$LDFLAGS
+ ZLIB_OLD_CPPFLAGS=$CPPFLAGS
+ if test -n "${ZLIB_HOME}"; then
+ if test -n "${withval_result}"; then
+ LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ fi
+ fi
+ AC_LANG_SAVE
+ AC_LANG_C
+ AC_CHECK_LIB([z], [inflateEnd], [zlib_cv_libz=yes], [zlib_cv_libz=no])
+ AC_CHECK_HEADER([zlib.h], [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
+ AC_LANG_RESTORE
+ if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
+ then
+ #
+ # If both library and header were found, action-if-found
+ #
+ m4_ifblank([$1],[
+ if test -n "${withval_result}"; then
+ LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+ CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+ fi
+ LIBS="-lz $LIBS"
+ AC_DEFINE([HAVE_LIBZ], [1],
+ [Define to 1 if you have `z' library (-lz)])
+ ],[
+ # Restore variables
LDFLAGS="$ZLIB_OLD_LDFLAGS"
CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
- AC_MSG_RESULT(failed)
- AC_MSG_ERROR(either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib)
- fi
+ $1
+ ])
+ else
+ #
+ # If either header or library was not found, action-if-not-found
+ #
+ m4_default([$2],[
+ AC_MSG_ERROR([either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib])
+ ])
+ fi
fi
-
])

File Metadata

Mime Type
text/x-diff
Expires
Sun, Feb 23, 2:56 PM (6 m, 47 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4486742
Default Alt Text
(25 KB)

Event Timeline