Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F11221788
clhep.m4
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
clhep.m4
View Options
# Search for CLHEP in standard directories using standard CLHEP names
#AC_SEARCH_CLHEP
#----------------------------------------
AC_DEFUN([AC_SEARCH_CLHEP], [
#AC_ARG_WITH([cedar_pkgname],
# AC_HELP_STRING(--with-@&t@cedar_pkgname, path to cedar_prettyname generator),
# [pkgpath=$with_@&t@cedar_pkgname],
# [pkgpath=${prefix}])
AC_ARG_VAR(CLHEPPATH,[The path to where CLHEP is installed. Default is $prefix.])
AC_ARG_VAR(CLHEPLIB,[The argument to be used when linking the CLHEP library. Default is "-lCLHEP".])
AC_ARG_VAR(CLHEPINCLUDE,[The argument used when compiling source files which use CLHEP. Default is "-I$CLHEPPATH/include".])
AC_MSG_CHECKING([if CLHEPPATH, CLHEPLIB and CLHEPINCLUDE are set])
notset=""
if test -z "$CLHEPPATH"; then
notset="true"
for dirbase in / /usr $ac_default_prefix $prefix; do
if test -z "$CLHEPLIB"; then
for filename in $dirbase/lib/libCLHEP-?.?.?.?.so $dirbase/lib/libCLHEP.so; do
if test -f $filename; then
CLHEPPATH=$dirbase
filename=`basename $filename`
CLHEPLIB=`echo $filename | sed -e 's/^lib/-l/' -e 's/\.so$//'`
fi
done
else
filename=`echo $CLHEPLIB | sed -e 's/^-l/lib/'`.so
if test -f $dirbase/lib/$filename; then
CLHEPPATH=$dirbase
fi
fi
done
else
if test -z "$CLHEPLIB"; then
notset="true"
for filename in $CLHEPPATH/lib/libCLHEP-?.?.?.?.so CLHEPPATH/lib/libCLHEP.so; do
if test -f $filename; then
filename=`basename $filename`
CLHEPLIB=`echo $filename | sed -e 's/^lib/-l/' -e 's/\.so$//'`
fi
done
fi
fi
if test -z"$CLHEPINCLUDE"; then
notset="true"
CLHEPINCLUDE=-I$CLHEPPATH/include
fi
if test -z "$notset"; then
AC_MSG_RESULT([yes ($CLHEPPATH, $CLHEPLIB and $CLHEPINCLUDE)])
else
AC_MSG_RESULT([no (found $CLHEPPATH, $CLHEPLIB and $CLHEPINCLUDE)])
fi
AC_TEST_CLHEP
AC_SUBST(CLHEPPATH)
AC_SUBST(CLHEPLIB)
AC_SUBST(CLHEPINCLUDE)
])
# Check whether we can link against CLHEP
#AC_TEST_CLHEP
AC_DEFUN([AC_TEST_CLHEP],[
## Now lets see if the libraries work properly
oldLIB="$LIBS"
oldLDFLAGS="$LDFLAGS"
oldCPPFLAGS="$CPPFLAGS"
LIBS="$LIBS $CLHEPLIB"
LDFLAGS="$LDFLAGS -L$CLHEPPATH/lib"
CPPFLAGS="$CPPFLAGS $CLHEPINCLUDE"
## Check CLHEP
AC_MSG_CHECKING([that CLHEP works])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CLHEP/Random/Random.h>
namespace CLHEP {}]], [[using namespace CLHEP; HepRandom r; r.flat();]])],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no)
LIBS="$oldLIB"
LDFLAGS="$oldLDFLAGS"
CPPFLAGS="$oldCPPFLAGS"
AC_MSG_ERROR(CLHEP must be installed to continue.)])
])
File Metadata
Details
Attached
Mime Type
text/x-makefile
Expires
Wed, May 14, 10:54 AM (20 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5091714
Default Alt Text
clhep.m4 (2 KB)
Attached To
rCEDARSVN cedarsvn
Event Timeline
Log In to Comment