Skip to content

Commit 67e6753

Browse files
committed
this should work
1 parent 9688f31 commit 67e6753

File tree

3 files changed

+38
-49
lines changed

3 files changed

+38
-49
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_UUID_GENERATE_TIME_SAFE
10+
#if defined(HAVE_UUID_GENERATE_TIME_SAFE) && 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_UUID_GENERATE_TIME_SAFE
41+
#if defined(HAVE_UUID_GENERATE_TIME_SAFE) && 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: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9512,70 +9512,51 @@ _ACEOF
95129512
fi
95139513
# Dynamic linking for HP-UX
95149514

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 :
9515+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if uuid_generate_time_safe() available" >&5
9516+
$as_echo_n "checking if uuid_generate_time_safe() available... " >&6; }
9517+
if ${ax_cv_uuid_generate_time_safe+:} false; then :
95189518
$as_echo_n "(cached) " >&6
95199519
else
9520-
ac_func_search_save_LIBS=$LIBS
9521-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9520+
if test "$cross_compiling" = yes; then :
9521+
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test program execution failed" >&5
9522+
$as_echo "$as_me: WARNING: test program execution failed" >&2;}
9523+
else
9524+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
95229525
/* end confdefs.h. */
95239526
9524-
/* Override any GCC internal prototype to avoid an error.
9525-
Use char because int might match the return type of a GCC
9526-
builtin and then its argument prototype would still apply. */
9527-
#ifdef __cplusplus
9528-
extern "C"
9529-
#endif
9530-
char uuid_generate_time_safe ();
9527+
#include <uuid/uuih.h>
95319528
int
95329529
main ()
95339530
{
9534-
return uuid_generate_time_safe ();
9531+
9532+
uuid_t out;
9533+
uuid_generate_time_safe(out);
9534+
95359535
;
95369536
return 0;
95379537
}
95389538
_ACEOF
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
9539+
if ac_fn_c_try_run "$LINENO"; then :
9540+
ax_cv_uuid_generate_time_safe=yes
9541+
else
9542+
ax_cv_uuid_generate_time_safe=no
95489543
fi
9549-
rm -f core conftest.err conftest.$ac_objext \
9550-
conftest$ac_exeext
9551-
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
9552-
break
9544+
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9545+
conftest.$ac_objext conftest.beam conftest.$ac_ext
95539546
fi
9554-
done
9555-
if ${ac_cv_search_uuid_generate_time_safe+:} false; then :
95569547

9557-
else
9558-
ac_cv_search_uuid_generate_time_safe=no
95599548
fi
9560-
rm conftest.$ac_ext
9561-
LIBS=$ac_func_search_save_LIBS
9562-
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"
9549+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_uuid_generate_time_safe" >&5
9550+
$as_echo "$ax_cv_uuid_generate_time_safe" >&6; }
9551+
if test "$ax_cv_uuid_generate_time_safe" = yes; then :
95689552

9569-
>...
95709553
$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h
95719554

9572-
95739555
else
95749556

9575-
>...
95769557
$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 0" >>confdefs.h
95779558

9578-
9559+
fi
95799560

95809561
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5
95819562
$as_echo_n "checking for library containing sem_init... " >&6; }

configure.ac

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,11 +2677,19 @@ 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
26792679

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-
]
2680+
AC_CACHE_CHECK([if uuid_generate_time_safe() available],
2681+
[ax_cv_uuid_generate_time_safe],
2682+
[AC_RUN_IFELSE([
2683+
AC_LANG_PROGRAM([#include <uuid/uuih.h>], [
2684+
uuid_t out;
2685+
uuid_generate_time_safe(out);
2686+
])],
2687+
[ax_cv_uuid_generate_time_safe=yes],
2688+
[ax_cv_uuid_generate_time_safe=no],
2689+
[AC_MSG_WARN([test program execution failed])])])
2690+
AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes],
2691+
[AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.])],
2692+
[AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [0], [Define if uuid_generate_time_safe() exists.])])
26852693

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

0 commit comments

Comments
 (0)