Skip to content

Commit 4ff23c7

Browse files
committed
bpo-40900: uuid module build fix on FreeBSD proposal.
Adding a new --with-uuid configure directive.
1 parent 47a23fc commit 4ff23c7

File tree

1 file changed

+84
-55
lines changed

1 file changed

+84
-55
lines changed

configure

Lines changed: 84 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ with_openssl
849849
with_ssl_default_suites
850850
with_builtin_hashlib_hashes
851851
with_experimental_isolated_subinterpreters
852+
with_uuid
852853
'
853854
ac_precious_vars='build_alias
854855
host_alias
@@ -1588,6 +1589,7 @@ Optional Packages:
15881589
--with-experimental-isolated-subinterpreters
15891590
better isolate subinterpreters, experimental build
15901591
mode (default is no)
1592+
--with-uuid=DIR override rott of libuuid to DIR
15911593

15921594
Some influential environment variables:
15931595
MACHDEP name for machine-dependent library files
@@ -9819,114 +9821,141 @@ _ACEOF
98199821
fi
98209822
# Dynamic linking for HP-UX
98219823

9824+
uuiddirs="/usr /usr/local /usr/pkg"
9825+
if test "${with_uuid+set}" = set; then :
9826+
withval=$with_uuid;
9827+
case "$withval" in
9828+
"" | y | ye | yes | n | no)
9829+
as_fn_error $? "Invalid --with-uuid value" "$LINENO" 5
9830+
;;
9831+
*) uuiddirs="$withval"
9832+
;;
9833+
esac
9834+
fi
9835+
98229836
# checks for uuid.h location
9823-
for ac_header in uuid/uuid.h uuid.h
9824-
do :
9825-
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
9826-
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
9827-
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
9837+
found=false
9838+
for uuiddir in $uuiddirs; do
9839+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid.h header" >&5
9840+
$as_echo_n "checking for uuid.h header... " >&6; }
9841+
if test -f "$uuiddir/include/uuid.h"; then
98289842
cat >>confdefs.h <<_ACEOF
9829-
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
9843+
#define HAVE_UUID_H 1
98309844
_ACEOF
9831-
9832-
fi
9833-
9834-
done
9835-
9836-
9837-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5
9838-
$as_echo_n "checking for uuid_generate_time_safe... " >&6; }
9845+
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
9846+
# FreeBSD and OpenBSD provides support as well
9847+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5
9848+
$as_echo_n "checking for uuid_create... " >&6; }
98399849
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98409850
/* end confdefs.h. */
9841-
#include <uuid/uuid.h>
9851+
#include <uuid.h>
98429852
int
98439853
main ()
98449854
{
98459855

9846-
#ifndef uuid_generate_time_safe
9847-
void *x = uuid_generate_time_safe
9856+
#ifndef uuid_create
9857+
void *x = uuid_create
98489858
#endif
98499859

98509860
;
98519861
return 0;
98529862
}
98539863
_ACEOF
9854-
if ac_fn_c_try_compile "$LINENO"; then :
9864+
if ac_fn_c_try_compile "$LINENO"; then :
98559865

9856-
$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h
9857-
9858-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9859-
$as_echo "yes" >&6; }
9860-
else
9861-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9862-
$as_echo "no" >&6; }
9866+
$as_echo "#define HAVE_UUID_CREATE 1" >>confdefs.h
98639867

9864-
fi
9865-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9868+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9869+
$as_echo "yes" >&6; }
9870+
found=true
9871+
break
9872+
else
9873+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9874+
$as_echo "no" >&6; }
98669875

9867-
# AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007)
9868-
# FreeBSD and OpenBSD provides support as well
9869-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5
9870-
$as_echo_n "checking for uuid_create... " >&6; }
9876+
fi
9877+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9878+
# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
9879+
# stream in big-endian byte-order
9880+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5
9881+
$as_echo_n "checking for uuid_enc_be... " >&6; }
98719882
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98729883
/* end confdefs.h. */
98739884
#include <uuid.h>
98749885
int
98759886
main ()
98769887
{
98779888

9878-
#ifndef uuid_create
9879-
void *x = uuid_create
9889+
#ifndef uuid_enc_be
9890+
void *x = uuid_enc_be
98809891
#endif
98819892

98829893
;
98839894
return 0;
98849895
}
98859896
_ACEOF
9886-
if ac_fn_c_try_compile "$LINENO"; then :
9897+
if ac_fn_c_try_compile "$LINENO"; then :
98879898

9888-
$as_echo "#define HAVE_UUID_CREATE 1" >>confdefs.h
9899+
$as_echo "#define HAVE_UUID_ENC_BE 1" >>confdefs.h
98899900

9890-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9901+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
98919902
$as_echo "yes" >&6; }
9892-
else
9893-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9903+
found=true
9904+
break
9905+
else
9906+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
98949907
$as_echo "no" >&6; }
98959908

9896-
fi
9897-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9898-
9899-
# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet
9900-
# stream in big-endian byte-order
9901-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5
9902-
$as_echo_n "checking for uuid_enc_be... " >&6; }
9909+
fi
9910+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9911+
fi
9912+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid/uuid.h header" >&5
9913+
$as_echo_n "checking for uuid/uuid.h header... " >&6; }
9914+
if test -f "$uuiddir/include/uuid/uuid.h"; then
9915+
cat >>confdefs.h <<_ACEOF
9916+
#define HAVE_UUID_UUID_H 1
9917+
_ACEOF
9918+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5
9919+
$as_echo_n "checking for uuid_generate_time_safe... " >&6; }
99039920
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
99049921
/* end confdefs.h. */
9905-
#include <uuid.h>
9922+
#include <uuid/uuid.h>
99069923
int
99079924
main ()
99089925
{
99099926

9910-
#ifndef uuid_enc_be
9911-
void *x = uuid_enc_be
9927+
#ifndef uuid_generate_time_safe
9928+
void *x = uuid_generate_time_safe
99129929
#endif
99139930

99149931
;
99159932
return 0;
99169933
}
99179934
_ACEOF
9918-
if ac_fn_c_try_compile "$LINENO"; then :
9935+
if ac_fn_c_try_compile "$LINENO"; then :
99199936

9920-
$as_echo "#define HAVE_UUID_ENC_BE 1" >>confdefs.h
9937+
$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h
99219938

9922-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9939+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
99239940
$as_echo "yes" >&6; }
9924-
else
9925-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9941+
found=true
9942+
break
9943+
else
9944+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
99269945
$as_echo "no" >&6; }
99279946

9928-
fi
9929-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9947+
fi
9948+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9949+
9950+
fi
9951+
if $found; then
9952+
CPPFLAGS="-I$uuiddir/include $CPPFLAGS"
9953+
LDFLAGS="-L$uuidir/lib $LDFLAGS"
9954+
break
9955+
fi
9956+
done
9957+
9958+
99309959

99319960
# 'Real Time' functions on Solaris
99329961
# posix4 on Solaris 2.6

0 commit comments

Comments
 (0)