Blob Blame History Raw
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Mon, 22 Jan 2018 20:10:32 +0000
Subject: [PATCH] 00290: Include crypt.h for declaration of crypt

Not every target system may provide a crypt() function in its stdlibc
and may use an external or replacement library, like libxcrypt, for
providing such functions.
Fixed upstream: https://bugs.python.org/issue32635

Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
---
 Include/Python.h | 3 +++
 configure        | 2 +-
 configure.ac     | 2 +-
 pyconfig.h.in    | 3 +++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Include/Python.h b/Include/Python.h
index 858dbd1a66..2845742203 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -35,6 +35,9 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
 
 /* For size_t? */
 #ifdef HAVE_STDDEF_H
diff --git a/configure b/configure
index 562f20278a..2ad2f59635 100755
--- a/configure
+++ b/configure
@@ -7709,7 +7709,7 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
-for ac_header in asm/types.h conio.h direct.h dlfcn.h errno.h \
+for ac_header in asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
 sched.h shadow.h signal.h stdint.h stropts.h termios.h \
diff --git a/configure.ac b/configure.ac
index 133b43d29f..933488b645 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1949,7 +1949,7 @@ dnl AC_MSG_RESULT($cpp_type)
 
 # checks for header files
 AC_HEADER_STDC
-AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
+AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
 ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
 sched.h shadow.h signal.h stdint.h stropts.h termios.h \
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 9052dbc184..7d1f125600 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -137,6 +137,9 @@
 /* Define to 1 if you have the `copysign' function. */
 #undef HAVE_COPYSIGN
 
+/* Define to 1 if you have the <crypt.h> header file. */
+#undef HAVE_CRYPT_H
+
 /* Define to 1 if you have the `ctermid' function. */
 #undef HAVE_CTERMID