Skip to content
Closed
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
6 changes: 0 additions & 6 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,7 @@ typedef intptr_t Py_intptr_t;
* sizeof(size_t). C99 doesn't define such a thing directly (size_t is an
* unsigned integral type). See PEP 353 for details.
*/
#ifdef HAVE_SSIZE_T
typedef ssize_t Py_ssize_t;
#elif SIZEOF_VOID_P == SIZEOF_SIZE_T
typedef Py_intptr_t Py_ssize_t;
#else
# error "Python needs a typedef for Py_ssize_t in pyport.h."
#endif

/* Py_hash_t is the same size as a pointer. */
#define SIZEOF_PY_HASH_T SIZEOF_SIZE_T
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python will now build on systems that don't properly define ssize_t or long
double.
124 changes: 49 additions & 75 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -887,7 +886,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1140,15 +1138,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1286,7 +1275,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1439,7 +1428,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -8221,13 +8209,59 @@ $as_echo "#define gid_t int" >>confdefs.h

fi


ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
if test "x$ac_cv_type_ssize_t" = xyes; then :

$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
else

cat >>confdefs.h <<_ACEOF
#define ssize_t int
_ACEOF

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
$as_echo_n "checking for long double... " >&6; }
if ${ac_cv_type_long_double+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$GCC" = yes; then
ac_cv_type_long_double=yes
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* The Stardent Vistra knows sizeof (long double), but does
not support it. */
long double foo = 0.0L;
int
main ()
{
static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
sizeof (double) <= sizeof (long double))];
test_array [0] = 0;
return test_array [0];

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_type_long_double=yes
else
ac_cv_type_long_double=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5
$as_echo "$ac_cv_type_long_double" >&6; }
if test $ac_cv_type_long_double = yes; then

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

fi


ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default"
if test "x$ac_cv_type___uint128_t" = xyes; then :
Expand Down Expand Up @@ -8603,66 +8637,6 @@ _ACEOF



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support" >&5
$as_echo_n "checking for long double support... " >&6; }
have_long_double=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{
long double x; x = (long double)0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :


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

have_long_double=yes

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_long_double" >&5
$as_echo "$have_long_double" >&6; }
if test "$have_long_double" = yes ; then
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
$as_echo_n "checking size of long double... " >&6; }
if ${ac_cv_sizeof_long_double+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :

else
if test "$ac_cv_type_long_double" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (long double)
See \`config.log' for more details" "$LINENO" 5; }
else
ac_cv_sizeof_long_double=0
fi
fi

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
$as_echo "$ac_cv_sizeof_long_double" >&6; }



cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
_ACEOF


fi

# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
Expand Down
14 changes: 2 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2178,9 +2178,9 @@ AC_TYPE_PID_T
AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void])
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_TYPE_SSIZE_T
AC_TYPE_LONG_DOUBLE

AC_CHECK_TYPE(ssize_t,
AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,)
AC_CHECK_TYPE(__uint128_t,
AC_DEFINE(HAVE_GCC_UINT128_T, 1, [Define if your compiler provides __uint128_t]),,)

Expand All @@ -2198,16 +2198,6 @@ AC_CHECK_SIZEOF(size_t, 4)
AC_CHECK_SIZEOF(pid_t, 4)
AC_CHECK_SIZEOF(uintptr_t)

AC_MSG_CHECKING(for long double support)
have_long_double=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]])],[
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
have_long_double=yes
],[])
AC_MSG_RESULT($have_long_double)
if test "$have_long_double" = yes ; then
AC_CHECK_SIZEOF(long double, 16)
fi

AC_CHECK_SIZEOF(_Bool, 1)

Expand Down
11 changes: 4 additions & 7 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
/* Define to 1 if you have the `log2' function. */
#undef HAVE_LOG2

/* Define this if you have the type long double. */
/* Define to 1 if the system has the type `long double'. */
#undef HAVE_LONG_DOUBLE

/* Define to 1 if you have the `lstat' function. */
Expand Down Expand Up @@ -941,9 +941,6 @@
/* Define to 1 if you have the <spawn.h> header file. */
#undef HAVE_SPAWN_H

/* Define if your compiler provides ssize_t */
#undef HAVE_SSIZE_T

/* Define to 1 if you have the `statvfs' function. */
#undef HAVE_STATVFS

Expand Down Expand Up @@ -1361,9 +1358,6 @@
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG

/* The size of `long double', as computed by sizeof. */
#undef SIZEOF_LONG_DOUBLE

/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG

Expand Down Expand Up @@ -1573,6 +1567,9 @@
/* Define to `int' if <sys/socket.h> does not define. */
#undef socklen_t

/* Define to `int' if <sys/types.h> does not define. */
#undef ssize_t

/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t

Expand Down