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

[m4]

apply the two caching patches proposed by Christoph Grüninger,
at least for me they worked flawless and showed some considerable configure speedup.

[[Imported from SVN: r6539]]
parent 53b2e076
No related branches found
No related tags found
No related merge requests found
AC_DEFUN([NULLPTR_CHECK],[
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether nullptr is supported])
AC_TRY_COMPILE([],[
char* ch = nullptr;
], [
HAVE_NULLPTR=yes
AC_MSG_RESULT(yes)], [
HAVE_NULLPTR=no
AC_MSG_RESULT(no)])
if test "x$HAVE_NULLPTR" = xyes; then
AC_CACHE_CHECK([whether nullptr is supported], dune_cv_nullptr_support, [
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_TRY_COMPILE([],[
char* ch = nullptr;
],
dune_cv_nullptr_support=yes,
dune_cv_nullptr_support=no)
AC_LANG_POP
])
if test "x$dune_cv_nullptr_support" = xyes; then
AC_DEFINE(HAVE_NULLPTR, 1, [Define to 1 if nullptr is supported])
fi
AC_LANG_POP
])
AC_DEFUN([STATIC_ASSERT_CHECK],[
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether static_assert is supported])
AC_TRY_COMPILE([],[static_assert(true,"MSG")], [
HAVE_STATIC_ASSERT=yes
AC_MSG_RESULT(yes)], [
HAVE_STATIC_ASSERT=no
AC_MSG_RESULT(no)])
if test "x$HAVE_STATIC_ASSERT" = xyes; then
AC_CACHE_CHECK([whether static_assert is supported], dune_cv_static_assert_support, [
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_TRY_COMPILE([],[static_assert(true,"MSG")],
dune_cv_static_assert_support=yes,
dune_cv_static_assert_support=no)
AC_LANG_POP
])
if test "x$dune_cv_static_assert_support" = xyes; then
AC_DEFINE(HAVE_STATIC_ASSERT, 1, [Define to 1 if static_assert is supported])
fi
AC_LANG_POP
])
......@@ -393,38 +393,35 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
AC_MSG_WARN([library check for _dune_name is disabled. DANGEROUS!])
],[
AS_IF([test "x$HAVE_[]_DUNE_MODULE" = "x1"],[
# save current LDFLAGS
ac_save_CXX="$CXX"
# Use $CXX $DUNE_LDFLAGS as link command, as the latter might
# contain the -static option to force static linkage
ac_cxx_ld=`echo $ac_save_CXX | sed -e "s@$CXX@$CXX $DUNE_LDFLAGS@"`
HAVE_[]_DUNE_MODULE=0
# define LTCXXLINK like it will be defined in the Makefile
CXX="./libtool --tag=CXX --mode=link $ac_cxx_ld "
# use module LDFLAGS
LDFLAGS="$ac_save_LDFLAGS $DUNE_LDFLAGS $DUNE_PKG_LDFLAGS $_dune_cm_LDFLAGS"
LIBS="$_dune_cm_LIBS $DUNE_LIBS $LIBS"
AC_MSG_CHECKING([for lib[]_dune_lib])
AC_TRY_LINK(dnl
[#]include<dune/[]_dune_header>,
_dune_symbol,
[
AC_MSG_RESULT([yes])
HAVE_[]_DUNE_MODULE=1
ac_save_CXX="$CXX"
AC_CACHE_CHECK([for lib[]_dune_lib], dune_cv_lib[]_dune_lib, [
# Use $CXX $DUNE_LDFLAGS as link command, as the latter might
# contain the -static option to force static linkage
ac_cxx_ld=`echo $ac_save_CXX | sed -e "s@$CXX@$CXX $DUNE_LDFLAGS@"`
# define LTCXXLINK like it will be defined in the Makefile
CXX="./libtool --tag=CXX --mode=link $ac_cxx_ld "
# use module LDFLAGS
LDFLAGS="$ac_save_LDFLAGS $DUNE_LDFLAGS $DUNE_PKG_LDFLAGS $_dune_cm_LDFLAGS"
LIBS="$_dune_cm_LIBS $DUNE_LIBS $LIBS"
AC_TRY_LINK(dnl
[#]include<dune/[]_dune_header>,
_dune_symbol,
dune_cv_lib[]_dune_lib=yes,
dune_cv_lib[]_dune_lib=no)
])
AS_IF([test "x$dune_cv_lib[]_dune_lib" = "xyes"], [
HAVE_[]_DUNE_MODULE=1
],[
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)])
])
]
)
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
......
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