summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Carlier <dcarlier@afilias.info>2018-01-09 19:38:07 (GMT)
committerAntoine Pitrou <pitrou@free.fr>2018-01-09 19:38:07 (GMT)
commitb4ebaa7099c3413b42a97777581c4ca560fe7540 (patch)
treebbcd366879bb2595307e5a1305de5e2fd954bf5f
parent2ab3a8fd264f24baf321b861a997bf8848f232d5 (diff)
downloadcpython-b4ebaa7099c3413b42a97777581c4ca560fe7540.zip
cpython-b4ebaa7099c3413b42a97777581c4ca560fe7540.tar.gz
cpython-b4ebaa7099c3413b42a97777581c4ca560fe7540.tar.bz2
bpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)
Allow building the _uuid extension module on FreeBSD and OpenBSD.
-rw-r--r--Misc/NEWS.d/next/Library/2018-01-08-15-53-37.bpo-32493.vTXxGN.rst1
-rw-r--r--Modules/_uuidmodule.c5
-rwxr-xr-xconfigure5
-rw-r--r--configure.ac5
-rw-r--r--pyconfig.h.in2
5 files changed, 9 insertions, 9 deletions
diff --git a/Misc/NEWS.d/next/Library/2018-01-08-15-53-37.bpo-32493.vTXxGN.rst b/Misc/NEWS.d/next/Library/2018-01-08-15-53-37.bpo-32493.vTXxGN.rst
new file mode 100644
index 0000000..82d33aa
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-01-08-15-53-37.bpo-32493.vTXxGN.rst
@@ -0,0 +1 @@
+UUID module fixes build for FreeBSD/OpenBSD
diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c
index 1b37511..16aa09b 100644
--- a/Modules/_uuidmodule.c
+++ b/Modules/_uuidmodule.c
@@ -19,10 +19,7 @@ py_uuid_generate_time_safe(void)
res = uuid_generate_time_safe(uuid);
return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
#elif HAVE_UUID_CREATE
-/*
- * AIX support for uuid - RFC4122
- */
- unsigned32 status;
+ uint32_t status;
uuid_create(&uuid, &status);
return Py_BuildValue("y#i", (const char *) &uuid, sizeof(uuid), (int) status);
#else
diff --git a/configure b/configure
index afffc19..9286443 100755
--- a/configure
+++ b/configure
@@ -9560,8 +9560,9 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RFC4122 - uuid support on AIX" >&5
-$as_echo_n "checking for RFC4122 - uuid support on AIX... " >&6; }
+# FreeBSD and OpenBSD provides support as well
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5
+$as_echo_n "checking for uuid_create... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <uuid.h>
diff --git a/configure.ac b/configure.ac
index 0a48e41..1894e21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2696,13 +2696,14 @@ void *x = uuid_generate_time_safe
)
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
-AC_MSG_CHECKING(for RFC4122 - uuid support on AIX)
+# FreeBSD and OpenBSD provides support as well
+AC_MSG_CHECKING(for uuid_create)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
#ifndef uuid_create
void *x = uuid_create
#endif
]])],
- [AC_DEFINE(HAVE_UUID_CREATE, 1, Define if uuid_create() exists. AIX support for uuid:RFC4122)
+ [AC_DEFINE(HAVE_UUID_CREATE, 1, Define if uuid_create() exists.)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 7d36656..ff1083a 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -1191,7 +1191,7 @@
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
-/* Define if uuid_create() exists. AIX support for uuid:RFC4122 */
+/* Define if uuid_create() exists. */
#undef HAVE_UUID_CREATE
/* Define if uuid_generate_time_safe() exists. */