summaryrefslogtreecommitdiff
path: root/config/cxx.m4
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-06-11 11:40:09 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-06-11 11:40:09 +0000
commit06cd0f1a32b843832298471e92cc1c577f1363a1 (patch)
treef94f7a4ea39288ff268213c93aff15e4d00682c2 /config/cxx.m4
parentb4182b1327415f2ef2cae6e3795d9f04f578df43 (diff)
downloadpostgresql-06cd0f1a32b843832298471e92cc1c577f1363a1.tar.gz
Substituted new configure test for types of accept()
Interfaced a lot of the custom tests to the config.cache, in the process made them separate macros and grouped them out into files. Made naming adjustments. Removed a couple of useless/unused configure tests. Disabled C++ by default. C++ is no more special than Perl, Python, and Tcl. And it breaks equally often. :(
Diffstat (limited to 'config/cxx.m4')
-rw-r--r--config/cxx.m467
1 files changed, 67 insertions, 0 deletions
diff --git a/config/cxx.m4 b/config/cxx.m4
new file mode 100644
index 0000000000..db437ac287
--- /dev/null
+++ b/config/cxx.m4
@@ -0,0 +1,67 @@
+# Macros to detect certain C++ features
+# $Header: /cvsroot/pgsql/config/Attic/cxx.m4,v 1.1 2000/06/11 11:39:46 petere Exp $
+
+
+# PGAC_CLASS_STRING
+# -----------------
+# Look for class `string'. First look for the <string> header. If this
+# is found a <string> header then it's probably safe to assume that
+# class string exists. If not, check to make sure that <string.h>
+# defines class `string'.
+AC_DEFUN([PGAC_CLASS_STRING],
+[AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CHECK_HEADER(string,
+ [AC_DEFINE(HAVE_CXX_STRING_HEADER)])
+
+if test x"$ac_cv_header_string" != xyes ; then
+ AC_CACHE_CHECK([for class string in <string.h>],
+ [pgac_cv_class_string_in_string_h],
+ [AC_TRY_COMPILE([#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+],
+ [string foo = "test"],
+ [pgac_cv_class_string_in_string_h=yes],
+ [pgac_cv_class_string_in_string_h=no])])
+
+ if test x"$pgac_cv_class_string_in_string_h" != xyes ; then
+ AC_MSG_ERROR([neither <string> nor <string.h> seem to define the C++ class \`string\'])
+ fi
+fi
+AC_LANG_RESTORE])# PGAC_CLASS_STRING
+
+
+# PGAC_CXX_NAMESPACE_STD
+# ----------------------
+# Check whether the C++ compiler understands `using namespace std'.
+#
+# Note 1: On at least some compilers, it will not work until you've
+# included a header that mentions namespace std. Thus, include the
+# usual suspects before trying it.
+#
+# Note 2: This test does not actually reveal whether the C++ compiler
+# properly understands namespaces in all generality. (GNU C++ 2.8.1
+# is one that doesn't.) However, we don't care.
+AC_DEFUN([PGAC_CXX_NAMESPACE_STD],
+[AC_REQUIRE([PGAC_CLASS_STRING])
+AC_CACHE_CHECK([for namespace std in C++],
+pgac_cv_cxx_namespace_std,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE(
+[#include <stdio.h>
+#include <stdlib.h>
+#ifdef HAVE_CXX_STRING_HEADER
+#include <string>
+#endif
+using namespace std;
+], [],
+[pgac_cv_cxx_namespace_std=yes],
+[pgac_cv_cxx_namespace_std=no])
+AC_LANG_RESTORE])
+
+if test $pgac_cv_cxx_namespace_std = yes ; then
+ AC_DEFINE(HAVE_NAMESPACE_STD, 1, [Define to 1 if the C++ compiler understands `using namespace std'])
+fi])# PGAC_CXX_NAMESPACE_STD