summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:40 -0800
committerSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:40 -0800
commitb2fa705fd3887c326e811c418469c784353027f4 (patch)
treeb3428f73de91453edbfd4df1a5d4a212d182eb44 /configure.ac
parent134e58fd3aaa2e91390041e143f3f0a21a60142b (diff)
parentb53654b6dbfce8318a7d4d1cdaddca7a7fec194b (diff)
downloadcpython-b2fa705fd3887c326e811c418469c784353027f4.tar.gz
Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac473
1 files changed, 258 insertions, 215 deletions
diff --git a/configure.ac b/configure.ac
index 49d1a37e5a..64f12f2879 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ dnl * Please run autoreconf to test your changes! *
dnl ***********************************************
# Set VERSION so we only need to edit in one place (i.e., here)
-m4_define(PYTHON_VERSION, 3.5)
+m4_define(PYTHON_VERSION, 3.6)
AC_PREREQ(2.65)
@@ -69,7 +69,7 @@ if test "$cross_compiling" = yes; then
if test -z "$PYTHON_FOR_BUILD"; then
for interp in python$PACKAGE_VERSION python3 python; do
which $interp >/dev/null 2>&1 || continue
- if $interp -c 'import sys;sys.exit(not sys.version_info@<:@:2@:>@ >= (3,3))'; then
+ if $interp -c "import sys;sys.exit(not '.'.join(str(n) for n in sys.version_info@<:@:2@:>@) == '$PACKAGE_VERSION')"; then
break
fi
interp=
@@ -78,7 +78,7 @@ if test "$cross_compiling" = yes; then
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
fi
AC_MSG_RESULT($interp)
- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp
fi
# Used to comment out stuff for rebuilding generated files
GENERATED_COMMENT='#'
@@ -379,6 +379,9 @@ then
# a lot of different things including 'define_xopen_source'
# in the case statement below.
case "$host" in
+ *-*-linux-android*)
+ ac_sys_system=Linux-android
+ ;;
*-*-linux*)
ac_sys_system=Linux
;;
@@ -694,6 +697,7 @@ fi
AC_PROG_CC
AC_PROG_CPP
AC_PROG_GREP
+AC_PROG_SED
AC_SUBST(CXX)
AC_SUBST(MAINCC)
@@ -768,7 +772,9 @@ cat >> conftest.c <<EOF
#undef powerpc
#undef sparc
#undef unix
-#if defined(__linux__)
+#if defined(__ANDROID__)
+ # Android is not a multiarch system.
+#elif defined(__linux__)
# if defined(__x86_64__) && defined(__LP64__)
x86_64-linux-gnu
# elif defined(__x86_64__) && defined(__ILP32__)
@@ -882,11 +888,14 @@ if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
fi
+elif test x$PLATFORM_TRIPLET != x && test x$MULTIARCH = x; then
+ MULTIARCH=$PLATFORM_TRIPLET
fi
-PLATDIR=plat-$MACHDEP
-AC_SUBST(PLATDIR)
AC_SUBST(PLATFORM_TRIPLET)
-
+if test x$MULTIARCH != x; then
+ MULTIARCH_CPPFLAGS="-DMULTIARCH=\\\"$MULTIARCH\\\""
+fi
+AC_SUBST(MULTIARCH_CPPFLAGS)
AC_MSG_CHECKING([for -Wl,--no-as-needed])
save_LDFLAGS="$LDFLAGS"
@@ -903,6 +912,34 @@ AC_SUBST(NO_AS_NEEDED)
# checks for UNIX variants that set C preprocessor variables
AC_USE_SYSTEM_EXTENSIONS
+AC_MSG_CHECKING([for the Android API level])
+cat >> conftest.c <<EOF
+#ifdef __ANDROID__
+#include <android/api-level.h>
+android_api = __ANDROID_API__
+arm_arch = __ARM_ARCH
+#else
+#error not Android
+#endif
+EOF
+
+if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
+ ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out`
+ _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out`
+ AC_MSG_RESULT([$ANDROID_API_LEVEL])
+ AC_DEFINE_UNQUOTED(ANDROID_API_LEVEL, $ANDROID_API_LEVEL, [The Android API level.])
+
+ AC_MSG_CHECKING([for the Android arm ABI])
+ AC_MSG_RESULT([$_arm_arch])
+ if test "$_arm_arch" = 7; then
+ BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
+ LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
+ fi
+else
+ AC_MSG_RESULT([not Android])
+fi
+rm -f conftest.c conftest.out
+
# Check for unsupported systems
case $ac_sys_system/$ac_sys_release in
atheos*|Linux*/1*)
@@ -1235,7 +1272,7 @@ AC_SUBST(DEF_MAKE_ALL_RULE)
AC_SUBST(DEF_MAKE_RULE)
Py_OPT='false'
AC_MSG_CHECKING(for --enable-optimizations)
-AC_ARG_ENABLE(optimizations, AS_HELP_STRING([--enable-optimizations], [Enable expensive optimizations (PGO, maybe LTO, etc). Disabled by default.]),
+AC_ARG_ENABLE(optimizations, AS_HELP_STRING([--enable-optimizations], [Enable expensive optimizations (PGO, etc). Disabled by default.]),
[
if test "$withval" != no
then
@@ -1249,7 +1286,7 @@ fi],
if test "$Py_OPT" = 'true' ; then
# Intentionally not forcing Py_LTO='true' here. Too many toolchains do not
# compile working code using it and both test_distutils and test_gdb are
- # broken when you do managed to get a toolchain that works with it. People
+ # broken when you do manage to get a toolchain that works with it. People
# who want LTO need to use --with-lto themselves.
DEF_MAKE_ALL_RULE="profile-opt"
REQUIRE_PGO="yes"
@@ -1277,13 +1314,20 @@ fi],
if test "$Py_LTO" = 'true' ; then
case $CC in
*clang*)
- # Any changes made here should be reflected in the GCC+Darwin case below
- LTOFLAGS="-flto"
+ case $ac_sys_system in
+ Darwin*)
+ # Any changes made here should be reflected in the GCC+Darwin case below
+ LTOFLAGS="-flto -Wl,-export_dynamic"
+ ;;
+ *)
+ LTOFLAGS="-flto"
+ ;;
+ esac
;;
*gcc*)
case $ac_sys_system in
Darwin*)
- LTOFLAGS="-flto"
+ LTOFLAGS="-flto -Wl,-export_dynamic"
;;
*)
LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"
@@ -1461,6 +1505,28 @@ AC_SUBST(UNIVERSAL_ARCH_FLAGS)
# tweak BASECFLAGS based on compiler and platform
case $GCC in
yes)
+ CFLAGS_NODIST="$CFLAGS_NODIST -std=c99"
+
+ AC_MSG_CHECKING(for -Wextra)
+ ac_save_cc="$CC"
+ CC="$CC -Wextra -Werror"
+ AC_CACHE_VAL(ac_cv_extra_warnings,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_extra_warnings=yes
+ ],[
+ ac_cv_extra_warnings=no
+ ]))
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_extra_warnings)
+
+ if test $ac_cv_extra_warnings = yes
+ then
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"
+ fi
+
# Python doesn't violate C99 aliasing rules, but older versions of
# GCC produce warnings for legal Python code. Enable
# -fno-strict-aliasing on versions of GCC that support but produce
@@ -1525,28 +1591,47 @@ yes)
if test $ac_cv_disable_unused_result_warning = yes
then
BASECFLAGS="$BASECFLAGS -Wno-unused-result"
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result"
fi
- AC_MSG_CHECKING(for -Werror=declaration-after-statement)
+ AC_MSG_CHECKING(if we can turn off $CC unused parameter warning)
ac_save_cc="$CC"
- CC="$CC -Werror=declaration-after-statement"
- save_CFLAGS="$CFLAGS"
- AC_CACHE_VAL(ac_cv_declaration_after_statement_warning,
+ CC="$CC -Wunused-parameter -Werror"
+ AC_CACHE_VAL(ac_cv_disable_unused_parameter_warning,
AC_COMPILE_IFELSE(
[
- AC_LANG_PROGRAM([[]], [[]])
- ],[
- ac_cv_declaration_after_statement_warning=yes
- ],[
- ac_cv_declaration_after_statement_warning=no
- ]))
- CFLAGS="$save_CFLAGS"
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_disable_unused_parameter_warning=yes
+ ],[
+ ac_cv_disable_unused_parameter_warning=no
+ ]))
CC="$ac_save_cc"
- AC_MSG_RESULT($ac_cv_declaration_after_statement_warning)
+ AC_MSG_RESULT($ac_cv_disable_unused_parameter_warning)
- if test $ac_cv_declaration_after_statement_warning = yes
+ if test $ac_cv_disable_unused_parameter_warning = yes
then
- CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter"
+ fi
+
+ AC_MSG_CHECKING(if we can turn off $CC missing field initializers warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wmissing-field-initializers -Werror"
+ AC_CACHE_VAL(ac_cv_disable_missing_field_initializers,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_disable_missing_field_initializers=yes
+ ],[
+ ac_cv_disable_missing_field_initializers=no
+ ]))
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_disable_missing_field_initializers)
+
+ if test $ac_cv_disable_missing_field_initializers = yes
+ then
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers"
fi
AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning)
@@ -1941,7 +2026,7 @@ AC_HEADER_STDC
AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
fcntl.h grp.h \
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
-sched.h shadow.h signal.h stdint.h stropts.h termios.h \
+sched.h shadow.h signal.h stropts.h termios.h \
unistd.h utime.h \
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
@@ -1950,11 +2035,18 @@ sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h
sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
-bluetooth/bluetooth.h linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
+linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
sys/endian.h)
AC_HEADER_DIRENT
AC_HEADER_MAJOR
+# bluetooth/bluetooth.h has been known to not compile with -std=c99.
+# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-std=c99 $CFLAGS"
+AC_CHECK_HEADERS(bluetooth/bluetooth.h)
+CFLAGS=$SAVE_CFLAGS
+
# On Darwin (OS X) net/if.h requires sys/socket.h to be imported first.
AC_CHECK_HEADERS([net/if.h], [], [],
[#include <stdio.h>
@@ -2048,6 +2140,11 @@ if test "$sol_lfs_bug" = "yes"; then
use_lfs=no
fi
+# Don't use largefile support for GNU/Hurd
+case $ac_sys_system in GNU*)
+ use_lfs=no
+esac
+
if test "$use_lfs" = "yes"; then
# Two defines needed to enable largefile support on various platforms
# These may affect some typedefs
@@ -2078,29 +2175,6 @@ AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is
AC_TYPE_SIZE_T
AC_TYPE_UID_T
-# There are two separate checks for each of the exact-width integer types we
-# need. First we check whether the type is available using the usual
-# AC_CHECK_TYPE macro with the default includes (which includes <inttypes.h>
-# and <stdint.h> where available). We then also use the special type checks of
-# the form AC_TYPE_UINT32_T, which in the case that uint32_t is not available
-# directly, #define's uint32_t to be a suitable type.
-
-AC_CHECK_TYPE(uint32_t,
- AC_DEFINE(HAVE_UINT32_T, 1, [Define if your compiler provides uint32_t.]),,)
-AC_TYPE_UINT32_T
-
-AC_CHECK_TYPE(uint64_t,
- AC_DEFINE(HAVE_UINT64_T, 1, [Define if your compiler provides uint64_t.]),,)
-AC_TYPE_UINT64_T
-
-AC_CHECK_TYPE(int32_t,
- AC_DEFINE(HAVE_INT32_T, 1, [Define if your compiler provides int32_t.]),,)
-AC_TYPE_INT32_T
-
-AC_CHECK_TYPE(int64_t,
- AC_DEFINE(HAVE_INT64_T, 1, [Define if your compiler provides int64_t.]),,)
-AC_TYPE_INT64_T
-
AC_CHECK_TYPE(ssize_t,
AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,)
AC_CHECK_TYPE(__uint128_t,
@@ -2110,6 +2184,7 @@ AC_CHECK_TYPE(__uint128_t,
# ANSI C requires sizeof(char) == 1, so no need to check it
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
+AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_SIZEOF(void *, 4)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(float, 4)
@@ -2117,17 +2192,7 @@ AC_CHECK_SIZEOF(double, 8)
AC_CHECK_SIZEOF(fpos_t, 4)
AC_CHECK_SIZEOF(size_t, 4)
AC_CHECK_SIZEOF(pid_t, 4)
-
-AC_MSG_CHECKING(for long long support)
-have_long_long=no
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[
- AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
- have_long_long=yes
-],[])
-AC_MSG_RESULT($have_long_long)
-if test "$have_long_long" = yes ; then
-AC_CHECK_SIZEOF(long long, 8)
-fi
+AC_CHECK_SIZEOF(uintptr_t)
AC_MSG_CHECKING(for long double support)
have_long_double=no
@@ -2140,26 +2205,7 @@ if test "$have_long_double" = yes ; then
AC_CHECK_SIZEOF(long double, 16)
fi
-
-AC_MSG_CHECKING(for _Bool support)
-have_c99_bool=no
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[
- AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.])
- have_c99_bool=yes
-],[])
-AC_MSG_RESULT($have_c99_bool)
-if test "$have_c99_bool" = yes ; then
AC_CHECK_SIZEOF(_Bool, 1)
-fi
-
-AC_CHECK_TYPES(uintptr_t,
- [AC_CHECK_SIZEOF(uintptr_t, 4)],
- [], [#ifdef HAVE_STDINT_H
- #include <stdint.h>
- #endif
- #ifdef HAVE_INTTYPES_H
- #include <inttypes.h>
- #endif])
AC_CHECK_SIZEOF(off_t, [], [
#ifdef HAVE_SYS_TYPES_H
@@ -2168,8 +2214,6 @@ AC_CHECK_SIZEOF(off_t, [], [
])
AC_MSG_CHECKING(whether to enable large file support)
-if test "$have_long_long" = yes
-then
if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
@@ -2181,9 +2225,6 @@ if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
else
AC_MSG_RESULT(no)
fi
-else
- AC_MSG_RESULT(no)
-fi
AC_CHECK_SIZEOF(time_t, [], [
#ifdef HAVE_SYS_TYPES_H
@@ -2506,6 +2547,7 @@ then
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
+ Linux-android*) ;;
Linux*|GNU*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
@@ -2537,6 +2579,7 @@ then
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
@@ -2742,9 +2785,25 @@ AC_MSG_RESULT($with_system_expat)
# Check for use of the system libffi library
AC_MSG_CHECKING(for --with-system-ffi)
AC_ARG_WITH(system_ffi,
- AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library]),
- [],
- [with_system_ffi="no"])
+ AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library]),,,)
+
+case "$with_system_ffi" in
+ "")
+ case $ac_sys_system in
+ Darwin)
+ with_system_ffi="no"
+ ;;
+ *)
+ with_system_ffi="yes"
+ ;;
+ esac
+ ;;
+ yes|no)
+ ;;
+ *)
+ AC_MSG_ERROR([--with-system-ffi accepts no arguments])
+ ;;
+esac
if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
@@ -2819,26 +2878,6 @@ else
fi])
AC_MSG_RESULT($with_dbmliborder)
-# Determine if signalmodule should be used.
-AC_SUBST(USE_SIGNAL_MODULE)
-AC_SUBST(SIGNAL_OBJS)
-AC_MSG_CHECKING(for --with-signal-module)
-AC_ARG_WITH(signal-module,
- AS_HELP_STRING([--with-signal-module], [disable/enable signal module]))
-
-if test -z "$with_signal_module"
-then with_signal_module="yes"
-fi
-AC_MSG_RESULT($with_signal_module)
-
-if test "${with_signal_module}" = "yes"; then
- USE_SIGNAL_MODULE=""
- SIGNAL_OBJS=""
-else
- USE_SIGNAL_MODULE="#"
- SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
-fi
-
# This is used to generate Setup.config
AC_SUBST(USE_THREAD_MODULE)
USE_THREAD_MODULE=""
@@ -3208,16 +3247,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* CAN_RAW_FD_FRAMES available check */
AC_MSG_RESULT(no)
])
-AC_MSG_CHECKING(for OSX 10.5 SDK or later)
-AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[#include <Carbon/Carbon.h>]], [[FSIORefNum fRef = 0]])
-],[
- AC_DEFINE(HAVE_OSX105_SDK, 1, [Define if compiling using MacOS X 10.5 SDK or later.])
- AC_MSG_RESULT(yes)
-],[
- AC_MSG_RESULT(no)
-])
-
# Check for --with-doc-strings
AC_MSG_CHECKING(for --with-doc-strings)
AC_ARG_WITH(doc-strings,
@@ -3233,19 +3262,6 @@ then
fi
AC_MSG_RESULT($with_doc_strings)
-# Check if eval loop should use timestamp counter profiling
-AC_MSG_CHECKING(for --with-tsc)
-AC_ARG_WITH(tsc,
- AS_HELP_STRING([--with(out)-tsc],[enable/disable timestamp counter profile]),[
-if test "$withval" != no
-then
- AC_DEFINE(WITH_TSC, 1,
- [Define to profile with the Pentium timestamp counter])
- AC_MSG_RESULT(yes)
-else AC_MSG_RESULT(no)
-fi],
-[AC_MSG_RESULT(no)])
-
# Check for Python-specific malloc support
AC_MSG_CHECKING(for --with-pymalloc)
AC_ARG_WITH(pymalloc,
@@ -3277,6 +3293,47 @@ if test "$with_valgrind" != no; then
OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
fi
+# Check for DTrace support
+AC_MSG_CHECKING(for --with-dtrace)
+AC_ARG_WITH(dtrace,
+ AC_HELP_STRING(--with(out)-dtrace, [disable/enable DTrace support]),,
+ with_dtrace=no)
+AC_MSG_RESULT($with_dtrace)
+
+AC_SUBST(DTRACE)
+AC_SUBST(DFLAGS)
+AC_SUBST(DTRACE_HEADERS)
+AC_SUBST(DTRACE_OBJS)
+DTRACE=
+DFLAGS=
+DTRACE_HEADERS=
+DTRACE_OBJS=
+
+if test "$with_dtrace" = "yes"
+then
+ AC_PATH_PROG(DTRACE, [dtrace], [not found])
+ if test "$DTRACE" = "not found"; then
+ AC_MSG_ERROR([dtrace command not found on \$PATH])
+ fi
+ AC_DEFINE(WITH_DTRACE, 1, [Define if you want to compile in DTrace support])
+ DTRACE_HEADERS="Include/pydtrace_probes.h"
+
+ # On OS X, DTrace providers do not need to be explicitly compiled and
+ # linked into the binary. Correspondingly, dtrace(1) is missing the ELF
+ # generation flag '-G'. We check for presence of this flag, rather than
+ # hardcoding support by OS, in the interest of robustness.
+ AC_CACHE_CHECK([whether DTrace probes require linking],
+ [ac_cv_dtrace_link], [dnl
+ ac_cv_dtrace_link=no
+ echo 'BEGIN' > conftest.d
+ "$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
+ ac_cv_dtrace_link=yes
+ ])
+ if test "$ac_cv_dtrace_link" = "yes"; then
+ DTRACE_OBJS="Python/pydtrace.o"
+ fi
+fi
+
# -I${DLINCLDIR} is added to the compile rule for importdl.o
AC_SUBST(DLINCLDIR)
DLINCLDIR=.
@@ -3341,8 +3398,7 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
futimens futimes gai_strerror getentropy \
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
- if_nameindex \
- initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
+ initgroups kill killpg lchmod lchown linkat lstat lutimes mmap \
memrchr mbrtowc mkdirat mkfifo \
mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
posix_fallocate posix_fadvise pread \
@@ -3669,6 +3725,12 @@ AC_CHECK_FUNCS(clock_getres, [], [
])
])
+AC_CHECK_FUNCS(clock_settime, [], [
+ AC_CHECK_LIB(rt, clock_settime, [
+ AC_DEFINE(HAVE_CLOCK_SETTIME, 1)
+ ])
+])
+
AC_MSG_CHECKING(for major, minor, and makedev)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if defined(MAJOR_IN_MKDEV)
@@ -3688,6 +3750,40 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
AC_MSG_RESULT(no)
])
+# On Android API level 24 with android-ndk-r13, if_nameindex() is available,
+# but the if_nameindex structure is not defined.
+AC_MSG_CHECKING(for if_nameindex)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+]], [[struct if_nameindex *ni = if_nameindex(); int x = ni[0].if_index;]])],
+ [AC_DEFINE(HAVE_IF_NAMEINDEX, 1, Define to 1 if you have the 'if_nameindex' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
+
+# Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
+# macro is not defined in android-ndk-r13.
+AC_MSG_CHECKING(for lockf)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h> ]],[[lockf(0, F_LOCK, 0);]])],
+ [AC_DEFINE(HAVE_LOCKF, 1, Define to 1 if you have the 'lockf' function and the F_LOCK macro.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
+
# On OSF/1 V5.1, getaddrinfo is available, but a define
# for [no]getaddrinfo in netdb.h.
AC_MSG_CHECKING(for getaddrinfo)
@@ -3830,6 +3926,10 @@ AC_CHECK_MEMBERS([struct stat.st_flags])
AC_CHECK_MEMBERS([struct stat.st_gen])
AC_CHECK_MEMBERS([struct stat.st_birthtime])
AC_CHECK_MEMBERS([struct stat.st_blocks])
+AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[
+ #include <sys/types.h>
+ #include <pwd.h>
+]])
AC_MSG_CHECKING(for time.h that defines altzone)
AC_CACHE_VAL(ac_cv_header_time_altzone,[
@@ -3878,6 +3978,19 @@ if test $ac_cv_struct_sockaddr_storage = yes; then
AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
fi
+AC_MSG_CHECKING(for sockaddr_alg)
+AC_CACHE_VAL(ac_cv_struct_sockaddr_alg,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <linux/if_alg.h>]], [[struct sockaddr_alg s]])],
+ [ac_cv_struct_sockaddr_alg=yes],
+ [ac_cv_struct_sockaddr_alg=no]))
+AC_MSG_RESULT($ac_cv_struct_sockaddr_alg)
+if test $ac_cv_struct_sockaddr_alg = yes; then
+ AC_DEFINE(HAVE_SOCKADDR_ALG, 1, [struct sockaddr_alg (linux/if_alg.h)])
+fi
+
# checks for compiler characteristics
AC_C_CHAR_UNSIGNED
@@ -3950,20 +4063,6 @@ x.sa_len = 0;]])],
[AC_MSG_RESULT(no)]
)
-va_list_is_array=no
-AC_MSG_CHECKING(whether va_list is an array)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_STDARG_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-]], [[va_list list1, list2; list1 = list2;]])],[],[
- AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind])
- va_list_is_array=yes
-])
-AC_MSG_RESULT($va_list_is_array)
-
# sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
AH_TEMPLATE(HAVE_GETHOSTBYNAME_R,
[Define this if you have some version of gethostbyname_r()])
@@ -4406,6 +4505,8 @@ then
[define to 1 if your sem_getvalue is broken.])
fi
+AC_CHECK_DECLS([RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_DEEPBIND], [], [], [[#include <dlfcn.h>]])
+
# determine what size digit to use for Python's longs
AC_MSG_CHECKING([digit size for Python's longs])
AC_ARG_ENABLE(big-digits,
@@ -4524,7 +4625,11 @@ AC_MSG_RESULT($LDVERSION)
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
AC_SUBST(PY_ENABLE_SHARED)
-LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+if test x$PLATFORM_TRIPLET = x; then
+ LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
+else
+ LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+fi
AC_SUBST(LIBPL)
# Check whether right shifting a negative integer extends the sign bit
@@ -4827,7 +4932,9 @@ fi
# first curses header check
ac_save_cppflags="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
+if test "$cross_compiling" = no; then
+ CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
+fi
AC_CHECK_HEADERS(curses.h ncurses.h)
@@ -4922,70 +5029,6 @@ if test "x$ac_cv_file__dev_ptc" = xyes; then
[Define to 1 if you have the /dev/ptc device file.])
fi
-if test "$have_long_long" = yes
-then
- AC_MSG_CHECKING(for %lld and %llu printf() format support)
- AC_CACHE_VAL(ac_cv_have_long_long_format,
- AC_RUN_IFELSE([AC_LANG_SOURCE([[[
- #include <stdio.h>
- #include <stddef.h>
- #include <string.h>
-
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
-
- int main()
- {
- char buffer[256];
-
- if (sprintf(buffer, "%lld", (long long)123) < 0)
- return 1;
- if (strcmp(buffer, "123"))
- return 1;
-
- if (sprintf(buffer, "%lld", (long long)-123) < 0)
- return 1;
- if (strcmp(buffer, "-123"))
- return 1;
-
- if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
- return 1;
- if (strcmp(buffer, "123"))
- return 1;
-
- return 0;
- }
- ]]])],
- [ac_cv_have_long_long_format=yes],
- [ac_cv_have_long_long_format=no],
- [ac_cv_have_long_long_format="cross -- assuming no"
- if test x$GCC = xyes; then
- save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -Werror -Wformat"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #include <stdio.h>
- #include <stddef.h>
- ]], [[
- char *buffer;
- sprintf(buffer, "%lld", (long long)123);
- sprintf(buffer, "%lld", (long long)-123);
- sprintf(buffer, "%llu", (unsigned long long)123);
- ]])],
- ac_cv_have_long_long_format=yes
- )
- CFLAGS=$save_CFLAGS
- fi])
- )
- AC_MSG_RESULT($ac_cv_have_long_long_format)
-fi
-
-if test "$ac_cv_have_long_long_format" = yes
-then
- AC_DEFINE(PY_FORMAT_LONG_LONG, "ll",
- [Define to printf format modifier for long long type])
-fi
-
if test $ac_sys_system = Darwin
then
LIBS="$LIBS -framework CoreFoundation"
@@ -5378,7 +5421,7 @@ mv config.c Modules
if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
echo "" >&AS_MESSAGE_FD
echo "" >&AS_MESSAGE_FD
- echo "If you want a release build with all optimizations active (LTO, PGO, etc),"
+ echo "If you want a release build with all optimizations active (LTO, PGO, etc)," >&AS_MESSAGE_FD
echo "please run ./configure --enable-optimizations" >&AS_MESSAGE_FD
echo "" >&AS_MESSAGE_FD
echo "" >&AS_MESSAGE_FD