Skip to content
Snippets Groups Projects
Commit 26dd2dbe authored by Christian Engwer's avatar Christian Engwer
Browse files

Many m4 cleanup, credits go to Elias

[[Imported from SVN: r5646]]
parent 1542bc6e
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ AC_DEFUN([DUNE_DISABLE_LIBCHECK],[ ...@@ -14,7 +14,7 @@ AC_DEFUN([DUNE_DISABLE_LIBCHECK],[
# check only for the headers and not for the libs. This feature is used # check only for the headers and not for the libs. This feature is used
# when building the web page, because we don't need the libs in this case # when building the web page, because we don't need the libs in this case
AC_ARG_ENABLE(dunelibcheck,[],,enable_dunelibcheck=yes) AC_ARG_ENABLE([dunelibcheck],[])
]) ])
AC_DEFUN([DUNE_MODULE_ADD_SUMMARY_ENTRY],[ AC_DEFUN([DUNE_MODULE_ADD_SUMMARY_ENTRY],[
...@@ -22,12 +22,12 @@ AC_DEFUN([DUNE_MODULE_ADD_SUMMARY_ENTRY],[ ...@@ -22,12 +22,12 @@ AC_DEFUN([DUNE_MODULE_ADD_SUMMARY_ENTRY],[
m4_pushdef([_dune_module], [m4_translit(_dune_name, [-], [_])]) m4_pushdef([_dune_module], [m4_translit(_dune_name, [-], [_])])
m4_pushdef([_DUNE_MODULE], [m4_toupper(_dune_module)]) m4_pushdef([_DUNE_MODULE], [m4_toupper(_dune_module)])
result="$with_[]_dune_module" result="$with_[]_dune_module"
if test "x$_DUNE_MODULE[]_ROOT" != "x"; then AS_IF([test -n "$_DUNE_MODULE[]_ROOT"],[
result="$result ($_DUNE_MODULE[]_ROOT)" result="$result ($_DUNE_MODULE[]_ROOT)"
fi ])
if test "x$_DUNE_MODULE[]_VERSION" != "x"; then AS_IF([test -n "$_DUNE_MODULE[]_VERSION"],[
result="$result version $_DUNE_MODULE[]_VERSION" result="$result version $_DUNE_MODULE[]_VERSION"
fi ])
DUNE_ADD_SUMMARY_MOD_ENTRY(_dune_name,[$result]) DUNE_ADD_SUMMARY_MOD_ENTRY(_dune_name,[$result])
]) ])
...@@ -79,7 +79,7 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -79,7 +79,7 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
# the usual option... # the usual option...
AC_ARG_WITH(_dune_name, AC_ARG_WITH(_dune_name,
AC_HELP_STRING([--with-_dune_name=PATH],[_dune_module directory])) AS_HELP_STRING([--with-_dune_name=PATH],[_dune_module directory]))
# backup of flags # backup of flags
ac_save_CPPFLAGS="$CPPFLAGS" ac_save_CPPFLAGS="$CPPFLAGS"
...@@ -95,17 +95,17 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -95,17 +95,17 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
AC_MSG_CHECKING([for $1 installation or source tree]) AC_MSG_CHECKING([for $1 installation or source tree])
# is a directory set? # is a directory set?
if test x$with_[]_dune_module = x ; then AS_IF([test -z "$with_[]_dune_module"],[
# #
# search module $1 via pkg-config # search module $1 via pkg-config
# #
with_[]_dune_module="global installation" with_[]_dune_module="global installation"
if test -z "$PKG_CONFIG"; then AS_IF([test -z "$PKG_CONFIG"],[
AC_MSG_RESULT([failed]) AC_MSG_RESULT([failed])
AC_MSG_NOTICE([could not search for module _dune_name]) AC_MSG_NOTICE([could not search for module _dune_name])
AC_MSG_ERROR([pkg-config is required for using installed modules]) AC_MSG_ERROR([pkg-config is required for using installed modules])
fi ])
if AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then AS_IF(AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]),[
_DUNE_MODULE[]_CPPFLAGS="`$PKG_CONFIG --cflags _dune_name`" 2>/dev/null _DUNE_MODULE[]_CPPFLAGS="`$PKG_CONFIG --cflags _dune_name`" 2>/dev/null
_DUNE_MODULE[]_ROOT="`$PKG_CONFIG --variable=prefix _dune_name`" 2>/dev/null _DUNE_MODULE[]_ROOT="`$PKG_CONFIG --variable=prefix _dune_name`" 2>/dev/null
_DUNE_MODULE[]_VERSION="`$PKG_CONFIG --modversion _dune_name`" 2>/dev/null _DUNE_MODULE[]_VERSION="`$PKG_CONFIG --modversion _dune_name`" 2>/dev/null
...@@ -114,29 +114,28 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -114,29 +114,28 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
_DUNE_MODULE[]_LIBS="-l[]_dune_lib" _DUNE_MODULE[]_LIBS="-l[]_dune_lib"
]) ])
HAVE_[]_DUNE_MODULE=1 HAVE_[]_DUNE_MODULE=1
AC_MSG_RESULT([ AC_MSG_RESULT([global installation in $_DUNE_MODULE[]_ROOT])
global installation in $_DUNE_MODULE[]_ROOT]) ],[
else
HAVE_[]_DUNE_MODULE=0 HAVE_[]_DUNE_MODULE=0
AC_MSG_RESULT([not found]) AC_MSG_RESULT([not found])
fi ])
else ],[
# #
# path for module $1 is specified via command line # path for module $1 is specified via command line
# #
if test -d $with_[]_dune_module ; then AS_IF([test -d "$with_[]_dune_module"],[
# expand tilde / other stuff # expand tilde / other stuff
_DUNE_MODULE[]_ROOT=`cd $with_[]_dune_module && pwd` _DUNE_MODULE[]_ROOT=`cd $with_[]_dune_module && pwd`
# expand search path (otherwise empty CPPFLAGS) # expand search path (otherwise empty CPPFLAGS)
if test -d $_DUNE_MODULE[]_ROOT/include/dune; then AS_IF([test -d "$_DUNE_MODULE[]_ROOT/include/dune"],[
# Dune was installed into directory given by with-dunecommon # Dune was installed into directory given by with-dunecommon
_DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_ROOT/include" _DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_ROOT/include"
_DUNE_MODULE[]_VERSION="`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$_DUNE_MODULE[]_ROOT/lib/pkgconfig $PKG_CONFIG --modversion _dune_name`" 2>/dev/null _DUNE_MODULE[]_VERSION="`PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$_DUNE_MODULE[]_ROOT/lib/pkgconfig $PKG_CONFIG --modversion _dune_name`" 2>/dev/null
else ],[
_DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_ROOT" _DUNE_MODULE[]_CPPFLAGS="-I$_DUNE_MODULE[]_ROOT"
_DUNE_MODULE[]_VERSION="`grep Version $_DUNE_MODULE[]_ROOT/dune.module | sed -e 's/^Version: *//'`" 2>/dev/null _DUNE_MODULE[]_VERSION="`grep Version $_DUNE_MODULE[]_ROOT/dune.module | sed -e 's/^Version: *//'`" 2>/dev/null
fi ])
ifelse(_dune_symbol,,,[ ifelse(_dune_symbol,,,[
_DUNE_MODULE[]_LDFLAGS="-L$_DUNE_MODULE[]_ROOT/lib" _DUNE_MODULE[]_LDFLAGS="-L$_DUNE_MODULE[]_ROOT/lib"
_DUNE_MODULE[]_LIBS="-l[]_dune_lib" _DUNE_MODULE[]_LIBS="-l[]_dune_lib"
...@@ -144,14 +143,13 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -144,14 +143,13 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
# set expanded module path # set expanded module path
with_[]_dune_module="$_DUNE_MODULE[]_ROOT" with_[]_dune_module="$_DUNE_MODULE[]_ROOT"
HAVE_[]_DUNE_MODULE=1 HAVE_[]_DUNE_MODULE=1
AC_MSG_RESULT([ AC_MSG_RESULT([found in $_DUNE_MODULE[]_ROOT])
found in $_DUNE_MODULE[]_ROOT]) ],[
else
HAVE_[]_DUNE_MODULE=0 HAVE_[]_DUNE_MODULE=0
AC_MSG_RESULT([not found]) AC_MSG_RESULT([not found])
AC_MSG_ERROR([_dune_name-directory $with_[]_dune_module does not exist]) AC_MSG_ERROR([_dune_name-directory $with_[]_dune_module does not exist])
fi ])
fi ])
DUNE_CPPFLAGS="$DUNE_CPPFLAGS $_DUNE_MODULE[]_CPPFLAGS" DUNE_CPPFLAGS="$DUNE_CPPFLAGS $_DUNE_MODULE[]_CPPFLAGS"
CPPFLAGS="$DUNE_CPPFLAGS" CPPFLAGS="$DUNE_CPPFLAGS"
...@@ -165,57 +163,66 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -165,57 +163,66 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
_DUNE_MODULE[]_CPPFLAGS="$SET_CPPFLAGS"], _DUNE_MODULE[]_CPPFLAGS="$SET_CPPFLAGS"],
[HAVE_[]_DUNE_MODULE=0 [HAVE_[]_DUNE_MODULE=0
_DUNE_MODULE[]_CPPFLAGS="" _DUNE_MODULE[]_CPPFLAGS=""
if test x$_DUNE_MODULE[]_ROOT != x; then AS_IF([test -n "$_DUNE_MODULE[]_ROOT"],[
AC_MSG_WARN([$_DUNE_MODULE[]_ROOT does not seem to contain a valid _dune_name (dune/[]_dune_header not found)])] AC_MSG_WARN([$_DUNE_MODULE[]_ROOT does not seem to contain a valid _dune_name (dune/[]_dune_header not found)])
fi ])
]
) )
## ##
## check for lib (if lib name was provided) ## check for lib (if lib name was provided)
## ##
ifelse(_dune_symbol,,AC_MSG_NOTICE([_dune_name does not provide libs]),[ ifelse(_dune_symbol,,
if test "x$enable_dunelibcheck" != "xyes"; then AC_MSG_NOTICE([_dune_name does not provide libs]),
AC_MSG_WARN([library check for _dune_name is disabled. DANGEROUS!])
fi
if test x$HAVE_[]_DUNE_MODULE = x1 -a x$enable_dunelibcheck = "xyes"; then
# save current LDFLAGS AS_IF([test "x$enable_dunelibcheck" = "xno"],[
ac_save_LDFLAGS="$LDFLAGS" AC_MSG_WARN([library check for _dune_name is disabled. DANGEROUS!])
ac_save_LIBS="$LIBS" ],[
ac_save_CXX="$CXX" AS_IF([test "x$HAVE_[]_DUNE_MODULE" = "x1"],[
HAVE_[]_DUNE_MODULE=0
# save current LDFLAGS
# define LTCXXCOMPILE like it will be defined in the Makefile ac_save_LDFLAGS="$LDFLAGS"
LTCXXLINK="./libtool --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS"
CXX="$LTCXXLINK" ac_save_LIBS="$LIBS"
ac_save_CXX="$CXX"
# use module LDFLAGS HAVE_[]_DUNE_MODULE=0
LDFLAGS="$LDFLAGS $DUNE_PKG_LDFLAGS $_DUNE_MODULE[]_LDFLAGS"
LIBS="$DUNE_LIBS $_DUNE_MODULE[]_LIBS" # define LTCXXCOMPILE like it will be defined in the Makefile
LTCXXLINK="./libtool --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS"
AC_MSG_CHECKING([for lib[]_dune_lib]) CXX="$LTCXXLINK"
AC_TRY_LINK(dnl
[#]include<dune/[]_dune_header>, # use module LDFLAGS
_dune_symbol, LDFLAGS="$LDFLAGS $DUNE_PKG_LDFLAGS $_DUNE_MODULE[]_LDFLAGS"
[AC_MSG_RESULT([yes]) LIBS="$DUNE_LIBS $_DUNE_MODULE[]_LIBS"
HAVE_[]_DUNE_MODULE=1
_DUNE_MODULE[]_LIBS="$LIBS"], AC_MSG_CHECKING([for lib[]_dune_lib])
[AC_MSG_RESULT([no])
HAVE_[]_DUNE_MODULE=0 AC_TRY_LINK(dnl
if test x$_DUNE_MODULE[]_ROOT != x; then [#]include<dune/[]_dune_header>,
AC_MSG_WARN([$with_[]_dune_module does not seem to contain a valid _dune_name (failed to link with lib[]_dune_lib[].la)])] _dune_symbol,
fi [
) AC_MSG_RESULT([yes])
HAVE_[]_DUNE_MODULE=1
_DUNE_MODULE[]_LIBS="$LIBS"
],[
AC_MSG_RESULT([no])
HAVE_[]_DUNE_MODULE=0
AS_IF([test -n "$_DUNE_MODULE[]_ROOT"],[
AC_MSG_WARN([$with_[]_dune_module does not seem to contain a valid _dune_name (failed to link with lib[]_dune_lib[].la)])
])
]
)
])
# reset variables # reset variables
LDFLAGS="$ac_save_LDFLAGS" LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS" LIBS="$ac_save_LIBS"
CXX="$ac_save_CXX" CXX="$ac_save_CXX"
fi ])
]) )
# did we succeed? # did we succeed?
if test x$HAVE_[]_DUNE_MODULE = x1; then AS_IF([test "x$HAVE_[]_DUNE_MODULE" = "x1"],[
# set variables for our modules # set variables for our modules
AC_SUBST(_DUNE_MODULE[]_CPPFLAGS, "$_DUNE_MODULE[]_CPPFLAGS") AC_SUBST(_DUNE_MODULE[]_CPPFLAGS, "$_DUNE_MODULE[]_CPPFLAGS")
AC_SUBST(_DUNE_MODULE[]_LDFLAGS, "$_DUNE_MODULE[]_LDFLAGS") AC_SUBST(_DUNE_MODULE[]_LDFLAGS, "$_DUNE_MODULE[]_LDFLAGS")
...@@ -237,9 +244,9 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -237,9 +244,9 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $_DUNE_MODULE[]_LDFLAGS" DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $_DUNE_MODULE[]_LDFLAGS"
with_[]_dune_module="yes" with_[]_dune_module="yes"
else ],[
with_[]_dune_module="no" with_[]_dune_module="no"
fi ])
AM_CONDITIONAL(HAVE_[]_DUNE_MODULE, test x$HAVE_[]_DUNE_MODULE = x1) AM_CONDITIONAL(HAVE_[]_DUNE_MODULE, test x$HAVE_[]_DUNE_MODULE = x1)
...@@ -265,76 +272,75 @@ AC_DEFUN([DUNE_CHECK_MODULES],[ ...@@ -265,76 +272,75 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
AC_DEFUN([DUNE_DEV_MODE],[ AC_DEFUN([DUNE_DEV_MODE],[
AC_ARG_ENABLE(dunedevel, AC_ARG_ENABLE(dunedevel,
AC_HELP_STRING([--enable-dunedevel],[activate Dune-Developer-mode])) AS_HELP_STRING([--enable-dunedevel],[activate Dune-Developer-mode]))
if test x"$enable_dunedevel" = xyes ; then AS_IF([test "x$enable_dunedevel" = "xyes"],
AC_DEFINE(DUNE_DEVEL_MODE, 1, [Activates developer output]) AC_DEFINE(DUNE_DEVEL_MODE, 1, [Activates developer output]))
fi
]) ])
AC_DEFUN([DUNE_SYMLINK],[ AC_DEFUN([DUNE_SYMLINK],[
AC_MSG_WARN([Module is using the deprecated 'dune' symlink.]) AC_MSG_WARN([Module is using the deprecated \'dune\' symlink.])
# create symlink for consistent paths even when $(top_srcdir) is not # create symlink for consistent paths even when $(top_srcdir) is not
# called dune/ (if filesystem/OS supports symlinks) # called dune/ (if filesystem/OS supports symlinks)
AC_PROG_LN_S AC_PROG_LN_S
if test x"$LN_S" = x"ln -s" ; then AS_IF([test "x$LN_S" = "xln -s"],[
# Symlinks possible! # Symlinks possible!
# Note: we are currently in the build directory which may be != the # Note: we are currently in the build directory which may be != the
# source directory # source directory
# does a file already exist? # does a file already exist?
if test -e dune ; then AS_IF([test -e "dune"],[
# exists: is a symlink? # exists: is a symlink?
if test -L dune ; then AS_IF([test -L "dune"],[
if ! test -r dune/$ac_unique_file ; then AS_IF([! test -r dune/$ac_unique_file],[
AC_MSG_ERROR([Symlink 'dune' exists but appears to be wrong! Please remove it manually]) AC_MSG_ERROR([Symlink \'dune\' exists but appears to be wrong\! Please remove it manually])
fi ])
fi ])
else ],[
echo Creating dune-symlink... echo Creating dune-symlink...
# set symlink in build directory to sources # set symlink in build directory to sources
ln -s $srcdir dune ln -s $srcdir dune
# sanity check # sanity check
if ! test -r dune/$ac_unique_file ; then AS_IF([! test -r "dune/$ac_unique_file"],[
AC_MSG_ERROR([Sanity check for symlink failed! Please send a bugreport to dune@dune-project.org]) AC_MSG_ERROR([Sanity check for symlink failed! Please send a bugreport to dune@dune-project.org])
fi ])
fi ])
else ],[
# no symlinks possible... check name of directory # no symlinks possible... check name of directory
AC_MSG_ERROR([No symlinks supported! You have to install dune. No inplace usage possible!]) AC_MSG_ERROR([No symlinks supported! You have to install dune. No inplace usage possible!])
fi ])
]) ])
AC_DEFUN([DUNE_WEB], AC_DEFUN([DUNE_WEB],
[ [
# special variable to include the documentation into the website # special variable to include the documentation into the website
AC_ARG_WITH(duneweb, AC_ARG_WITH(duneweb,
AC_HELP_STRING([--with-duneweb=PATH],[Only needed for website-generation, path to checked out version of dune-web])) AS_HELP_STRING([--with-duneweb=PATH],[Only needed for website-generation, path to checked out version of dune-web]))
if test x$with_duneweb != x; then AS_IF([test -n "$with_duneweb"],[
if test x$with_duneweb != xno; then AS_IF([test "x$with_duneweb" != "xno"],[
# parameter is set. Check it # parameter is set. Check it
AC_MSG_CHECKING([whether passed Dune-Web ($with_duneweb) directory appears correct]) AC_MSG_CHECKING([whether passed Dune-Web ($with_duneweb) directory appears correct])
WEBTESTFILE="$with_duneweb/layout/default.wml" WEBTESTFILE="$with_duneweb/layout/default.wml"
if test -d "$with_duneweb" && test -e "$WEBTESTFILE" ; then AS_IF([test -d "$with_duneweb" -a -e "$WEBTESTFILE"],[
AC_MSG_RESULT([ok]) AC_MSG_RESULT([ok])
# normalize path # normalize path
with_duneweb=`(cd $with_duneweb && pwd)` ; with_duneweb=`(cd $with_duneweb && pwd)` ;
else ],[
if test -d "$with_duneweb" ; then AS_IF([test -d "$with_duneweb"],[
AC_MSG_ERROR([$WEBTESTFILE not found in Dune-web dir $with_duneweb!]) AC_MSG_ERROR([$WEBTESTFILE not found in Dune-web dir $with_duneweb!])
else ],[
AC_MSG_ERROR([Dune-Web directory $with_duneweb not found!]) AC_MSG_ERROR([Dune-Web directory $with_duneweb not found!])
fi ])
with_duneweb=no with_duneweb=no
fi ])
fi ])
DUNE_ADD_SUMMARY_ENTRY([dune web],[$with_duneweb]) DUNE_ADD_SUMMARY_ENTRY([dune web],[$with_duneweb])
else ],[
with_duneweb=no with_duneweb=no
fi ])
AC_SUBST(DUNEWEBDIR, $with_duneweb) AC_SUBST(DUNEWEBDIR, $with_duneweb)
AM_CONDITIONAL(DUNEWEB, test x$with_duneweb != xno) AM_CONDITIONAL(DUNEWEB, [test "x$with_duneweb" != "xno"])
]) ])
...@@ -13,15 +13,11 @@ AC_DEFUN([DUNE_CHECK_ALL],[ ...@@ -13,15 +13,11 @@ AC_DEFUN([DUNE_CHECK_ALL],[
AC_REQUIRE([DUNE_WEB]) AC_REQUIRE([DUNE_WEB])
AC_ARG_ENABLE(enabledist, AC_ARG_ENABLE(enabledist,
AC_HELP_STRING([--enable-dist], AS_HELP_STRING([--enable-dist],
[go into create-tarballs-mode [[default=no]]]), [go into create-tarballs-mode [[default=no]]]))
[enabledist=$enableval], AM_CONDITIONAL(MAKEDIST, [test "x$enabledist" = "xyes"])
[enabledist=no] AS_IF([test "x$enabledist" = "xyes"],[
) AM_CONDITIONAL(DUNEWEB, false)])
AM_CONDITIONAL(MAKEDIST, test x$enabledist = xyes)
if test x$enabledist = xyes; then
AM_CONDITIONAL(DUNEWEB, false)
fi
dnl check dependencies of this module dnl check dependencies of this module
dnl this test is autogenerated for each module dnl this test is autogenerated for each module
......
...@@ -5,21 +5,24 @@ ...@@ -5,21 +5,24 @@
AC_DEFUN([DUNE_AUTOBUILD_FLAGS],[ AC_DEFUN([DUNE_AUTOBUILD_FLAGS],[
# special settings for check-log # special settings for check-log
AC_ARG_WITH([hostid], AC_ARG_WITH([hostid],
AC_HELP_STRING([--with-hostid=HOST_IDENTIFIER], AS_HELP_STRING([--with-hostid=HOST_IDENTIFIER],
[host identifier used for automated test runs])) [host identifier used for automated test runs]))
if test "x$with_hostid" = "xno" ; then AS_IF([test "x$with_hostid" = "xno"],[
with_hostid="$ac_hostname (`uname -sm`, $COMPILER_NAME)"; with_hostid="$ac_hostname (`uname -sm`, $COMPILER_NAME)";
fi ])
AC_SUBST([hostid], [$with_hostid]) AC_SUBST([hostid], [$with_hostid])
AC_ARG_WITH([tag], AC_ARG_WITH([tag],
AC_HELP_STRING([--with-tag=TAG], AS_HELP_STRING([--with-tag=TAG],
[tag to use for automated test runs])) [tag to use for automated test runs]))
if test "x$with_tag" = "xno" ; then with_tag=foo; fi AS_IF([test "x$with_tag" = "xno"],[
with_tag=foo
])
AC_SUBST([tag], [$with_tag]) AC_SUBST([tag], [$with_tag])
AC_ARG_WITH([revision], AC_ARG_WITH([revision],
AC_HELP_STRING([--with-revision=TAG], AS_HELP_STRING([--with-revision=TAG],
[revision to use for automated test runs])) [revision to use for automated test runs]))
if test "x$with_revision" = "xno" ; then with_revision=bar; fi AS_IF([test "x$with_revision" = "xno"],[
with_revision=bar])
AC_SUBST([revision], [$with_revision]) AC_SUBST([revision], [$with_revision])
]) ])
\ No newline at end of file
...@@ -29,16 +29,14 @@ AC_DEFUN([DUNE_COMMON_CHECKS], ...@@ -29,16 +29,14 @@ AC_DEFUN([DUNE_COMMON_CHECKS],
dnl check for programs dnl check for programs
AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CC])
# add -Wall if the compiler is gcc # add -Wall if the compiler is gcc
if test "$ac_test_CFLAGS" != set && \ AS_IF([test "x$ac_test_CFLAGS" != "xset" -a "x$GCC" = "xyes"],[
test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wall"
fi ])
# add -Wall if the compiler is g++ # add -Wall if the compiler is g++
AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXX])
if test "$ac_test_CXXFLAGS" != set && \ AS_IF([test "x$ac_test_CXXFLAGS" != "xset" -a "x$GXX" = "xyes"],[
test "$GXX" = yes; then
CXXFLAGS="$CXXFLAGS -Wall" CXXFLAGS="$CXXFLAGS -Wall"
fi ])
dnl checks for header files. dnl checks for header files.
AC_REQUIRE([AC_HEADER_STDC]) AC_REQUIRE([AC_HEADER_STDC])
...@@ -48,12 +46,12 @@ AC_DEFUN([DUNE_COMMON_CHECKS], ...@@ -48,12 +46,12 @@ AC_DEFUN([DUNE_COMMON_CHECKS],
# Allow disabling tr1 headers. E.g. needed for broken xlc on Blue Gene # Allow disabling tr1 headers. E.g. needed for broken xlc on Blue Gene
AC_ARG_ENABLE(tr1-headers, AC_ARG_ENABLE(tr1-headers,
AC_HELP_STRING([--disable-tr1-headers], AS_HELP_STRING([--disable-tr1-headers],
[Prevents checking for tr1 headers like tuple, array, etc. [Prevents checking for tr1 headers like tuple, array, etc.
This might be needed for broken compilers like xlc on Blue Gene]), This might be needed for broken compilers like xlc on Blue Gene]))
[], [ AS_IF([test "x$enable_tr1_headers" = "xyes"],
AC_CHECK_HEADERS([type_traits tr1/type_traits array tr1/array tuple tr1/tuple]) AC_CHECK_HEADERS([type_traits tr1/type_traits array tr1/array tuple tr1/tuple])
]) )
AC_LANG_POP([C++]) AC_LANG_POP([C++])
......
...@@ -4,11 +4,8 @@ ...@@ -4,11 +4,8 @@
AC_DEFUN([DUNE_CHECK_COMPILER],[ AC_DEFUN([DUNE_CHECK_COMPILER],[
AC_ARG_ENABLE(compilercheck, AC_ARG_ENABLE(compilercheck,
AC_HELP_STRING([--enable-compilercheck], AS_HELP_STRING([--enable-compilercheck],
[check for supported compilers [[default=yes]]]), [check for supported compilers [[default=yes]]]))
[compilercheck=$enableval],
[compilercheck=yes]
)
SUPPORTED_COMPILER="gcc (>= 3.4.1) or icc (>= 7.0)" SUPPORTED_COMPILER="gcc (>= 3.4.1) or icc (>= 7.0)"
...@@ -39,20 +36,17 @@ int main() { ...@@ -39,20 +36,17 @@ int main() {
} }
_ACEOF _ACEOF
if test "x$compilercheck" != "xyes" ; then AS_IF([test "x$compilercheck" != "xno"],[
AC_MSG_WARN([compilercheck is disabled. DANGEROUS!]) AC_MSG_WARN([compilercheck is disabled. DANGEROUS!])],[
else AS_IF([$CXX conftest.cc -o conftest.$ac_exeext >&5],[
if $CXX conftest.cc -o conftest.$ac_exeext >&5; then COMPILER_NAME=`./conftest.$ac_exeext`;
COMPILER_NAME=`./conftest.$ac_exeext` rm -f conftest.$ac_exeext],[
rm -f conftest.$ac_exeext
else
AC_MSG_ERROR([Your compiler is not officially supported by dune AC_MSG_ERROR([Your compiler is not officially supported by dune
dune is known to work with $SUPPORTED_COMPILER]) dune is known to work with $SUPPORTED_COMPILER])
fi ]
fi )]
)
if test "x$COMPILER_NAME" = "x"; then
COMPILER_NAME="unknown compiler"
fi
AS_IF([test -z "$COMPILER_NAME"],[
COMPILER_NAME="unknown compiler"])
]) ])
...@@ -5,18 +5,16 @@ AC_DEFUN([DUNE_DOCUMENTATION],[ ...@@ -5,18 +5,16 @@ AC_DEFUN([DUNE_DOCUMENTATION],[
# documentation then disable documentation # documentation then disable documentation
# option by default # option by default
DOCU_TAG_FILE="no-documentation.tag" DOCU_TAG_FILE="no-documentation.tag"
if test -f doc/$DOCU_TAG_FILE ; then AS_IF([test -f "doc/$DOCU_TAG_FILE"],[
HAS_DOCUMENTATION="no" HAS_DOCUMENTATION="no"],[
else
# check whether option is chosen or not # check whether option is chosen or not
if test x$enable_documentation != xno; then AS_IF([test "x$enable_documentation" != "xno"],[
HAS_DOCUMENTATION="yes" HAS_DOCUMENTATION="yes"],[
else
HAS_DOCUMENTATION="no" HAS_DOCUMENTATION="no"
fi ])
fi ])
AC_SUBST(DOCUMENTATION_TAG_FILE, $DOCU_TAG_FILE ) AC_SUBST(DOCUMENTATION_TAG_FILE, $DOCU_TAG_FILE )
AC_ARG_ENABLE(documentation, AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--disable-documentation],[don't generate docs, speeds up the build])) AS_HELP_STRING([--disable-documentation],[don\'t generate docs, speeds up the build]))
AM_CONDITIONAL(BUILD_DOCS, test x$HAS_DOCUMENTATION = xyes) AM_CONDITIONAL(BUILD_DOCS, [test "x$HAS_DOCUMENTATION" = "xyes"])
]) ])
AC_DEFUN([DUNE_EXPRTMPL],[ AC_DEFUN([DUNE_EXPRTMPL],[
# enable experimental features # enable experimental features
AC_ARG_ENABLE(expressiontemplates, AC_ARG_ENABLE(expressiontemplates,
AC_HELP_STRING([--enable-expressiontemplates],[enable experimental expressiontemplates in dune])) AS_HELP_STRING([--enable-expressiontemplates],[enable experimental expressiontemplates in dune]))
if test x$enable_expressiontemplates = xyes; then AS_IF([test "x$enable_expressiontemplates" = "xyes"],[
AC_DEFINE([DUNE_EXPRESSIONTEMPLATES], [1], AC_DEFINE([DUNE_EXPRESSIONTEMPLATES], [1],
[Define to 1 if the experimental expression templates should be used]) [Define to 1 if the experimental expression templates should be used])])
fi
AM_CONDITIONAL([EXPRESSIONTEMPLATES], AM_CONDITIONAL([EXPRESSIONTEMPLATES],
[test x$enable_expressiontemplates = xyes]) [test "x$enable_expressiontemplates" = "xyes"])
]) ])
\ No newline at end of file
...@@ -5,58 +5,58 @@ AC_DEFUN([DUNE_GRID_DIMENSION],[ ...@@ -5,58 +5,58 @@ AC_DEFUN([DUNE_GRID_DIMENSION],[
# default is disabled # default is disabled
AC_ARG_WITH(grid_dim, AC_ARG_WITH(grid_dim,
AC_HELP_STRING([--with-grid-dim=1|2|3], AS_HELP_STRING([--with-grid-dim=1|2|3],
[dimension of grid; mainly used to determine grid [dimension of grid; mainly used to determine grid
dimension during compilation (default=disabled)]), dimension during compilation (default=disabled)]),
, with_grid_dim=0) , with_grid_dim=0)
AC_ARG_WITH(world_dim, AC_ARG_WITH(world_dim,
AC_HELP_STRING([-with-world-dim=1|2|3], AS_HELP_STRING([-with-world-dim=1|2|3],
[dimension of world; mainly used to determine grid [dimension of world; mainly used to determine grid
dimension during compilation (default=grid-dim)]), dimension during compilation (default=grid-dim)]),
, with_world_dim=0) , with_world_dim=0)
AC_ARG_WITH(grid_type, AC_ARG_WITH(grid_type,
AC_HELP_STRING([--with-grid-type= ALBERTAGRID | ALUGRID_CUBE | ALUGRID_SIMPLEX | ALUGRID_CONFORM | ONEDGRID | SGRID | UGGRID | YASPGRID], AS_HELP_STRING([--with-grid-type= ALBERTAGRID | ALUGRID_CUBE | ALUGRID_SIMPLEX | ALUGRID_CONFORM | ONEDGRID | SGRID | UGGRID | YASPGRID],
[only enabled if grid-dim is given, sets type of grid (default=YASPGRID)]),, with_grid_type=YASPGRID) [only enabled if grid-dim is given, sets type of grid (default=YASPGRID)]),, with_grid_type=YASPGRID)
if test x$with_grid_dim != x0 ; then AS_IF([test "x$with_grid_dim" != "x0"],[
AC_MSG_CHECKING([grid-dim and grid-type]) AC_MSG_CHECKING([grid-dim and grid-type])
# make sure that given grid dim is valid # make sure that given grid dim is valid
if test x$with_grid_dim != x1 && test x$with_grid_dim != x2 && test x$with_grid_dim != x3 ; then AS_IF([test "x$with_grid_dim" != "x1" -a "x$with_grid_dim" != "x2" -a "x$with_grid_dim" != "x3"],[
AC_MSG_ERROR([Delivered grid-dim = $with_grid_dim is not valid. Valid are only 1, 2, or 3 .]) AC_MSG_ERROR([Delivered grid-dim = $with_grid_dim is not valid. Valid are only 1, 2, or 3 .])
fi ])
# make sure that given grid type is valid # make sure that given grid type is valid
if test $with_grid_type != "ALBERTAGRID" && AS_IF([test "x$with_grid_type" != "xALBERTAGRID" -a
test $with_grid_type != "ALUGRID_CUBE" && "x$with_grid_type" != "xALUGRID_CUBE" -a
test $with_grid_type != "ALUGRID_SIMPLEX" && "x$with_grid_type" != "xALUGRID_SIMPLEX" -a
test $with_grid_type != "ALUGRID_CONFORM" && "x$with_grid_type" != "xALUGRID_CONFORM" -a
test $with_grid_type != "ONEDGRID" && "x$with_grid_type" != "xONEDGRID" -a
test $with_grid_type != "SGRID" && "x$with_grid_type" != "xSGRID" -a
test $with_grid_type != "UGGRID" && "x$with_grid_type" != "xUGGRID" -a
test $with_grid_type != "YASPGRID" ; then "x$with_grid_type" != "xYASPGRID"],[
AC_MSG_ERROR([Delivered grid-type = $with_grid_type is not valid. Run ./configure --help for valid values.]) AC_MSG_ERROR([Delivered grid-type = $with_grid_type is not valid. Run ./configure --help for valid values.])
fi ])
variable_griddim="$``(``GRIDDIM``)``" variable_griddim="$``(``GRIDDIM``)``"
variable_worlddim="$``(``WORLDDIM``)``" variable_worlddim="$``(``WORLDDIM``)``"
griddim_cppflags="-DGRIDDIM=$``(``GRIDDIM``)`` -DWORLDDIM=$``(``WORLDDIM``)`` -D$``(``GRIDTYPE``)``" griddim_cppflags="-DGRIDDIM=$``(``GRIDDIM``)`` -DWORLDDIM=$``(``WORLDDIM``)`` -D$``(``GRIDTYPE``)``"
AC_SUBST(GRIDDIM, $with_grid_dim) AC_SUBST(GRIDDIM, $with_grid_dim)
if test x$with_world_dim = x0 ; then AS_IF([test "x$with_world_dim" = "x0"],[
AC_SUBST(WORLDDIM, $variable_griddim) AC_SUBST(WORLDDIM, $variable_griddim)
else ],[
AC_SUBST(WORLDDIM, $with_world_dim) AC_SUBST(WORLDDIM, $with_world_dim)
fi ])
AC_SUBST(GRIDDIMGRID, $variable_griddim ) AC_SUBST(GRIDDIMGRID, $variable_griddim )
AC_SUBST(GRIDDIMWORLD, $variable_worlddim ) AC_SUBST(GRIDDIMWORLD, $variable_worlddim )
AC_SUBST(GRIDTYPE, $with_grid_type ) AC_SUBST(GRIDTYPE, $with_grid_type )
AC_SUBST(GRIDDIM_CPPFLAGS, $griddim_cppflags) AC_SUBST(GRIDDIM_CPPFLAGS, $griddim_cppflags)
DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $griddim_cppflags" DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $griddim_cppflags"
if test x$with_world_dim = x0 ; then AS_IF([test "x$with_world_dim" = "x0"],[
AC_MSG_RESULT([yes (GRIDDIM=$GRIDDIM, WORLDDIM=GRIDDIM and GRIDTYPE=$GRIDTYPE)]) AC_MSG_RESULT([yes (GRIDDIM=$GRIDDIM, WORLDDIM=GRIDDIM and GRIDTYPE=$GRIDTYPE)])
else ].[
AC_MSG_RESULT([yes (GRIDDIM=$GRIDDIM, WORLDDIM=$WORLDDIM and GRIDTYPE=$GRIDTYPE)]) AC_MSG_RESULT([yes (GRIDDIM=$GRIDDIM, WORLDDIM=$WORLDDIM and GRIDTYPE=$GRIDTYPE)])
fi ])
fi ])
]) ])
...@@ -65,28 +65,21 @@ AC_DEFUN([DUNE_MPI],[ ...@@ -65,28 +65,21 @@ AC_DEFUN([DUNE_MPI],[
# enable/disable parallel features # enable/disable parallel features
AC_ARG_ENABLE(parallel, AC_ARG_ENABLE(parallel,
AC_HELP_STRING([--enable-parallel], AS_HELP_STRING([--enable-parallel],
[Enable the parallel features of Dune. If enabled [Enable the parallel features of Dune. If enabled
configure will try to determine your MPI automatically. You can configure will try to determine your MPI automatically. You can
overwrite this setting by specifying the MPICC variable]), overwrite this setting by specifying the MPICC variable]))
[with_parallel=$enableval], AC_SUBST(ENABLE_PARALLEL, "$enable_parallel")
[with_parallel=no]
)
AC_SUBST(ENABLE_PARALLEL, "$with_parallel")
# disable runtest if we have a queuing system # disable runtest if we have a queuing system
AC_ARG_ENABLE(mpiruntest, AC_ARG_ENABLE(mpiruntest,
AC_HELP_STRING([--disable-mpiruntest], AS_HELP_STRING([--disable-mpiruntest],
[Don't try to run a MPI program during configure. (This is needed if you depend on a queuing system)]), [Don\'t try to run a MPI program during configure. (This is needed if you depend on a queuing system)]))
[mpiruntest=${enableval}],
[mpiruntest=yes]
)
with_mpi="no" with_mpi="no"
## do nothing if --disable-parallel is used ## do nothing if --disable-parallel is used
if test x$with_parallel = xyes ; then AS_IF([test "x$enable_parallel" = "xyes"],[
ACX_MPI([ ACX_MPI([
MPICOMP="$MPICC" MPICOMP="$MPICC"
...@@ -97,11 +90,10 @@ AC_DEFUN([DUNE_MPI],[ ...@@ -97,11 +90,10 @@ AC_DEFUN([DUNE_MPI],[
],[ ],[
# ACX_MPI didn't find anything # ACX_MPI didn't find anything
with_mpi="no" with_mpi="no"
]) ])])
fi # end of MPI identification
# if an MPI implementation was found.. # if an MPI implementation was found..
if test x"$with_mpi" != xno ; then AS_IF([test "x$with_mpi" != "xno"],[
### do a sanity check: can we compile and link a trivial MPI program? ### do a sanity check: can we compile and link a trivial MPI program?
AC_MSG_CHECKING([whether compiling with $dune_MPI_VERSION works]) AC_MSG_CHECKING([whether compiling with $dune_MPI_VERSION works])
...@@ -129,9 +121,9 @@ AC_DEFUN([DUNE_MPI],[ ...@@ -129,9 +121,9 @@ AC_DEFUN([DUNE_MPI],[
with_mpi=no] with_mpi=no]
) )
if test "x$mpiruntest" != "xyes" ; then AS_IF([test "x$mpiruntest" != "xyes"],[
AC_MSG_WARN([Diabled test whether running with $dune_MPI_VERSION works.]) AC_MSG_WARN([Diabled test whether running with $dune_MPI_VERSION works.])
else ],[
AC_MSG_CHECKING([whether running with $dune_MPI_VERSION works]) AC_MSG_CHECKING([whether running with $dune_MPI_VERSION works])
AC_RUN_IFELSE( AC_RUN_IFELSE(
AC_LANG_SOURCE( AC_LANG_SOURCE(
...@@ -152,7 +144,7 @@ AC_DEFUN([DUNE_MPI],[ ...@@ -152,7 +144,7 @@ AC_DEFUN([DUNE_MPI],[
See config.log for details]) See config.log for details])
with_mpi=no] with_mpi=no]
) )
fi ])
AC_LANG_POP AC_LANG_POP
# Check for MPI-2 Standard # Check for MPI-2 Standard
...@@ -163,22 +155,22 @@ AC_DEFUN([DUNE_MPI],[ ...@@ -163,22 +155,22 @@ AC_DEFUN([DUNE_MPI],[
# restore variables # restore variables
LIBS="$ac_save_LIBS" LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS" CPPFLAGS="$ac_save_CPPFLAGS"
fi ])
# set flags # set flags
if test x"$with_mpi" != xno ; then AS_IF([test "x$with_mpi" != "xno"],[
AC_SUBST(MPI_CPPFLAGS, $MPI_CPPFLAGS) AC_SUBST(MPI_CPPFLAGS, $MPI_CPPFLAGS)
AC_SUBST(MPI_LDFLAGS, $MPI_LDFLAGS) AC_SUBST(MPI_LDFLAGS, $MPI_LDFLAGS)
AC_SUBST(MPI_VERSION, $dune_MPI_VERSION) AC_SUBST(MPI_VERSION, $dune_MPI_VERSION)
AC_DEFINE(HAVE_MPI,ENABLE_MPI,[Define if you have the MPI library. AC_DEFINE(HAVE_MPI,ENABLE_MPI,[Define if you have the MPI library.
This is only true if MPI was found by configure This is only true if MPI was found by configure
_and_ if the application uses the MPI_CPPFLAGS]) _and_ if the application uses the MPI_CPPFLAGS])
else ],[
AC_SUBST(MPI_CPPFLAGS, "") AC_SUBST(MPI_CPPFLAGS, "")
AC_SUBST(MPI_LDFLAGS, "") AC_SUBST(MPI_LDFLAGS, "")
fi ])
AM_CONDITIONAL(MPI, test x"$with_mpi" != xno) AM_CONDITIONAL(MPI, [test "x$with_mpi" != "xno"])
DUNE_ADD_SUMMARY_ENTRY([MPI],[$with_mpi]) DUNE_ADD_SUMMARY_ENTRY([MPI],[$with_mpi])
......
...@@ -12,7 +12,7 @@ AC_DEFUN([DUNE_SET_MINIMAL_DEBUG_LEVEL],[ ...@@ -12,7 +12,7 @@ AC_DEFUN([DUNE_SET_MINIMAL_DEBUG_LEVEL],[
# GRAVE_DEBUG_LEVEL = 5; # GRAVE_DEBUG_LEVEL = 5;
AC_ARG_WITH(minimal_debug_level, AC_ARG_WITH(minimal_debug_level,
AC_HELP_STRING([--with-minimal-debug-level=[grave|warn|info|verb|vverb]], AS_HELP_STRING([--with-minimal-debug-level=[grave|warn|info|verb|vverb]],
[set the MINIMAL_DEBUG_LEVEL. Standard debug streams with level below [set the MINIMAL_DEBUG_LEVEL. Standard debug streams with level below
MINIMAL_DEBUG_LEVEL will collapse to doing nothing if output is MINIMAL_DEBUG_LEVEL will collapse to doing nothing if output is
requested. (default=warn)] requested. (default=warn)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment