summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-02-13 19:27:28 -0800
committerGitHub <noreply@github.com>2020-02-13 19:27:28 -0800
commit28fc1bac0fbe1f4ae2e3dcba1dee38d2c063a539 (patch)
treea37f36445d0c24f9033f4e7827a378e9971ef0f0
parent581b8606ca0609cf36c4eb9a5bb025eb77540e5e (diff)
downloadcpython-git-28fc1bac0fbe1f4ae2e3dcba1dee38d2c063a539.tar.gz
closes bpo-39619 Fix os.chroot on HP-UX 11.31 (GH-18495)
Setting `-D_XOPEN_SOURCE=700` on HP-UX causes system functions such as chroot to be undefined. This change stops `_XOPEN_SOURCE` begin set on HP-UX Co-authored-by: Benjamin Peterson <benjamin@python.org> (cherry picked from commit a9edf44a2de9b23a1690b36cdfeed7b41ab763bd) Co-authored-by: Ian Norton <inorton@gmail.com>
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-02-13-07-35-00.bpo-39619.inb_master_chroot.rst1
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac6
3 files changed, 26 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-02-13-07-35-00.bpo-39619.inb_master_chroot.rst b/Misc/NEWS.d/next/Core and Builtins/2020-02-13-07-35-00.bpo-39619.inb_master_chroot.rst
new file mode 100644
index 0000000000..18f32f7e80
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-02-13-07-35-00.bpo-39619.inb_master_chroot.rst
@@ -0,0 +1 @@
+Enable use of :func:`os.chroot` on HP-UX systems.
diff --git a/configure b/configure
index 0914e24704..a979363acf 100755
--- a/configure
+++ b/configure
@@ -782,6 +782,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -895,6 +896,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1147,6 +1149,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1284,7 +1295,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1437,6 +1448,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -3405,6 +3417,12 @@ $as_echo "#define _BSD_SOURCE 1" >>confdefs.h
define_xopen_source=no
;;
+ # On HP-UX, defining _XOPEN_SOURCE to 600 or greater hides
+ # chroot() and other functions
+ hp*|HP*)
+ define_xopen_source=no
+ ;;
+
esac
if test $define_xopen_source = yes
diff --git a/configure.ac b/configure.ac
index 7051dc109a..e57ef7c38b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -521,6 +521,12 @@ case $ac_sys_system/$ac_sys_release in
define_xopen_source=no
;;
+ # On HP-UX, defining _XOPEN_SOURCE to 600 or greater hides
+ # chroot() and other functions
+ hp*|HP*)
+ define_xopen_source=no
+ ;;
+
esac
if test $define_xopen_source = yes