dnl BOOST uses long long, so don't warn about this
CXXFLAGSG="$CXXFLAGSG -Wno-long-long"
- dnl See whether the gcc we use already supports C++0x features.
- dnl
+ dnl See whether the gcc we use already has a flag for C++0x features.
OLD_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-std=c++0x
- AC_MSG_CHECKING(whether compiler supports C++0x)
+ AC_MSG_CHECKING(whether compiler has a flag to support C++0x)
AC_TRY_COMPILE([], [;],
[
AC_MSG_RESULT(yes)
- CXXFLAGSG="$CXXFLAGSG -std=c++0x"
- CXXFLAGSO="$CXXFLAGSO -std=c++0x"
- AC_DEFINE(DEAL_II_CAN_USE_CXX0X, 1,
- [Defined if the compiler we use supports the upcoming C++0x standard.])
+ test_cxx0x=yes
],
[
AC_MSG_RESULT(no)
+ test_cxx0x=no
])
CXXFLAGS="${OLD_CXXFLAGS}"
+ if test "x$test_cxx0x" = "xyes" ; then
+ DEAL_II_CHECK_CXX0X_COMPONENTS("-std=c++0x")
+ fi
dnl On some gcc 4.3 snapshots, a 'const' qualifier on a return type triggers a
dnl warning. This is unfortunate, since we happen to stumble on this
+dnl -------------------------------------------------------------
+dnl Given the command line flag specified as argument to this macro,
+dnl test whether all components that we need from the C++0X
+dnl standard are actually available. If so, add the flag to
+dnl CXXFLAGS.g and CXXFLAGS.o, and set a flag in config.h
+dnl
+dnl Usage: DEAL_II_CHECK_CXX0X_COMPONENTS(cxxflag)
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_CXX0X_COMPONENTS, dnl
+[
+ OLD_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$1"
+
+ all_cxx0x_available=yes
+
+ AC_MSG_CHECKING(for std::array)
+ AC_TRY_COMPILE(
+ [#include <array>],
+ [ std::array<int,3> p; p[0];],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no); all_cxx0x_available=no ]
+ )
+
+ AC_MSG_CHECKING(for std::condition_variable)
+ AC_TRY_COMPILE(
+ [#include <condition_variable> ],
+ [ std::condition_variable c; c.notify_all()],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no); all_cxx0x_available=no ]
+ )
+
+ AC_MSG_CHECKING(for std::function and std::bind)
+ AC_TRY_COMPILE(
+ [#include <functional>
+ void f(int, double); ],
+ [ std::function<void (int)>
+ g = std::bind (f, std::placeholders::_1, 1.1) ;],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no); all_cxx0x_available=no ]
+ )
+
+ AC_MSG_CHECKING(for std::shared_ptr)
+ AC_TRY_COMPILE(
+ [#include <memory>],
+ [ std::shared_ptr<int> p(new int(3))],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no); all_cxx0x_available=no ]
+ )
+
+ AC_MSG_CHECKING(for std::thread)
+ AC_TRY_COMPILE(
+ [#include <thread>
+ void f(int); ],
+ [ std::thread t(f,1); t.join();],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no); all_cxx0x_available=no ]
+ )
+
+ AC_MSG_CHECKING(for std::mutex)
+ AC_TRY_COMPILE(
+ [#include <mutex> ],
+ [ std::mutex m; m.lock();],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no); all_cxx0x_available=no ]
+ )
+
+ AC_MSG_CHECKING(for std::tuple)
+ AC_TRY_COMPILE(
+ [#include <tuple>],
+ [ std::tuple<int,double,char> p(1,1.1,'a')],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no); all_cxx0x_available=no ]
+ )
+
+ CXXFLAGS="${OLD_CXXFLAGS}"
+
+ AC_MSG_CHECKING(whether C++0x support is complete enough)
+ if test "x$all_cxx0x_available" = "xyes" ; then
+ AC_MSG_RESULT(yes)
+
+ CXXFLAGSG="$CXXFLAGSG $1"
+ CXXFLAGSO="$CXXFLAGSO $1"
+
+ AC_DEFINE(DEAL_II_CAN_USE_CXX0X, 1,
+ [Defined if the compiler we use supports the upcoming C++0x standard.])
+ else
+ AC_MSG_RESULT(no)
+ fi
+])
+
+
dnl -------------------------------------------------------------
dnl Determine the C compiler in use. Return the name and possibly
dnl version of this compiler in CC_VERSION. This function is almost
#! /bin/sh
-# From configure.in Revision: 18101 .
+# From configure.in Revision: 18210 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for deal.II 6.2.pre.
#
CXXFLAGSG="$CXXFLAGSG -Wno-long-long"
- OLD_CXXFLAGS="$CXXFLAGS"
+ OLD_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-std=c++0x
- { echo "$as_me:$LINENO: checking whether compiler supports C++0x" >&5
-echo $ECHO_N "checking whether compiler supports C++0x... $ECHO_C" >&6; }
+ { echo "$as_me:$LINENO: checking whether compiler has a flag to support C++0x" >&5
+echo $ECHO_N "checking whether compiler has a flag to support C++0x... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
- CXXFLAGSG="$CXXFLAGSG -std=c++0x"
- CXXFLAGSO="$CXXFLAGSO -std=c++0x"
-
-cat >>confdefs.h <<\_ACEOF
-#define DEAL_II_CAN_USE_CXX0X 1
-_ACEOF
-
+ test_cxx0x=yes
else
echo "$as_me: failed program was:" >&5
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
+ test_cxx0x=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXXFLAGS="${OLD_CXXFLAGS}"
+ if test "x$test_cxx0x" = "xyes" ; then
+
+ OLD_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=""-std=c++0x""
+
+ all_cxx0x_available=yes
+
+ { echo "$as_me:$LINENO: checking for std::array" >&5
+echo $ECHO_N "checking for std::array... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <array>
+int
+main ()
+{
+ std::array<int,3> p; p[0];
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { echo "$as_me:$LINENO: checking for std::condition_variable" >&5
+echo $ECHO_N "checking for std::condition_variable... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <condition_variable>
+int
+main ()
+{
+ std::condition_variable c; c.notify_all()
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { echo "$as_me:$LINENO: checking for std::function and std::bind" >&5
+echo $ECHO_N "checking for std::function and std::bind... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <functional>
+ void f(int, double);
+int
+main ()
+{
+ std::function<void (int)>
+ g = std::bind (f, std::placeholders::_1, 1.1) ;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { echo "$as_me:$LINENO: checking for std::shared_ptr" >&5
+echo $ECHO_N "checking for std::shared_ptr... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <memory>
+int
+main ()
+{
+ std::shared_ptr<int> p(new int(3))
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { echo "$as_me:$LINENO: checking for std::thread" >&5
+echo $ECHO_N "checking for std::thread... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <thread>
+ void f(int);
+int
+main ()
+{
+ std::thread t(f,1); t.join();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { echo "$as_me:$LINENO: checking for std::mutex" >&5
+echo $ECHO_N "checking for std::mutex... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <mutex>
+int
+main ()
+{
+ std::mutex m; m.lock();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { echo "$as_me:$LINENO: checking for std::tuple" >&5
+echo $ECHO_N "checking for std::tuple... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <tuple>
+int
+main ()
+{
+ std::tuple<int,double,char> p(1,1.1,'a')
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }; all_cxx0x_available=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ CXXFLAGS="${OLD_CXXFLAGS}"
+
+ { echo "$as_me:$LINENO: checking whether C++0x support is complete enough" >&5
+echo $ECHO_N "checking whether C++0x support is complete enough... $ECHO_C" >&6; }
+ if test "x$all_cxx0x_available" = "xyes" ; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+ CXXFLAGSG="$CXXFLAGSG "-std=c++0x""
+ CXXFLAGSO="$CXXFLAGSO "-std=c++0x""
+
+
+cat >>confdefs.h <<\_ACEOF
+#define DEAL_II_CAN_USE_CXX0X 1
+_ACEOF
+
+ else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ fi
+
+ fi
CXXFLAGS="-Wreturn-type -Werror"
{ echo "$as_me:$LINENO: checking whether qualifiers in return types lead to a warning" >&5