diff --git a/Makefile.in b/Makefile.in index 7ebc79dd..cb92f876 100644 --- a/Makefile.in +++ b/Makefile.in @@ -93,6 +93,7 @@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \ diff --git a/aclocal.m4 b/aclocal.m4 index 130f0916..8cb6e58c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1210,6 +1210,7 @@ AC_SUBST([am__untar]) m4_include([m4/ax_check_sign.m4]) m4_include([m4/ax_cxx_compile_stdcxx.m4]) +m4_include([m4/ax_cxx_namespace.m4]) m4_include([m4/ax_lib_mysql.m4]) m4_include([m4/ax_numval.m4]) m4_include([m4/ax_pthread.m4]) diff --git a/bin/Makefile.in b/bin/Makefile.in index 610cba34..37fb7b80 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -93,6 +93,7 @@ subdir = bin ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \ diff --git a/configure b/configure index 5da43ba2..fe5f990f 100755 --- a/configure +++ b/configure @@ -6924,9 +6924,48 @@ fi if test "${HAVE_CXX}" = "yes" then - AX_CXX_NAMESPACE_STD - ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler implements namespaces" >&5 +printf %s "checking whether the compiler implements namespaces... " >&6; } +if test ${ax_cv_cxx_namespaces+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +namespace Outer { namespace Inner { int i = 0; }} + using namespace Outer::Inner; int foo(void) { return i;} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_cxx_namespaces=yes +else $as_nop + ax_cv_cxx_namespaces=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_namespaces" >&5 +printf "%s\n" "$ax_cv_cxx_namespaces" >&6; } +if test "$ax_cv_cxx_namespaces" = yes; then + +printf "%s\n" "#define HAVE_NAMESPACES /**/" >>confdefs.h + +fi + + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/configure.ac b/configure.ac index f72224cd..f995a90b 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no) if test "${HAVE_CXX}" = "yes" then dnl check if the C++ compiler supports namespace - AX_CXX_NAMESPACE_STD + AX_CXX_NAMESPACES dnl HAVE_CXX11 AX_CXX_COMPILE_STDCXX(11, , optional) fi diff --git a/lib/Makefile.in b/lib/Makefile.in index a139aa7f..ccdf6ddb 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -120,6 +120,7 @@ subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \ diff --git a/lib/hawk-cfg.h.in b/lib/hawk-cfg.h.in index dfa8ddd8..0f2a9092 100644 --- a/lib/hawk-cfg.h.in +++ b/lib/hawk-cfg.h.in @@ -307,6 +307,9 @@ /* Define to 1 if MySQL libraries are available */ #undef HAVE_MYSQL +/* define if the compiler implements namespaces */ +#undef HAVE_NAMESPACES + /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP diff --git a/mod/Makefile.in b/mod/Makefile.in index 59794d3b..d3b2db3a 100644 --- a/mod/Makefile.in +++ b/mod/Makefile.in @@ -100,6 +100,7 @@ subdir = mod ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \ diff --git a/samples/Makefile.in b/samples/Makefile.in index c2d200ed..ed481e56 100644 --- a/samples/Makefile.in +++ b/samples/Makefile.in @@ -94,6 +94,7 @@ subdir = samples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \ diff --git a/t/Makefile.in b/t/Makefile.in index 7218ce48..667f64ad 100644 --- a/t/Makefile.in +++ b/t/Makefile.in @@ -93,6 +93,7 @@ subdir = t ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \ diff --git a/tools/Makefile.in b/tools/Makefile.in index 21c97112..0935fce7 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -93,6 +93,7 @@ subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \