X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=m4%2Facinclude.m4;fp=m4%2Facinclude.m4;h=79a124be4cd1d6f55db2879845f45ddab758d622;hp=15cc47fe37adfb9ea87e97bb6f28863aeee10725;hb=758ca4437f77768ba4f486ddb944c8b597255ba3;hpb=aad3cc122bf1227d27418b072c9bf91a47152fe6 diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index 15cc47f..79a124b 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -8,12 +8,12 @@ dnl AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], - [using namespace Outer::Inner; return i;], - ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) - AC_LANG_RESTORE +[AC_DIAGNOSE([obsolete],[Instead of using `AC_LANG', `AC_LANG_SAVE', and `AC_LANG_RESTORE', +you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])dnl +AC_LANG_SAVE + AC_LANG([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[namespace Outer { namespace Inner { int i = 0; }}]], [[using namespace Outer::Inner; return i;]])],[ac_cv_cxx_namespaces=yes],[ac_cv_cxx_namespaces=no]) + AC_LANG_POP([]) ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,1,[define if the compiler implements namespaces]) @@ -28,16 +28,17 @@ AC_DEFUN([AC_CXX_REQUIRE_STL], [AC_CACHE_CHECK(whether the compiler supports Standard Template Library, ac_cv_cxx_have_stl, [AC_REQUIRE([AC_CXX_NAMESPACES]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([#include + AC_DIAGNOSE([obsolete],[Instead of using `AC_LANG', `AC_LANG_SAVE', and `AC_LANG_RESTORE', +you should use `AC_LANG_PUSH' and `AC_LANG_POP'.])dnl +AC_LANG_SAVE + AC_LANG([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include #ifdef HAVE_NAMESPACES using namespace std; -#endif],[list x; x.push_back(5); -list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;], - ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no) - AC_LANG_RESTORE +#endif]], [[list x; x.push_back(5); +list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;]])],[ac_cv_cxx_have_stl=yes],[ac_cv_cxx_have_stl=no]) + AC_LANG_POP([]) ]) if test "x_$ac_cv_cxx_have_stl" != x_yes; then AC_MSG_ERROR([C++ Standard Template Libary unsupported])