summaryrefslogtreecommitdiffstats
path: root/configure
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
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')
-rwxr-xr-xconfigure34
1 files changed, 34 insertions, 0 deletions
diff --git a/configure b/configure
index 6a46502..ea48260 100755
--- a/configure
+++ b/configure
@@ -9584,6 +9584,40 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
+# stream in big-endian byte-order
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5
+$as_echo_n "checking for uuid_enc_be... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <uuid.h>
+int
+main ()
+{
+
+#ifndef uuid_enc_be
+uuid_t uuid;
+unsigned char buf[sizeof(uuid)];
+uuid_enc_be(buf, &uuid);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_UUID_ENC_BE 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
# 'Real Time' functions on Solaris
# posix4 on Solaris 2.6
# pthread (first!) on Linux