1 # Macros to detect certain C++ features
2 # $Header: /cvsroot/pgsql/config/Attic/cxx.m4,v 1.1 2000/06/11 11:39:46 petere Exp $
7 # Look for class `string'. First look for the <string> header. If this
8 # is found a <string> header then it's probably safe to assume that
9 # class string exists. If not, check to make sure that <string.h>
10 # defines class `string'.
11 AC_DEFUN([PGAC_CLASS_STRING],
14 AC_CHECK_HEADER(string,
15 [AC_DEFINE(HAVE_CXX_STRING_HEADER)])
17 if test x"$ac_cv_header_string" != xyes ; then
18 AC_CACHE_CHECK([for class string in <string.h>],
19 [pgac_cv_class_string_in_string_h],
20 [AC_TRY_COMPILE([#include <stdio.h>
24 [string foo = "test"],
25 [pgac_cv_class_string_in_string_h=yes],
26 [pgac_cv_class_string_in_string_h=no])])
28 if test x"$pgac_cv_class_string_in_string_h" != xyes ; then
29 AC_MSG_ERROR([neither <string> nor <string.h> seem to define the C++ class \`string\'])
32 AC_LANG_RESTORE])# PGAC_CLASS_STRING
35 # PGAC_CXX_NAMESPACE_STD
36 # ----------------------
37 # Check whether the C++ compiler understands `using namespace std'.
39 # Note 1: On at least some compilers, it will not work until you've
40 # included a header that mentions namespace std. Thus, include the
41 # usual suspects before trying it.
43 # Note 2: This test does not actually reveal whether the C++ compiler
44 # properly understands namespaces in all generality. (GNU C++ 2.8.1
45 # is one that doesn't.) However, we don't care.
46 AC_DEFUN([PGAC_CXX_NAMESPACE_STD],
47 [AC_REQUIRE([PGAC_CLASS_STRING])
48 AC_CACHE_CHECK([for namespace std in C++],
49 pgac_cv_cxx_namespace_std,
56 #ifdef HAVE_CXX_STRING_HEADER
61 [pgac_cv_cxx_namespace_std=yes],
62 [pgac_cv_cxx_namespace_std=no])
65 if test $pgac_cv_cxx_namespace_std = yes ; then
66 AC_DEFINE(HAVE_NAMESPACE_STD, 1, [Define to 1 if the C++ compiler understands `using namespace std'])
67 fi])# PGAC_CXX_NAMESPACE_STD