1dnl -------------------------------------------------------------
2dnl AC_CXX_HAVE_NAMESPACES
3dnl -------------------------------------------------------------
4AC_DEFUN([AC_CXX_NAMESPACES],
5[AC_CACHE_CHECK(whether the compiler implements namespaces,
6ac_cv_cxx_namespaces,
7[AC_LANG_SAVE
8 AC_LANG_CPLUSPLUS
9 AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
10                [using namespace Outer::Inner; return i;],
11 ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
12 AC_LANG_RESTORE
13])
14AS_IF([test "x$ac_cv_cxx_namespaces" = "xyes"],
15      [AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])])
16])
17