Skip to content

bpo-40900: uuid module build fix on FreeBSD proposal. #20693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -9820,23 +9820,15 @@ fi
# Dynamic linking for HP-UX

# checks for uuid.h location
for ac_header in uuid/uuid.h uuid.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi
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 :

done

$as_echo "#define HAVE_UUID_UUID_H 1" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5
{ $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
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <uuid/uuid.h>
int
Expand All @@ -9855,7 +9847,7 @@ 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 "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
Expand All @@ -9864,20 +9856,28 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
# FreeBSD and OpenBSD provides support as well
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5
else

ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
if test "x$ac_cv_header_uuid_h" = xyes; then :


$as_echo "#define HAVE_UUID_H 1" >>confdefs.h

# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
# FreeBSD and OpenBSD provides support as well
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5
$as_echo_n "checking for uuid_create... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <uuid.h>
int
main ()
{

#ifndef uuid_create
void *x = uuid_create
#endif
#ifndef uuid_create
void *x = uuid_create
#endif

;
return 0;
Expand All @@ -9887,7 +9887,7 @@ if ac_fn_c_try_compile "$LINENO"; then :

$as_echo "#define HAVE_UUID_CREATE 1" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
{ $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
Expand All @@ -9896,11 +9896,11 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
# stream in big-endian byte-order
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5
# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
# stream in big-endian byte-order
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5
$as_echo_n "checking for uuid_enc_be... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <uuid.h>
int
Expand All @@ -9919,7 +9919,7 @@ if ac_fn_c_try_compile "$LINENO"; then :

$as_echo "#define HAVE_UUID_ENC_BE 1" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
{ $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
Expand All @@ -9928,6 +9928,14 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

fi



fi



# 'Real Time' functions on Solaris
# posix4 on Solaris 2.6
# pthread (first!) on Linux
Expand Down
69 changes: 38 additions & 31 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2817,44 +2817,51 @@ AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX

# checks for uuid.h location
AC_CHECK_HEADERS([uuid/uuid.h uuid.h])

AC_MSG_CHECKING(for uuid_generate_time_safe)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid/uuid.h>]], [[
AC_CHECK_HEADER(uuid/uuid.h,
[
AC_DEFINE(HAVE_UUID_UUID_H, 1, Define to 1 if you have the <uuid/uuid.h> header file.)
AC_MSG_CHECKING(for uuid_generate_time_safe)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid/uuid.h>]], [[
#ifndef uuid_generate_time_safe
void *x = uuid_generate_time_safe
#endif
]])],
[AC_DEFINE(HAVE_UUID_GENERATE_TIME_SAFE, 1, Define if uuid_generate_time_safe() exists.)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)

# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
# FreeBSD and OpenBSD provides support as well
AC_MSG_CHECKING(for uuid_create)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
#ifndef uuid_create
void *x = uuid_create
#endif
]])],
[AC_DEFINE(HAVE_UUID_CREATE, 1, Define if uuid_create() exists.)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
]])],
[AC_DEFINE(HAVE_UUID_GENERATE_TIME_SAFE, 1, Define if uuid_generate_time_safe() exists.)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
],
[
AC_CHECK_HEADER(uuid.h,
[
AC_DEFINE(HAVE_UUID_H, 1, Define to 1 if you have the <uuid.h> header file.)
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
# FreeBSD and OpenBSD provides support as well
AC_MSG_CHECKING(for uuid_create)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
#ifndef uuid_create
void *x = uuid_create
#endif
]])],
[AC_DEFINE(HAVE_UUID_CREATE, 1, Define if uuid_create() exists.)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)

# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
# stream in big-endian byte-order
AC_MSG_CHECKING(for uuid_enc_be)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
# stream in big-endian byte-order
AC_MSG_CHECKING(for uuid_enc_be)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[
#ifndef uuid_enc_be
void *x = uuid_enc_be
#endif
]])],
[AC_DEFINE(HAVE_UUID_ENC_BE, 1, Define if uuid_enc_be() exists.)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
]])],
[AC_DEFINE(HAVE_UUID_ENC_BE, 1, Define if uuid_enc_be() exists.)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
], [] [])
], [])

# 'Real Time' functions on Solaris
# posix4 on Solaris 2.6
Expand Down