2013-05-01 14:35:30 +01:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
# Initialization
|
2015-11-03 15:18:36 +00:00
|
|
|
AC_PREREQ([2.63])
|
2016-04-06 18:46:17 +01:00
|
|
|
AC_INIT([LatAnalyze],[3.1-rc],[antonin.portelli@me.com],[LatAnalyze])
|
2013-05-01 14:35:30 +01:00
|
|
|
AC_CONFIG_AUX_DIR([.buildutils])
|
2014-03-13 18:51:01 +00:00
|
|
|
AC_CONFIG_SRCDIR([lib/Global.cpp])
|
2014-02-13 19:23:39 +00:00
|
|
|
AC_CONFIG_SRCDIR([utils/sample_read.cpp])
|
2014-02-06 18:08:46 +00:00
|
|
|
AC_CONFIG_SRCDIR([examples/exMathInterpreter.cpp])
|
2013-05-01 14:35:30 +01:00
|
|
|
AC_CONFIG_MACRO_DIR([.buildutils/m4])
|
2016-04-08 00:42:11 +01:00
|
|
|
AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign])
|
2013-05-01 14:35:30 +01:00
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2016-04-08 00:42:11 +01:00
|
|
|
AM_CONDITIONAL([HAVE_AM_MINOR_LE_11],
|
|
|
|
[test `automake --version | grep automake | awk -F '.' '{print $2}'` -le 11])
|
2014-02-20 20:21:45 +00:00
|
|
|
# Checks for programs
|
2013-05-01 14:35:30 +01:00
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_AWK
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2013-05-21 18:02:42 +01:00
|
|
|
AC_PROG_LEX
|
|
|
|
AC_PROG_YACC
|
2013-05-01 14:35:30 +01:00
|
|
|
m4_ifdef([AM_PROG_AR],[AM_PROG_AR])
|
|
|
|
|
|
|
|
LT_INIT
|
|
|
|
|
2014-02-20 20:21:45 +00:00
|
|
|
# Options
|
2014-04-17 12:17:34 +01:00
|
|
|
AC_ARG_WITH([gsl],
|
|
|
|
[AS_HELP_STRING([--with-gsl=prefix],
|
|
|
|
[try this for a non-standard install prefix of the GSL library])],
|
|
|
|
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_gsl/include"]
|
2015-11-03 15:18:36 +00:00
|
|
|
[AM_LDFLAGS="$AM_LDFLAGS -L$with_gsl/lib"])
|
2016-04-07 20:10:47 +01:00
|
|
|
AC_ARG_WITH([minuit],
|
|
|
|
[AS_HELP_STRING([--with-minuit=prefix],
|
2014-02-20 20:21:45 +00:00
|
|
|
[try this for a non-standard install prefix of the Minuit2 library])],
|
2016-04-07 20:10:47 +01:00
|
|
|
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_minuit/include"]
|
|
|
|
[AM_LDFLAGS="$AM_LDFLAGS -L$with_minuit/lib"])
|
2016-04-01 21:40:22 +01:00
|
|
|
AC_ARG_WITH([nlopt],
|
|
|
|
[AS_HELP_STRING([--with-nlopt=prefix],
|
2016-04-07 20:10:47 +01:00
|
|
|
[try this for a non-standard install prefix of the NLopt library])],
|
2016-04-01 21:40:22 +01:00
|
|
|
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_nlopt/include"]
|
|
|
|
[AM_LDFLAGS="$AM_LDFLAGS -L$with_nlopt/lib"])
|
2016-04-07 20:10:47 +01:00
|
|
|
AC_ARG_WITH([hdf5],
|
|
|
|
[AS_HELP_STRING([--with-hdf5=prefix],
|
|
|
|
[try this for a non-standard install prefix of the HDF5 library])],
|
|
|
|
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_hdf5/include"]
|
|
|
|
[AM_LDFLAGS="$AM_LDFLAGS -L$with_hdf5/lib"])
|
|
|
|
AC_ARG_WITH([latcore],
|
|
|
|
[AS_HELP_STRING([--with-latcore=prefix],
|
2015-02-23 18:11:37 +00:00
|
|
|
[use this option for a non-standard install prefix of the LatCore library])],
|
2016-04-07 20:10:47 +01:00
|
|
|
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_latcore/include"]
|
|
|
|
[AM_LDFLAGS="$AM_LDFLAGS -L$with_latcore/lib"])
|
|
|
|
CFLAGS="$AM_CFLAGS $CFLAGS"
|
|
|
|
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
|
|
|
|
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
|
2014-02-10 16:01:39 +00:00
|
|
|
|
2013-05-01 14:35:30 +01:00
|
|
|
# Get compilers informations
|
|
|
|
AX_COMPILER_VENDOR
|
|
|
|
AC_DEFINE_UNQUOTED([C_COMP_VENDOR],["$ax_cv_c_compiler_vendor"],
|
|
|
|
[vendor of C compiler that will compile the code])
|
|
|
|
AM_CONDITIONAL([CC_GNU],[test $ax_cv_c_compiler_vendor = "gnu"])
|
|
|
|
AM_CONDITIONAL([CC_INTEL],[test $ax_cv_c_compiler_vendor = "intel"])
|
|
|
|
AC_LANG([C++])
|
2014-02-13 19:23:39 +00:00
|
|
|
AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
|
2013-05-01 14:35:30 +01:00
|
|
|
AX_COMPILER_VENDOR
|
|
|
|
AC_DEFINE_UNQUOTED([CXX_COMP_VENDOR],["$ax_cv_cxx_compiler_vendor"],
|
|
|
|
[vendor of C++ compiler that will compile the code])
|
|
|
|
AM_CONDITIONAL([CXX_GNU],[test $ax_cv_cxx_compiler_vendor = "gnu"])
|
|
|
|
AM_CONDITIONAL([CXX_INTEL],[test $ax_cv_cxx_compiler_vendor = "intel"])
|
|
|
|
AX_GCC_VERSION
|
|
|
|
AC_DEFINE_UNQUOTED([GCC_VERSION],["$GCC_VERSION"],
|
|
|
|
[version of gcc that will compile the code])
|
|
|
|
AX_GXX_VERSION
|
|
|
|
AC_DEFINE_UNQUOTED([GXX_VERSION],["$GXX_VERSION"],
|
|
|
|
[version of g++ that will compile the code])
|
|
|
|
|
|
|
|
# Checks for libraries.
|
|
|
|
AC_CHECK_LIB([m],[cos],[],[AC_MSG_ERROR([libm library not found])])
|
2015-03-20 16:11:02 +00:00
|
|
|
AC_CHECK_LIB([gslcblas],[cblas_dgemm],[],
|
2015-03-20 16:08:34 +00:00
|
|
|
[AC_MSG_ERROR([GSL CBLAS library not found])])
|
2015-03-20 16:11:02 +00:00
|
|
|
AC_CHECK_LIB([gsl],[gsl_blas_dgemm],[],[AC_MSG_ERROR([GSL library not found])])
|
2016-04-01 21:40:22 +01:00
|
|
|
AC_CHECK_LIB([nlopt_cxx],[nlopt_create],
|
|
|
|
[AC_DEFINE([HAVE_NLOPT],
|
|
|
|
[1],
|
|
|
|
[Define to 1 if you have the `NLopt' library (-lnlopt_cxx).])]
|
|
|
|
[have_nlopt=true]
|
|
|
|
[LIBS="$LIBS -lnlopt_cxx"],[])
|
|
|
|
AM_CONDITIONAL([HAVE_NLOPT], [test x$have_nlopt = xtrue])
|
2016-04-07 20:10:47 +01:00
|
|
|
AC_CHECK_LIB([hdf5_cpp],[H5Fopen],
|
|
|
|
[AC_DEFINE([HAVE_HDF5],
|
|
|
|
[1],
|
|
|
|
[Define to 1 if you have the `HDF5' library (-lhdf5_cpp).])]
|
|
|
|
[have_hdf5=true]
|
2016-04-08 00:42:11 +01:00
|
|
|
[LIBS="$LIBS -lhdf5_cpp -lhdf5"],[],[-lhdf5])
|
2016-04-07 20:10:47 +01:00
|
|
|
AM_CONDITIONAL([HAVE_HDF5], [test x$have_hdf5 = xtrue])
|
2014-02-20 20:21:45 +00:00
|
|
|
SAVED_LDFLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$LDFLAGS -lMinuit2"
|
|
|
|
AC_MSG_CHECKING([for ROOT::Minuit2::BasicMinimumError in -lMinuit2]);
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([#include <Minuit2/BasicMinimumError.h>],
|
|
|
|
[ROOT::Minuit2::BasicMinimumError dummy(0)])],
|
|
|
|
[LIBS="$LIBS -lMinuit2"]
|
|
|
|
[AC_DEFINE([HAVE_MINUIT2],
|
|
|
|
[1],
|
|
|
|
[Define to 1 if you have the `Minuit2' library (-lMinuit2).])]
|
|
|
|
[have_minuit=true]
|
|
|
|
[AC_MSG_RESULT([yes])],
|
|
|
|
[have_minuit=false]
|
|
|
|
[AC_MSG_RESULT([no])])
|
|
|
|
AM_CONDITIONAL([HAVE_MINUIT], [test x$have_minuit = xtrue])
|
|
|
|
LDFLAGS=$SAVED_LDFLAGS
|
2016-04-08 00:42:11 +01:00
|
|
|
SAVED_LDFLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$LDFLAGS -lLatCore"
|
|
|
|
AC_MSG_CHECKING([for LatCore::XmlReader in -lLatCore]);
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([#include <LatCore/XmlReader.hpp>],
|
|
|
|
[LatCore::XmlReader dummy()])],
|
|
|
|
[LIBS="$LIBS -lLatCore"]
|
|
|
|
[AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])]
|
|
|
|
[AC_MSG_ERROR([LatCore library not found])])
|
|
|
|
LDFLAGS=$SAVED_LDFLAGS
|
2013-05-01 14:35:30 +01:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
|
|
|
AC_SUBST([LIBS])
|
|
|
|
AC_SUBST([AM_CFLAGS])
|
|
|
|
AC_SUBST([AM_LDFLAGS])
|
|
|
|
|
2014-03-13 18:51:01 +00:00
|
|
|
AC_CONFIG_FILES([Makefile lib/Makefile utils/Makefile examples/Makefile])
|
2013-05-01 14:35:30 +01:00
|
|
|
AC_OUTPUT
|