summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-11-11 13:26:51 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-11-11 13:26:51 (GMT)
commite981a4eb3607f8b18acc1c715a6789f7aa7ac07c (patch)
tree741332966e90dab26e904193e239685316dfb661
parent35195ad221d4c0295644b6e5f12ddf1e40b02342 (diff)
downloadcpython-e981a4eb3607f8b18acc1c715a6789f7aa7ac07c.zip
cpython-e981a4eb3607f8b18acc1c715a6789f7aa7ac07c.tar.gz
cpython-e981a4eb3607f8b18acc1c715a6789f7aa7ac07c.tar.bz2
Do not define _XOPEN_SOURCE on OpenBSD 2.x and 3.[012]. Fixes #635034
-rw-r--r--configure.in27
1 files changed, 25 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 4c6738c..79ace17 100644
--- a/configure.in
+++ b/configure.in
@@ -33,9 +33,10 @@ AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
AH_VERBATIM([_XOPEN_SOURCE],
[/* Define on UNIX to activate XPG/5 features. */
#ifndef _XOPEN_SOURCE
-# define _XOPEN_SOURCE 500
+# undef _XOPEN_SOURCE
#endif])
-AC_DEFINE(_XOPEN_SOURCE, 500)
+
+define_xopen_source=yes
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires definition
# of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else several APIs
@@ -113,6 +114,28 @@ then
esac
fi
+# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
+# disable features if it is defined, without any means to access these
+# features as extensions. For these systems, we skip the definition of
+# _XOPEN_SOURCE. Before adding a system to the list to gain access to
+# some feature, make sure there is no alternative way to access this
+# feature. Also, when using wildcards, make sure you have verified the
+# need for not defining _XOPEN_SOURCE on all systems matching the
+# wildcard, and that the wildcard does not include future systems
+# (which may remove their limitations).
+dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
+case $ac_sys_system/$ac_sys_release in
+ # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
+ # even though select is a POSIX function. Reported by J. Ribbens.
+ OpenBSD/2.* | OpenBSD/3.@<:@012@:>@)
+ define_xopen_source=no;;
+esac
+
+if test $define_xopen_source = yes
+then
+ AC_DEFINE(_XOPEN_SOURCE, 500)
+fi
+
#
# SGI compilers allow the specification of the both the ABI and the
# ISA on the command line. Depending on the values of these switches,