# Process this file with autoconf to produce a configure script. #------------------------------------------------------------------------------ # This file is part of the Code_Saturne Preprocessor. # # Copyright (C) 2005-2006 EDF # # The Code_Saturne Preprocessor is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # The Code_Saturne Preprocessor is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public Licence # along with the Code_Saturne Preprocessor; if not, write to the # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Initialization #------------------------------------------------------------------------------ m4_define([ecs_licence_c_comment], [/* This file is part of "ECS" library, Copyright (C) 2004-2006 EDF */]) m4_define([ecs_major_version], [1]) m4_define([ecs_minor_version], [3]) m4_define([ecs_release_version], [c]) m4_define([ecs_version_extra], []) m4_define([ecs_version_string], [ecs_major_version.ecs_minor_version.ecs_release_version@&t@ecs_version_extra]) AC_INIT([ecs],[ecs_version_string],[yvan.fournier@edf.fr]) AC_CONFIG_SRCDIR([src/appli/ecs_main.c]) # Use the config directory for libtool stuff ... AC_CONFIG_AUX_DIR(config) AC_SUBST(ac_aux_dir) AC_CANONICAL_TARGET AC_CONFIG_HEADERS([ecs_config.h]) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE #------------------------------------------------------------------------------ # Checks for programs. #------------------------------------------------------------------------------ user_CPPFLAGS=$CPPFLAGS user_CFLAGS=$CFLAGS user_LDFLAGS=$LDFLAGS AC_PROG_CC(cc gcc) AC_PROG_INSTALL AC_PROG_LN_S # Debug or production compilation mode (debug by default) ? AC_ARG_ENABLE(debug, [ --enable-debug enable debugging (reduces optimization)], [ case "${enableval}" in yes) debug=true ;; no) debug=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; esac ], [ debug=false ] ) AM_CONDITIONAL(DEBUG, test x$debug = xtrue) # Optionally deactivate automatic determination of flags on known systems AC_ARG_ENABLE(auto-flags, [ --disable-auto-flags Do not define *FLAGS on known systems], [ case "${enableval}" in yes) auto_flags=true ;; no) auto_flags=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-auto-flags]) ;; esac ], [ auto_flags=true ] ) # Default compiler debug options (may be modified # by defining G_CFLAGS in the environment) #------------------------------------------------ if test "x$auto_flags" = "xtrue" ; then # Source associated recommended compiler options if test -f "$srcdir/config/ecs_auto_flags.sh" ; then AC_MSG_NOTICE([sourcing config/ecs_auto_flags.sh (test for known compilers)]) . "$srcdir/config/ecs_auto_flags.sh" else AC_MSG_WARN([config/ecs_auto_flags.sh default configuration file not found]) fi if test "x$user_CPPFLAGS" = "x"; then CPPFLAGS="$cppflags_default" else AC_MSG_NOTICE([default CPPFLAGS overridden by user definition]) fi if test "x$user_CFLAGS" = "x"; then CFLAGS="$cflags_default" if test "x$debug" = xtrue; then CFLAGS="${CFLAGS} $cflags_default_dbg" else CFLAGS="${CFLAGS} $cflags_default_opt" fi else AC_MSG_NOTICE([default CFLAGS overridden by user definition]) fi if test "x$user_LDFLAGS" = "x"; then LDFLAGS="$ldflags_default" if test "x$debug" = xtrue; then LDFLAGS="${LDFLAGS} $ldflags_default_dbg" else LDFLAGS="${LDFLAGS} $ldflags_default_opt" fi else AC_MSG_NOTICE([default LDFLAGS overridden by user definition]) fi fi # Optional additional user flags #------------------------------- AC_ARG_VAR(CPP_ADD, [Additional user C compiler flags]) AC_ARG_VAR(CC_ADD, [Additional user C compiler flags]) AC_ARG_VAR(LD_ADD, [Additional user linker flags, e.g. -L]) AC_ARG_VAR(LIBS_ADD, [Additional user librairies, e.g. -l]) if test "x$CPP_ADD" != x ; then CPPFLAGS="${CPPFLAGS} $CPP_ADD" fi if test "x$CC_ADD" != x ; then CFLAGS="${CFLAGS} $CC_ADD" fi if test "x$LD_ADD" != x ; then LDFLAGS="${LDFLAGS} $LD_ADD" fi if test "x$LIBS_ADD" != x ; then LIBS="${LIBS} $LIBS_ADD" fi # Add some preprocessor flags to include additional system features #------------------------------------------------------------------ case "$host_os" in linux* | hpux* | irix*) CPPFLAGS="${CPPFLAGS} -D_POSIX_SOURCE" ;; osf*) CPPFLAGS="${CPPFLAGS} -D_OSF_SOURCE" ;; solaris*) CPPFLAGS="${CPPFLAGS} -D_POSIX_SOURCE" ;; esac # We may only turn on processing for libtool now that the basic compiler # and linker flags are set (to avoid issues with linkers with different # modes such as 32 and 64 bit which may be modified by compiler or # linker flags). AC_PROG_LIBTOOL # Libtool configuration bug workaround (problem encountered by ecs on Linux # with pgcc 3.3.1, which does not recognize "-soname", so that "-Wl,-soname" # is needed to pass flags to the linker; Manually setting $wl to "-Wl" in # libtool corrects the problem, and so does this workaround borrowed from # the HDF5 configure.in, which does it automatically. case $host_os in linux*) if test "x$GCC" != "xyes"; then echo 'fixing $wl in' $ofile ed - $ofile < /dev/null /^wl=""/s//wl="-Wl,"/ w q EOF fi ;; esac #------------------------------------------------------------------------------ # Checks for libraries. #------------------------------------------------------------------------------ # Check for BFT (modifies CPPFLAGS, LDFLAGS, and LIBS) #----------------------------------------------------- ECS_AC_TEST_BFT(["1.0.1"]) # syntax with maximum version check: ECS_TEST_BFT(["0.0.0"], ["0.1.0"]) # Check for optionnal HDF support ECS_AC_TEST_HDF5 # Check for optionnal CGNS support ECS_AC_TEST_CGNS # Check for optionnal MED support ECS_AC_TEST_MED # Check for optionnal METIS support ECS_AC_TEST_METIS #------------------------------------------------------------------------------ # Checks for header files. #------------------------------------------------------------------------------ AC_HEADER_STDC AC_CHECK_HEADERS([sys/types.h sys/utsname.h sys/stat.h stddef.h]) #------------------------------------------------------------------------------ # Checks for typedefs, structures, and compiler characteristics. #------------------------------------------------------------------------------ AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_TYPE_PID_T AC_HEADER_TIME AC_HEADER_STDBOOL AC_CHECK_TYPES([long long, unsigned long long]) AC_CHECK_TYPES([int32_t]) AC_CHECK_TYPES([int64_t]) AC_CHECK_TYPES([uint32_t]) AC_CHECK_TYPES([uint64_t]) AC_CHECK_TYPES([ptrdiff_t]) AC_CHECK_SIZEOF([void *], [ecs]) AC_CHECK_SIZEOF([short], [ecs]) AC_CHECK_SIZEOF([int], [ecs]) AC_CHECK_SIZEOF([long], [ecs]) AC_CHECK_SIZEOF([float], [ecs]) AC_CHECK_SIZEOF([double], [ecs]) #------------------------------------------------------------------------------ # Checks for library functions. #------------------------------------------------------------------------------ AC_CHECK_FUNCS([mkdir]) AC_CHECK_FUNCS([snprintf]) #------------------------------------------------------------------------------ # Checks for system services. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Internationalization #------------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then localedir="/usr/local/share/locale" else localedir="${prefix}/share/locale" fi AC_DEFINE_UNQUOTED(LOCALEDIR, "${localedir}", LOCALEDIR) # Set of available languages now in po/LINGUAS. AM_GNU_GETTEXT([external]) #------------------------------------------------------------------------------ # Compiler options and system characteristics #------------------------------------------------------------------------------ CPPFLAGS="${CPPFLAGS} $BFT_CPPFLAGS" LDFLAGS="${LDFLAGS} $BFT_LDFLAGS" LIBS="${LIBS} $BFT_LIBS" AC_SUBST(CPPFLAGS) AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LIBS) #------------------------------------------------------------------------------ # Output #------------------------------------------------------------------------------ # Output configuration info script #--------------------------------- ECS_AC_CONFIG_INFO_INIT([ecs-config]) ECS_AC_CONFIG_INFO_EXTRA([ # use debugging code: "$debug" # HDF5 (Hierarchical Data Format) support: "$have_hdf5" # CGNS (CFD General Notation System) support: "$have_cgns" # MED (Model for Exchange of Data) support: "$have_med" # METIS (Graph Partitioning) support: "$have_metis" ]) ECS_AC_CONFIG_INFO_CC([${CC}], [${ecs_ac_cc_version}], [${ecs_ac_cc_version_full}]) ECS_AC_CONFIG_INFO_VERSION([ecs_version_string]) ECS_AC_CONFIG_INFO_DIRS([$prefix], [$exec_prefix]) ECS_AC_CONFIG_INFO_FLAGS([$CPPFLAGS $HDF5_CPPFLAGS $CGNS_CPPFLAGS $MED_CPPFLAGS $METIS_CPPFLAGS], [$CFLAGS], [$METIS_LDFLAGS $MED_LDFLAGS $CGNS_LDFLAGS $HDF5_LDFLAGS $LDFLAGS], [$METIS_LIBS $MED_LIBS $CGNS_LIBS $HDF5_LIBS $LIBS]) ECS_AC_CONFIG_INFO_FINALIZE #------------------------------------------------------------------------------ # If we use GNU gettext, we need intl/Makefile, po/Makefile, and m4/Makefile. # AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile # intl/Makefile po/Makefile.in m4/Makefile]) AC_CONFIG_FILES([Makefile po/Makefile.in src/appli/Makefile src/base/Makefile src/pre-post/Makefile src/util/Makefile src/outils/Makefile]) #------------------------------------------------------------------------------ AC_OUTPUT echo echo "Configuration options:" echo " use debugging code: "$debug"" echo " HDF (Hierarchical Data Format) support: "$have_hdf5"" echo " CGNS (CFD General Notation System) support: "$have_cgns"" echo " MED (Model for Exchange of Data) support: "$have_med"" echo " METIS (Graph Partitioning) support: "$have_metis"" echo echo "The package has been configured. Type:" echo " make" echo " make install" echo echo "To generate and install the ECS package" echo