Skip to content

Commit b3b8cb4

Browse files
authored
run autoconf (GH-9411)
Follow up to 2a9c380 (bpo-34585).
1 parent 9da3961 commit b3b8cb4

File tree

3 files changed

+51
-100
lines changed

3 files changed

+51
-100
lines changed

aclocal.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,5 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
288288
AS_VAR_IF([$1], [""], [$5], [$4])dnl
289289
])dnl PKG_CHECK_VAR
290290

291+
m4_include([m4/ax_c_float_words_bigendian.m4])
291292
m4_include([m4/ax_check_openssl.m4])

configure

Lines changed: 46 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -13853,131 +13853,77 @@ fi
1385313853
# * Check for various properties of floating point *
1385413854
# **************************************************
1385513855

13856-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are little-endian IEEE 754 binary64" >&5
13857-
$as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64... " >&6; }
13858-
if ${ac_cv_little_endian_double+:} false; then :
13856+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether float word ordering is bigendian" >&5
13857+
$as_echo_n "checking whether float word ordering is bigendian... " >&6; }
13858+
if ${ax_cv_c_float_words_bigendian+:} false; then :
1385913859
$as_echo_n "(cached) " >&6
1386013860
else
1386113861

13862-
if test "$cross_compiling" = yes; then :
13863-
ac_cv_little_endian_double=no
13864-
else
13865-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13862+
13863+
ax_cv_c_float_words_bigendian=unknown
13864+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1386613865
/* end confdefs.h. */
1386713866
13868-
#include <string.h>
13869-
int main() {
13870-
double x = 9006104071832581.0;
13871-
if (memcmp(&x, "\x05\x04\x03\x02\x01\xff\x3f\x43", 8) == 0)
13872-
return 0;
13873-
else
13874-
return 1;
13875-
}
1387613867
13877-
_ACEOF
13878-
if ac_fn_c_try_run "$LINENO"; then :
13879-
ac_cv_little_endian_double=yes
13880-
else
13881-
ac_cv_little_endian_double=no
13882-
fi
13883-
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13884-
conftest.$ac_objext conftest.beam conftest.$ac_ext
13885-
fi
13868+
double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
1388613869
13887-
fi
1388813870
13889-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_little_endian_double" >&5
13890-
$as_echo "$ac_cv_little_endian_double" >&6; }
13891-
if test "$ac_cv_little_endian_double" = yes
13892-
then
13871+
_ACEOF
13872+
if ac_fn_c_try_compile "$LINENO"; then :
1389313873

13894-
$as_echo "#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1" >>confdefs.h
1389513874

13875+
if grep noonsees conftest.$ac_objext >/dev/null ; then
13876+
ax_cv_c_float_words_bigendian=yes
13877+
fi
13878+
if grep seesnoon conftest.$ac_objext >/dev/null ; then
13879+
if test "$ax_cv_c_float_words_bigendian" = unknown; then
13880+
ax_cv_c_float_words_bigendian=no
13881+
else
13882+
ax_cv_c_float_words_bigendian=unknown
13883+
fi
1389613884
fi
1389713885

13898-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are big-endian IEEE 754 binary64" >&5
13899-
$as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... " >&6; }
13900-
if ${ac_cv_big_endian_double+:} false; then :
13901-
$as_echo_n "(cached) " >&6
13902-
else
13903-
13904-
if test "$cross_compiling" = yes; then :
13905-
ac_cv_big_endian_double=no
13906-
else
13907-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13908-
/* end confdefs.h. */
13909-
13910-
#include <string.h>
13911-
int main() {
13912-
double x = 9006104071832581.0;
13913-
if (memcmp(&x, "\x43\x3f\xff\x01\x02\x03\x04\x05", 8) == 0)
13914-
return 0;
13915-
else
13916-
return 1;
13917-
}
1391813886

13919-
_ACEOF
13920-
if ac_fn_c_try_run "$LINENO"; then :
13921-
ac_cv_big_endian_double=yes
13922-
else
13923-
ac_cv_big_endian_double=no
1392413887
fi
13925-
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13926-
conftest.$ac_objext conftest.beam conftest.$ac_ext
13888+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1392713889
fi
13890+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_float_words_bigendian" >&5
13891+
$as_echo "$ax_cv_c_float_words_bigendian" >&6; }
1392813892

13929-
fi
13893+
case $ax_cv_c_float_words_bigendian in
13894+
yes)
1393013895

13931-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_big_endian_double" >&5
13932-
$as_echo "$ac_cv_big_endian_double" >&6; }
13933-
if test "$ac_cv_big_endian_double" = yes
13934-
then
13896+
$as_echo "#define FLOAT_WORDS_BIGENDIAN 1" >>confdefs.h
13897+
;;
13898+
no)
13899+
;;
13900+
*)
13901+
as_fn_error $? "
1393513902
13936-
$as_echo "#define DOUBLE_IS_BIG_ENDIAN_IEEE754 1" >>confdefs.h
13903+
Unknown float word ordering. You need to manually preset
13904+
ax_cv_c_float_words_bigendian=no (or yes) according to your system.
1393713905
13938-
fi
13906+
" "$LINENO" 5 ;;
13907+
esac
1393913908

13940-
# Some ARM platforms use a mixed-endian representation for doubles.
13941-
# While Python doesn't currently have full support for these platforms
13942-
# (see e.g., issue 1762561), we can at least make sure that float <-> string
13943-
# conversions work.
13944-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are ARM mixed-endian IEEE 754 binary64" >&5
13945-
$as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64... " >&6; }
13946-
if ${ac_cv_mixed_endian_double+:} false; then :
13947-
$as_echo_n "(cached) " >&6
13948-
else
1394913909

13950-
if test "$cross_compiling" = yes; then :
13951-
ac_cv_mixed_endian_double=no
13952-
else
13953-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13954-
/* end confdefs.h. */
13910+
if test "$ax_cv_c_float_words_bigendian" = "yes"
13911+
then
1395513912

13956-
#include <string.h>
13957-
int main() {
13958-
double x = 9006104071832581.0;
13959-
if (memcmp(&x, "\x01\xff\x3f\x43\x05\x04\x03\x02", 8) == 0)
13960-
return 0;
13961-
else
13962-
return 1;
13963-
}
13913+
$as_echo "#define DOUBLE_IS_BIG_ENDIAN_IEEE754 1" >>confdefs.h
1396413914

13965-
_ACEOF
13966-
if ac_fn_c_try_run "$LINENO"; then :
13967-
ac_cv_mixed_endian_double=yes
13968-
else
13969-
ac_cv_mixed_endian_double=no
13970-
fi
13971-
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13972-
conftest.$ac_objext conftest.beam conftest.$ac_ext
13973-
fi
13915+
elif test "$ax_cv_c_float_words_bigendian" = "no"
13916+
then
1397413917

13975-
fi
13918+
$as_echo "#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1" >>confdefs.h
1397613919

13977-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mixed_endian_double" >&5
13978-
$as_echo "$ac_cv_mixed_endian_double" >&6; }
13979-
if test "$ac_cv_mixed_endian_double" = yes
13980-
then
13920+
else
13921+
# Some ARM platforms use a mixed-endian representation for doubles.
13922+
# While Python doesn't currently have full support for these platforms
13923+
# (see e.g., issue 1762561), we can at least make sure that float <-> string
13924+
# conversions work.
13925+
# FLOAT_WORDS_BIGENDIAN doesnt actually detect this case, but if it's not big
13926+
# or little, then it must be this?
1398113927

1398213928
$as_echo "#define DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 1" >>confdefs.h
1398313929

pyconfig.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
/* Define if --enable-ipv6 is specified */
3131
#undef ENABLE_IPV6
3232

33+
/* Define to 1 if your system stores words within floats with the most
34+
significant word first */
35+
#undef FLOAT_WORDS_BIGENDIAN
36+
3337
/* Define if flock needs to be linked with bsd library. */
3438
#undef FLOCK_NEEDS_LIBBSD
3539

0 commit comments

Comments
 (0)