From 0f36c1d11dd0b20bdb2c466a7f599de779d04140 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sun, 5 Nov 2017 11:03:29 +0300 Subject: [PATCH 1/5] bpo-11063: Add a configure check for uuid_generate_time_safe --- Modules/_uuidmodule.c | 11 ++--------- configure | 45 +++++++++++++++++++++++++++++++++++++++++++ configure.ac | 1 + pyconfig.h.in | 3 +++ 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c index 88c40ce353786e..39ed95ab6debea 100644 --- a/Modules/_uuidmodule.c +++ b/Modules/_uuidmodule.c @@ -4,17 +4,10 @@ #include -/* bpo-11063: libuuid on macOS doesn't provide uuid_generate_time_safe(), - only uuid_generate_time(). */ -#ifndef __APPLE__ -# define HAVE_TIME_SAFE -#endif - - static PyObject * py_uuid_generate_time_safe(void) { -#ifdef HAVE_TIME_SAFE +#ifdef HAVE_LIBUUID uuid_t out; int res; @@ -45,7 +38,7 @@ PyInit__uuid(void) { PyObject *mod; assert(sizeof(uuid_t) == 16); -#ifdef HAVE_TIME_SAFE +#ifdef HAVE_LIBUUID int has_uuid_generate_time_safe = 1; #else int has_uuid_generate_time_safe = 0; diff --git a/configure b/configure index 0edbb3e8623a83..bd175e06998b74 100755 --- a/configure +++ b/configure @@ -9511,6 +9511,51 @@ _ACEOF fi # Dynamic linking for HP-UX +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe in -luuid" >&5 +$as_echo_n "checking for uuid_generate_time_safe in -luuid... " >&6; } +if ${ac_cv_lib_uuid_uuid_generate_time_safe+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luuid $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_generate_time_safe (); +int +main () +{ +return uuid_generate_time_safe (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_uuid_uuid_generate_time_safe=yes +else + ac_cv_lib_uuid_uuid_generate_time_safe=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_time_safe" >&5 +$as_echo "$ac_cv_lib_uuid_uuid_generate_time_safe" >&6; } +if test "x$ac_cv_lib_uuid_uuid_generate_time_safe" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUUID 1 +_ACEOF + + LIBS="-luuid $LIBS" + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 $as_echo_n "checking for library containing sem_init... " >&6; } diff --git a/configure.ac b/configure.ac index c7738064582e08..eeff702e7ff11b 100644 --- a/configure.ac +++ b/configure.ac @@ -2676,6 +2676,7 @@ AC_MSG_RESULT($SHLIBS) AC_CHECK_LIB(sendfile, sendfile) AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX +AC_CHECK_LIB(uuid, uuid_generate_time_safe) AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 diff --git a/pyconfig.h.in b/pyconfig.h.in index 5f8b09a6189453..b6400d54e7cced 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -571,6 +571,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBUTIL_H +/* Define to 1 if you have the `uuid' library (-luuid). */ +#undef HAVE_LIBUUID + /* Define if you have the 'link' function. */ #undef HAVE_LINK From 9688f318755507fef58dec59bad9dd681f03a4fa Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Mon, 6 Nov 2017 11:27:59 +0300 Subject: [PATCH 2/5] another attempt --- Modules/_uuidmodule.c | 4 +-- configure | 58 +++++++++++++++++++++++++++++-------------- configure.ac | 7 +++++- pyconfig.h.in | 6 ++--- 4 files changed, 50 insertions(+), 25 deletions(-) diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c index 39ed95ab6debea..d4bc3c7b0d4be8 100644 --- a/Modules/_uuidmodule.c +++ b/Modules/_uuidmodule.c @@ -7,7 +7,7 @@ static PyObject * py_uuid_generate_time_safe(void) { -#ifdef HAVE_LIBUUID +#ifdef HAVE_UUID_GENERATE_TIME_SAFE uuid_t out; int res; @@ -38,7 +38,7 @@ PyInit__uuid(void) { PyObject *mod; assert(sizeof(uuid_t) == 16); -#ifdef HAVE_LIBUUID +#ifdef HAVE_UUID_GENERATE_TIME_SAFE int has_uuid_generate_time_safe = 1; #else int has_uuid_generate_time_safe = 0; diff --git a/configure b/configure index bd175e06998b74..1495250455ff89 100755 --- a/configure +++ b/configure @@ -9511,13 +9511,13 @@ _ACEOF fi # Dynamic linking for HP-UX -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe in -luuid" >&5 -$as_echo_n "checking for uuid_generate_time_safe in -luuid... " >&6; } -if ${ac_cv_lib_uuid_uuid_generate_time_safe+:} false; then : + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate_time_safe" >&5 +$as_echo_n "checking for library containing uuid_generate_time_safe... " >&6; } +if ${ac_cv_search_uuid_generate_time_safe+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-luuid $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9536,25 +9536,45 @@ return uuid_generate_time_safe (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_uuid_uuid_generate_time_safe=yes -else - ac_cv_lib_uuid_uuid_generate_time_safe=no +for ac_lib in '' uuid; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_uuid_generate_time_safe=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_uuid_generate_time_safe+:} false; then : + break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_time_safe" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_generate_time_safe" >&6; } -if test "x$ac_cv_lib_uuid_uuid_generate_time_safe" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUUID 1 -_ACEOF - - LIBS="-luuid $LIBS" +done +if ${ac_cv_search_uuid_generate_time_safe+:} false; then : +else + ac_cv_search_uuid_generate_time_safe=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate_time_safe" >&5 +$as_echo "$ac_cv_search_uuid_generate_time_safe" >&6; } +ac_res=$ac_cv_search_uuid_generate_time_safe +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +>... +$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h + + +else + +>... +$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 0" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 diff --git a/configure.ac b/configure.ac index eeff702e7ff11b..58e091b184a98f 100644 --- a/configure.ac +++ b/configure.ac @@ -2676,7 +2676,12 @@ AC_MSG_RESULT($SHLIBS) AC_CHECK_LIB(sendfile, sendfile) AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX -AC_CHECK_LIB(uuid, uuid_generate_time_safe) + +AC_SEARCH_LIBS([uuid_generate_time_safe], [uuid], [ +>...AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.]) +], [ +>...AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [0], [Define if uuid_generate_time_safe() exists.]) +] AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 diff --git a/pyconfig.h.in b/pyconfig.h.in index b6400d54e7cced..6e0f3e8eeb37b5 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -571,9 +571,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBUTIL_H -/* Define to 1 if you have the `uuid' library (-luuid). */ -#undef HAVE_LIBUUID - /* Define if you have the 'link' function. */ #undef HAVE_LINK @@ -1190,6 +1187,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H +/* Define if uuid_generate_time_safe() exists. */ +#undef HAVE_UUID_GENERATE_TIME_SAFE + /* Define to 1 if you have the `wait3' function. */ #undef HAVE_WAIT3 From 67e67538586c3946bbbe2ecbe136ffef2f954a6b Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Mon, 6 Nov 2017 12:26:33 +0300 Subject: [PATCH 3/5] this should work --- Modules/_uuidmodule.c | 4 +-- configure | 65 +++++++++++++++---------------------------- configure.ac | 18 ++++++++---- 3 files changed, 38 insertions(+), 49 deletions(-) diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c index d4bc3c7b0d4be8..ab988c5dcba962 100644 --- a/Modules/_uuidmodule.c +++ b/Modules/_uuidmodule.c @@ -7,7 +7,7 @@ static PyObject * py_uuid_generate_time_safe(void) { -#ifdef HAVE_UUID_GENERATE_TIME_SAFE +#if defined(HAVE_UUID_GENERATE_TIME_SAFE) && HAVE_UUID_GENERATE_TIME_SAFE uuid_t out; int res; @@ -38,7 +38,7 @@ PyInit__uuid(void) { PyObject *mod; assert(sizeof(uuid_t) == 16); -#ifdef HAVE_UUID_GENERATE_TIME_SAFE +#if defined(HAVE_UUID_GENERATE_TIME_SAFE) && HAVE_UUID_GENERATE_TIME_SAFE int has_uuid_generate_time_safe = 1; #else int has_uuid_generate_time_safe = 0; diff --git a/configure b/configure index 1495250455ff89..14c2c200bc3d40 100755 --- a/configure +++ b/configure @@ -9512,70 +9512,51 @@ _ACEOF fi # Dynamic linking for HP-UX -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate_time_safe" >&5 -$as_echo_n "checking for library containing uuid_generate_time_safe... " >&6; } -if ${ac_cv_search_uuid_generate_time_safe+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if uuid_generate_time_safe() available" >&5 +$as_echo_n "checking if uuid_generate_time_safe() available... " >&6; } +if ${ax_cv_uuid_generate_time_safe+:} false; then : $as_echo_n "(cached) " >&6 else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test program execution failed" >&5 +$as_echo "$as_me: WARNING: test program execution failed" >&2;} +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char uuid_generate_time_safe (); + #include int main () { -return uuid_generate_time_safe (); + + uuid_t out; + uuid_generate_time_safe(out); + ; return 0; } _ACEOF -for ac_lib in '' uuid; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_uuid_generate_time_safe=$ac_res +if ac_fn_c_try_run "$LINENO"; then : + ax_cv_uuid_generate_time_safe=yes +else + ax_cv_uuid_generate_time_safe=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_uuid_generate_time_safe+:} false; then : - break +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -done -if ${ac_cv_search_uuid_generate_time_safe+:} false; then : -else - ac_cv_search_uuid_generate_time_safe=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate_time_safe" >&5 -$as_echo "$ac_cv_search_uuid_generate_time_safe" >&6; } -ac_res=$ac_cv_search_uuid_generate_time_safe -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_uuid_generate_time_safe" >&5 +$as_echo "$ax_cv_uuid_generate_time_safe" >&6; } +if test "$ax_cv_uuid_generate_time_safe" = yes; then : ->... $as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h - else ->... $as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 0" >>confdefs.h - +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 $as_echo_n "checking for library containing sem_init... " >&6; } diff --git a/configure.ac b/configure.ac index 58e091b184a98f..caf41994dbe112 100644 --- a/configure.ac +++ b/configure.ac @@ -2677,11 +2677,19 @@ AC_CHECK_LIB(sendfile, sendfile) AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX -AC_SEARCH_LIBS([uuid_generate_time_safe], [uuid], [ ->...AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.]) -], [ ->...AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [0], [Define if uuid_generate_time_safe() exists.]) -] +AC_CACHE_CHECK([if uuid_generate_time_safe() available], +[ax_cv_uuid_generate_time_safe], +[AC_RUN_IFELSE([ + AC_LANG_PROGRAM([#include ], [ + uuid_t out; + uuid_generate_time_safe(out); + ])], + [ax_cv_uuid_generate_time_safe=yes], + [ax_cv_uuid_generate_time_safe=no], + [AC_MSG_WARN([test program execution failed])])]) +AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes], + [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.])], + [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [0], [Define if uuid_generate_time_safe() exists.])]) AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 From 0f5703a2c5130c1abcc6e76555ff9888843c25ca Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Tue, 7 Nov 2017 14:48:56 +0300 Subject: [PATCH 4/5] address review comments --- Modules/_uuidmodule.c | 4 ++-- configure | 4 ---- configure.ac | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c index ab988c5dcba962..d4bc3c7b0d4be8 100644 --- a/Modules/_uuidmodule.c +++ b/Modules/_uuidmodule.c @@ -7,7 +7,7 @@ static PyObject * py_uuid_generate_time_safe(void) { -#if defined(HAVE_UUID_GENERATE_TIME_SAFE) && HAVE_UUID_GENERATE_TIME_SAFE +#ifdef HAVE_UUID_GENERATE_TIME_SAFE uuid_t out; int res; @@ -38,7 +38,7 @@ PyInit__uuid(void) { PyObject *mod; assert(sizeof(uuid_t) == 16); -#if defined(HAVE_UUID_GENERATE_TIME_SAFE) && HAVE_UUID_GENERATE_TIME_SAFE +#ifdef HAVE_UUID_GENERATE_TIME_SAFE int has_uuid_generate_time_safe = 1; #else int has_uuid_generate_time_safe = 0; diff --git a/configure b/configure index 14c2c200bc3d40..b548f7c6adb690 100755 --- a/configure +++ b/configure @@ -9552,10 +9552,6 @@ if test "$ax_cv_uuid_generate_time_safe" = yes; then : $as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h -else - -$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 0" >>confdefs.h - fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 diff --git a/configure.ac b/configure.ac index caf41994dbe112..ed090133b81654 100644 --- a/configure.ac +++ b/configure.ac @@ -2688,8 +2688,7 @@ AC_CACHE_CHECK([if uuid_generate_time_safe() available], [ax_cv_uuid_generate_time_safe=no], [AC_MSG_WARN([test program execution failed])])]) AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes], - [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.])], - [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [0], [Define if uuid_generate_time_safe() exists.])]) + [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.])]) AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 From 8f6a73abe475fbfde77144aa2db32cc730744eba Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Wed, 8 Nov 2017 22:48:57 +0300 Subject: [PATCH 5/5] simplify check a bit --- configure | 43 ++++++++++++++++--------------------------- configure.ac | 23 +++++++++++------------ 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/configure b/configure index b548f7c6adb690..7944f8fe5d48c3 100755 --- a/configure +++ b/configure @@ -9512,47 +9512,36 @@ _ACEOF fi # Dynamic linking for HP-UX -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if uuid_generate_time_safe() available" >&5 -$as_echo_n "checking if uuid_generate_time_safe() available... " >&6; } -if ${ax_cv_uuid_generate_time_safe+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test program execution failed" >&5 -$as_echo "$as_me: WARNING: test program execution failed" >&2;} -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5 +$as_echo_n "checking for uuid_generate_time_safe... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - #include +#include int main () { - uuid_t out; - uuid_generate_time_safe(out); +#ifndef uuid_generate_time_safe +uuid_t out; +uuid_generate_time_safe(out); +#endif ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_uuid_generate_time_safe=yes -else - ax_cv_uuid_generate_time_safe=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_uuid_generate_time_safe" >&5 -$as_echo "$ax_cv_uuid_generate_time_safe" >&6; } -if test "$ax_cv_uuid_generate_time_safe" = yes; then : +if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 $as_echo_n "checking for library containing sem_init... " >&6; } diff --git a/configure.ac b/configure.ac index ed090133b81654..743e0625dc4695 100644 --- a/configure.ac +++ b/configure.ac @@ -2677,18 +2677,17 @@ AC_CHECK_LIB(sendfile, sendfile) AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX -AC_CACHE_CHECK([if uuid_generate_time_safe() available], -[ax_cv_uuid_generate_time_safe], -[AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include ], [ - uuid_t out; - uuid_generate_time_safe(out); - ])], - [ax_cv_uuid_generate_time_safe=yes], - [ax_cv_uuid_generate_time_safe=no], - [AC_MSG_WARN([test program execution failed])])]) -AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes], - [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1], [Define if uuid_generate_time_safe() exists.])]) +AC_MSG_CHECKING(for uuid_generate_time_safe) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ +#ifndef uuid_generate_time_safe +uuid_t out; +uuid_generate_time_safe(out); +#endif +]])], + [AC_DEFINE(HAVE_UUID_GENERATE_TIME_SAFE, 1, Define if uuid_generate_time_safe() exists.) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)] +) AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris # posix4 on Solaris 2.6