summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac299
1 files changed, 129 insertions, 170 deletions
diff --git a/configure.ac b/configure.ac
index 138d562..47ba787 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,19 +3,33 @@ 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.2)
-
-dnl Some m4 magic to ensure that the configure script is generated
-dnl by the correct autoconf version.
-m4_define([version_required],
-[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [$1]), 0,
- [],
- [m4_fatal([Autoconf version $1 is required for Python], 63)])
-])
+m4_define(PYTHON_VERSION, 3.3)
+
AC_PREREQ(2.65)
-AC_REVISION($Revision$)
AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
+
+AC_SUBST(HGVERSION)
+AC_SUBST(HGTAG)
+AC_SUBST(HGBRANCH)
+
+if test -e $srcdir/.hg/dirstate
+then
+AC_CHECK_PROG(HAS_HG, hg, found, not-found)
+else
+HAS_HG=no-repository
+fi
+if test $HAS_HG = found
+then
+ HGVERSION="hg id -i \$(srcdir)"
+ HGTAG="hg id -t \$(srcdir)"
+ HGBRANCH="hg id -b \$(srcdir)"
+else
+ HGVERSION=""
+ HGTAG=""
+ HGBRANCH=""
+fi
+
AC_CONFIG_SRCDIR([Include/object.h])
AC_CONFIG_HEADER(pyconfig.h)
@@ -290,7 +304,7 @@ then
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
- linux*) MACHDEP="linux2";;
+ linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
irix646) MACHDEP="irix6";;
@@ -383,7 +397,8 @@ esac
if test $define_xopen_source = yes
then
- AC_DEFINE(_XOPEN_SOURCE, 600,
+ # X/Open 7, incorporating POSIX.1-2008
+ AC_DEFINE(_XOPEN_SOURCE, 700,
Define to the level of X/Open that your system supports)
# On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
@@ -393,8 +408,7 @@ then
AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
Define to activate Unix95-and-earlier features)
- AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
-
+ AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008)
fi
#
@@ -783,11 +797,6 @@ if test $enable_shared = "yes"; then
BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(LDVERSION)'
RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH}
;;
- OSF*)
- LDLIBRARY='libpython$(LDVERSION).so'
- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(LDVERSION)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- ;;
Darwin*)
LDLIBRARY='libpython$(LDVERSION).dylib'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
@@ -821,36 +830,6 @@ then
ARFLAGS="rc"
fi
-AC_SUBST(SVNVERSION)
-AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
-if test $SVNVERSION = found
-then
- SVNVERSION="svnversion \$(srcdir)"
-else
- SVNVERSION="echo Unversioned directory"
-fi
-
-AC_SUBST(HGVERSION)
-AC_SUBST(HGTAG)
-AC_SUBST(HGBRANCH)
-
-if test -e $srcdir/.hg/dirstate
-then
-AC_CHECK_PROG(HAS_HG, hg, found, not-found)
-else
-HAS_HG=no-repository
-fi
-if test $HAS_HG = found
-then
- HGVERSION="hg id -i \$(srcdir)"
- HGTAG="hg id -t \$(srcdir)"
- HGBRANCH="hg id -b \$(srcdir)"
-else
- HGVERSION=""
- HGTAG=""
- HGBRANCH=""
-fi
-
AC_SUBST(DISABLE_ASDLGEN)
DISABLE_ASDLGEN=""
AC_CHECK_PROG(HAS_PYTHON, python, found, not-found)
@@ -1003,6 +982,28 @@ yes)
BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
fi
+ AC_MSG_CHECKING(if we can turn off $CC unused result warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wunused-result -Werror"
+ save_CFLAGS="$CFLAGS"
+ AC_CACHE_VAL(ac_cv_disable_unused_result_warning,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_disable_unused_result_warning=yes
+ ],[
+ ac_cv_disable_unused_result_warning=no
+ ]))
+ CFLAGS="$save_CFLAGS"
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_disable_unused_result_warning)
+
+ if test $ac_cv_disable_unused_result_warning = yes
+ then
+ BASECFLAGS="$BASECFLAGS -Wno-unused-result"
+ 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.
@@ -1119,9 +1120,6 @@ yes)
EXPORT_MACOSX_DEPLOYMENT_TARGET=''
;;
- OSF*)
- BASECFLAGS="$BASECFLAGS -mieee"
- ;;
esac
;;
@@ -1130,9 +1128,6 @@ yes)
OpenUNIX*|UnixWare*)
BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca "
;;
- OSF*)
- BASECFLAGS="$BASECFLAGS -ieee -std"
- ;;
SCO_SV*)
BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5"
;;
@@ -1335,19 +1330,37 @@ dnl AC_MSG_RESULT($cpp_type)
AC_HEADER_STDC
AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
fcntl.h grp.h \
-ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
-shadow.h signal.h stdint.h stropts.h termios.h thread.h \
+ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
+sched.h shadow.h signal.h stdint.h stropts.h termios.h \
unistd.h utime.h \
-sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
-sys/lock.h sys/mkdev.h sys/modem.h \
-sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
-sys/syscall.h sys/termio.h sys/time.h \
-sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
-sys/resource.h netpacket/packet.h sysexits.h bluetooth.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 \
+sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \
+sys/param.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 spawn.h util.h)
AC_HEADER_DIRENT
AC_HEADER_MAJOR
+# On Darwin (OS X) net/if.h requires sys/socket.h to be imported first.
+AC_CHECK_HEADERS([net/if.h], [], [],
+[#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
+])
+
+
# On Solaris, term.h requires curses.h
AC_CHECK_HEADERS(term.h,,,[
#ifdef HAVE_CURSES_H
@@ -1365,6 +1378,13 @@ AC_CHECK_HEADERS(linux/netlink.h,,,[
#endif
])
+# On Linux, can.h and can/raw.h require sys/socket.h
+AC_CHECK_HEADERS(linux/can.h linux/can/raw.h,,,[
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+])
+
# checks for typedefs
was_it_defined=no
AC_MSG_CHECKING(for clock_t in time.h)
@@ -1373,7 +1393,6 @@ AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
])
AC_MSG_RESULT($was_it_defined)
-# Check whether using makedev requires defining _OSF_SOURCE
AC_MSG_CHECKING(for makedev)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if defined(MAJOR_IN_MKDEV)
@@ -1386,19 +1405,6 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
]], [[
makedev(0, 0) ]])
],[ac_cv_has_makedev=yes],[ac_cv_has_makedev=no])
-if test "$ac_cv_has_makedev" = "no"; then
- # we didn't link, try if _OSF_SOURCE will allow us to link
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#define _OSF_SOURCE 1
-#include <sys/types.h>
- ]],
- [[ makedev(0, 0) ]])],
- [ac_cv_has_makedev=yes],
- [ac_cv_has_makedev=no])
- if test "$ac_cv_has_makedev" = "yes"; then
- AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
- fi
-fi
AC_MSG_RESULT($ac_cv_has_makedev)
if test "$ac_cv_has_makedev" = "yes"; then
AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
@@ -1718,7 +1724,6 @@ then
else
LDSHARED='ld -b'
fi ;;
- OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
Darwin/1.3*)
LDSHARED='$(CC) -bundle'
LDCXXSHARED='$(CXX) -bundle'
@@ -1948,6 +1953,7 @@ AC_MSG_RESULT($SHLIBS)
# checks for libraries
+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
@@ -2072,21 +2078,10 @@ fi
AC_SUBST(USE_THREAD_MODULE)
USE_THREAD_MODULE=""
-AC_MSG_CHECKING(for --with-dec-threads)
AC_SUBST(LDLAST)
-AC_ARG_WITH(dec-threads,
- AS_HELP_STRING([--with-dec-threads], [use DEC Alpha/OSF1 thread-safe libraries]),
-[
-AC_MSG_RESULT($withval)
-LDLAST=-threads
-if test "${with_thread+set}" != set; then
- with_thread="$withval";
-fi],
-[AC_MSG_RESULT(no)])
# Templates for things AC_DEFINEd more than once.
# For a single AC_DEFINE, no template is needed.
-AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package])
AH_TEMPLATE(_REENTRANT,
[Define to force use of thread-safe errno, h_errno, and other functions])
AH_TEMPLATE(WITH_THREAD,
@@ -2168,17 +2163,6 @@ yes
AC_MSG_RESULT($unistd_defines_pthreads)
AC_DEFINE(_REENTRANT)
- AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
- AC_DEFINE(C_THREADS)
- AC_DEFINE(HURD_C_THREADS, 1,
- [Define if you are using Mach cthreads directly under /include])
- LIBS="$LIBS -lthreads"
- THREADOBJ="Python/thread.o"],[
- AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
- AC_DEFINE(C_THREADS)
- AC_DEFINE(MACH_C_THREADS, 1,
- [Define if you are using Mach cthreads under mach /])
- THREADOBJ="Python/thread.o"],[
# Just looking for pthread_create in libpthread is not enough:
# on HP/UX, pthread.h renames pthread_create to a different symbol name.
# So we really have to include pthread.h, and then link.
@@ -2214,7 +2198,7 @@ pthread_create (NULL, NULL, start_routine, NULL)]])],[
LIBS="$LIBS -lcma"
THREADOBJ="Python/thread.o"],[
USE_THREAD_MODULE="#"])
- ])])])])])])])
+ ])])])])])
AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
LIBS="$LIBS -lmpc"
@@ -2227,15 +2211,6 @@ pthread_create (NULL, NULL, start_routine, NULL)]])],[
THREADOBJ="Python/thread.o"
USE_THREAD_MODULE=""])
fi
-
- if test "$USE_THREAD_MODULE" != "#"
- then
- # If the above checks didn't disable threads, (at least) OSF1
- # needs this '-threads' argument during linking.
- case $ac_sys_system in
- OSF1) LDLAST=-threads;;
- esac
- fi
fi
if test "$posix_threads" = "yes"; then
@@ -2587,19 +2562,27 @@ AC_MSG_RESULT(MACHDEP_OBJS)
# checks for library functions
AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
- gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
+ clock confstr ctermid execv faccessat fchmod fchmodat fchown fchownat \
+ fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
+ futimens futimes gai_strerror \
+ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
- initgroups kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \
- mremap nice pathconf pause plock poll pthread_init \
- putenv readlink realpath \
- select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
- setgid \
- setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setuid setvbuf \
- sigaction siginterrupt sigrelse snprintf strftime strlcpy \
+ if_nameindex \
+ initgroups kill killpg lchmod lchown lockf 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 \
+ pthread_init pthread_kill putenv pwrite readlink readlinkat readv realpath renameat \
+ select sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \
+ setgid sethostname \
+ setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \
+ sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
+ sched_rr_get_interval \
+ sigaction sigaltstack siginterrupt sigpending sigrelse \
+ sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
- truncate uname unsetenv utimes waitpid wait3 wait4 \
- wcscoll wcsftime wcsxfrm _getpty)
+ truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
+ wcscoll wcsftime wcsxfrm writev _getpty)
AC_CHECK_DECL(dirfd,
AC_DEFINE(HAVE_DIRFD, 1,
@@ -2651,6 +2634,12 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/epoll.h>]], [[void *x=epoll_c
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
])
+AC_MSG_CHECKING(for epoll_create1)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/epoll.h>]], [[void *x=epoll_create1]])],
+ [AC_DEFINE(HAVE_EPOLL_CREATE1, 1, Define if you have the 'epoll_create1' function.)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+])
AC_MSG_CHECKING(for kqueue)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
@@ -2881,6 +2870,20 @@ AC_CHECK_FUNCS(gettimeofday,
])
)
+AC_CHECK_FUNCS(clock_gettime, [], [
+ AC_CHECK_LIB(rt, clock_gettime, [
+ AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
+ AC_DEFINE(TIMEMODULE_LIB, [rt],
+ [Library needed by timemodule.c: librt may be needed for clock_gettime()])
+ ])
+])
+
+AC_CHECK_FUNCS(clock_getres, [], [
+ AC_CHECK_LIB(rt, clock_getres, [
+ AC_DEFINE(HAVE_CLOCK_GETRES, 1)
+ ])
+])
+
AC_MSG_CHECKING(for major, minor, and makedev)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#if defined(MAJOR_IN_MKDEV)
@@ -3450,7 +3453,7 @@ LIBS_SAVE=$LIBS
LIBS="$LIBS $LIBM"
AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma])
-AC_CHECK_FUNCS([hypot lgamma log1p round tgamma])
+AC_CHECK_FUNCS([hypot lgamma log1p log2 round tgamma])
AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
@@ -3648,57 +3651,19 @@ then
AC_MSG_RESULT($ac_cv_wchar_t_signed)
fi
-AC_MSG_CHECKING(what type to use for str)
-AC_ARG_WITH(wide-unicode,
- AS_HELP_STRING([--with-wide-unicode], [Use 4-byte Unicode characters (default is 2 bytes)]),
-[
-if test "$withval" != no
-then unicode_size="4"
-else unicode_size="2"
-fi
-],
-[
-case "$have_ucs4_tcl" in
- yes) unicode_size="4";;
- *) unicode_size="2" ;;
-esac
-])
-
-AH_TEMPLATE(Py_UNICODE_SIZE,
- [Define as the size of the unicode type.])
-case "$unicode_size" in
- 4)
- AC_DEFINE(Py_UNICODE_SIZE, 4)
- ABIFLAGS="${ABIFLAGS}u"
- ;;
- *) AC_DEFINE(Py_UNICODE_SIZE, 2) ;;
-esac
-
-AH_TEMPLATE(PY_UNICODE_TYPE,
- [Define as the integral type used for Unicode representation.])
-
# wchar_t is only usable if it maps to an unsigned type
-if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \
+if test "$ac_cv_sizeof_wchar_t" -ge 2 \
-a "$ac_cv_wchar_t_signed" = "no"
then
- PY_UNICODE_TYPE="wchar_t"
+ HAVE_USABLE_WCHAR_T="yes"
AC_DEFINE(HAVE_USABLE_WCHAR_T, 1,
[Define if you have a useable wchar_t type defined in wchar.h; useable
means wchar_t must be an unsigned type with at least 16 bits. (see
Include/unicodeobject.h).])
- AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
-elif test "$ac_cv_sizeof_short" = "$unicode_size"
-then
- PY_UNICODE_TYPE="unsigned short"
- AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
-elif test "$ac_cv_sizeof_long" = "$unicode_size"
-then
- PY_UNICODE_TYPE="unsigned long"
- AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
else
- PY_UNICODE_TYPE="no type found"
+ HAVE_USABLE_WCHAR_T="no usable wchar_t found"
fi
-AC_MSG_RESULT($PY_UNICODE_TYPE)
+AC_MSG_RESULT($HAVE_USABLE_WCHAR_T)
# check for endianness
AC_C_BIGENDIAN
@@ -4308,12 +4273,6 @@ AIX*)
esac
-case $ac_sys_system in
- OSF*) AC_MSG_ERROR(OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606) ;;
-esac
-
-AC_CHECK_FUNC(pipe2, AC_DEFINE(HAVE_PIPE2, 1, [Define if the OS supports pipe2()]), )
-
AC_SUBST(THREADHEADERS)
for h in `(cd $srcdir;echo Python/thread_*.h)`