Commit f170136a authored by Eddie Kohler's avatar Eddie Kohler

A momentous commit: Require C++11.

parent 7cb8ca13
......@@ -3227,6 +3227,7 @@ ac_config_files="$ac_config_files share/click/config.mk:config.mk.in share/click
ac_config_files="$ac_config_files doc/Makefile etc/libclick/Makefile tools/Makefile tools/lib/Makefile"
ac_user_cxx=${CXX+y}
CLICK_VERSION=$PACKAGE_VERSION
tabchar=' '
......@@ -5428,6 +5429,57 @@ $as_echo "#define HAVE_NEW_H 1" >>confdefs.h
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler understands 'auto'" >&5
$as_echo_n "checking whether the C++ compiler understands 'auto'... " >&6; }
if ${ac_cv_cxx_auto+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
struct s { int a; }; int f(s x) { auto &y = x; return y.a; }
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_cxx_auto=yes
else
ac_cv_cxx_auto=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_auto" >&5
$as_echo "$ac_cv_cxx_auto" >&6; }
if test "$ac_cv_cxx_auto" != yes -a -z "$ac_user_cxx"; then
CXX="${CXX} -std=gnu++0x"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler with -std=gnu++0x understands 'auto'" >&5
$as_echo_n "checking whether the C++ compiler with -std=gnu++0x understands 'auto'... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
struct s { int a; }; int f(s x) { auto &y = x; return y.a; }
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_cxx_auto=yes
else
ac_cv_cxx_auto=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_auto" >&5
$as_echo "$ac_cv_cxx_auto" >&6; }
fi
save_cxxflags="$CXXFLAGS"
test -n "$ac_cv_c_w_wall" && CXXFLAGS="$CXXFLAGS -W -Wall"
test -n "$ac_cv_c_werror" && CXXFLAGS="$CXXFLAGS -Werror"
......
......@@ -23,6 +23,7 @@ AC_CONFIG_FILES([installch], [chmod +x installch])
AC_CONFIG_FILES([share/click/config.mk:config.mk.in share/click/pkg-config.mk])
AC_CONFIG_FILES([doc/Makefile etc/libclick/Makefile tools/Makefile tools/lib/Makefile])
AC_CONFIG_SRCDIR([click-buildtool.in])
ac_user_cxx=${CXX+y}
CLICK_VERSION=$PACKAGE_VERSION
dnl NB a real tab character!
......
......@@ -128,6 +128,18 @@ and Linux header files are GCC-specific.)
fi
fi
dnl require C++11
AC_CACHE_CHECK([whether the C++ compiler understands 'auto'], [ac_cv_cxx_auto], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct s { int a; }; int f(s x) { auto &y = x; return y.a; }]], [[]])],
[ac_cv_cxx_auto=yes], [ac_cv_cxx_auto=no])])
if test "$ac_cv_cxx_auto" != yes -a -z "$ac_user_cxx"; then
CXX="${CXX} -std=gnu++0x"
AC_MSG_CHECKING([whether the C++ compiler with -std=gnu++0x understands 'auto'])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct s { int a; }; int f(s x) { auto &y = x; return y.a; }]], [[]])],
[ac_cv_cxx_auto=yes], [ac_cv_cxx_auto=no])
AC_MSG_RESULT([$ac_cv_cxx_auto])
fi
dnl check for C++11 features
save_cxxflags="$CXXFLAGS"
test -n "$ac_cv_c_w_wall" && CXXFLAGS="$CXXFLAGS -W -Wall"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment