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

This commit is contained in:
Christian Heimes 2021-12-06 22:43:44 +02:00 committed by GitHub
parent f16f93e527
commit fc012d8012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 3 deletions

33
configure vendored
View File

@ -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

View File

@ -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