summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac91
1 files changed, 89 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 9698ea0221..99d430c100 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.4)
+m4_define(PYTHON_VERSION, 3.5)
AC_PREREQ(2.65)
@@ -1039,6 +1039,15 @@ else
ASDLGEN="$PYTHON"
fi
+AC_SUBST(OPCODEHGEN)
+AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
+if test "$PYTHON" = not-found; then
+ OPCODEHGEN="@echo python: $PYTHON! cannot run Tools/scripts/generate_opcode_h.py"
+else
+ OPCODEHGEN="$PYTHON"
+fi
+
+
case $MACHDEP in
bsdos*|hp*|HP*)
@@ -1229,6 +1238,52 @@ yes)
CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
fi
+ AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wsign-compare"
+ save_CFLAGS="$CFLAGS"
+ AC_CACHE_VAL(ac_cv_enable_sign_compare_warning,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_enable_sign_compare_warning=yes
+ ],[
+ ac_cv_enable_sign_compare_warning=no
+ ]))
+ CFLAGS="$save_CFLAGS"
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_enable_sign_compare_warning)
+
+ if test $ac_cv_enable_sign_compare_warning = yes
+ then
+ BASECFLAGS="$BASECFLAGS -Wsign-compare"
+ fi
+
+ AC_MSG_CHECKING(if we can turn on $CC unreachable code warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wunreachable-code"
+ save_CFLAGS="$CFLAGS"
+ AC_CACHE_VAL(ac_cv_enable_unreachable_code_warning,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_enable_unreachable_code_warning=yes
+ ],[
+ ac_cv_enable_unreachable_code_warning=no
+ ]))
+ CFLAGS="$save_CFLAGS"
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
+
+ # Don't enable unreachable code warning in debug mode, since it usually
+ # results in non-standard code paths.
+ if test $ac_cv_enable_unreachable_code_warning = yes && test "$Py_DEBUG" != "true"
+ then
+ BASECFLAGS="$BASECFLAGS -Wunreachable-code"
+ fi
+
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.
@@ -2238,6 +2293,9 @@ AC_MSG_RESULT($SHLIBS)
AC_CHECK_LIB(sendfile, sendfile)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
+AC_CHECK_LIB(crypto, RAND_egd,
+ AC_DEFINE(HAVE_RAND_EGD, 1,
+ [Define if the libcrypto has RAND_egd]))
# only check for sem_init if thread support is requested
if test "$with_threads" = "yes" -o -z "$with_threads"; then
@@ -2322,6 +2380,17 @@ esac
],
[AC_MSG_RESULT(default)])
+AC_MSG_CHECKING(for --with-address-sanitizer)
+AC_ARG_WITH(address_sanitizer,
+ AS_HELP_STRING([--with-address-sanitizer],
+ [enable AddressSanitizer]),
+[
+AC_MSG_RESULT($withval)
+BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS"
+LDFLAGS="-fsanitize=address $LDFLAGS"
+],
+[AC_MSG_RESULT(no)])
+
# Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
@@ -3253,6 +3322,7 @@ AC_CHECK_FUNCS(gettimeofday,
AC_CHECK_FUNCS(clock_gettime, [], [
AC_CHECK_LIB(rt, clock_gettime, [
+ LIBS="$LIBS -lrt"
AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
AC_DEFINE(TIMEMODULE_LIB, [rt],
[Library needed by timemodule.c: librt may be needed for clock_gettime()])
@@ -3807,6 +3877,19 @@ then
[Define if we can use gcc inline assembler to get and set x87 control word])
fi
+AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set mc68881 fpcr)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ unsigned int fpcr;
+ __asm__ __volatile__ ("fmove.l %%fpcr,%0" : "=g" (fpcr));
+ __asm__ __volatile__ ("fmove.l %0,%%fpcr" : : "g" (fpcr));
+]])],[have_gcc_asm_for_mc68881=yes],[have_gcc_asm_for_mc68881=no])
+AC_MSG_RESULT($have_gcc_asm_for_mc68881)
+if test "$have_gcc_asm_for_mc68881" = yes
+then
+ AC_DEFINE(HAVE_GCC_ASM_FOR_MC68881, 1,
+ [Define if we can use gcc inline assembler to get and set mc68881 fpcr])
+fi
+
# Detect whether system arithmetic is subject to x87-style double
# rounding issues. The result of this test has little meaning on non
# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding
@@ -4228,6 +4311,10 @@ then
[Define if you can turn off readline's signal handling.]), )
fi
+AC_CHECK_LIB(readline, append_history,
+ AC_DEFINE(HAVE_RL_APPEND_HISTORY, 1,
+ [Define if readline supports append_history]), ,$READLINE_LIBS)
+
# End of readline checks: restore LIBS
LIBS=$LIBS_no_readline
@@ -4705,7 +4792,7 @@ do
done
AC_SUBST(SRCDIRS)
-SRCDIRS="Parser Grammar Objects Python Modules Mac"
+SRCDIRS="Parser Grammar Objects Python Modules Mac Programs"
AC_MSG_CHECKING(for build directories)
for dir in $SRCDIRS; do
if test ! -d $dir; then