[Python-checkins] bpo-45847: Fix uuid detection on macOS (GH-29946)

tiran webhook-mailer at python.org
Mon Dec 6 15:43:54 EST 2021


https://github.com/python/cpython/commit/fc012d801202a9ea139df143b934778060d51a60
commit: fc012d801202a9ea139df143b934778060d51a60
branch: main
author: Christian Heimes <christian at python.org>
committer: tiran <christian at python.org>
date: 2021-12-06T21:43:44+01:00
summary:

bpo-45847: Fix uuid detection on macOS (GH-29946)

files:
M configure
M configure.ac

diff --git a/configure b/configure
index fca9567c7102f..2237e6ed8ce2a 100755
--- a/configure
+++ b/configure
@@ -10623,7 +10623,6 @@ fi
 
       LIBUUID_LIBS="-luuid"
       LIBUUID_CFLAGS=
-      have_uuid=no
       for ac_header in uuid/uuid.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
@@ -10754,7 +10753,6 @@ $as_echo "no" >&6; }
 
       LIBUUID_LIBS="-luuid"
       LIBUUID_CFLAGS=
-      have_uuid=no
       for ac_header in uuid/uuid.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
@@ -10895,6 +10893,37 @@ fi
 
 fi
 
+if test "x$have_uuid" = xmissing; then :
+
+  for ac_header in uuid/uuid.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_UUID_UUID_H 1
+_ACEOF
+
+    ac_fn_c_check_func "$LINENO" "uuid_generate_time" "ac_cv_func_uuid_generate_time"
+if test "x$ac_cv_func_uuid_generate_time" = xyes; then :
+
+      have_uuid=yes
+      LIBUUID_CFLAGS=
+      LIBUUID_LIBS=
+
+fi
+
+
+fi
+
+done
+
+
+fi
+
+if test "x$have_uuid" = xmissing; then :
+  have_uuid=no
+fi
+
 # 'Real Time' functions on Solaris
 # posix4 on Solaris 2.6
 # pthread (first!) on Linux
diff --git a/configure.ac b/configure.ac
index c7c71255a3a4c..f1aac2db71f5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2963,7 +2963,6 @@ AS_VAR_IF([have_uuid], [missing], [
     ], [
       LIBUUID_LIBS="-luuid"
       LIBUUID_CFLAGS=
-      have_uuid=no
       AC_CHECK_HEADERS([uuid/uuid.h], [
         WITH_SAVE_ENV(
           [AC_CHECK_LIB([uuid], [uuid_generate_time], [have_uuid=yes])
@@ -2979,6 +2978,19 @@ AS_VAR_IF([have_uuid], [missing], [
   )
 ])
 
+dnl macOS has uuid/uuid.h but uuid_generate_time is in libc
+AS_VAR_IF([have_uuid], [missing], [
+  AC_CHECK_HEADERS([uuid/uuid.h], [
+    AC_CHECK_FUNC([uuid_generate_time], [
+      have_uuid=yes
+      LIBUUID_CFLAGS=
+      LIBUUID_LIBS=
+    ])
+  ])
+])
+
+AS_VAR_IF([have_uuid], [missing], [have_uuid=no])
+
 # 'Real Time' functions on Solaris
 # posix4 on Solaris 2.6
 # pthread (first!) on Linux



More information about the Python-checkins mailing list