AC_INIT([eutils],[1.9]) : ${CXXFLAGS=-O3} #AX_CHECK_COMPILE_FLAG([-std=c++11x], [ # CXXFLAGS="$CXXFLAGS -std=c++11x"]) AC_LANG([C++]) AC_PROG_CXX AC_CANONICAL_HOST AC_CONFIG_MACRO_DIR([m4]) #AC_CHECK_TOOL(AR, ar) # AC_PROG_RANLIB AC_PROG_INSTALL AM_INIT_AUTOMAKE PKG_PROG_PKG_CONFIG LT_INIT AX_PTHREAD() LIBS="$PTHREAD_LIBS $LIBS" CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" #CC="$PTHREAD_CC" #CXXFLAGS="${CXXFLAGS} -pthread" #LDFLAGS="${LDFLAGS} -pthread" AX_CXX_COMPILE_STDCXX_11(,mandatory) case "${host_os}" in darwin*) echo =========================================================== echo Setting up build environment for ${host_os} # ${target_cpu}${target_os} echo =========================================================== LIBS="${LIBS} -framework Carbon -framework Foundation -framework AppKit" LDFLAGS="${LDFLAGS} -ObjC++ -headerpad_max_install_names" # CXXFLAGS="${CXXFLAGS} -ObjC++" os=macosx ;; *linux*) echo =========================================================== echo Setting up build environment for ${host_os} echo =========================================================== # in linux we only have this option os=linux ;; *win32*|*mingw*) echo =========================================================== echo Setting up build environment for ${host_os} echo =========================================================== os=win32 ;; *) echo =========================================================== echo Setting up build environment for ${host_os} echo =========================================================== AC_MSG_ERROR([ "Unsupported target operating system" ]) esac AM_CONDITIONAL(WIN32, test "x$os" = "xwin32") AM_CONDITIONAL(LINUX, test "x$os" = "xlinux") AM_CONDITIONAL(OSX, test "x$os" = "xmacosx") # Check for GSL installation AM_PATH_GSL(1.7) if test "$no_gsl" != yes; then CPPFLAGS="$CPPFLAGS $GSL_CFLAGS" CXXFLAGS="$CXXFLAGS $GSL_CFLAGS" CFLAGS="$CFLAGS $GSL_CFLAGS" LIBS="$LIBS $GSL_LIBS" AC_DEFINE_UNQUOTED(HAVE_LIBGSL,1,[define when libgsl exists]) else AC_MSG_WARN([ Continuing without GSL support. If you want GSL support please install the gsl headers and libraries. If GSL is installed you might need to indicate where using the argument: --with-gsl-prefix=DIR ]) fi # Check for MYSQL installation AC_ARG_WITH(mysql,[AS_HELP_STRING([--with-mysql@<:@=path@:>@],[Specify path to Mysql library installation.])]) if test "x$with_mysql" != "xno"; then AM_PATH_MYSQL(4.0.0) if test "$no_mysql" != yes; then CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS" CFLAGS="$CFLAGS $MYSQL_CFLAGS" LIBS="$LIBS $MYSQL_LIBS" AC_DEFINE_UNQUOTED(HAVE_LIBMYSQL,1,[define when libmysql exists]) else AC_MSG_WARN([ Continuing without MYSQL support. If you want MYSQL support please install the mysql headers and libraries. If MYSQL is installed you might need to indicate where using the argument: --with-mysql-prefix=DIR ]) fi fi AC_ARG_WITH(readline, [ --without-readline disable readline library. ], ,with_readline="yes" ) if test "x$with_readline" = "xyes"; then AC_CHECK_LIB(readline,main,,no_readline=1) if test "x$no_readline" = "x"; then AC_CHECK_HEADER([readline/readline.h],[AC_DEFINE([HAVE_READLINE_H],[1],[define when readline.h exists])]) LIBS="$LIBS -lreadline" fi fi # Check for NCURSES installation AM_PATH_NCURSES(5.0) if test "$no_ncurses" != yes; then CXXFLAGS="$CXXFLAGS $NCURSES_CFLAGS" CFLAGS="$CFLAGS $NCURSES_CFLAGS" LIBS="$LIBS $NCURSES_LIBS" AC_DEFINE_UNQUOTED(HAVE_LIBNCURSES,1,[define when ncurses exists]) else AC_MSG_WARN([ Continuing without NCURSES support. If you want NCURSES support please install ncurses headers and libraries. If NCURSES is installed you might need to indicate where using the argument: --with-ncurses-prefix=DIR ]) fi AC_ARG_WITH(gpm, [ --without-gpm disable gpm library. ], ,with_gpm="yes" ) if test "x$with_gpm" = "xyes"; then AC_CHECK_LIB(gpm,main,,no_gpm=1) if test "x$no_gpm" = "x"; then LIBS="$LIBS -lgpm" fi fi AC_CHECK_LIB(dl,main) AC_CHECK_LIB(rt,main) AC_CHECK_LIB(crypto,main) AM_PATH_GMP(5.0) if test "x$no_gmp" = "x"; then echo "Compiling GNU MP library support" AC_DEFINE_UNQUOTED(HAVE_GMPLIB,1,[define when gnu mp library exists]) LIBS="$LIBS $GMP_LIBS" fi AM_CONDITIONAL(HAVE_GMPLIB, test "x$no_gmp" = "x" ) AC_CHECK_LIB([mpfr],main,[mpfrlib_exists=1]) if test "x$mpfrlib_exists" != "x"; then echo "Compiling mpfr library support" AC_DEFINE_UNQUOTED(HAVE_MPFRLIB,1,[define when mpfr library exists]) LIBS="$LIBS -lmpfr" fi AM_CONDITIONAL(HAVE_MPFRLIB, test "x$mpfrlib_exists" != "x" ) AC_ARG_WITH(mpi,[AS_HELP_STRING([--with-mpi@<:@=path@:>@],[Specify path to MPI library installation.])],,with_mpi=no) if test "x$with_mpi" != "xno"; then if test "x$with_mpi" != "xyes"; then CXXFLAGS="${CXXFLAGS} -I${with_mpi}/include" LDFLAGS="${LDFLAGS} -L${with_mpi}/lib" fi AC_CHECK_PROG([MPICPP],[mpic++],[/usr/bin/mpic++],[no]) if test "x$MPICPP" != "xno"; then LDFLAGS="${LDFLAGS} `mpic++ --showme:links`" CXXFLAGS="${CXXFLAGS} `mpic++ --showme:compile`" else if test "x$no_mpi" = "xyes"; then PKG_CHECK_MODULES(MPI,"openmpi-1.4-gcc",no_mpi="") LIBS="${LIBS} $MPI_LIBS" CXXFLAGS="${CXXFLAGS} $MPI_CFLAGS" else AC_CHECK_LIB(mpi,main,,no_mpi=yes) if test "x$no_mpi" != "xyes"; then AC_CHECK_HEADER([mpi.h],,no_mpi=yes) if test "x$no_mpi" = "xyes"; then no_mpi="" AC_CHECK_HEADER([mpi/mpi.h],,no_mpi=yes) if test "$x$no_mpi" != "xyes"; then CXXFLAGS="${CXXFLAGS} -I/usr/include/mpi" fi fi fi fi fi if test "x$no_mpi" = "xyes"; then AC_MSG_ERROR([ *** MPI library support requested but not found. *** If you want the MPI version to be compiled, you can try installing the MPI library using the package manager in your system or by downloading and installing manually (http://www.open-mpi.org/). *** Some examples of commands for packet managers are: apt-get install libopenmpi (on Debian, Ubuntu, ...), yum install openmpi (on Redhat, Rocks, ...). *** If you know that the MPI library is installed, please make sure that the libmpi.a (or libmpi.so) library can be found in /usr/lib, and that the mpi.h header can be found in /usr/include. *** If the files exist elsewhere please use ./configure CXXFLAGS="-I/include/path/to/mpi.h_directory/" LDFLAGS="-L/library/path/to/libmpi.a_directory/", or create symbolic links to the correct files in the /usr/include and /usr/lib directories.]) fi if test "x$no_mpi" != "xyes"; then echo "Compiling MPI library support" AC_DEFINE_UNQUOTED(HAVE_MPILIB,1,[define when MPI library exists]) LIBS="$LIBS -lmpi" AC_CHECK_LIB(mpi_cxx,main) AC_CHECK_LIB(mpi++,main) fi fi AM_CONDITIONAL(HAVE_MPILIB, test "x$no_mpi" != "xyes" -a "x$with_mpi" != "xno") AC_CHECK_LIB(apophenia,main,[apolib_exists=1]) if test "x$apolib_exists" != "x"; then echo "Compiling apophenia library support" AC_DEFINE_UNQUOTED(HAVE_APOLIB,1,[ define when apophenia library exists ]) LIBS="$LIBS -lapophenia" fi AM_CONDITIONAL(HAVE_APOLIB, test "x$apolib_exists" != "x" ) AC_CHECK_LIB(z,main,[zlib_exists=1]) if test "x$zlib_exists" != "x"; then echo "Compiling zlib support" AC_DEFINE_UNQUOTED(HAVE_ZLIB,1,[define when zlib exists]) LIBS="$LIBS -lz" fi AM_CONDITIONAL(HAVE_ZLIB, test "x$zlib_exists" != "x") AC_CHECK_LIB(hdf5_serial,main,[hdf5_exists=1]) if test "x$hdf5_exists" != "x"; then hdf5_exists="" AC_CHECK_HEADER([hdf5/serial/hdf5.h],[hdf5_exists=1]) if test "x$hdf5_exists" != "x"; then echo "Compiling HDF5 support" AC_DEFINE_UNQUOTED(HAVE_HDF5,1,[define when HDF5 exists]) # LIBS="$LIBS -lsz -laec -lz -lhdf5_serial" LIBS="$LIBS -lhdf5_serial -lsz -laec -lz" fi fi AM_CONDITIONAL(HAVE_HDF5, [test "x$hdf5_exists" != "x"]) AC_ARG_ENABLE(regcommon, [ --disable-regcommon disable registration of all eutils classes and methods. Useful when developing to reduce compiling time. ], ,enable_regcommon="yes" ) if test "x$enable_regcommon" = "xyes"; then AC_DEFINE_UNQUOTED(REGISTER_COMMON,1,[register all eutils classes and methods]) fi AC_CHECK_HEADER([zlib.h],[zlib_exists=yes]) AM_CONDITIONAL(HAVE_ZLIB, test "x$zlib_exists" != "x") if test "x$zlib_exists" != "x"; then AC_DEFINE_UNQUOTED(HAVE_ZLIB_H,1,[define when zlib.h exists]) fi AC_CHECK_HEADER([openssl/md5.h],[md5_exists=yes]) AM_CONDITIONAL(HAVE_MD5, test "x$md5_exists" != "x") if test "x$md5_exists" != "x"; then AC_DEFINE_UNQUOTED([HAVE_MD5_H],1,[define when MD5 function is available]) # AC_DEFINE([USE_DISTCOMP],[1],[define when using distributed computing module]) fi AC_CHECK_HEADER(regex.h,,no_regex=1) if test "x$no_regex" = "x"; then AC_DEFINE_UNQUOTED(HAVE_REGEX,1,[define when regex exists]) fi EUTILS_CXXFLAGS="$CXXFLAGS -I$includedir" EUTILS_LDFLAGS="$LDFLAGS" EUTILS_LIBS="$LIBS -L$libdir -leutils" AC_ARG_ENABLE([makestatic], [ --enable-makestatic compile statically linked executable. ],[enable_makestatic=$enableval],[enable_makestatic=no]) if test "x$enable_makestatic" = "xyes"; then AC_MSG_NOTICE([Enabling static compilation]) # LDFLAGS="${LDFLAGS} -static" # LDFLAGS="${LDFLAGS} -Wl,-Bstatic" LDFLAGS="${LDFLAGS} -all-static" fi AC_SUBST(EUTILS_CXXFLAGS) AC_SUBST(EUTILS_LDFLAGS) AC_SUBST(EUTILS_LIBS) AC_CONFIG_HEADERS([config.h]) AX_PREFIX_CONFIG_H AC_CONFIG_FILES([eutils-config eutils.pc Makefile]) AC_OUTPUT