# vim: expandtab sw=2 # Copyright (C) 2000, 2001, 2002, 2003, 2004 # Stefan Buehler # Patrick Eriksson # Oliver Lemke # # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. AC_INIT(autogen.sh) AM_CONFIG_HEADER(config.h) # The ARTS release number must go here: AM_INIT_AUTOMAKE(arts,1.1.967) dnl Put the ACLOCAL flags in the Makefile ACLOCAL="$ACLOCAL -I m4 $ACLOCAL_FLAGS" AM_MAINTAINER_MODE # # First of all set the default PREFIX if not given # (needed for arts data path later) # if test x${prefix} = xNONE; then prefix="/usr/local" fi # C Compiler: AC_PROG_CC # C Preprocessor AC_PROG_CPP # C++ Compiler: AC_PROG_CXX # C++ Preprocessor: AC_PROG_CXXCPP # Determine the name of the ranlib program AC_PROG_RANLIB # What's used by make install: AC_PROG_INSTALL # Provide standard headers: AC_STDC_HEADERS # Check features of c++ compiler AC_CXX_HAVE_STD AC_CXX_BOOL AC_CXX_STATIC_CAST AC_CXX_CONST_CAST AC_CXX_TEMPLATES AC_CXX_HAVE_SSTREAM # Check compiler characteristics AC_C_INLINE AC_C_CONST AC_TYPE_SIZE_T AC_CHECK_SIZEOF(float, 8) AC_CHECK_SIZEOF(double, 16) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 8) AC_CHECK_SIZEOF(size_t, 8) # Special headers that we need: # AC_HAVE_HEADERS(getopt.h) (now included in the source) AC_CHECK_HEADER(math.h, , AC_MSG_ERROR(required header file missing)) # # Check for math library # AC_CHECK_LIB(m, sin, , AC_MSG_ERROR(function $func not found in math library) ) # # MPI support # AC_ARG_WITH([mpi], [ --with-mpi MPI support (default is no)], [case "${withval}" in yes) ac_use_mpi=yes ;; *) ac_use_mpi=no ;; esac], [ac_use_mpi=no]) if test x$ac_use_mpi = xyes; then AC_CHECK_HEADER(mpi.h, AC_DEFINE_UNQUOTED(HAVE_MPI, , Use MPI support), [AC_MSG_ERROR(mpi.h not found)]) fi # # Default Numeric type # AC_ARG_WITH(numeric-type, [ --with-numeric-type=ARG Set Numeric type (default=double)], [case "${withval}" in double) ac_numeric_type=double ;; float) ac_numeric_type=float ;; *) AC_MSG_ERROR(bad value ${withval} for --with-numeric-type) ;; esac],[ ac_numeric_type=double ]) AC_MSG_RESULT(Setting Numeric type to $ac_numeric_type) AC_DEFINE_UNQUOTED(NUMERIC, $ac_numeric_type, Default Numeric type) if test x$ac_numeric_type = xdouble; then AC_DEFINE_UNQUOTED(USE_DOUBLE,, Whether double precision is in use) fi # # Default Index type # AC_ARG_WITH(index-type, [ --with-index-type=ARG Set Index type (default=long)], [case "${withval}" in short) ac_index_type=short ;; int) ac_index_type=int ;; long) ac_index_type=long ;; size_t) ac_index_type=size_t ;; *) AC_MSG_ERROR(bad value ${withval} for --with-index-type) ;; esac],[ ac_index_type=long ]) AC_MSG_RESULT(Setting Index type to $ac_index_type) AC_DEFINE_UNQUOTED(INDEX, $ac_index_type, Default Index type) # # Enable/disable debugging # AC_MSG_CHECKING(whether debugging should be activated) AC_ARG_ENABLE(debug, [ --enable-debug Activate debugging mode (default=no)], [case "${enableval}" in yes) ac_debug=yes ;; no) ac_debug=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac],[ ac_debug=$USE_MAINTAINER_MODE ]) AM_CONDITIONAL(DEBUGGING, test x$ac_debug = xyes) AC_MSG_RESULT([$ac_debug]) # # Enable/disable warnings # AC_MSG_CHECKING(whether warnings should be enabled) AC_ARG_ENABLE(more-warnings, [ --enable-more-warnings Enable more warnings (default=no)], [case "${enableval}" in yes) ac_more_warnings=yes ;; no) ac_more_warnings=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-more-warnings) ;; esac],[ ac_more_warnings=no ]) AC_MSG_RESULT([$ac_more_warnings]) # # Toggle documentation # if test x$USE_MAINTAINER_MODE = xyes; then ac_docgen=yes else ac_docgen=no fi AC_MSG_CHECKING(whether documentation should be generated) AM_CONDITIONAL(ARTS_GENDOCS, test x$ac_docgen = xyes) AC_MSG_RESULT([$ac_docgen]) # # Check for the required tools to build the docs # if test x$ac_docgen = xyes; then AC_CHECK_PROG(ac_doxygen, doxygen, yes, no) if test x$ac_doxygen = xno; then AC_MSG_WARN(Doxygen is required to build the documentation - Get it from http://www.doxygen.org/) fi AC_CHECK_PROG(ac_dot, dot, yes, no) if test x$ac_dot = xno; then AC_MSG_WARN(The dot tool from the graphviz package is needed to generate dependency plots in the documentation - Get it from http://www.graphviz.org/) fi AC_SUBST(ac_dot) AC_CHECK_PROG(ac_latex, latex, yes, no) if test x$ac_latex = xno; then AC_MSG_ERROR(LaTeX is required to build the documentation!!!) fi AC_CHECK_PROG(ac_pdflatex, pdflatex, yes, no) if test x$ac_pdflatex = xno; then AC_MSG_ERROR(pdfLaTeX is required to build the documentation!!!) fi fi WARNING_FLAGS= if test x$ac_cv_cxx_compiler_gnu = xyes -o x$ac_cv_prog_gxx = xyes; then GCC_MAJOR=`$CC -v 2>&1 | grep '^gcc version' | sed 's/^gcc version \([[0-9]]\)\..*$/\1/'` WARNING_FLAGS="-W -Wall -Wconversion" if test x$ac_more_warnings = xyes; then WARNING_FLAGS="$WARNING_FLAGS -Werror" # gcc2 produces warnings in standard headers, therefore only # enable it with gcc3 if test x$GCC_MAJOR = x3; then WARNING_FLAGS="$WARNING_FLAGS -Wshadow" fi fi fi # # OS check # ac_osname=`uname` ac_osversion=`uname -r` AM_CONDITIONAL(OS_NAME, test "$ac_osname") AC_DEFINE_UNQUOTED(OS_NAME, "$ac_osname", Operating system name) AM_CONDITIONAL(OS_VERSION, test "$ac_osversion") AC_DEFINE_UNQUOTED(OS_VERSION, "$ac_osversion", Operating system version) case "$ac_osname" in Linux) CPPFLAGS="$CPPFLAGS -DLINUX" ;; HP-UX) CPPFLAGS="$CPPFLAGS -DHPUX" ;; SunOS) CPPFLAGS="$CPPFLAGS -DSUNOS" ;; esac # # Compile flags switches # if test x$ac_debug = xyes; then DEBUG_FLAGS="-g" else DEBUG_FLAGS="" CPPFLAGS="$CPPFLAGS -DNDEBUG" fi CFLAGS="$CFLAGS $DEBUG_FLAGS $WARNING_FLAGS" if test x$ac_cv_cxx_compiler_gnu = xyes -o x$ac_cv_prog_gxx = xyes; then CXXFLAGS_FIXED="$DEBUG_FLAGS -ftemplate-depth-60 $WARNING_FLAGS" CXXFLAGS="$CXXFLAGS $CXXFLAGS_FIXED" else CXXFLAGS_FIXED="$CXXFLAGS $DEBUG_FLAGS" CXXFLAGS="$CXXFLAGS_FIXED" fi AC_SUBST(CXXFLAGS_FIXED) AM_CONDITIONAL(COMPILE_FLAGS, test "$CXXFLAGS") AC_DEFINE_UNQUOTED(COMPILE_FLAGS, "$CXXFLAGS", Compile Flags) AC_OUTPUT([ arts.spec Makefile aii/Makefile doc/Makefile doc/index.html doc/icons/Makefile doc/doxygen/Makefile doc/doxygen/Doxyfile doc/doxygen/html/Makefile doc/doxygen/latex/Makefile doc/reference/Makefile doc/reference/auto_version.tex doc/uguide/Makefile doc/uguide/auto_version.tex doc/uguide/Figs/Makefile doc/uguide/Figs/concept/Makefile doc/uguide/Figs/fm_definitions/Makefile doc/uguide/Figs/interpolation/Makefile doc/uguide/Figs/montecarlo/Makefile doc/uguide/Figs/polarization/Makefile doc/uguide/Figs/ppath/Makefile doc/uguide/Figs/rte_theory/Makefile doc/uguide/Figs/scattering/Makefile doc/uguide/Figs/sensor/Makefile doc/examples/Makefile doc/examples/data/Makefile m4/Makefile src/Makefile tests/Makefile ]) AC_MSG_RESULT() AC_MSG_RESULT([*******************************************************]) AC_MSG_RESULT([ ARTS configuration summary]) AC_MSG_RESULT() AC_MSG_RESULT([ Maintainer mode : $USE_MAINTAINER_MODE]) AC_MSG_RESULT([ Debugging : $ac_debug]) AC_MSG_RESULT([ Numeric type : $ac_numeric_type]) AC_MSG_RESULT([ Index type : $ac_index_type]) AC_MSG_RESULT([ Use MPI : $ac_use_mpi]) AC_MSG_RESULT([ Regenerate documentation : $ac_docgen]) AC_MSG_RESULT() AC_MSG_RESULT([ CPPFLAGS : $CPPFLAGS]) AC_MSG_RESULT([ CFLAGS : $CFLAGS]) AC_MSG_RESULT([ CXXFLAGS : $CXXFLAGS]) AC_MSG_RESULT([ LDFLAGS : $LDFLAGS]) AC_MSG_RESULT([*******************************************************]) AC_MSG_RESULT()