summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-05-24 22:45:09 (GMT)
committerVictor Stinner <vstinner@redhat.com>2018-05-24 22:45:09 (GMT)
commit17d8830312d82e7de42ab89739b0771f712645ff (patch)
tree6d87adc3ad89f6e3ac2d5eec511216fafaeab566 /configure.ac
parent483000e164ec68717d335767b223ae31b4b720cf (diff)
downloadcpython-17d8830312d82e7de42ab89739b0771f712645ff.zip
cpython-17d8830312d82e7de42ab89739b0771f712645ff.tar.gz
cpython-17d8830312d82e7de42ab89739b0771f712645ff.tar.bz2
bpo-32493: Fix uuid.uuid1() on FreeBSD. (GH-7099)
Use uuid_enc_be() if available to encode UUID to bytes as big endian.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 679fac3..872a829 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2696,6 +2696,21 @@ void *x = uuid_create
[AC_MSG_RESULT(no)]
)
+# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
+# stream in big-endian byte-order
+AC_MSG_CHECKING(for uuid_enc_be)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
+#ifndef uuid_enc_be
+uuid_t uuid;
+unsigned char buf[sizeof(uuid)];
+uuid_enc_be(buf, &uuid);
+#endif
+]])],
+ [AC_DEFINE(HAVE_UUID_ENC_BE, 1, Define if uuid_enc_be() exists.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
+)
+
# 'Real Time' functions on Solaris
# posix4 on Solaris 2.6
# pthread (first!) on Linux