# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT( [Photos C++ Interface], [3.3], [tomasz.przedzinski@uj.edu.pl] ) AC_LANG_CPLUSPLUS AC_PREFIX_DEFAULT([`pwd`]) AC_CONFIG_SRCDIR([src/photosCInterfaces/Photos.cxx]) ############################################################################## # Process command line options if test "$AFS_PATHS" == "yes"; then with_hepmc=$HEPMCLOCATION with_tauola=$TAUOLALOCATION with_mc_tester=$MCTESTERLOCATION with_pythia8=$PYTHIALOCATION pythia8data=$PYTHIA8DATA fi echo "" AC_MSG_CHECKING([if HepMC location defined]) AC_ARG_WITH( [hepmc], [AS_HELP_STRING([--with-hepmc], [Path to HepMC 2.xx (use --without-hepmc to compile without HepMC)] )], [AC_MSG_RESULT([$with_hepmc])], [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([if MC-TESTER location defined]) AC_ARG_WITH( [mc-tester], [AS_HELP_STRING([--with-mc-tester], [Path to MC-TESTER 1.23 or later (used by examples only)] )], [AC_MSG_RESULT([$with_mc_tester])], [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([if Pythia 8 location defined]) AC_ARG_WITH( [pythia8], [AS_HELP_STRING([--with-pythia8], [Path to Pythia 8.1 or later (used by examples only)] )], [AC_MSG_RESULT([$with_pythia8])], [AC_MSG_RESULT([no])] ) AC_MSG_CHECKING([if Tauola location defined]) AC_ARG_WITH( [tauola], [AS_HELP_STRING([--with-tauola], [Path to Tauola C++ interface v1.0.5 or later (used by examples only)] )], [AC_MSG_RESULT([$with_tauola])], [AC_MSG_RESULT([no])] ) # Check for debug flags AC_MSG_CHECKING([if debug flags are enabled]) AC_ARG_ENABLE( [debug], [AS_HELP_STRING([--enable-debug],[Enable debug flags])], [ AC_MSG_RESULT([$enable_debug]) ; FFLAGS="-g3 -O0" ; CXXFLAGS="-g3 -O0" ], [ AC_MSG_RESULT([no]) ; FFLAGS="-O2" ; CXXFLAGS="-O2" ] ) echo "" ############################################################################## # Check for programs AC_PROG_MAKE_SET AC_PROG_LN_S AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB # here is a trick to preffer # gfortran for gcc4 and higher # and g77 for gcc3 and lower flist="gfortran g77 f77" if [[[ "$(gcc -dumpversion | cut -d . -f 1)" < "4" ]]] ; then flist="g77 f77 gfortran" fi AC_PROG_F77([$flist]) AC_PROG_CPP AC_CHECK_PROG(DIRECT_CPP,cpp,cpp,$CPP) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_CHECK_TYPES([ptrdiff_t]) # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_STRFTIME AC_CHECK_FUNCS([atexit getcwd pow sqrt], , [ echo "" && echo "ERROR: Basic functions not found. Something's wrong with paths." && exit -1 ]) ############################################################################## # Check for HepMC header files # If user specified --without-hepmc, skip hepmc check if ! test "$with_hepmc" == "no"; then AC_SUBST(with_hepmc) CPPFLAGS="-I$with_hepmc/include $CPPFLAGS" AC_CHECK_HEADERS([HepMC/Version.h], , [ echo "" && echo "ERROR: HepMC not found. To provide location use:" && echo " --with-hepmc=/path/to/HepMC" ; echo " or use"; echo " --without-hepmc"; echo " (Consider using 'source platform/afs.paths.sh' (or .csh) )" echo "" exit -1 ]) else with_hepmc="" AC_SUBST(with_hepmc) fi ############################################################################## with_photos=`pwd` if test "$prefix" != "NONE"; then with_photos=$prefix fi pythia8data=$PYTHIA8DATA if test -z "$pythia8data"; then pythia8data=$with_pythia8/xmldoc fi ln -sf platform/make.inc make.inc AC_SUBST(with_photos) AC_SUBST(with_hepmc) AC_SUBST(pythia8data) AC_SUBST(with_tauola) AC_SUBST(with_pythia8) AC_SUBST(with_mc_tester) AC_CONFIG_FILES([platform/make.inc configure.paths.sh configure.paths.csh]) AC_OUTPUT