Skip to content

Commit 9688f31

Browse files
committed
another attempt
1 parent 0f36c1d commit 9688f31

File tree

4 files changed

+50
-25
lines changed

4 files changed

+50
-25
lines changed

Modules/_uuidmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
static PyObject *
88
py_uuid_generate_time_safe(void)
99
{
10-
#ifdef HAVE_LIBUUID
10+
#ifdef HAVE_UUID_GENERATE_TIME_SAFE
1111
uuid_t out;
1212
int res;
1313

@@ -38,7 +38,7 @@ PyInit__uuid(void)
3838
{
3939
PyObject *mod;
4040
assert(sizeof(uuid_t) == 16);
41-
#ifdef HAVE_LIBUUID
41+
#ifdef HAVE_UUID_GENERATE_TIME_SAFE
4242
int has_uuid_generate_time_safe = 1;
4343
#else
4444
int has_uuid_generate_time_safe = 0;

configure

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9511,13 +9511,13 @@ _ACEOF
95119511

95129512
fi
95139513
# Dynamic linking for HP-UX
9514-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe in -luuid" >&5
9515-
$as_echo_n "checking for uuid_generate_time_safe in -luuid... " >&6; }
9516-
if ${ac_cv_lib_uuid_uuid_generate_time_safe+:} false; then :
9514+
9515+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate_time_safe" >&5
9516+
$as_echo_n "checking for library containing uuid_generate_time_safe... " >&6; }
9517+
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
95179518
$as_echo_n "(cached) " >&6
95189519
else
9519-
ac_check_lib_save_LIBS=$LIBS
9520-
LIBS="-luuid $LIBS"
9520+
ac_func_search_save_LIBS=$LIBS
95219521
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
95229522
/* end confdefs.h. */
95239523
@@ -9536,25 +9536,45 @@ return uuid_generate_time_safe ();
95369536
return 0;
95379537
}
95389538
_ACEOF
9539-
if ac_fn_c_try_link "$LINENO"; then :
9540-
ac_cv_lib_uuid_uuid_generate_time_safe=yes
9541-
else
9542-
ac_cv_lib_uuid_uuid_generate_time_safe=no
9539+
for ac_lib in '' uuid; do
9540+
if test -z "$ac_lib"; then
9541+
ac_res="none required"
9542+
else
9543+
ac_res=-l$ac_lib
9544+
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
9545+
fi
9546+
if ac_fn_c_try_link "$LINENO"; then :
9547+
ac_cv_search_uuid_generate_time_safe=$ac_res
95439548
fi
95449549
rm -f core conftest.err conftest.$ac_objext \
9545-
conftest$ac_exeext conftest.$ac_ext
9546-
LIBS=$ac_check_lib_save_LIBS
9550+
conftest$ac_exeext
9551+
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
9552+
break
95479553
fi
9548-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_time_safe" >&5
9549-
$as_echo "$ac_cv_lib_uuid_uuid_generate_time_safe" >&6; }
9550-
if test "x$ac_cv_lib_uuid_uuid_generate_time_safe" = xyes; then :
9551-
cat >>confdefs.h <<_ACEOF
9552-
#define HAVE_LIBUUID 1
9553-
_ACEOF
9554-
9555-
LIBS="-luuid $LIBS"
9554+
done
9555+
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
95569556

9557+
else
9558+
ac_cv_search_uuid_generate_time_safe=no
9559+
fi
9560+
rm conftest.$ac_ext
9561+
LIBS=$ac_func_search_save_LIBS
95579562
fi
9563+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate_time_safe" >&5
9564+
$as_echo "$ac_cv_search_uuid_generate_time_safe" >&6; }
9565+
ac_res=$ac_cv_search_uuid_generate_time_safe
9566+
if test "$ac_res" != no; then :
9567+
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
9568+
9569+
>...
9570+
$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h
9571+
9572+
9573+
else
9574+
9575+
>...
9576+
$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 0" >>confdefs.h
9577+
95589578

95599579

95609580
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2676,7 +2676,12 @@ AC_MSG_RESULT($SHLIBS)
26762676
AC_CHECK_LIB(sendfile, sendfile)
26772677
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
26782678
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
2679-
AC_CHECK_LIB(uuid, uuid_generate_time_safe)
2679+
2680+
AC_SEARCH_LIBS([uuid_generate_time_safe], [uuid], [
2681+
>...AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.])
2682+
], [
2683+
>...AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [0], [Define if uuid_generate_time_safe() exists.])
2684+
]
26802685

26812686
AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
26822687
# posix4 on Solaris 2.6

pyconfig.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,6 @@
571571
/* Define to 1 if you have the <libutil.h> header file. */
572572
#undef HAVE_LIBUTIL_H
573573

574-
/* Define to 1 if you have the `uuid' library (-luuid). */
575-
#undef HAVE_LIBUUID
576-
577574
/* Define if you have the 'link' function. */
578575
#undef HAVE_LINK
579576

@@ -1190,6 +1187,9 @@
11901187
/* Define to 1 if you have the <utime.h> header file. */
11911188
#undef HAVE_UTIME_H
11921189

1190+
/* Define if uuid_generate_time_safe() exists. */
1191+
#undef HAVE_UUID_GENERATE_TIME_SAFE
1192+
11931193
/* Define to 1 if you have the `wait3' function. */
11941194
#undef HAVE_WAIT3
11951195

0 commit comments

Comments
 (0)