summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-05-24 16:22:59 -0700
committerGitHub <noreply@github.com>2018-05-24 16:22:59 -0700
commit5734f41a9b46b4fd65b6ba90240b108f8a0b7c57 (patch)
tree6f3f2aec5631ee53c66d469ac3b3a5ed81c13b45 /configure
parentd9eb22c67c38b45764dd924801c72092770d200f (diff)
downloadcpython-git-5734f41a9b46b4fd65b6ba90240b108f8a0b7c57.tar.gz
bpo-32493: Fix uuid.uuid1() on FreeBSD. (GH-7099)
Use uuid_enc_be() if available to encode UUID to bytes as big endian. (cherry picked from commit 17d8830312d82e7de42ab89739b0771f712645ff) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure34
1 files changed, 34 insertions, 0 deletions
diff --git a/configure b/configure
index f1f01df4a8..b1cd944ac5 100755
--- a/configure
+++ b/configure
@@ -9625,6 +9625,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