Benjamin Peterson | d7c7784 | 2008-05-26 13:01:25 +0000 | [diff] [blame] | 1 | dnl *********************************************** |
| 2 | dnl * Please run autoreconf to test your changes! * |
| 3 | dnl *********************************************** |
Martin v. Löwis | 88afe66 | 2002-10-26 13:47:44 +0000 | [diff] [blame] | 4 | |
| 5 | # Set VERSION so we only need to edit in one place (i.e., here) |
Martin v. Löwis | 174440b | 2008-10-03 08:59:41 +0000 | [diff] [blame] | 6 | m4_define(PYTHON_VERSION, 2.7) |
Martin v. Löwis | 88afe66 | 2002-10-26 13:47:44 +0000 | [diff] [blame] | 7 | |
Georg Brandl | 71f4fbb | 2011-02-25 11:04:50 +0000 | [diff] [blame] | 8 | AC_PREREQ(2.65) |
Alexandre Vassalotti | 130ae15 | 2009-07-18 00:31:06 +0000 | [diff] [blame] | 9 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 10 | AC_REVISION($Revision$) |
Georg Brandl | 464432d | 2009-05-20 18:24:08 +0000 | [diff] [blame] | 11 | AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/) |
Martin v. Löwis | 88afe66 | 2002-10-26 13:47:44 +0000 | [diff] [blame] | 12 | AC_CONFIG_SRCDIR([Include/object.h]) |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 13 | AC_CONFIG_HEADER(pyconfig.h) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 14 | |
Martin Panter | e9ee317 | 2016-04-23 00:58:44 +0000 | [diff] [blame] | 15 | AC_SUBST(cross_compiling) |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 16 | AC_CANONICAL_HOST |
| 17 | AC_SUBST(build) |
| 18 | AC_SUBST(host) |
| 19 | |
Ned Deily | 983df86 | 2014-08-22 13:30:59 -0700 | [diff] [blame] | 20 | # pybuilddir.txt will be created by --generate-posix-vars in the Makefile |
| 21 | rm -f pybuilddir.txt |
| 22 | |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 23 | if test "$cross_compiling" = yes; then |
| 24 | AC_MSG_CHECKING([for python interpreter for cross build]) |
| 25 | if test -z "$PYTHON_FOR_BUILD"; then |
| 26 | for interp in python$PACKAGE_VERSION python2 python; do |
| 27 | which $interp >/dev/null 2>&1 || continue |
| 28 | if $interp -c 'import sys;sys.exit(not (sys.version_info@<:@:2@:>@ >= (2,7) and sys.version_info@<:@0@:>@ < 3))'; then |
| 29 | break |
| 30 | fi |
| 31 | interp= |
| 32 | done |
| 33 | if test x$interp = x; then |
| 34 | AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) |
| 35 | fi |
| 36 | AC_MSG_RESULT($interp) |
doko@ubuntu.com | 9e7ece2 | 2015-04-13 21:55:08 +0200 | [diff] [blame] | 37 | 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 |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 38 | fi |
| 39 | elif test "$cross_compiling" = maybe; then |
| 40 | AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) |
| 41 | else |
| 42 | PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E' |
| 43 | fi |
| 44 | AC_SUBST(PYTHON_FOR_BUILD) |
| 45 | |
Georg Brandl | bcd64a3 | 2009-03-31 21:45:18 +0000 | [diff] [blame] | 46 | dnl Ensure that if prefix is specified, it does not end in a slash. If |
| 47 | dnl it does, we get path names containing '//' which is both ugly and |
| 48 | dnl can cause trouble. |
| 49 | |
| 50 | dnl Last slash shouldn't be stripped if prefix=/ |
| 51 | if test "$prefix" != "/"; then |
| 52 | prefix=`echo "$prefix" | sed -e 's/\/$//g'` |
| 53 | fi |
| 54 | |
Martin v. Löwis | 8316feb | 2003-06-14 07:48:07 +0000 | [diff] [blame] | 55 | dnl This is for stuff that absolutely must end up in pyconfig.h. |
| 56 | dnl Please use pyport.h instead, if possible. |
Martin v. Löwis | bddf5a5 | 2002-11-11 13:37:28 +0000 | [diff] [blame] | 57 | AH_TOP([ |
| 58 | #ifndef Py_PYCONFIG_H |
| 59 | #define Py_PYCONFIG_H |
| 60 | ]) |
Martin v. Löwis | 1143799 | 2002-04-12 09:54:03 +0000 | [diff] [blame] | 61 | AH_BOTTOM([ |
Martin v. Löwis | 1143799 | 2002-04-12 09:54:03 +0000 | [diff] [blame] | 62 | /* Define the macros needed if on a UnixWare 7.x system. */ |
| 63 | #if defined(__USLC__) && defined(__SCO_VERSION__) |
| 64 | #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ |
| 65 | #endif |
Martin v. Löwis | bddf5a5 | 2002-11-11 13:37:28 +0000 | [diff] [blame] | 66 | |
| 67 | #endif /*Py_PYCONFIG_H*/ |
Martin v. Löwis | 1143799 | 2002-04-12 09:54:03 +0000 | [diff] [blame] | 68 | ]) |
| 69 | |
Martin v. Löwis | 8316feb | 2003-06-14 07:48:07 +0000 | [diff] [blame] | 70 | # We don't use PACKAGE_ variables, and they cause conflicts |
| 71 | # with other autoconf-based packages that include Python.h |
| 72 | grep -v 'define PACKAGE_' <confdefs.h >confdefs.h.new |
| 73 | rm confdefs.h |
| 74 | mv confdefs.h.new confdefs.h |
| 75 | |
Guido van Rossum | 642b678 | 1997-07-19 19:35:41 +0000 | [diff] [blame] | 76 | AC_SUBST(VERSION) |
Martin v. Löwis | 88afe66 | 2002-10-26 13:47:44 +0000 | [diff] [blame] | 77 | VERSION=PYTHON_VERSION |
Guido van Rossum | 642b678 | 1997-07-19 19:35:41 +0000 | [diff] [blame] | 78 | |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 79 | AC_SUBST(SOVERSION) |
| 80 | SOVERSION=1.0 |
| 81 | |
Martin v. Löwis | 6f18a3c | 2002-07-20 08:51:52 +0000 | [diff] [blame] | 82 | # The later defininition of _XOPEN_SOURCE disables certain features |
| 83 | # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone). |
| 84 | AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features]) |
| 85 | |
Martin v. Löwis | bcd9396 | 2003-05-03 10:32:18 +0000 | [diff] [blame] | 86 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables |
| 87 | # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable |
| 88 | # them. |
| 89 | AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features]) |
| 90 | |
Andrew MacIntyre | abccf41 | 2003-07-02 13:53:25 +0000 | [diff] [blame] | 91 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables |
| 92 | # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable |
| 93 | # them. |
| 94 | AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features]) |
| 95 | |
Martin v. Löwis | d632050 | 2004-08-12 13:45:08 +0000 | [diff] [blame] | 96 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables |
| 97 | # u_int on Irix 5.3. Defining _BSD_TYPES brings it back. |
| 98 | AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int]) |
| 99 | |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 100 | # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables |
| 101 | # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable |
| 102 | # them. |
| 103 | AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features]) |
| 104 | |
| 105 | |
Martin v. Löwis | e981a4e | 2002-11-11 13:26:51 +0000 | [diff] [blame] | 106 | define_xopen_source=yes |
Martin v. Löwis | 6f18a3c | 2002-07-20 08:51:52 +0000 | [diff] [blame] | 107 | |
Neil Schemenauer | 4edbc2a | 2001-03-22 00:34:03 +0000 | [diff] [blame] | 108 | # Arguments passed to configure. |
| 109 | AC_SUBST(CONFIG_ARGS) |
| 110 | CONFIG_ARGS="$ac_configure_args" |
| 111 | |
Ronald Oussoren | 3c0a126 | 2010-01-17 19:27:57 +0000 | [diff] [blame] | 112 | AC_MSG_CHECKING([for --enable-universalsdk]) |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 113 | AC_ARG_ENABLE(universalsdk, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 114 | AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@], [Build against Mac OS X 10.4u SDK (ppc/i386)]), |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 115 | [ |
| 116 | case $enableval in |
| 117 | yes) |
| 118 | enableval=/Developer/SDKs/MacOSX10.4u.sdk |
Ronald Oussoren | 3c0a126 | 2010-01-17 19:27:57 +0000 | [diff] [blame] | 119 | if test ! -d "${enableval}" |
| 120 | then |
| 121 | enableval=/ |
| 122 | fi |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 123 | ;; |
| 124 | esac |
| 125 | case $enableval in |
| 126 | no) |
| 127 | UNIVERSALSDK= |
| 128 | enable_universalsdk= |
| 129 | ;; |
| 130 | *) |
| 131 | UNIVERSALSDK=$enableval |
Ronald Oussoren | 3c0a126 | 2010-01-17 19:27:57 +0000 | [diff] [blame] | 132 | if test ! -d "${UNIVERSALSDK}" |
| 133 | then |
| 134 | AC_MSG_ERROR([--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}]) |
| 135 | fi |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 136 | ;; |
| 137 | esac |
Ronald Oussoren | 3c0a126 | 2010-01-17 19:27:57 +0000 | [diff] [blame] | 138 | |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 139 | ],[ |
| 140 | UNIVERSALSDK= |
| 141 | enable_universalsdk= |
| 142 | ]) |
Ronald Oussoren | 3c0a126 | 2010-01-17 19:27:57 +0000 | [diff] [blame] | 143 | if test -n "${UNIVERSALSDK}" |
| 144 | then |
| 145 | AC_MSG_RESULT(${UNIVERSALSDK}) |
| 146 | else |
| 147 | AC_MSG_RESULT(no) |
| 148 | fi |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 149 | AC_SUBST(UNIVERSALSDK) |
| 150 | |
Benjamin Peterson | 0e6ea5d | 2008-07-16 20:17:04 +0000 | [diff] [blame] | 151 | AC_SUBST(ARCH_RUN_32BIT) |
Ned Deily | 8e60f6e | 2013-05-30 00:14:29 -0700 | [diff] [blame] | 152 | ARCH_RUN_32BIT="" |
Benjamin Peterson | 0e6ea5d | 2008-07-16 20:17:04 +0000 | [diff] [blame] | 153 | |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 154 | UNIVERSAL_ARCHS="32-bit" |
Ronald Oussoren | 92919a6 | 2009-12-24 13:30:58 +0000 | [diff] [blame] | 155 | AC_SUBST(LIPO_32BIT_FLAGS) |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 156 | AC_MSG_CHECKING(for --with-universal-archs) |
| 157 | AC_ARG_WITH(universal-archs, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 158 | AS_HELP_STRING([--with-universal-archs=ARCH], [select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")]), |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 159 | [ |
| 160 | AC_MSG_RESULT($withval) |
| 161 | UNIVERSAL_ARCHS="$withval" |
Ronald Oussoren | 9ebd242 | 2009-09-29 13:00:44 +0000 | [diff] [blame] | 162 | if test "${enable_universalsdk}" ; then |
| 163 | : |
| 164 | else |
| 165 | AC_MSG_ERROR([--with-universal-archs without --enable-universalsdk. See Mac/README]) |
| 166 | fi |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 167 | ], |
| 168 | [ |
| 169 | AC_MSG_RESULT(32-bit) |
| 170 | ]) |
| 171 | |
| 172 | |
| 173 | |
Ronald Oussoren | 580c7fe | 2008-05-02 19:45:11 +0000 | [diff] [blame] | 174 | AC_ARG_WITH(framework-name, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 175 | AS_HELP_STRING([--with-framework-name=FRAMEWORK], |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 176 | [specify an alternate name of the framework built with --enable-framework]), |
Ronald Oussoren | 580c7fe | 2008-05-02 19:45:11 +0000 | [diff] [blame] | 177 | [ |
Ronald Oussoren | 9ebd242 | 2009-09-29 13:00:44 +0000 | [diff] [blame] | 178 | if test "${enable_framework}"; then |
| 179 | : |
| 180 | else |
| 181 | AC_MSG_ERROR([--with-framework-name without --enable-framework. See Mac/README]) |
| 182 | fi |
Ronald Oussoren | 580c7fe | 2008-05-02 19:45:11 +0000 | [diff] [blame] | 183 | PYTHONFRAMEWORK=${withval} |
| 184 | PYTHONFRAMEWORKDIR=${withval}.framework |
| 185 | PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr '[A-Z]' '[a-z]'` |
| 186 | ],[ |
| 187 | PYTHONFRAMEWORK=Python |
| 188 | PYTHONFRAMEWORKDIR=Python.framework |
| 189 | PYTHONFRAMEWORKIDENTIFIER=org.python.python |
| 190 | ]) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 191 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 192 | AC_ARG_ENABLE(framework, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 193 | AS_HELP_STRING([--enable-framework@<:@=INSTALLDIR@:>@], [Build (MacOSX|Darwin) framework]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 194 | [ |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 195 | case $enableval in |
| 196 | yes) |
| 197 | enableval=/Library/Frameworks |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 198 | esac |
| 199 | case $enableval in |
| 200 | no) |
| 201 | PYTHONFRAMEWORK= |
| 202 | PYTHONFRAMEWORKDIR=no-framework |
| 203 | PYTHONFRAMEWORKPREFIX= |
| 204 | PYTHONFRAMEWORKINSTALLDIR= |
Ronald Oussoren | 567a8ff | 2006-05-26 11:43:26 +0000 | [diff] [blame] | 205 | FRAMEWORKINSTALLFIRST= |
| 206 | FRAMEWORKINSTALLLAST= |
Ronald Oussoren | 5b78732 | 2006-06-06 19:50:24 +0000 | [diff] [blame] | 207 | FRAMEWORKALTINSTALLFIRST= |
| 208 | FRAMEWORKALTINSTALLLAST= |
Ronald Oussoren | 2db3a8f | 2006-06-07 19:06:01 +0000 | [diff] [blame] | 209 | if test "x${prefix}" = "xNONE"; then |
| 210 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}" |
| 211 | else |
| 212 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}" |
| 213 | fi |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 214 | enable_framework= |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 215 | ;; |
| 216 | *) |
Ronald Oussoren | 01d149f | 2010-04-30 11:20:14 +0000 | [diff] [blame] | 217 | PYTHONFRAMEWORKPREFIX="${enableval}" |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 218 | PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR |
Ronald Oussoren | 567a8ff | 2006-05-26 11:43:26 +0000 | [diff] [blame] | 219 | FRAMEWORKINSTALLFIRST="frameworkinstallstructure" |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 220 | FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall" |
Ronald Oussoren | 92919a6 | 2009-12-24 13:30:58 +0000 | [diff] [blame] | 221 | FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools" |
| 222 | FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools" |
Ronald Oussoren | 01d149f | 2010-04-30 11:20:14 +0000 | [diff] [blame] | 223 | FRAMEWORKINSTALLAPPSPREFIX="/Applications" |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 224 | |
Ronald Oussoren | 2db3a8f | 2006-06-07 19:06:01 +0000 | [diff] [blame] | 225 | if test "x${prefix}" = "xNONE" ; then |
| 226 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}" |
Ronald Oussoren | 01d149f | 2010-04-30 11:20:14 +0000 | [diff] [blame] | 227 | |
Ronald Oussoren | 2db3a8f | 2006-06-07 19:06:01 +0000 | [diff] [blame] | 228 | else |
| 229 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}" |
| 230 | fi |
Ronald Oussoren | 01d149f | 2010-04-30 11:20:14 +0000 | [diff] [blame] | 231 | |
| 232 | case "${enableval}" in |
| 233 | /System*) |
| 234 | FRAMEWORKINSTALLAPPSPREFIX="/Applications" |
| 235 | if test "${prefix}" = "NONE" ; then |
| 236 | # See below |
| 237 | FRAMEWORKUNIXTOOLSPREFIX="/usr" |
| 238 | fi |
| 239 | ;; |
| 240 | |
| 241 | /Library*) |
| 242 | FRAMEWORKINSTALLAPPSPREFIX="/Applications" |
| 243 | ;; |
| 244 | |
| 245 | */Library/Frameworks) |
| 246 | MDIR="`dirname "${enableval}"`" |
| 247 | MDIR="`dirname "${MDIR}"`" |
| 248 | FRAMEWORKINSTALLAPPSPREFIX="${MDIR}/Applications" |
| 249 | |
| 250 | if test "${prefix}" = "NONE"; then |
| 251 | # User hasn't specified the |
| 252 | # --prefix option, but wants to install |
| 253 | # the framework in a non-default location, |
| 254 | # ensure that the compatibility links get |
| 255 | # installed relative to that prefix as well |
| 256 | # instead of in /usr/local. |
| 257 | FRAMEWORKUNIXTOOLSPREFIX="${MDIR}" |
| 258 | fi |
| 259 | ;; |
| 260 | |
| 261 | *) |
| 262 | FRAMEWORKINSTALLAPPSPREFIX="/Applications" |
| 263 | ;; |
| 264 | esac |
| 265 | |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 266 | prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION |
Ronald Oussoren | 836b039 | 2006-05-14 19:56:34 +0000 | [diff] [blame] | 267 | |
Ronald Oussoren | 580c7fe | 2008-05-02 19:45:11 +0000 | [diff] [blame] | 268 | # Add files for Mac specific code to the list of output |
Ronald Oussoren | 836b039 | 2006-05-14 19:56:34 +0000 | [diff] [blame] | 269 | # files: |
Ronald Oussoren | 2db3a8f | 2006-06-07 19:06:01 +0000 | [diff] [blame] | 270 | AC_CONFIG_FILES(Mac/Makefile) |
| 271 | AC_CONFIG_FILES(Mac/PythonLauncher/Makefile) |
| 272 | AC_CONFIG_FILES(Mac/IDLE/Makefile) |
Ronald Oussoren | 580c7fe | 2008-05-02 19:45:11 +0000 | [diff] [blame] | 273 | AC_CONFIG_FILES(Mac/Resources/framework/Info.plist) |
| 274 | AC_CONFIG_FILES(Mac/Resources/app/Info.plist) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 275 | esac |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 276 | ],[ |
| 277 | PYTHONFRAMEWORK= |
Jack Jansen | 127e56e | 2001-09-11 14:41:54 +0000 | [diff] [blame] | 278 | PYTHONFRAMEWORKDIR=no-framework |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 279 | PYTHONFRAMEWORKPREFIX= |
| 280 | PYTHONFRAMEWORKINSTALLDIR= |
Ronald Oussoren | 567a8ff | 2006-05-26 11:43:26 +0000 | [diff] [blame] | 281 | FRAMEWORKINSTALLFIRST= |
| 282 | FRAMEWORKINSTALLLAST= |
Ronald Oussoren | 5b78732 | 2006-06-06 19:50:24 +0000 | [diff] [blame] | 283 | FRAMEWORKALTINSTALLFIRST= |
| 284 | FRAMEWORKALTINSTALLLAST= |
Ronald Oussoren | 2db3a8f | 2006-06-07 19:06:01 +0000 | [diff] [blame] | 285 | if test "x${prefix}" = "xNONE" ; then |
| 286 | FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}" |
| 287 | else |
| 288 | FRAMEWORKUNIXTOOLSPREFIX="${prefix}" |
| 289 | fi |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 290 | enable_framework= |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 291 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 292 | ]) |
| 293 | AC_SUBST(PYTHONFRAMEWORK) |
Ronald Oussoren | 580c7fe | 2008-05-02 19:45:11 +0000 | [diff] [blame] | 294 | AC_SUBST(PYTHONFRAMEWORKIDENTIFIER) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 295 | AC_SUBST(PYTHONFRAMEWORKDIR) |
| 296 | AC_SUBST(PYTHONFRAMEWORKPREFIX) |
| 297 | AC_SUBST(PYTHONFRAMEWORKINSTALLDIR) |
Ronald Oussoren | 567a8ff | 2006-05-26 11:43:26 +0000 | [diff] [blame] | 298 | AC_SUBST(FRAMEWORKINSTALLFIRST) |
| 299 | AC_SUBST(FRAMEWORKINSTALLLAST) |
Ronald Oussoren | 5b78732 | 2006-06-06 19:50:24 +0000 | [diff] [blame] | 300 | AC_SUBST(FRAMEWORKALTINSTALLFIRST) |
| 301 | AC_SUBST(FRAMEWORKALTINSTALLLAST) |
| 302 | AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX) |
Ronald Oussoren | 01d149f | 2010-04-30 11:20:14 +0000 | [diff] [blame] | 303 | AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX) |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 304 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 305 | ##AC_ARG_WITH(dyld, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 306 | ## AS_HELP_STRING([--with-dyld], |
| 307 | ## [Use (OpenStep|Rhapsody) dynamic linker])) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 308 | ## |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 309 | # Set name for machine-dependent library files |
| 310 | AC_SUBST(MACHDEP) |
| 311 | AC_MSG_CHECKING(MACHDEP) |
| 312 | if test -z "$MACHDEP" |
| 313 | then |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 314 | # avoid using uname for cross builds |
| 315 | if test "$cross_compiling" = yes; then |
| 316 | # ac_sys_system and ac_sys_release are only used for setting |
| 317 | # `define_xopen_source' in the case statement below. For the |
| 318 | # current supported cross builds, this macro is not adjusted. |
| 319 | case "$host" in |
| 320 | *-*-linux*) |
| 321 | ac_sys_system=Linux |
| 322 | ;; |
| 323 | *-*-cygwin*) |
| 324 | ac_sys_system=Cygwin |
| 325 | ;; |
| 326 | *) |
| 327 | # for now, limit cross builds to known configurations |
| 328 | MACHDEP="unknown" |
| 329 | AC_MSG_ERROR([cross build not supported for $host]) |
| 330 | esac |
| 331 | ac_sys_release= |
| 332 | else |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 333 | ac_sys_system=`uname -s` |
Georg Brandl | fe18a11 | 2009-09-04 07:55:14 +0000 | [diff] [blame] | 334 | if test "$ac_sys_system" = "AIX" \ |
Martin v. Löwis | 21ee409 | 2002-09-30 16:19:48 +0000 | [diff] [blame] | 335 | -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 336 | ac_sys_release=`uname -v` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 337 | else |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 338 | ac_sys_release=`uname -r` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 339 | fi |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 340 | fi |
| 341 | ac_md_system=`echo $ac_sys_system | |
| 342 | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'` |
| 343 | ac_md_release=`echo $ac_sys_release | |
| 344 | tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'` |
| 345 | MACHDEP="$ac_md_system$ac_md_release" |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 346 | |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 347 | case $MACHDEP in |
Victor Stinner | acacbaa | 2011-08-20 14:02:38 +0200 | [diff] [blame] | 348 | linux*) MACHDEP="linux2";; |
Andrew M. Kuchling | 5a3e4cb | 2001-07-20 19:29:04 +0000 | [diff] [blame] | 349 | cygwin*) MACHDEP="cygwin";; |
Jack Jansen | 8a97f4a | 2001-12-05 23:27:32 +0000 | [diff] [blame] | 350 | darwin*) MACHDEP="darwin";; |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 351 | atheos*) MACHDEP="atheos";; |
Martin v. Löwis | f332228 | 2003-07-13 09:46:13 +0000 | [diff] [blame] | 352 | irix646) MACHDEP="irix6";; |
Guido van Rossum | b97ef17 | 1997-09-28 05:44:03 +0000 | [diff] [blame] | 353 | '') MACHDEP="unknown";; |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 354 | esac |
| 355 | fi |
| 356 | |
| 357 | AC_SUBST(_PYTHON_HOST_PLATFORM) |
| 358 | if test "$cross_compiling" = yes; then |
| 359 | case "$host" in |
| 360 | *-*-linux*) |
| 361 | case "$host_cpu" in |
| 362 | arm*) |
| 363 | _host_cpu=arm |
| 364 | ;; |
| 365 | *) |
| 366 | _host_cpu=$host_cpu |
| 367 | esac |
| 368 | ;; |
| 369 | *-*-cygwin*) |
| 370 | _host_cpu= |
| 371 | ;; |
| 372 | *) |
| 373 | # for now, limit cross builds to known configurations |
| 374 | MACHDEP="unknown" |
| 375 | AC_MSG_ERROR([cross build not supported for $host]) |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 376 | esac |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 377 | _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 378 | fi |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 379 | |
Martin v. Löwis | e981a4e | 2002-11-11 13:26:51 +0000 | [diff] [blame] | 380 | # Some systems cannot stand _XOPEN_SOURCE being defined at all; they |
| 381 | # disable features if it is defined, without any means to access these |
| 382 | # features as extensions. For these systems, we skip the definition of |
| 383 | # _XOPEN_SOURCE. Before adding a system to the list to gain access to |
| 384 | # some feature, make sure there is no alternative way to access this |
| 385 | # feature. Also, when using wildcards, make sure you have verified the |
| 386 | # need for not defining _XOPEN_SOURCE on all systems matching the |
| 387 | # wildcard, and that the wildcard does not include future systems |
| 388 | # (which may remove their limitations). |
| 389 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output |
| 390 | case $ac_sys_system/$ac_sys_release in |
| 391 | # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, |
| 392 | # even though select is a POSIX function. Reported by J. Ribbens. |
Martin v. Löwis | 76bafc6 | 2003-10-03 13:47:44 +0000 | [diff] [blame] | 393 | # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. |
Martin v. Löwis | 7875ef6 | 2010-02-15 21:41:12 +0000 | [diff] [blame] | 394 | # In addition, Stefan Krah confirms that issue #1244610 exists through |
| 395 | # OpenBSD 4.6, but is fixed in 4.7. |
Charles-François Natali | 97781b0 | 2011-07-22 23:43:42 +0200 | [diff] [blame] | 396 | OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.@<:@0123456@:>@) |
Martin v. Löwis | cb78de6 | 2007-12-29 18:49:21 +0000 | [diff] [blame] | 397 | define_xopen_source=no |
| 398 | # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is |
| 399 | # also defined. This can be overridden by defining _BSD_SOURCE |
| 400 | # As this has a different meaning on Linux, only define it on OpenBSD |
| 401 | AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features]) |
| 402 | ;; |
Charles-François Natali | 97781b0 | 2011-07-22 23:43:42 +0200 | [diff] [blame] | 403 | OpenBSD/*) |
Martin v. Löwis | 5e2dd86 | 2010-02-15 08:32:00 +0000 | [diff] [blame] | 404 | # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is |
| 405 | # also defined. This can be overridden by defining _BSD_SOURCE |
| 406 | # As this has a different meaning on Linux, only define it on OpenBSD |
| 407 | AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features]) |
| 408 | ;; |
Martin v. Löwis | 4d542ec | 2006-11-25 15:39:19 +0000 | [diff] [blame] | 409 | # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of |
| 410 | # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by |
| 411 | # Marc Recht |
Georg Brandl | 4b9bcfc | 2008-11-16 08:00:17 +0000 | [diff] [blame] | 412 | NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@) |
Martin v. Löwis | 4d542ec | 2006-11-25 15:39:19 +0000 | [diff] [blame] | 413 | define_xopen_source=no;; |
Martin v. Löwis | b41afb5 | 2010-05-28 15:28:47 +0000 | [diff] [blame] | 414 | # From the perspective of Solaris, _XOPEN_SOURCE is not so much a |
| 415 | # request to enable features supported by the standard as a request |
| 416 | # to disable features not supported by the standard. The best way |
| 417 | # for Python to use Solaris is simply to leave _XOPEN_SOURCE out |
| 418 | # entirely and define __EXTENSIONS__ instead. |
| 419 | SunOS/*) |
Martin v. Löwis | a9d7142 | 2003-03-28 18:43:31 +0000 | [diff] [blame] | 420 | define_xopen_source=no;; |
Martin v. Löwis | c2409b4 | 2003-05-11 05:53:41 +0000 | [diff] [blame] | 421 | # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE, |
| 422 | # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice. |
Martin v. Löwis | 253d1f4 | 2004-05-07 19:14:14 +0000 | [diff] [blame] | 423 | # Reconfirmed for 7.1.4 by Martin v. Loewis. |
| 424 | OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@) |
Martin v. Löwis | c2409b4 | 2003-05-11 05:53:41 +0000 | [diff] [blame] | 425 | define_xopen_source=no;; |
| 426 | # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE, |
Martin v. Löwis | 53e73c3 | 2003-05-05 05:13:18 +0000 | [diff] [blame] | 427 | # but used in struct sockaddr.sa_family. Reported by Tim Rice. |
Martin v. Löwis | c2409b4 | 2003-05-11 05:53:41 +0000 | [diff] [blame] | 428 | SCO_SV/3.2) |
Martin v. Löwis | 53e73c3 | 2003-05-05 05:13:18 +0000 | [diff] [blame] | 429 | define_xopen_source=no;; |
Martin v. Löwis | bb86d83 | 2008-11-04 20:40:09 +0000 | [diff] [blame] | 430 | # On FreeBSD 4, the math functions C89 does not cover are never defined |
| 431 | # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them. |
| 432 | FreeBSD/4.*) |
| 433 | define_xopen_source=no;; |
| 434 | # On MacOS X 10.2, a bug in ncurses.h means that it craps out if |
| 435 | # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which |
| 436 | # identifies itself as Darwin/7.* |
| 437 | # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE |
| 438 | # disables platform specific features beyond repair. |
| 439 | # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE |
| 440 | # has no effect, don't bother defining them |
| 441 | Darwin/@<:@6789@:>@.*) |
Anthony Baxter | 6169c6b | 2003-10-04 07:46:23 +0000 | [diff] [blame] | 442 | define_xopen_source=no;; |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 443 | Darwin/1@<:@0-9@:>@.*) |
| 444 | define_xopen_source=no;; |
Trent Mick | af16e8c | 2004-08-25 23:55:59 +0000 | [diff] [blame] | 445 | # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but |
| 446 | # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined |
| 447 | # or has another value. By not (re)defining it, the defaults come in place. |
Martin v. Löwis | c19c5a6 | 2003-11-18 20:00:44 +0000 | [diff] [blame] | 448 | AIX/4) |
| 449 | define_xopen_source=no;; |
Trent Mick | af16e8c | 2004-08-25 23:55:59 +0000 | [diff] [blame] | 450 | AIX/5) |
| 451 | if test `uname -r` -eq 1; then |
| 452 | define_xopen_source=no |
| 453 | fi |
| 454 | ;; |
Martin v. Löwis | 8c255e4 | 2008-05-23 15:06:50 +0000 | [diff] [blame] | 455 | # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from |
| 456 | # defining NI_NUMERICHOST. |
| 457 | QNX/6.3.2) |
| 458 | define_xopen_source=no |
| 459 | ;; |
Martin v. Löwis | a058836 | 2006-04-04 06:03:50 +0000 | [diff] [blame] | 460 | |
Martin v. Löwis | e981a4e | 2002-11-11 13:26:51 +0000 | [diff] [blame] | 461 | esac |
| 462 | |
| 463 | if test $define_xopen_source = yes |
| 464 | then |
Martin v. Löwis | b41afb5 | 2010-05-28 15:28:47 +0000 | [diff] [blame] | 465 | AC_DEFINE(_XOPEN_SOURCE, 600, |
| 466 | Define to the level of X/Open that your system supports) |
Martin v. Löwis | 678fc1e | 2002-11-12 06:04:39 +0000 | [diff] [blame] | 467 | |
| 468 | # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires |
| 469 | # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else |
| 470 | # several APIs are not declared. Since this is also needed in some |
| 471 | # cases for HP-UX, we define it globally. |
Martin v. Löwis | b41afb5 | 2010-05-28 15:28:47 +0000 | [diff] [blame] | 472 | AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, |
| 473 | Define to activate Unix95-and-earlier features) |
Martin v. Löwis | 678fc1e | 2002-11-12 06:04:39 +0000 | [diff] [blame] | 474 | |
Bob Ippolito | 7026a0a | 2005-03-28 23:23:47 +0000 | [diff] [blame] | 475 | AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001) |
| 476 | |
Martin v. Löwis | e981a4e | 2002-11-11 13:26:51 +0000 | [diff] [blame] | 477 | fi |
| 478 | |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 479 | # |
| 480 | # SGI compilers allow the specification of the both the ABI and the |
| 481 | # ISA on the command line. Depending on the values of these switches, |
| 482 | # different and often incompatable code will be generated. |
| 483 | # |
| 484 | # The SGI_ABI variable can be used to modify the CC and LDFLAGS and |
| 485 | # thus supply support for various ABI/ISA combinations. The MACHDEP |
| 486 | # variable is also adjusted. |
| 487 | # |
| 488 | AC_SUBST(SGI_ABI) |
| 489 | if test ! -z "$SGI_ABI" |
| 490 | then |
| 491 | CC="cc $SGI_ABI" |
| 492 | LDFLAGS="$SGI_ABI $LDFLAGS" |
| 493 | MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` |
| 494 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 495 | AC_MSG_RESULT($MACHDEP) |
| 496 | |
doko@ubuntu.com | 9e7ece2 | 2015-04-13 21:55:08 +0200 | [diff] [blame] | 497 | AC_SUBST(PLATDIR) |
| 498 | PLATDIR=plat-$MACHDEP |
| 499 | |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 500 | # And add extra plat-mac for darwin |
| 501 | AC_SUBST(EXTRAPLATDIR) |
Jack Jansen | 7b59b42 | 2003-03-17 15:44:10 +0000 | [diff] [blame] | 502 | AC_SUBST(EXTRAMACHDEPPATH) |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 503 | AC_MSG_CHECKING(EXTRAPLATDIR) |
| 504 | if test -z "$EXTRAPLATDIR" |
| 505 | then |
| 506 | case $MACHDEP in |
Jack Jansen | 7b59b42 | 2003-03-17 15:44:10 +0000 | [diff] [blame] | 507 | darwin) |
| 508 | EXTRAPLATDIR="\$(PLATMACDIRS)" |
| 509 | EXTRAMACHDEPPATH="\$(PLATMACPATH)" |
| 510 | ;; |
| 511 | *) |
| 512 | EXTRAPLATDIR="" |
| 513 | EXTRAMACHDEPPATH="" |
| 514 | ;; |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 515 | esac |
| 516 | fi |
| 517 | AC_MSG_RESULT($EXTRAPLATDIR) |
| 518 | |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 519 | # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, |
| 520 | # it may influence the way we can build extensions, so distutils |
| 521 | # needs to check it |
| 522 | AC_SUBST(CONFIGURE_MACOSX_DEPLOYMENT_TARGET) |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 523 | AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET) |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 524 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET= |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 525 | EXPORT_MACOSX_DEPLOYMENT_TARGET='#' |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 526 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 527 | # checks for alternative programs |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 528 | |
| 529 | # compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just |
| 530 | # for debug/optimization stuff. BASECFLAGS is for flags that are required |
| 531 | # just to get things to compile and link. Users are free to override OPT |
| 532 | # when running configure or make. The build should not break if they do. |
| 533 | # BASECFLAGS should generally not be messed with, however. |
| 534 | |
| 535 | # XXX shouldn't some/most/all of this code be merged with the stuff later |
| 536 | # on that fiddles with OPT and BASECFLAGS? |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 537 | AC_MSG_CHECKING(for --without-gcc) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 538 | AC_ARG_WITH(gcc, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 539 | AS_HELP_STRING([--without-gcc], [never use gcc]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 540 | [ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 541 | case $withval in |
Skip Montanaro | 516144f | 2009-01-04 10:36:58 +0000 | [diff] [blame] | 542 | no) CC=${CC:-cc} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 543 | without_gcc=yes;; |
| 544 | yes) CC=gcc |
| 545 | without_gcc=no;; |
| 546 | *) CC=$withval |
| 547 | without_gcc=$withval;; |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 548 | esac], [ |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 549 | case $ac_sys_system in |
Antoine Pitrou | 285cd16 | 2010-09-21 15:23:17 +0000 | [diff] [blame] | 550 | AIX*) CC=${CC:-xlc_r} |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 551 | without_gcc=;; |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 552 | BeOS*) |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 553 | case $BE_HOST_CPU in |
| 554 | ppc) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 555 | CC=mwcc |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 556 | without_gcc=yes |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 557 | BASECFLAGS="$BASECFLAGS -export pragma" |
| 558 | OPT="$OPT -O" |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 559 | LDFLAGS="$LDFLAGS -nodup" |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 560 | ;; |
| 561 | x86) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 562 | CC=gcc |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 563 | without_gcc=no |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 564 | OPT="$OPT -O" |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 565 | ;; |
| 566 | *) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 567 | AC_MSG_ERROR([Unknown BeOS platform "$BE_HOST_CPU"]) |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 568 | ;; |
| 569 | esac |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 570 | AR="\$(srcdir)/Modules/ar_beos" |
| 571 | RANLIB=: |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 572 | ;; |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 573 | *) without_gcc=no;; |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 574 | esac]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 575 | AC_MSG_RESULT($without_gcc) |
| 576 | |
Zachary Ware | 6ed42ea | 2015-12-21 11:43:03 -0600 | [diff] [blame] | 577 | AC_MSG_CHECKING(for --with-icc) |
| 578 | AC_ARG_WITH(icc, |
| 579 | AS_HELP_STRING([--with-icc], [build with icc]), |
| 580 | [ |
| 581 | case $withval in |
| 582 | no) CC=${CC:-cc} |
| 583 | with_icc=no;; |
| 584 | yes) CC=icc |
| 585 | CXX=icpc |
| 586 | with_icc=yes;; |
| 587 | *) CC=$withval |
| 588 | with_icc=$withval;; |
| 589 | esac], [ |
| 590 | with_icc=no]) |
| 591 | AC_MSG_RESULT($with_icc) |
| 592 | |
Guido van Rossum | 03ad99f | 1995-03-09 14:09:54 +0000 | [diff] [blame] | 593 | # If the user switches compilers, we can't believe the cache |
| 594 | if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" |
| 595 | then |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 596 | AC_MSG_ERROR([cached CC is different -- throw away $cache_file |
| 597 | (it is also a good idea to do 'make clean' before compiling)]) |
Guido van Rossum | 03ad99f | 1995-03-09 14:09:54 +0000 | [diff] [blame] | 598 | fi |
| 599 | |
Trent Nelson | 15daa35 | 2012-12-13 06:46:39 +0000 | [diff] [blame] | 600 | if test "$MACHDEP" = "irix6" && test "$CC" != "gcc"; then |
| 601 | # Normally, MIPSpro CC treats #error directives as warnings, which means |
| 602 | # a successful exit code is returned (0). This is a problem because IRIX |
| 603 | # has a bunch of system headers with this guard at the top: |
| 604 | # |
| 605 | # #ifndef __c99 |
| 606 | # #error This header file is to be used only for c99 mode compilations |
| 607 | # #else |
| 608 | # |
| 609 | # When autoconf tests for such a header, like stdint.h, this happens: |
| 610 | # |
| 611 | # configure:4619: cc -c conftest.c >&5 |
| 612 | # cc-1035 cc: WARNING File = /usr/include/stdint.h, Line = 5 |
| 613 | # #error directive: This header file is to be used only for c99 mode |
| 614 | # compilations |
| 615 | # |
| 616 | # #error This header file is to be used only for c99 mode compilations |
| 617 | # ^ |
| 618 | # |
| 619 | # configure:4619: $? = 0 |
| 620 | # configure:4619: result: yes |
| 621 | # |
| 622 | # Therefore, we use `-diag_error 1035` to have the compiler treat the |
| 623 | # warning as an error, which causes cc to return a non-zero result, |
| 624 | # which autoconf can interpret correctly. |
| 625 | CFLAGS="$CFLAGS -diag_error 1035" |
| 626 | # Whilst we're here, we might as well make sure CXX defaults to something |
| 627 | # sensible if we're not using gcc. |
| 628 | if test -z "$CXX"; then |
| 629 | CXX="CC" |
| 630 | fi |
| 631 | fi |
| 632 | |
Marc-André Lemburg | 6d5e579 | 2010-04-30 17:20:14 +0000 | [diff] [blame] | 633 | # If the user set CFLAGS, use this instead of the automatically |
| 634 | # determined setting |
| 635 | preset_cflags="$CFLAGS" |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 636 | AC_PROG_CC |
Marc-André Lemburg | 6d5e579 | 2010-04-30 17:20:14 +0000 | [diff] [blame] | 637 | if test ! -z "$preset_cflags" |
| 638 | then |
| 639 | CFLAGS=$preset_cflags |
| 640 | fi |
Martin v. Löwis | 1d5ecb7 | 2001-08-09 10:29:44 +0000 | [diff] [blame] | 641 | |
Martin v. Löwis | 0f48d98 | 2006-04-14 14:34:26 +0000 | [diff] [blame] | 642 | AC_SUBST(CXX) |
| 643 | AC_SUBST(MAINCC) |
| 644 | AC_MSG_CHECKING(for --with-cxx-main=<compiler>) |
| 645 | AC_ARG_WITH(cxx_main, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 646 | AS_HELP_STRING([--with-cxx-main=<compiler>], |
Martin v. Löwis | 0f48d98 | 2006-04-14 14:34:26 +0000 | [diff] [blame] | 647 | [compile main() and link python executable with C++ compiler]), |
| 648 | [ |
| 649 | |
| 650 | case $withval in |
| 651 | no) with_cxx_main=no |
| 652 | MAINCC='$(CC)';; |
| 653 | yes) with_cxx_main=yes |
| 654 | MAINCC='$(CXX)';; |
| 655 | *) with_cxx_main=yes |
| 656 | MAINCC=$withval |
| 657 | if test -z "$CXX" |
| 658 | then |
| 659 | CXX=$withval |
| 660 | fi;; |
| 661 | esac], [ |
| 662 | with_cxx_main=no |
| 663 | MAINCC='$(CC)' |
| 664 | ]) |
| 665 | AC_MSG_RESULT($with_cxx_main) |
| 666 | |
| 667 | preset_cxx="$CXX" |
| 668 | if test -z "$CXX" |
| 669 | then |
| 670 | case "$CC" in |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 671 | gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;; |
| 672 | cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;; |
Martin v. Löwis | 0f48d98 | 2006-04-14 14:34:26 +0000 | [diff] [blame] | 673 | esac |
| 674 | if test "$CXX" = "notfound" |
| 675 | then |
| 676 | CXX="" |
| 677 | fi |
| 678 | fi |
| 679 | if test -z "$CXX" |
| 680 | then |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 681 | AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound) |
Martin v. Löwis | 0f48d98 | 2006-04-14 14:34:26 +0000 | [diff] [blame] | 682 | if test "$CXX" = "notfound" |
| 683 | then |
| 684 | CXX="" |
| 685 | fi |
| 686 | fi |
| 687 | if test "$preset_cxx" != "$CXX" |
| 688 | then |
| 689 | AC_MSG_WARN([ |
| 690 | |
| 691 | By default, distutils will build C++ extension modules with "$CXX". |
| 692 | If this is not intended, then set CXX on the configure command line. |
| 693 | ]) |
| 694 | fi |
| 695 | |
doko@python.org | 4e63fbe | 2013-01-25 13:08:27 +0100 | [diff] [blame] | 696 | MULTIARCH=$($CC --print-multiarch 2>/dev/null) |
| 697 | AC_SUBST(MULTIARCH) |
| 698 | |
Martin v. Löwis | 0f48d98 | 2006-04-14 14:34:26 +0000 | [diff] [blame] | 699 | |
Martin v. Löwis | 1d5ecb7 | 2001-08-09 10:29:44 +0000 | [diff] [blame] | 700 | # checks for UNIX variants that set C preprocessor variables |
Matthias Klose | 9f8e0c1 | 2010-05-08 10:17:27 +0000 | [diff] [blame] | 701 | AC_USE_SYSTEM_EXTENSIONS |
Martin v. Löwis | 1d5ecb7 | 2001-08-09 10:29:44 +0000 | [diff] [blame] | 702 | |
Martin v. Löwis | 779ffc0 | 2002-12-02 22:17:01 +0000 | [diff] [blame] | 703 | # Check for unsupported systems |
| 704 | case $ac_sys_system/$ac_sys_release in |
Brett Cannon | 19fab76 | 2007-06-02 03:02:29 +0000 | [diff] [blame] | 705 | atheos*|Linux*/1*) |
Martin v. Löwis | 779ffc0 | 2002-12-02 22:17:01 +0000 | [diff] [blame] | 706 | echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. |
| 707 | echo See README for details. |
| 708 | exit 1;; |
| 709 | esac |
| 710 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 711 | AC_EXEEXT |
Neil Schemenauer | 3ae1d0a | 2001-01-27 06:54:42 +0000 | [diff] [blame] | 712 | AC_MSG_CHECKING(for --with-suffix) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 713 | AC_ARG_WITH(suffix, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 714 | AS_HELP_STRING([--with-suffix=.exe], [set executable suffix]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 715 | [ |
Neil Schemenauer | 3ae1d0a | 2001-01-27 06:54:42 +0000 | [diff] [blame] | 716 | case $withval in |
| 717 | no) EXEEXT=;; |
| 718 | yes) EXEEXT=.exe;; |
| 719 | *) EXEEXT=$withval;; |
| 720 | esac]) |
| 721 | AC_MSG_RESULT($EXEEXT) |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 722 | |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 723 | # Test whether we're running on a non-case-sensitive system, in which |
| 724 | # case we give a warning if no ext is given |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 725 | AC_SUBST(BUILDEXEEXT) |
| 726 | AC_MSG_CHECKING(for case-insensitive build directory) |
Jack Jansen | 3c2c433 | 2002-11-06 13:33:32 +0000 | [diff] [blame] | 727 | if test ! -d CaseSensitiveTestDir; then |
| 728 | mkdir CaseSensitiveTestDir |
| 729 | fi |
| 730 | |
| 731 | if test -d casesensitivetestdir |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 732 | then |
Jack Jansen | 1999ef4 | 2001-12-06 21:47:20 +0000 | [diff] [blame] | 733 | AC_MSG_RESULT(yes) |
| 734 | BUILDEXEEXT=.exe |
| 735 | else |
| 736 | AC_MSG_RESULT(no) |
Jack Jansen | dd19cf8 | 2001-12-06 22:36:17 +0000 | [diff] [blame] | 737 | BUILDEXEEXT=$EXEEXT |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 738 | fi |
Jack Jansen | 3c2c433 | 2002-11-06 13:33:32 +0000 | [diff] [blame] | 739 | rmdir CaseSensitiveTestDir |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 740 | |
Guido van Rossum | dd997f7 | 1998-10-07 19:58:26 +0000 | [diff] [blame] | 741 | case $MACHDEP in |
| 742 | bsdos*) |
| 743 | case $CC in |
| 744 | gcc) CC="$CC -D_HAVE_BSDI";; |
| 745 | esac;; |
| 746 | esac |
| 747 | |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 748 | case $ac_sys_system in |
| 749 | hp*|HP*) |
| 750 | case $CC in |
Guido van Rossum | cd5ff9f | 2000-09-22 16:15:54 +0000 | [diff] [blame] | 751 | cc|*/cc) CC="$CC -Ae";; |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 752 | esac;; |
Martin v. Löwis | e8964d4 | 2001-03-06 12:09:07 +0000 | [diff] [blame] | 753 | SunOS*) |
| 754 | # Some functions have a prototype only with that define, e.g. confstr |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 755 | AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.]) |
Martin v. Löwis | e8964d4 | 2001-03-06 12:09:07 +0000 | [diff] [blame] | 756 | ;; |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 757 | esac |
| 758 | |
Martin v. Löwis | e8964d4 | 2001-03-06 12:09:07 +0000 | [diff] [blame] | 759 | |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 760 | AC_SUBST(LIBRARY) |
| 761 | AC_MSG_CHECKING(LIBRARY) |
| 762 | if test -z "$LIBRARY" |
| 763 | then |
| 764 | LIBRARY='libpython$(VERSION).a' |
| 765 | fi |
| 766 | AC_MSG_RESULT($LIBRARY) |
| 767 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 768 | # LDLIBRARY is the name of the library to link against (as opposed to the |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 769 | # name of the library into which to insert object files). BLDLIBRARY is also |
| 770 | # the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY |
| 771 | # is blank as the main program is not linked directly against LDLIBRARY. |
| 772 | # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On |
| 773 | # systems without shared libraries, LDLIBRARY is the same as LIBRARY |
| 774 | # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library, |
| 775 | # DLLLIBRARY is the shared (i.e., DLL) library. |
| 776 | # |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 777 | # RUNSHARED is used to run shared python without installed libraries |
| 778 | # |
| 779 | # INSTSONAME is the name of the shared library that will be use to install |
| 780 | # on the system - some systems like version suffix, others don't |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 781 | AC_SUBST(LDLIBRARY) |
Guido van Rossum | 2755290 | 2001-01-23 01:52:26 +0000 | [diff] [blame] | 782 | AC_SUBST(DLLLIBRARY) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 783 | AC_SUBST(BLDLIBRARY) |
| 784 | AC_SUBST(LDLIBRARYDIR) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 785 | AC_SUBST(INSTSONAME) |
| 786 | AC_SUBST(RUNSHARED) |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 787 | LDLIBRARY="$LIBRARY" |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 788 | BLDLIBRARY='$(LDLIBRARY)' |
Martin v. Löwis | 09bdf72 | 2002-05-08 08:51:29 +0000 | [diff] [blame] | 789 | INSTSONAME='$(LDLIBRARY)' |
Guido van Rossum | 2755290 | 2001-01-23 01:52:26 +0000 | [diff] [blame] | 790 | DLLLIBRARY='' |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 791 | LDLIBRARYDIR='' |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 792 | RUNSHARED='' |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 793 | |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 794 | # LINKCC is the command that links the python executable -- default is $(CC). |
Martin v. Löwis | b7da67a | 2001-10-18 15:35:38 +0000 | [diff] [blame] | 795 | # If CXX is set, and if it is needed to link a main function that was |
| 796 | # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable: |
| 797 | # python might then depend on the C++ runtime |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 798 | # This is altered for AIX in order to build the export list before |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 799 | # linking. |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 800 | AC_SUBST(LINKCC) |
| 801 | AC_MSG_CHECKING(LINKCC) |
| 802 | if test -z "$LINKCC" |
| 803 | then |
Martin v. Löwis | 0f48d98 | 2006-04-14 14:34:26 +0000 | [diff] [blame] | 804 | LINKCC='$(PURIFY) $(MAINCC)' |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 805 | case $ac_sys_system in |
| 806 | AIX*) |
Neal Norwitz | 0b27ff9 | 2003-03-31 15:53:49 +0000 | [diff] [blame] | 807 | exp_extra="\"\"" |
| 808 | if test $ac_sys_release -ge 5 -o \ |
| 809 | $ac_sys_release -eq 4 -a `uname -r` -ge 2 ; then |
| 810 | exp_extra="." |
| 811 | fi |
| 812 | LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; |
Martin v. Löwis | 8c255e4 | 2008-05-23 15:06:50 +0000 | [diff] [blame] | 813 | QNX*) |
| 814 | # qcc must be used because the other compilers do not |
| 815 | # support -N. |
| 816 | LINKCC=qcc;; |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 817 | esac |
| 818 | fi |
| 819 | AC_MSG_RESULT($LINKCC) |
| 820 | |
Tarek Ziadé | e2be83d | 2009-05-09 08:28:53 +0000 | [diff] [blame] | 821 | # GNULD is set to "yes" if the GNU linker is used. If this goes wrong |
| 822 | # make sure we default having it set to "no": this is used by |
| 823 | # distutils.unixccompiler to know if it should add --enable-new-dtags |
| 824 | # to linker command lines, and failing to detect GNU ld simply results |
| 825 | # in the same bahaviour as before. |
| 826 | AC_SUBST(GNULD) |
| 827 | AC_MSG_CHECKING(for GNU ld) |
| 828 | ac_prog=ld |
| 829 | if test "$GCC" = yes; then |
| 830 | ac_prog=`$CC -print-prog-name=ld` |
| 831 | fi |
| 832 | case `"$ac_prog" -V 2>&1 < /dev/null` in |
| 833 | *GNU*) |
| 834 | GNULD=yes;; |
| 835 | *) |
| 836 | GNULD=no;; |
| 837 | esac |
| 838 | AC_MSG_RESULT($GNULD) |
| 839 | |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 840 | AC_MSG_CHECKING(for --enable-shared) |
| 841 | AC_ARG_ENABLE(shared, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 842 | AS_HELP_STRING([--enable-shared], [disable/enable building shared python library])) |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 843 | |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 844 | if test -z "$enable_shared" |
| 845 | then |
Martin v. Löwis | b51033d | 2002-05-03 05:53:15 +0000 | [diff] [blame] | 846 | case $ac_sys_system in |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 847 | CYGWIN* | atheos*) |
Martin v. Löwis | b51033d | 2002-05-03 05:53:15 +0000 | [diff] [blame] | 848 | enable_shared="yes";; |
| 849 | *) |
| 850 | enable_shared="no";; |
| 851 | esac |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 852 | fi |
| 853 | AC_MSG_RESULT($enable_shared) |
| 854 | |
Skip Montanaro | 56f6a4f | 2004-06-18 02:47:22 +0000 | [diff] [blame] | 855 | AC_MSG_CHECKING(for --enable-profiling) |
| 856 | AC_ARG_ENABLE(profiling, |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 857 | AS_HELP_STRING([--enable-profiling], [enable C-level code profiling])) |
| 858 | if test "x$enable_profiling" = xyes; then |
| 859 | ac_save_cc="$CC" |
Benjamin Peterson | b9be7bb | 2013-03-26 08:55:37 -0400 | [diff] [blame] | 860 | CC="$CC -pg" |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 861 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], |
| 862 | [], |
| 863 | [enable_profiling=no]) |
| 864 | CC="$ac_save_cc" |
| 865 | else |
| 866 | enable_profiling=no |
| 867 | fi |
| 868 | AC_MSG_RESULT($enable_profiling) |
Skip Montanaro | 56f6a4f | 2004-06-18 02:47:22 +0000 | [diff] [blame] | 869 | |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 870 | if test "x$enable_profiling" = xyes; then |
| 871 | BASECFLAGS="-pg $BASECFLAGS" |
| 872 | LDFLAGS="-pg $LDFLAGS" |
| 873 | fi |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 874 | |
| 875 | AC_MSG_CHECKING(LDLIBRARY) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 876 | |
Guido van Rossum | b855216 | 2001-09-05 14:58:11 +0000 | [diff] [blame] | 877 | # MacOSX framework builds need more magic. LDLIBRARY is the dynamic |
| 878 | # library that we build, but we do not want to link against it (we |
| 879 | # will find it with a -framework option). For this reason there is an |
| 880 | # extra variable BLDLIBRARY against which Python and the extension |
| 881 | # modules are linked, BLDLIBRARY. This is normally the same as |
| 882 | # LDLIBRARY, but empty for MacOSX framework builds. |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 883 | if test "$enable_framework" |
| 884 | then |
| 885 | LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
doko@ubuntu.com | 9ba90c9 | 2014-05-07 04:41:26 +0200 | [diff] [blame] | 886 | RUNSHARED=DYLD_FRAMEWORK_PATH=`pwd`${DYLD_FRAMEWORK_PATH:+:${DYLD_FRAMEWORK_PATH}} |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 887 | BLDLIBRARY='' |
| 888 | else |
| 889 | BLDLIBRARY='$(LDLIBRARY)' |
| 890 | fi |
| 891 | |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 892 | # Other platforms follow |
| 893 | if test $enable_shared = "yes"; then |
Mark Hammond | 8235ea1 | 2002-07-19 06:55:41 +0000 | [diff] [blame] | 894 | AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.]) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 895 | case $ac_sys_system in |
| 896 | BeOS*) |
| 897 | LDLIBRARY='libpython$(VERSION).so' |
| 898 | ;; |
| 899 | CYGWIN*) |
| 900 | LDLIBRARY='libpython$(VERSION).dll.a' |
| 901 | DLLLIBRARY='libpython$(VERSION).dll' |
| 902 | ;; |
| 903 | SunOS*) |
| 904 | LDLIBRARY='libpython$(VERSION).so' |
Martin v. Löwis | d141a8c | 2003-06-14 15:20:28 +0000 | [diff] [blame] | 905 | BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' |
doko@ubuntu.com | 9ba90c9 | 2014-05-07 04:41:26 +0200 | [diff] [blame] | 906 | RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
Martin v. Löwis | 2389c41 | 2003-10-31 15:42:07 +0000 | [diff] [blame] | 907 | INSTSONAME="$LDLIBRARY".$SOVERSION |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 908 | ;; |
Charles-François Natali | 3de8c73 | 2011-07-24 22:33:35 +0200 | [diff] [blame] | 909 | Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 910 | LDLIBRARY='libpython$(VERSION).so' |
| 911 | BLDLIBRARY='-L. -lpython$(VERSION)' |
doko@ubuntu.com | 9ba90c9 | 2014-05-07 04:41:26 +0200 | [diff] [blame] | 912 | RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
Hye-Shik Chang | 3376149 | 2004-10-26 09:53:46 +0000 | [diff] [blame] | 913 | case $ac_sys_system in |
| 914 | FreeBSD*) |
| 915 | SOVERSION=`echo $SOVERSION|cut -d "." -f 1` |
| 916 | ;; |
| 917 | esac |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 918 | INSTSONAME="$LDLIBRARY".$SOVERSION |
| 919 | ;; |
| 920 | hp*|HP*) |
Neal Norwitz | 58e2888 | 2006-05-19 07:00:58 +0000 | [diff] [blame] | 921 | case `uname -m` in |
| 922 | ia64) |
| 923 | LDLIBRARY='libpython$(VERSION).so' |
| 924 | ;; |
| 925 | *) |
| 926 | LDLIBRARY='libpython$(VERSION).sl' |
| 927 | ;; |
| 928 | esac |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 929 | BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)' |
doko@ubuntu.com | 9ba90c9 | 2014-05-07 04:41:26 +0200 | [diff] [blame] | 930 | RUNSHARED=SHLIB_PATH=`pwd`${SHLIB_PATH:+:${SHLIB_PATH}} |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 931 | ;; |
| 932 | OSF*) |
| 933 | LDLIBRARY='libpython$(VERSION).so' |
Neal Norwitz | 671b9e3 | 2006-01-09 07:07:12 +0000 | [diff] [blame] | 934 | BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)' |
doko@ubuntu.com | 9ba90c9 | 2014-05-07 04:41:26 +0200 | [diff] [blame] | 935 | RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 936 | ;; |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 937 | atheos*) |
| 938 | LDLIBRARY='libpython$(VERSION).so' |
| 939 | BLDLIBRARY='-L. -lpython$(VERSION)' |
| 940 | RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} |
| 941 | ;; |
Ronald Oussoren | 79f9049 | 2009-01-02 10:44:46 +0000 | [diff] [blame] | 942 | Darwin*) |
| 943 | LDLIBRARY='libpython$(VERSION).dylib' |
| 944 | BLDLIBRARY='-L. -lpython$(VERSION)' |
doko@ubuntu.com | 9ba90c9 | 2014-05-07 04:41:26 +0200 | [diff] [blame] | 945 | RUNSHARED=DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}} |
Ronald Oussoren | 79f9049 | 2009-01-02 10:44:46 +0000 | [diff] [blame] | 946 | ;; |
Antoine Pitrou | aabdceb | 2010-09-10 20:03:17 +0000 | [diff] [blame] | 947 | AIX*) |
| 948 | LDLIBRARY='libpython$(VERSION).so' |
doko@ubuntu.com | 9ba90c9 | 2014-05-07 04:41:26 +0200 | [diff] [blame] | 949 | RUNSHARED=LIBPATH=`pwd`${LIBPATH:+:${LIBPATH}} |
Antoine Pitrou | aabdceb | 2010-09-10 20:03:17 +0000 | [diff] [blame] | 950 | ;; |
Ronald Oussoren | 79f9049 | 2009-01-02 10:44:46 +0000 | [diff] [blame] | 951 | |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 952 | esac |
Jason Tishler | 3076559 | 2003-09-04 11:04:06 +0000 | [diff] [blame] | 953 | else # shared is disabled |
| 954 | case $ac_sys_system in |
| 955 | CYGWIN*) |
| 956 | BLDLIBRARY='$(LIBRARY)' |
| 957 | LDLIBRARY='libpython$(VERSION).dll.a' |
| 958 | ;; |
| 959 | esac |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 960 | fi |
| 961 | |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 962 | if test "$cross_compiling" = yes; then |
| 963 | RUNSHARED= |
| 964 | fi |
| 965 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 966 | AC_MSG_RESULT($LDLIBRARY) |
| 967 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 968 | AC_PROG_RANLIB |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 969 | AC_SUBST(AR) |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 970 | AC_CHECK_TOOLS(AR, ar aal, ar) |
Neil Schemenauer | a42c827 | 2001-03-31 00:01:55 +0000 | [diff] [blame] | 971 | |
Tarek Ziadé | 99f660a | 2009-05-07 21:20:34 +0000 | [diff] [blame] | 972 | # tweak ARFLAGS only if the user didn't set it on the command line |
| 973 | AC_SUBST(ARFLAGS) |
| 974 | if test -z "$ARFLAGS" |
| 975 | then |
| 976 | ARFLAGS="rc" |
| 977 | fi |
| 978 | |
Martin v. Löwis | dea59e5 | 2006-01-05 10:00:36 +0000 | [diff] [blame] | 979 | AC_SUBST(SVNVERSION) |
Martin v. Löwis | ff60023 | 2006-04-03 19:12:32 +0000 | [diff] [blame] | 980 | AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found) |
Martin v. Löwis | c5bf5a0 | 2006-01-05 10:33:59 +0000 | [diff] [blame] | 981 | if test $SVNVERSION = found |
| 982 | then |
| 983 | SVNVERSION="svnversion \$(srcdir)" |
| 984 | else |
Benjamin Peterson | e5afa3b | 2009-05-23 19:24:37 +0000 | [diff] [blame] | 985 | SVNVERSION="echo Unversioned directory" |
Martin v. Löwis | c5bf5a0 | 2006-01-05 10:33:59 +0000 | [diff] [blame] | 986 | fi |
Martin v. Löwis | dea59e5 | 2006-01-05 10:00:36 +0000 | [diff] [blame] | 987 | |
Trent Nelson | d86ceec | 2012-10-16 09:42:45 -0400 | [diff] [blame] | 988 | AC_SUBST(BASECPPFLAGS) |
Trent Nelson | abf2051 | 2012-10-17 04:32:49 -0400 | [diff] [blame] | 989 | if test "$abs_srcdir" != "$abs_builddir"; then |
Trent Nelson | d86ceec | 2012-10-16 09:42:45 -0400 | [diff] [blame] | 990 | # If we're building out-of-tree make sure Include (in the current dir) |
| 991 | # gets picked up before its $srcdir counterpart in order for Python-ast.h |
| 992 | # and graminit.h to get picked up from the correct directory. |
| 993 | # (A side effect of this is that these resources will automatically be |
| 994 | # regenerated when building out-of-tree, regardless of whether or not |
| 995 | # the $srcdir counterpart is up-to-date. This is an acceptable trade |
| 996 | # off.) |
| 997 | BASECPPFLAGS="-IInclude" |
| 998 | else |
| 999 | BASECPPFLAGS="" |
| 1000 | fi |
| 1001 | |
Georg Brandl | 3a5508e | 2011-03-06 10:42:21 +0100 | [diff] [blame] | 1002 | AC_SUBST(HGVERSION) |
| 1003 | AC_SUBST(HGTAG) |
| 1004 | AC_SUBST(HGBRANCH) |
| 1005 | AC_CHECK_PROG(HAS_HG, hg, found, not-found) |
| 1006 | if test $HAS_HG = found |
| 1007 | then |
| 1008 | HGVERSION="hg id -i \$(srcdir)" |
| 1009 | HGTAG="hg id -t \$(srcdir)" |
| 1010 | HGBRANCH="hg id -b \$(srcdir)" |
| 1011 | else |
| 1012 | HGVERSION="" |
| 1013 | HGTAG="" |
| 1014 | HGBRANCH="" |
| 1015 | fi |
| 1016 | |
Neil Schemenauer | a42c827 | 2001-03-31 00:01:55 +0000 | [diff] [blame] | 1017 | case $MACHDEP in |
Neil Schemenauer | af5567f | 2001-10-21 22:32:04 +0000 | [diff] [blame] | 1018 | bsdos*|hp*|HP*) |
| 1019 | # install -d does not work on BSDI or HP-UX |
Neil Schemenauer | a42c827 | 2001-03-31 00:01:55 +0000 | [diff] [blame] | 1020 | if test -z "$INSTALL" |
| 1021 | then |
| 1022 | INSTALL="${srcdir}/install-sh -c" |
| 1023 | fi |
| 1024 | esac |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 1025 | AC_PROG_INSTALL |
Trent Nelson | f6407a1 | 2012-08-30 14:56:13 +0000 | [diff] [blame] | 1026 | AC_PROG_MKDIR_P |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 1027 | |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 1028 | # Not every filesystem supports hard links |
| 1029 | AC_SUBST(LN) |
| 1030 | if test -z "$LN" ; then |
| 1031 | case $ac_sys_system in |
| 1032 | BeOS*) LN="ln -s";; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 1033 | CYGWIN*) LN="ln -s";; |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 1034 | atheos*) LN="ln -s";; |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 1035 | *) LN=ln;; |
| 1036 | esac |
| 1037 | fi |
| 1038 | |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 1039 | # Check for --with-pydebug |
| 1040 | AC_MSG_CHECKING(for --with-pydebug) |
| 1041 | AC_ARG_WITH(pydebug, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 1042 | AS_HELP_STRING([--with-pydebug], [build with Py_DEBUG defined]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 1043 | [ |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 1044 | if test "$withval" != no |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1045 | then |
| 1046 | AC_DEFINE(Py_DEBUG, 1, |
| 1047 | [Define if you want to build an interpreter with many run-time checks.]) |
| 1048 | AC_MSG_RESULT(yes); |
| 1049 | Py_DEBUG='true' |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 1050 | else AC_MSG_RESULT(no); Py_DEBUG='false' |
| 1051 | fi], |
| 1052 | [AC_MSG_RESULT(no)]) |
| 1053 | |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1054 | # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be |
| 1055 | # merged with this chunk of code? |
| 1056 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 1057 | # Optimizer/debugger flags |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1058 | # ------------------------ |
| 1059 | # (The following bit of code is complicated enough - please keep things |
| 1060 | # indented properly. Just pretend you're editing Python code. ;-) |
| 1061 | |
| 1062 | # There are two parallel sets of case statements below, one that checks to |
| 1063 | # see if OPT was set and one that does BASECFLAGS setting based upon |
| 1064 | # compiler and platform. BASECFLAGS tweaks need to be made even if the |
| 1065 | # user set OPT. |
| 1066 | |
| 1067 | # tweak OPT based on compiler and platform, only if the user didn't set |
| 1068 | # it on the command line |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 1069 | AC_SUBST(OPT) |
Benjamin Peterson | d4b721b | 2010-03-23 20:58:37 +0000 | [diff] [blame] | 1070 | if test "${OPT-unset}" = "unset" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 1071 | then |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1072 | case $GCC in |
| 1073 | yes) |
Skip Montanaro | 288a5be | 2006-04-13 02:00:56 +0000 | [diff] [blame] | 1074 | if test "$CC" != 'g++' ; then |
| 1075 | STRICT_PROTO="-Wstrict-prototypes" |
| 1076 | fi |
Guido van Rossum | 7c862f8 | 2007-12-13 20:50:10 +0000 | [diff] [blame] | 1077 | # For gcc 4.x we need to use -fwrapv so lets check if its supported |
| 1078 | if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then |
| 1079 | WRAP="-fwrapv" |
| 1080 | fi |
Stefan Krah | 503e5e1 | 2011-09-14 15:19:42 +0200 | [diff] [blame] | 1081 | |
| 1082 | # Clang also needs -fwrapv |
Stefan Krah | 2bc1e8f | 2011-12-08 22:26:06 +0100 | [diff] [blame] | 1083 | case $CC in |
| 1084 | *clang*) WRAP="-fwrapv" |
| 1085 | ;; |
| 1086 | esac |
Stefan Krah | 503e5e1 | 2011-09-14 15:19:42 +0200 | [diff] [blame] | 1087 | |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1088 | case $ac_cv_prog_cc_g in |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 1089 | yes) |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 1090 | if test "$Py_DEBUG" = 'true' ; then |
| 1091 | # Optimization messes up debuggers, so turn it off for |
| 1092 | # debug builds. |
Mark Dickinson | d2f3e3f | 2010-05-05 22:23:58 +0000 | [diff] [blame] | 1093 | OPT="-g -O0 -Wall $STRICT_PROTO" |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 1094 | else |
Guido van Rossum | 7c862f8 | 2007-12-13 20:50:10 +0000 | [diff] [blame] | 1095 | OPT="-g $WRAP -O3 -Wall $STRICT_PROTO" |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1096 | fi |
| 1097 | ;; |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 1098 | *) |
Skip Montanaro | 288a5be | 2006-04-13 02:00:56 +0000 | [diff] [blame] | 1099 | OPT="-O3 -Wall $STRICT_PROTO" |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1100 | ;; |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 1101 | esac |
Martin v. Löwis | 21ee409 | 2002-09-30 16:19:48 +0000 | [diff] [blame] | 1102 | case $ac_sys_system in |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1103 | SCO_SV*) OPT="$OPT -m486 -DSCO5" |
| 1104 | ;; |
| 1105 | esac |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 1106 | ;; |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1107 | |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 1108 | *) |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1109 | OPT="-O" |
| 1110 | ;; |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 1111 | esac |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 1112 | fi |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1113 | |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1114 | AC_SUBST(BASECFLAGS) |
Ronald Oussoren | 5640ce2 | 2008-06-05 12:58:24 +0000 | [diff] [blame] | 1115 | |
| 1116 | # The -arch flags for universal builds on OSX |
| 1117 | UNIVERSAL_ARCH_FLAGS= |
| 1118 | AC_SUBST(UNIVERSAL_ARCH_FLAGS) |
| 1119 | |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1120 | # tweak BASECFLAGS based on compiler and platform |
| 1121 | case $GCC in |
| 1122 | yes) |
Martin v. Löwis | 70fedcd | 2003-07-07 21:26:19 +0000 | [diff] [blame] | 1123 | # Python violates C99 rules, by casting between incompatible |
| 1124 | # pointer types. GCC may generate bad code as a result of that, |
| 1125 | # so use -fno-strict-aliasing if supported. |
| 1126 | AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing) |
| 1127 | ac_save_cc="$CC" |
| 1128 | CC="$CC -fno-strict-aliasing" |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 1129 | AC_CACHE_VAL(ac_cv_no_strict_aliasing_ok, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1130 | AC_COMPILE_IFELSE( |
Mark Dickinson | 5e13e29 | 2010-05-11 08:55:06 +0000 | [diff] [blame] | 1131 | [AC_LANG_PROGRAM([[]], [[]])], |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1132 | [ac_cv_no_strict_aliasing_ok=yes], |
| 1133 | [ac_cv_no_strict_aliasing_ok=no])) |
Martin v. Löwis | 70fedcd | 2003-07-07 21:26:19 +0000 | [diff] [blame] | 1134 | CC="$ac_save_cc" |
| 1135 | AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok) |
| 1136 | if test $ac_cv_no_strict_aliasing_ok = yes |
| 1137 | then |
| 1138 | BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" |
| 1139 | fi |
Mark Dickinson | 6513466 | 2008-04-25 16:11:04 +0000 | [diff] [blame] | 1140 | |
| 1141 | # if using gcc on alpha, use -mieee to get (near) full IEEE 754 |
| 1142 | # support. Without this, treatment of subnormals doesn't follow |
| 1143 | # the standard. |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 1144 | case $host in |
Mark Dickinson | 6513466 | 2008-04-25 16:11:04 +0000 | [diff] [blame] | 1145 | alpha*) |
| 1146 | BASECFLAGS="$BASECFLAGS -mieee" |
| 1147 | ;; |
| 1148 | esac |
| 1149 | |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1150 | case $ac_sys_system in |
| 1151 | SCO_SV*) |
| 1152 | BASECFLAGS="$BASECFLAGS -m486 -DSCO5" |
| 1153 | ;; |
| 1154 | # is there any other compiler on Darwin besides gcc? |
| 1155 | Darwin*) |
Jeffrey Yasskin | 1b4e45b | 2008-03-17 14:40:53 +0000 | [diff] [blame] | 1156 | # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd |
| 1157 | # used to be here, but non-Apple gcc doesn't accept them. |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1158 | if test "${CC}" = gcc |
| 1159 | then |
| 1160 | AC_MSG_CHECKING(which compiler should be used) |
| 1161 | case "${UNIVERSALSDK}" in |
| 1162 | */MacOSX10.4u.sdk) |
| 1163 | # Build using 10.4 SDK, force usage of gcc when the |
| 1164 | # compiler is gcc, otherwise the user will get very |
| 1165 | # confusing error messages when building on OSX 10.6 |
| 1166 | CC=gcc-4.0 |
| 1167 | CPP=cpp-4.0 |
| 1168 | ;; |
| 1169 | esac |
| 1170 | AC_MSG_RESULT($CC) |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 1171 | fi |
| 1172 | |
Benjamin Peterson | 4347c44 | 2008-07-17 15:59:24 +0000 | [diff] [blame] | 1173 | # Calculate the right deployment target for this build. |
| 1174 | # |
Ned Deily | c40b903 | 2014-06-25 13:48:46 -0700 | [diff] [blame] | 1175 | cur_target_major=`sw_vers -productVersion | \ |
| 1176 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` |
| 1177 | cur_target_minor=`sw_vers -productVersion | \ |
| 1178 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` |
| 1179 | cur_target="${cur_target_major}.${cur_target_minor}" |
| 1180 | if test ${cur_target_major} -eq 10 && \ |
| 1181 | test ${cur_target_minor} -ge 3 |
| 1182 | then |
Benjamin Peterson | 4347c44 | 2008-07-17 15:59:24 +0000 | [diff] [blame] | 1183 | cur_target=10.3 |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1184 | if test ${enable_universalsdk}; then |
| 1185 | if test "${UNIVERSAL_ARCHS}" = "all"; then |
| 1186 | # Ensure that the default platform for a |
| 1187 | # 4-way universal build is OSX 10.5, |
| 1188 | # that's the first OS release where |
| 1189 | # 4-way builds make sense. |
| 1190 | cur_target='10.5' |
Ronald Oussoren | 23d9253 | 2009-09-07 06:12:00 +0000 | [diff] [blame] | 1191 | |
| 1192 | elif test "${UNIVERSAL_ARCHS}" = "3-way"; then |
| 1193 | cur_target='10.5' |
| 1194 | |
| 1195 | elif test "${UNIVERSAL_ARCHS}" = "intel"; then |
| 1196 | cur_target='10.5' |
| 1197 | |
| 1198 | elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then |
| 1199 | cur_target='10.5' |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1200 | fi |
| 1201 | else |
Ronald Oussoren | bc0e83c | 2010-02-11 13:26:54 +0000 | [diff] [blame] | 1202 | if test `/usr/bin/arch` = "i386"; then |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1203 | # On Intel macs default to a deployment |
| 1204 | # target of 10.4, that's the first OSX |
| 1205 | # release with Intel support. |
| 1206 | cur_target="10.4" |
| 1207 | fi |
| 1208 | fi |
Benjamin Peterson | 4347c44 | 2008-07-17 15:59:24 +0000 | [diff] [blame] | 1209 | fi |
| 1210 | CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}} |
| 1211 | |
| 1212 | # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the |
| 1213 | # environment with a value that is the same as what we'll use |
| 1214 | # in the Makefile to ensure that we'll get the same compiler |
| 1215 | # environment during configure and build time. |
| 1216 | MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET" |
| 1217 | export MACOSX_DEPLOYMENT_TARGET |
| 1218 | EXPORT_MACOSX_DEPLOYMENT_TARGET='' |
| 1219 | |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1220 | if test "${enable_universalsdk}"; then |
| 1221 | UNIVERSAL_ARCH_FLAGS="" |
| 1222 | if test "$UNIVERSAL_ARCHS" = "32-bit" ; then |
| 1223 | UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" |
| 1224 | ARCH_RUN_32BIT="" |
Ronald Oussoren | 7591285 | 2010-04-08 08:13:31 +0000 | [diff] [blame] | 1225 | LIPO_32BIT_FLAGS="" |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1226 | |
| 1227 | elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then |
| 1228 | UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" |
| 1229 | LIPO_32BIT_FLAGS="" |
| 1230 | ARCH_RUN_32BIT="true" |
| 1231 | |
| 1232 | elif test "$UNIVERSAL_ARCHS" = "all" ; then |
| 1233 | UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" |
| 1234 | LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" |
Ronald Oussoren | 92397ce | 2010-01-17 19:32:00 +0000 | [diff] [blame] | 1235 | ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1236 | |
| 1237 | elif test "$UNIVERSAL_ARCHS" = "intel" ; then |
| 1238 | UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" |
| 1239 | LIPO_32BIT_FLAGS="-extract i386" |
Ronald Oussoren | 92397ce | 2010-01-17 19:32:00 +0000 | [diff] [blame] | 1240 | ARCH_RUN_32BIT="/usr/bin/arch -i386" |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1241 | |
| 1242 | elif test "$UNIVERSAL_ARCHS" = "3-way" ; then |
| 1243 | UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" |
| 1244 | LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386" |
Ronald Oussoren | 9922f17 | 2010-02-11 13:19:34 +0000 | [diff] [blame] | 1245 | ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1246 | |
| 1247 | else |
| 1248 | AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way]) |
| 1249 | |
| 1250 | fi |
| 1251 | |
| 1252 | |
Ronald Oussoren | 974eb5e | 2010-04-18 17:59:37 +0000 | [diff] [blame] | 1253 | CFLAGS="${UNIVERSAL_ARCH_FLAGS} ${CFLAGS}" |
| 1254 | if test "${UNIVERSALSDK}" != "/" |
| 1255 | then |
| 1256 | CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}" |
| 1257 | LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}" |
| 1258 | CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}" |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1259 | fi |
| 1260 | |
| 1261 | fi |
| 1262 | |
| 1263 | |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1264 | ;; |
Neal Norwitz | dedeeaa | 2006-03-31 06:54:45 +0000 | [diff] [blame] | 1265 | OSF*) |
| 1266 | BASECFLAGS="$BASECFLAGS -mieee" |
| 1267 | ;; |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1268 | esac |
| 1269 | ;; |
| 1270 | |
| 1271 | *) |
| 1272 | case $ac_sys_system in |
| 1273 | OpenUNIX*|UnixWare*) |
| 1274 | BASECFLAGS="$BASECFLAGS -K pentium,host,inline,loop_unroll,alloca " |
| 1275 | ;; |
Neal Norwitz | b44f165 | 2003-05-26 14:11:55 +0000 | [diff] [blame] | 1276 | OSF*) |
| 1277 | BASECFLAGS="$BASECFLAGS -ieee -std" |
| 1278 | ;; |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1279 | SCO_SV*) |
| 1280 | BASECFLAGS="$BASECFLAGS -belf -Ki486 -DSCO5" |
| 1281 | ;; |
| 1282 | esac |
| 1283 | ;; |
| 1284 | esac |
| 1285 | |
Zachary Ware | 6ed42ea | 2015-12-21 11:43:03 -0600 | [diff] [blame] | 1286 | # ICC needs -fp-model strict or floats behave badly |
| 1287 | case "$CC" in |
| 1288 | *icc*) |
| 1289 | BASECFLAGS="$BASECFLAGS -fp-model strict" |
| 1290 | ;; |
| 1291 | esac |
| 1292 | |
Fred Drake | e1ceaa0 | 2001-12-04 20:55:47 +0000 | [diff] [blame] | 1293 | if test "$Py_DEBUG" = 'true'; then |
| 1294 | : |
| 1295 | else |
| 1296 | OPT="-DNDEBUG $OPT" |
| 1297 | fi |
| 1298 | |
Guido van Rossum | 6f2260e | 1996-09-09 16:21:03 +0000 | [diff] [blame] | 1299 | if test "$ac_arch_flags" |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 1300 | then |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1301 | BASECFLAGS="$BASECFLAGS $ac_arch_flags" |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 1302 | fi |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1303 | |
Neal Norwitz | 020c46a | 2006-01-07 21:39:28 +0000 | [diff] [blame] | 1304 | # disable check for icc since it seems to pass, but generates a warning |
| 1305 | if test "$CC" = icc |
| 1306 | then |
| 1307 | ac_cv_opt_olimit_ok=no |
| 1308 | fi |
| 1309 | |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 1310 | AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0) |
| 1311 | AC_CACHE_VAL(ac_cv_opt_olimit_ok, |
| 1312 | [ac_save_cc="$CC" |
| 1313 | CC="$CC -OPT:Olimit=0" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1314 | AC_COMPILE_IFELSE( |
Mark Dickinson | 5e13e29 | 2010-05-11 08:55:06 +0000 | [diff] [blame] | 1315 | [AC_LANG_PROGRAM([[]], [[]])], |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1316 | [ac_cv_opt_olimit_ok=yes], |
| 1317 | [ac_cv_opt_olimit_ok=no] |
Gregory P. Smith | ec3b8bd | 2009-11-01 21:02:52 +0000 | [diff] [blame] | 1318 | ) |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 1319 | CC="$ac_save_cc"]) |
| 1320 | AC_MSG_RESULT($ac_cv_opt_olimit_ok) |
Guido van Rossum | 2efa34b | 1997-10-23 17:43:11 +0000 | [diff] [blame] | 1321 | if test $ac_cv_opt_olimit_ok = yes; then |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 1322 | case $ac_sys_system in |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1323 | # XXX is this branch needed? On MacOSX 10.2.2 the result of the |
| 1324 | # olimit_ok test is "no". Is it "yes" in some other Darwin-esque |
| 1325 | # environment? |
| 1326 | Darwin*) |
| 1327 | ;; |
Trent Nelson | 34562e1 | 2012-10-17 18:01:12 -0400 | [diff] [blame] | 1328 | # XXX thankfully this useless troublemaker of a flag has been |
| 1329 | # eradicated in the 3.x line. For now, make sure it isn't picked |
| 1330 | # up by any of our other platforms that use CC. |
| 1331 | AIX*|SunOS*|HP-UX*|IRIX*) |
| 1332 | ;; |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1333 | *) |
| 1334 | BASECFLAGS="$BASECFLAGS -OPT:Olimit=0" |
| 1335 | ;; |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 1336 | esac |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 1337 | else |
| 1338 | AC_MSG_CHECKING(whether $CC accepts -Olimit 1500) |
| 1339 | AC_CACHE_VAL(ac_cv_olimit_ok, |
| 1340 | [ac_save_cc="$CC" |
| 1341 | CC="$CC -Olimit 1500" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1342 | AC_COMPILE_IFELSE( |
Mark Dickinson | 5e13e29 | 2010-05-11 08:55:06 +0000 | [diff] [blame] | 1343 | [AC_LANG_PROGRAM([[]], [[]])], |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1344 | [ac_cv_olimit_ok=yes], |
| 1345 | [ac_cv_olimit_ok=no] |
Gregory P. Smith | ec3b8bd | 2009-11-01 21:02:52 +0000 | [diff] [blame] | 1346 | ) |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 1347 | CC="$ac_save_cc"]) |
| 1348 | AC_MSG_RESULT($ac_cv_olimit_ok) |
| 1349 | if test $ac_cv_olimit_ok = yes; then |
Stefan Krah | 6747326 | 2012-11-29 00:17:05 +0100 | [diff] [blame] | 1350 | case $ac_sys_system in |
| 1351 | # Issue #16534: On HP-UX ac_cv_olimit_ok=yes is a false positive. |
| 1352 | HP-UX*) |
| 1353 | ;; |
| 1354 | *) |
| 1355 | BASECFLAGS="$BASECFLAGS -Olimit 1500" |
| 1356 | ;; |
| 1357 | esac |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 1358 | fi |
Guido van Rossum | 201afe5 | 1997-05-14 21:14:44 +0000 | [diff] [blame] | 1359 | fi |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 1360 | |
Martin v. Löwis | aac1316 | 2006-10-19 10:58:46 +0000 | [diff] [blame] | 1361 | # Check whether GCC supports PyArg_ParseTuple format |
| 1362 | if test "$GCC" = "yes" |
| 1363 | then |
| 1364 | AC_MSG_CHECKING(whether gcc supports ParseTuple __format__) |
| 1365 | save_CFLAGS=$CFLAGS |
Benjamin Peterson | c875966 | 2013-05-11 13:00:05 -0500 | [diff] [blame] | 1366 | CFLAGS="$CFLAGS -Werror -Wformat" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1367 | AC_COMPILE_IFELSE([ |
| 1368 | AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]]) |
| 1369 | ],[ |
| 1370 | AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, 1, |
| 1371 | [Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))]) |
| 1372 | AC_MSG_RESULT(yes) |
| 1373 | ],[ |
| 1374 | AC_MSG_RESULT(no) |
| 1375 | ]) |
Martin v. Löwis | c1d7597 | 2006-10-19 16:01:37 +0000 | [diff] [blame] | 1376 | CFLAGS=$save_CFLAGS |
Martin v. Löwis | aac1316 | 2006-10-19 10:58:46 +0000 | [diff] [blame] | 1377 | fi |
| 1378 | |
Brett Cannon | 4ff151a | 2015-09-18 15:09:42 -0700 | [diff] [blame] | 1379 | |
| 1380 | # Enable PGO flags. |
| 1381 | AC_SUBST(PGO_PROF_GEN_FLAG) |
| 1382 | AC_SUBST(PGO_PROF_USE_FLAG) |
| 1383 | AC_SUBST(LLVM_PROF_MERGER) |
| 1384 | AC_SUBST(LLVM_PROF_FILE) |
| 1385 | AC_SUBST(LLVM_PROF_ERR) |
| 1386 | AC_SUBST(LLVM_PROF_FOUND) |
| 1387 | AC_CHECK_PROG(LLVM_PROF_FOUND, llvm-profdata, found, not-found) |
| 1388 | LLVM_PROF_ERR=no |
| 1389 | case $CC in |
| 1390 | *clang*) |
| 1391 | # Any changes made here should be reflected in the GCC+Darwin case below |
| 1392 | PGO_PROF_GEN_FLAG="-fprofile-instr-generate" |
| 1393 | PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" |
| 1394 | LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclangr" |
| 1395 | LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" |
| 1396 | if test $LLVM_PROF_FOUND = not-found |
| 1397 | then |
| 1398 | LLVM_PROF_ERR=yes |
| 1399 | fi |
| 1400 | ;; |
| 1401 | *gcc*) |
| 1402 | case $ac_sys_system in |
| 1403 | Darwin*) |
| 1404 | PGO_PROF_GEN_FLAG="-fprofile-instr-generate" |
| 1405 | PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" |
| 1406 | LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclangr" |
| 1407 | LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" |
| 1408 | if test $LLVM_PROF_FOUND = not-found |
| 1409 | then |
| 1410 | LLVM_PROF_ERR=yes |
| 1411 | fi |
| 1412 | ;; |
| 1413 | *) |
| 1414 | PGO_PROF_GEN_FLAG="-fprofile-generate" |
| 1415 | PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction" |
| 1416 | LLVM_PROF_MERGER="true" |
| 1417 | LLVM_PROF_FILE="" |
| 1418 | ;; |
| 1419 | esac |
| 1420 | ;; |
Zachary Ware | 6ed42ea | 2015-12-21 11:43:03 -0600 | [diff] [blame] | 1421 | *icc*) |
| 1422 | PGO_PROF_GEN_FLAG="-prof-gen" |
| 1423 | PGO_PROF_USE_FLAG="-prof-use" |
| 1424 | LLVM_PROF_MERGER="true" |
| 1425 | LLVM_PROF_FILE="" |
| 1426 | ;; |
Brett Cannon | 4ff151a | 2015-09-18 15:09:42 -0700 | [diff] [blame] | 1427 | esac |
| 1428 | |
| 1429 | |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 1430 | # On some compilers, pthreads are available without further options |
| 1431 | # (e.g. MacOS X). On some of these systems, the compiler will not |
| 1432 | # complain if unaccepted options are passed (e.g. gcc on Mac OS X). |
| 1433 | # So we have to see first whether pthreads are available without |
| 1434 | # options before we can check whether -Kpthread improves anything. |
| 1435 | AC_MSG_CHECKING(whether pthreads are available without options) |
| 1436 | AC_CACHE_VAL(ac_cv_pthread_is_default, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1437 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Stefan Krah | ae66ca6 | 2012-11-22 22:36:57 +0100 | [diff] [blame] | 1438 | #include <stdio.h> |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 1439 | #include <pthread.h> |
| 1440 | |
| 1441 | void* routine(void* p){return NULL;} |
| 1442 | |
| 1443 | int main(){ |
| 1444 | pthread_t p; |
| 1445 | if(pthread_create(&p,NULL,routine,NULL)!=0) |
| 1446 | return 1; |
Jack Jansen | 4f8d054 | 2002-03-08 13:43:01 +0000 | [diff] [blame] | 1447 | (void)pthread_detach(p); |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 1448 | return 0; |
| 1449 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1450 | ]])],[ |
Skip Montanaro | d8d39a0 | 2003-07-10 20:44:10 +0000 | [diff] [blame] | 1451 | ac_cv_pthread_is_default=yes |
| 1452 | ac_cv_kthread=no |
| 1453 | ac_cv_pthread=no |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1454 | ],[ac_cv_pthread_is_default=no],[ac_cv_pthread_is_default=no]) |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 1455 | ]) |
| 1456 | AC_MSG_RESULT($ac_cv_pthread_is_default) |
| 1457 | |
| 1458 | |
| 1459 | if test $ac_cv_pthread_is_default = yes |
| 1460 | then |
| 1461 | ac_cv_kpthread=no |
| 1462 | else |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 1463 | # -Kpthread, if available, provides the right #defines |
| 1464 | # and linker options to make pthread_create available |
Martin v. Löwis | 260aecc | 2001-10-07 08:14:41 +0000 | [diff] [blame] | 1465 | # Some compilers won't report that they do not support -Kpthread, |
| 1466 | # so we need to run a program to see whether it really made the |
| 1467 | # function available. |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 1468 | AC_MSG_CHECKING(whether $CC accepts -Kpthread) |
| 1469 | AC_CACHE_VAL(ac_cv_kpthread, |
| 1470 | [ac_save_cc="$CC" |
| 1471 | CC="$CC -Kpthread" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1472 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Stefan Krah | ae66ca6 | 2012-11-22 22:36:57 +0100 | [diff] [blame] | 1473 | #include <stdio.h> |
Martin v. Löwis | 260aecc | 2001-10-07 08:14:41 +0000 | [diff] [blame] | 1474 | #include <pthread.h> |
| 1475 | |
| 1476 | void* routine(void* p){return NULL;} |
| 1477 | |
| 1478 | int main(){ |
| 1479 | pthread_t p; |
| 1480 | if(pthread_create(&p,NULL,routine,NULL)!=0) |
| 1481 | return 1; |
Jack Jansen | 4f8d054 | 2002-03-08 13:43:01 +0000 | [diff] [blame] | 1482 | (void)pthread_detach(p); |
Martin v. Löwis | 260aecc | 2001-10-07 08:14:41 +0000 | [diff] [blame] | 1483 | return 0; |
| 1484 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1485 | ]])],[ac_cv_kpthread=yes],[ac_cv_kpthread=no],[ac_cv_kpthread=no]) |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 1486 | CC="$ac_save_cc"]) |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 1487 | AC_MSG_RESULT($ac_cv_kpthread) |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 1488 | fi |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 1489 | |
Skip Montanaro | d8d39a0 | 2003-07-10 20:44:10 +0000 | [diff] [blame] | 1490 | if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no |
Martin v. Löwis | 5f433f0 | 2003-05-05 05:05:30 +0000 | [diff] [blame] | 1491 | then |
| 1492 | # -Kthread, if available, provides the right #defines |
| 1493 | # and linker options to make pthread_create available |
| 1494 | # Some compilers won't report that they do not support -Kthread, |
| 1495 | # so we need to run a program to see whether it really made the |
| 1496 | # function available. |
| 1497 | AC_MSG_CHECKING(whether $CC accepts -Kthread) |
| 1498 | AC_CACHE_VAL(ac_cv_kthread, |
| 1499 | [ac_save_cc="$CC" |
| 1500 | CC="$CC -Kthread" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1501 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Stefan Krah | ae66ca6 | 2012-11-22 22:36:57 +0100 | [diff] [blame] | 1502 | #include <stdio.h> |
Martin v. Löwis | 5f433f0 | 2003-05-05 05:05:30 +0000 | [diff] [blame] | 1503 | #include <pthread.h> |
| 1504 | |
| 1505 | void* routine(void* p){return NULL;} |
| 1506 | |
| 1507 | int main(){ |
| 1508 | pthread_t p; |
| 1509 | if(pthread_create(&p,NULL,routine,NULL)!=0) |
| 1510 | return 1; |
| 1511 | (void)pthread_detach(p); |
| 1512 | return 0; |
| 1513 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1514 | ]])],[ac_cv_kthread=yes],[ac_cv_kthread=no],[ac_cv_kthread=no]) |
Martin v. Löwis | 5f433f0 | 2003-05-05 05:05:30 +0000 | [diff] [blame] | 1515 | CC="$ac_save_cc"]) |
| 1516 | AC_MSG_RESULT($ac_cv_kthread) |
| 1517 | fi |
| 1518 | |
Skip Montanaro | d8d39a0 | 2003-07-10 20:44:10 +0000 | [diff] [blame] | 1519 | if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 1520 | then |
| 1521 | # -pthread, if available, provides the right #defines |
| 1522 | # and linker options to make pthread_create available |
| 1523 | # Some compilers won't report that they do not support -pthread, |
| 1524 | # so we need to run a program to see whether it really made the |
| 1525 | # function available. |
| 1526 | AC_MSG_CHECKING(whether $CC accepts -pthread) |
doko@python.org | fa3f9a3 | 2013-01-25 15:32:31 +0100 | [diff] [blame] | 1527 | AC_CACHE_VAL(ac_cv_pthread, |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 1528 | [ac_save_cc="$CC" |
| 1529 | CC="$CC -pthread" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1530 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Stefan Krah | ae66ca6 | 2012-11-22 22:36:57 +0100 | [diff] [blame] | 1531 | #include <stdio.h> |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 1532 | #include <pthread.h> |
| 1533 | |
| 1534 | void* routine(void* p){return NULL;} |
| 1535 | |
| 1536 | int main(){ |
| 1537 | pthread_t p; |
| 1538 | if(pthread_create(&p,NULL,routine,NULL)!=0) |
| 1539 | return 1; |
| 1540 | (void)pthread_detach(p); |
| 1541 | return 0; |
| 1542 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1543 | ]])],[ac_cv_pthread=yes],[ac_cv_pthread=no],[ac_cv_pthread=no]) |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 1544 | CC="$ac_save_cc"]) |
| 1545 | AC_MSG_RESULT($ac_cv_pthread) |
| 1546 | fi |
| 1547 | |
Martin v. Löwis | ab1e585 | 2003-06-28 07:46:38 +0000 | [diff] [blame] | 1548 | # If we have set a CC compiler flag for thread support then |
| 1549 | # check if it works for CXX, too. |
| 1550 | ac_cv_cxx_thread=no |
| 1551 | if test ! -z "$CXX" |
| 1552 | then |
| 1553 | AC_MSG_CHECKING(whether $CXX also accepts flags for thread support) |
| 1554 | ac_save_cxx="$CXX" |
| 1555 | |
| 1556 | if test "$ac_cv_kpthread" = "yes" |
| 1557 | then |
Martin v. Löwis | 519adae | 2003-09-20 10:47:47 +0000 | [diff] [blame] | 1558 | CXX="$CXX -Kpthread" |
Martin v. Löwis | ab1e585 | 2003-06-28 07:46:38 +0000 | [diff] [blame] | 1559 | ac_cv_cxx_thread=yes |
| 1560 | elif test "$ac_cv_kthread" = "yes" |
| 1561 | then |
| 1562 | CXX="$CXX -Kthread" |
| 1563 | ac_cv_cxx_thread=yes |
| 1564 | elif test "$ac_cv_pthread" = "yes" |
| 1565 | then |
| 1566 | CXX="$CXX -pthread" |
| 1567 | ac_cv_cxx_thread=yes |
| 1568 | fi |
| 1569 | |
| 1570 | if test $ac_cv_cxx_thread = yes |
| 1571 | then |
| 1572 | echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext |
| 1573 | $CXX -c conftest.$ac_ext 2>&5 |
| 1574 | if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \ |
| 1575 | && test -s conftest$ac_exeext && ./conftest$ac_exeext |
| 1576 | then |
| 1577 | ac_cv_cxx_thread=yes |
| 1578 | else |
| 1579 | ac_cv_cxx_thread=no |
Martin v. Löwis | ab1e585 | 2003-06-28 07:46:38 +0000 | [diff] [blame] | 1580 | fi |
| 1581 | rm -fr conftest* |
Martin v. Löwis | ab1e585 | 2003-06-28 07:46:38 +0000 | [diff] [blame] | 1582 | fi |
Brett Cannon | c601e0f | 2004-11-07 01:24:12 +0000 | [diff] [blame] | 1583 | AC_MSG_RESULT($ac_cv_cxx_thread) |
Martin v. Löwis | ab1e585 | 2003-06-28 07:46:38 +0000 | [diff] [blame] | 1584 | fi |
Martin v. Löwis | 519adae | 2003-09-20 10:47:47 +0000 | [diff] [blame] | 1585 | CXX="$ac_save_cxx" |
Martin v. Löwis | ab1e585 | 2003-06-28 07:46:38 +0000 | [diff] [blame] | 1586 | |
Fred Drake | ce81d59 | 2000-07-09 14:39:29 +0000 | [diff] [blame] | 1587 | dnl # check for ANSI or K&R ("traditional") preprocessor |
| 1588 | dnl AC_MSG_CHECKING(for C preprocessor type) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1589 | dnl AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Fred Drake | ce81d59 | 2000-07-09 14:39:29 +0000 | [diff] [blame] | 1590 | dnl #define spam(name, doc) {#name, &name, #name "() -- " doc} |
| 1591 | dnl int foo; |
| 1592 | dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something"); |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1593 | dnl ]], [[;]])],[cpp_type=ansi],[AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional]) |
Fred Drake | ce81d59 | 2000-07-09 14:39:29 +0000 | [diff] [blame] | 1594 | dnl AC_MSG_RESULT($cpp_type) |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 1595 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1596 | # checks for header files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1597 | AC_HEADER_STDC |
doko@ubuntu.com | f27ec3e | 2014-04-17 20:11:19 +0200 | [diff] [blame] | 1598 | AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ |
Martin v. Löwis | 0e8bd7e | 2006-06-10 12:23:46 +0000 | [diff] [blame] | 1599 | fcntl.h grp.h \ |
doko@ubuntu.com | f27ec3e | 2014-04-17 20:11:19 +0200 | [diff] [blame] | 1600 | ieeefp.h io.h langinfo.h libintl.h poll.h process.h pthread.h \ |
Martin v. Löwis | 40e9aed | 2006-10-02 15:20:37 +0000 | [diff] [blame] | 1601 | shadow.h signal.h stdint.h stropts.h termios.h thread.h \ |
Martin v. Löwis | 14e73b1 | 2003-01-01 09:51:12 +0000 | [diff] [blame] | 1602 | unistd.h utime.h \ |
Christian Heimes | 0e9ab5f | 2008-03-21 23:49:44 +0000 | [diff] [blame] | 1603 | sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \ |
| 1604 | sys/lock.h sys/mkdev.h sys/modem.h \ |
Martin v. Löwis | 0e8bd7e | 2006-06-10 12:23:46 +0000 | [diff] [blame] | 1605 | sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ |
Martin v. Löwis | 8c255e4 | 2008-05-23 15:06:50 +0000 | [diff] [blame] | 1606 | sys/termio.h sys/time.h \ |
Martin v. Löwis | 0e8bd7e | 2006-06-10 12:23:46 +0000 | [diff] [blame] | 1607 | sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ |
Martin v. Löwis | 0347a9a | 2006-10-27 07:06:52 +0000 | [diff] [blame] | 1608 | sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ |
Christian Heimes | 3aa138f | 2013-06-18 13:25:24 +0200 | [diff] [blame] | 1609 | bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1610 | AC_HEADER_DIRENT |
Martin v. Löwis | dbe3f76 | 2002-10-10 14:27:30 +0000 | [diff] [blame] | 1611 | AC_HEADER_MAJOR |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1612 | |
Martin v. Löwis | 11017b1 | 2006-01-14 18:12:57 +0000 | [diff] [blame] | 1613 | # On Linux, netlink.h requires asm/types.h |
| 1614 | AC_CHECK_HEADERS(linux/netlink.h,,,[ |
| 1615 | #ifdef HAVE_ASM_TYPES_H |
| 1616 | #include <asm/types.h> |
| 1617 | #endif |
| 1618 | #ifdef HAVE_SYS_SOCKET_H |
| 1619 | #include <sys/socket.h> |
| 1620 | #endif |
| 1621 | ]) |
| 1622 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1623 | # checks for typedefs |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1624 | was_it_defined=no |
| 1625 | AC_MSG_CHECKING(for clock_t in time.h) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1626 | AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [ |
| 1627 | AC_DEFINE(clock_t, long, [Define to 'long' if <time.h> doesn't define.]) |
| 1628 | ]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1629 | AC_MSG_RESULT($was_it_defined) |
| 1630 | |
Neal Norwitz | 1169011 | 2002-07-30 01:08:28 +0000 | [diff] [blame] | 1631 | # Check whether using makedev requires defining _OSF_SOURCE |
| 1632 | AC_MSG_CHECKING(for makedev) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1633 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Jesus Cea | 616de77 | 2010-04-28 10:32:30 +0000 | [diff] [blame] | 1634 | #if defined(MAJOR_IN_MKDEV) |
| 1635 | #include <sys/mkdev.h> |
| 1636 | #elif defined(MAJOR_IN_SYSMACROS) |
| 1637 | #include <sys/sysmacros.h> |
| 1638 | #else |
| 1639 | #include <sys/types.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1640 | #endif ]], [[ makedev(0, 0) ]])], |
| 1641 | [ac_cv_has_makedev=yes], |
| 1642 | [ac_cv_has_makedev=no]) |
Neal Norwitz | 1169011 | 2002-07-30 01:08:28 +0000 | [diff] [blame] | 1643 | if test "$ac_cv_has_makedev" = "no"; then |
| 1644 | # we didn't link, try if _OSF_SOURCE will allow us to link |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1645 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Neal Norwitz | 6eb37f0 | 2003-02-23 23:28:15 +0000 | [diff] [blame] | 1646 | #define _OSF_SOURCE 1 |
| 1647 | #include <sys/types.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1648 | ]], [[ makedev(0, 0) ]])], |
| 1649 | [ac_cv_has_makedev=yes], |
| 1650 | [ac_cv_has_makedev=no]) |
Neal Norwitz | 1169011 | 2002-07-30 01:08:28 +0000 | [diff] [blame] | 1651 | if test "$ac_cv_has_makedev" = "yes"; then |
| 1652 | AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.]) |
| 1653 | fi |
| 1654 | fi |
| 1655 | AC_MSG_RESULT($ac_cv_has_makedev) |
| 1656 | if test "$ac_cv_has_makedev" = "yes"; then |
| 1657 | AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.]) |
| 1658 | fi |
| 1659 | |
Martin v. Löwis | 399a689 | 2002-10-04 10:22:02 +0000 | [diff] [blame] | 1660 | # Enabling LFS on Solaris (2.6 to 9) with gcc 2.95 triggers a bug in |
| 1661 | # the system headers: If _XOPEN_SOURCE and _LARGEFILE_SOURCE are |
| 1662 | # defined, but the compiler does not support pragma redefine_extname, |
| 1663 | # and _LARGEFILE64_SOURCE is not defined, the headers refer to 64-bit |
| 1664 | # structures (such as rlimit64) without declaring them. As a |
| 1665 | # work-around, disable LFS on such configurations |
| 1666 | |
| 1667 | use_lfs=yes |
| 1668 | AC_MSG_CHECKING(Solaris LFS bug) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1669 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | 399a689 | 2002-10-04 10:22:02 +0000 | [diff] [blame] | 1670 | #define _LARGEFILE_SOURCE 1 |
| 1671 | #define _FILE_OFFSET_BITS 64 |
| 1672 | #include <sys/resource.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1673 | ]], [[struct rlimit foo;]])],[sol_lfs_bug=no],[sol_lfs_bug=yes]) |
Martin v. Löwis | 399a689 | 2002-10-04 10:22:02 +0000 | [diff] [blame] | 1674 | AC_MSG_RESULT($sol_lfs_bug) |
| 1675 | if test "$sol_lfs_bug" = "yes"; then |
| 1676 | use_lfs=no |
| 1677 | fi |
| 1678 | |
| 1679 | if test "$use_lfs" = "yes"; then |
Guido van Rossum | 810cc51 | 2001-09-09 23:51:39 +0000 | [diff] [blame] | 1680 | # Two defines needed to enable largefile support on various platforms |
| 1681 | # These may affect some typedefs |
Georg Brandl | 94800df | 2011-02-25 11:09:02 +0000 | [diff] [blame] | 1682 | case $ac_sys_system/$ac_sys_release in |
| 1683 | AIX*) |
| 1684 | AC_DEFINE(_LARGE_FILES, 1, |
| 1685 | [This must be defined on AIX systems to enable large file support.]) |
| 1686 | ;; |
| 1687 | esac |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1688 | AC_DEFINE(_LARGEFILE_SOURCE, 1, |
| 1689 | [This must be defined on some systems to enable large file support.]) |
| 1690 | AC_DEFINE(_FILE_OFFSET_BITS, 64, |
| 1691 | [This must be set to 64 on some systems to enable large file support.]) |
Martin v. Löwis | 399a689 | 2002-10-04 10:22:02 +0000 | [diff] [blame] | 1692 | fi |
Guido van Rossum | 810cc51 | 2001-09-09 23:51:39 +0000 | [diff] [blame] | 1693 | |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 1694 | # Add some code to confdefs.h so that the test for off_t works on SCO |
| 1695 | cat >> confdefs.h <<\EOF |
| 1696 | #if defined(SCO_DS) |
| 1697 | #undef _OFF_T |
| 1698 | #endif |
| 1699 | EOF |
| 1700 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 1701 | # Type availability checks |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1702 | AC_TYPE_MODE_T |
| 1703 | AC_TYPE_OFF_T |
| 1704 | AC_TYPE_PID_T |
Matthias Klose | cbf54b1 | 2010-05-08 11:04:18 +0000 | [diff] [blame] | 1705 | AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1706 | AC_TYPE_SIZE_T |
| 1707 | AC_TYPE_UID_T |
Mark Dickinson | 17c50cd | 2012-12-02 13:13:56 +0000 | [diff] [blame] | 1708 | |
| 1709 | # There are two separate checks for each of the exact-width integer types we |
| 1710 | # need. First we check whether the type is available using the usual |
| 1711 | # AC_CHECK_TYPE macro with the default includes (which includes <inttypes.h> |
| 1712 | # and <stdint.h> where available). We then also use the special type checks of |
| 1713 | # the form AC_TYPE_UINT32_T, which in the case that uint32_t is not available |
| 1714 | # directly, #define's uint32_t to be a suitable type. |
| 1715 | |
| 1716 | AC_CHECK_TYPE(uint32_t, |
| 1717 | AC_DEFINE(HAVE_UINT32_T, 1, [Define if your compiler provides uint32_t.]),,) |
Mark Dickinson | efc82f7 | 2009-03-20 15:51:55 +0000 | [diff] [blame] | 1718 | AC_TYPE_UINT32_T |
Mark Dickinson | 17c50cd | 2012-12-02 13:13:56 +0000 | [diff] [blame] | 1719 | |
| 1720 | AC_CHECK_TYPE(uint64_t, |
| 1721 | AC_DEFINE(HAVE_UINT64_T, 1, [Define if your compiler provides uint64_t.]),,) |
Mark Dickinson | efc82f7 | 2009-03-20 15:51:55 +0000 | [diff] [blame] | 1722 | AC_TYPE_UINT64_T |
Mark Dickinson | 17c50cd | 2012-12-02 13:13:56 +0000 | [diff] [blame] | 1723 | |
| 1724 | AC_CHECK_TYPE(int32_t, |
| 1725 | AC_DEFINE(HAVE_INT32_T, 1, [Define if your compiler provides int32_t.]),,) |
Mark Dickinson | efc82f7 | 2009-03-20 15:51:55 +0000 | [diff] [blame] | 1726 | AC_TYPE_INT32_T |
Mark Dickinson | 17c50cd | 2012-12-02 13:13:56 +0000 | [diff] [blame] | 1727 | |
| 1728 | AC_CHECK_TYPE(int64_t, |
| 1729 | AC_DEFINE(HAVE_INT64_T, 1, [Define if your compiler provides int64_t.]),,) |
Mark Dickinson | efc82f7 | 2009-03-20 15:51:55 +0000 | [diff] [blame] | 1730 | AC_TYPE_INT64_T |
Mark Dickinson | 17c50cd | 2012-12-02 13:13:56 +0000 | [diff] [blame] | 1731 | |
Christian Heimes | 951cc0f | 2008-01-31 23:08:23 +0000 | [diff] [blame] | 1732 | AC_CHECK_TYPE(ssize_t, |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 1733 | AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1734 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 1735 | # Sizes of various common basic types |
Skip Montanaro | b9820a3 | 2004-01-17 00:16:12 +0000 | [diff] [blame] | 1736 | # ANSI C requires sizeof(char) == 1, so no need to check it |
Guido van Rossum | 3065c94 | 2001-09-17 04:03:14 +0000 | [diff] [blame] | 1737 | AC_CHECK_SIZEOF(int, 4) |
| 1738 | AC_CHECK_SIZEOF(long, 4) |
| 1739 | AC_CHECK_SIZEOF(void *, 4) |
Guido van Rossum | 3065c94 | 2001-09-17 04:03:14 +0000 | [diff] [blame] | 1740 | AC_CHECK_SIZEOF(short, 2) |
| 1741 | AC_CHECK_SIZEOF(float, 4) |
| 1742 | AC_CHECK_SIZEOF(double, 8) |
| 1743 | AC_CHECK_SIZEOF(fpos_t, 4) |
Martin v. Löwis | 18e1655 | 2006-02-15 17:27:45 +0000 | [diff] [blame] | 1744 | AC_CHECK_SIZEOF(size_t, 4) |
Christian Heimes | 951cc0f | 2008-01-31 23:08:23 +0000 | [diff] [blame] | 1745 | AC_CHECK_SIZEOF(pid_t, 4) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 1746 | |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 1747 | AC_MSG_CHECKING(for long long support) |
| 1748 | have_long_long=no |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1749 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[ |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1750 | AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.]) |
| 1751 | have_long_long=yes |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1752 | ],[]) |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 1753 | AC_MSG_RESULT($have_long_long) |
Guido van Rossum | 8bc1dfd | 1999-04-10 16:01:48 +0000 | [diff] [blame] | 1754 | if test "$have_long_long" = yes ; then |
Guido van Rossum | 3065c94 | 2001-09-17 04:03:14 +0000 | [diff] [blame] | 1755 | AC_CHECK_SIZEOF(long long, 8) |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 1756 | fi |
| 1757 | |
Travis E. Oliphant | 711c9e9 | 2008-06-06 22:33:21 +0000 | [diff] [blame] | 1758 | AC_MSG_CHECKING(for long double support) |
| 1759 | have_long_double=no |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1760 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]])],[ |
Travis E. Oliphant | 711c9e9 | 2008-06-06 22:33:21 +0000 | [diff] [blame] | 1761 | AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.]) |
| 1762 | have_long_double=yes |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1763 | ],[]) |
Travis E. Oliphant | 711c9e9 | 2008-06-06 22:33:21 +0000 | [diff] [blame] | 1764 | AC_MSG_RESULT($have_long_double) |
Mark Dickinson | dc1688a | 2008-06-27 22:20:14 +0000 | [diff] [blame] | 1765 | if test "$have_long_double" = yes ; then |
Travis E. Oliphant | 711c9e9 | 2008-06-06 22:33:21 +0000 | [diff] [blame] | 1766 | AC_CHECK_SIZEOF(long double, 12) |
| 1767 | fi |
| 1768 | |
Martin v. Löwis | aef4c6b | 2007-01-21 09:33:07 +0000 | [diff] [blame] | 1769 | AC_MSG_CHECKING(for _Bool support) |
| 1770 | have_c99_bool=no |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1771 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Bool x; x = (_Bool)0;]])],[ |
Martin v. Löwis | aef4c6b | 2007-01-21 09:33:07 +0000 | [diff] [blame] | 1772 | AC_DEFINE(HAVE_C99_BOOL, 1, [Define this if you have the type _Bool.]) |
| 1773 | have_c99_bool=yes |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1774 | ],[]) |
Martin v. Löwis | aef4c6b | 2007-01-21 09:33:07 +0000 | [diff] [blame] | 1775 | AC_MSG_RESULT($have_c99_bool) |
| 1776 | if test "$have_c99_bool" = yes ; then |
| 1777 | AC_CHECK_SIZEOF(_Bool, 1) |
| 1778 | fi |
| 1779 | |
Martin v. Löwis | ebe2670 | 2006-10-02 14:55:51 +0000 | [diff] [blame] | 1780 | AC_CHECK_TYPES(uintptr_t, |
| 1781 | [AC_CHECK_SIZEOF(uintptr_t, 4)], |
Martin v. Löwis | 40e9aed | 2006-10-02 15:20:37 +0000 | [diff] [blame] | 1782 | [], [#ifdef HAVE_STDINT_H |
| 1783 | #include <stdint.h> |
Antoine Pitrou | 7be5a65 | 2010-10-10 08:14:41 +0000 | [diff] [blame] | 1784 | #endif |
| 1785 | #ifdef HAVE_INTTYPES_H |
| 1786 | #include <inttypes.h> |
Martin v. Löwis | 40e9aed | 2006-10-02 15:20:37 +0000 | [diff] [blame] | 1787 | #endif]) |
Martin v. Löwis | ebe2670 | 2006-10-02 14:55:51 +0000 | [diff] [blame] | 1788 | |
Alexandre Vassalotti | 856782e | 2009-07-17 04:59:05 +0000 | [diff] [blame] | 1789 | AC_CHECK_SIZEOF(off_t, [], [ |
| 1790 | #ifdef HAVE_SYS_TYPES_H |
| 1791 | #include <sys/types.h> |
| 1792 | #endif |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1793 | ]) |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1794 | |
| 1795 | AC_MSG_CHECKING(whether to enable large file support) |
Mark Dickinson | 0ef0b91 | 2009-12-31 21:11:48 +0000 | [diff] [blame] | 1796 | if test "$have_long_long" = yes |
| 1797 | then |
| 1798 | if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ |
Guido van Rossum | 8bc1dfd | 1999-04-10 16:01:48 +0000 | [diff] [blame] | 1799 | "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1800 | AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1, |
| 1801 | [Defined to enable large file support when an off_t is bigger than a long |
| 1802 | and long long is available and at least as big as an off_t. You may need |
| 1803 | to add some flags for configuration and compilation to enable this mode. |
| 1804 | (For Solaris and Linux, the necessary defines are already defined.)]) |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1805 | AC_MSG_RESULT(yes) |
| 1806 | else |
| 1807 | AC_MSG_RESULT(no) |
| 1808 | fi |
Mark Dickinson | 0ef0b91 | 2009-12-31 21:11:48 +0000 | [diff] [blame] | 1809 | else |
| 1810 | AC_MSG_RESULT(no) |
| 1811 | fi |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1812 | |
Alexandre Vassalotti | 856782e | 2009-07-17 04:59:05 +0000 | [diff] [blame] | 1813 | AC_CHECK_SIZEOF(time_t, [], [ |
| 1814 | #ifdef HAVE_SYS_TYPES_H |
| 1815 | #include <sys/types.h> |
| 1816 | #endif |
| 1817 | #ifdef HAVE_TIME_H |
| 1818 | #include <time.h> |
| 1819 | #endif |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 1820 | ]) |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1821 | |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 1822 | # if have pthread_t then define SIZEOF_PTHREAD_T |
Martin v. Löwis | 123cbd2 | 2001-07-19 14:21:10 +0000 | [diff] [blame] | 1823 | ac_save_cc="$CC" |
| 1824 | if test "$ac_cv_kpthread" = "yes" |
| 1825 | then CC="$CC -Kpthread" |
Martin v. Löwis | 5f433f0 | 2003-05-05 05:05:30 +0000 | [diff] [blame] | 1826 | elif test "$ac_cv_kthread" = "yes" |
| 1827 | then CC="$CC -Kthread" |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 1828 | elif test "$ac_cv_pthread" = "yes" |
| 1829 | then CC="$CC -pthread" |
Martin v. Löwis | 123cbd2 | 2001-07-19 14:21:10 +0000 | [diff] [blame] | 1830 | fi |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 1831 | AC_MSG_CHECKING(for pthread_t) |
| 1832 | have_pthread_t=no |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1833 | AC_COMPILE_IFELSE([ |
| 1834 | AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t x; x = *(pthread_t*)0;]]) |
| 1835 | ],[have_pthread_t=yes],[]) |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 1836 | AC_MSG_RESULT($have_pthread_t) |
| 1837 | if test "$have_pthread_t" = yes ; then |
Alexandre Vassalotti | 856782e | 2009-07-17 04:59:05 +0000 | [diff] [blame] | 1838 | AC_CHECK_SIZEOF(pthread_t, [], [ |
| 1839 | #ifdef HAVE_PTHREAD_H |
| 1840 | #include <pthread.h> |
| 1841 | #endif |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 1842 | ]) |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 1843 | fi |
Martin v. Löwis | 123cbd2 | 2001-07-19 14:21:10 +0000 | [diff] [blame] | 1844 | CC="$ac_save_cc" |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 1845 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1846 | AC_MSG_CHECKING(for --enable-toolbox-glue) |
| 1847 | AC_ARG_ENABLE(toolbox-glue, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 1848 | AS_HELP_STRING([--enable-toolbox-glue], [disable/enable MacOSX glue code for extensions])) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1849 | |
| 1850 | if test -z "$enable_toolbox_glue" |
| 1851 | then |
| 1852 | case $ac_sys_system/$ac_sys_release in |
| 1853 | Darwin/*) |
| 1854 | enable_toolbox_glue="yes";; |
| 1855 | *) |
| 1856 | enable_toolbox_glue="no";; |
| 1857 | esac |
| 1858 | fi |
| 1859 | case "$enable_toolbox_glue" in |
| 1860 | yes) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1861 | extra_machdep_objs="Python/mactoolboxglue.o" |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 1862 | extra_undefs="-u _PyMac_Error" |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1863 | AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE, 1, |
| 1864 | [Define if you want to use MacPython modules on MacOSX in unix-Python.]) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1865 | ;; |
| 1866 | *) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1867 | extra_machdep_objs="" |
Jack Jansen | 591cbed | 2001-08-15 13:55:15 +0000 | [diff] [blame] | 1868 | extra_undefs="" |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1869 | ;; |
| 1870 | esac |
| 1871 | AC_MSG_RESULT($enable_toolbox_glue) |
| 1872 | |
Ronald Oussoren | 0d236eb | 2008-06-06 21:31:33 +0000 | [diff] [blame] | 1873 | |
Bob Ippolito | 7026a0a | 2005-03-28 23:23:47 +0000 | [diff] [blame] | 1874 | AC_SUBST(OTHER_LIBTOOL_OPT) |
| 1875 | case $ac_sys_system/$ac_sys_release in |
Anthony Baxter | 8220174 | 2006-04-09 15:07:40 +0000 | [diff] [blame] | 1876 | Darwin/@<:@01567@:>@\..*) |
Bob Ippolito | 7026a0a | 2005-03-28 23:23:47 +0000 | [diff] [blame] | 1877 | OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000" |
| 1878 | ;; |
| 1879 | Darwin/*) |
| 1880 | OTHER_LIBTOOL_OPT="" |
| 1881 | ;; |
| 1882 | esac |
| 1883 | |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1884 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 1885 | AC_SUBST(LIBTOOL_CRUFT) |
| 1886 | case $ac_sys_system/$ac_sys_release in |
Anthony Baxter | 8220174 | 2006-04-09 15:07:40 +0000 | [diff] [blame] | 1887 | Darwin/@<:@01567@:>@\..*) |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 1888 | LIBTOOL_CRUFT="-framework System -lcc_dynamic" |
| 1889 | if test "${enable_universalsdk}"; then |
| 1890 | : |
| 1891 | else |
Ronald Oussoren | bc0e83c | 2010-02-11 13:26:54 +0000 | [diff] [blame] | 1892 | LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`" |
Ronald Oussoren | 988117f | 2006-04-29 11:31:35 +0000 | [diff] [blame] | 1893 | fi |
Jack Jansen | b36687a | 2004-07-16 08:43:47 +0000 | [diff] [blame] | 1894 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Jack Jansen | a3891ea | 2001-09-07 14:25:12 +0000 | [diff] [blame] | 1895 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 1896 | Darwin/*) |
Ronald Oussoren | a55af9a | 2010-01-17 16:25:57 +0000 | [diff] [blame] | 1897 | gcc_version=`gcc -dumpversion` |
Bob Ippolito | 7026a0a | 2005-03-28 23:23:47 +0000 | [diff] [blame] | 1898 | if test ${gcc_version} '<' 4.0 |
| 1899 | then |
| 1900 | LIBTOOL_CRUFT="-lcc_dynamic" |
| 1901 | else |
| 1902 | LIBTOOL_CRUFT="" |
| 1903 | fi |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1904 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1905 | #include <unistd.h> |
| 1906 | int main(int argc, char*argv[]) |
| 1907 | { |
| 1908 | if (sizeof(long) == 4) { |
| 1909 | return 0; |
| 1910 | } else { |
| 1911 | return 1; |
| 1912 | } |
Ronald Oussoren | 84ddd72 | 2009-09-08 07:17:10 +0000 | [diff] [blame] | 1913 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 1914 | ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes]) |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1915 | |
| 1916 | if test "${ac_osx_32bit}" = "yes"; then |
Ronald Oussoren | bc0e83c | 2010-02-11 13:26:54 +0000 | [diff] [blame] | 1917 | case `/usr/bin/arch` in |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1918 | i386) |
| 1919 | MACOSX_DEFAULT_ARCH="i386" |
| 1920 | ;; |
| 1921 | ppc) |
| 1922 | MACOSX_DEFAULT_ARCH="ppc" |
| 1923 | ;; |
| 1924 | *) |
| 1925 | AC_MSG_ERROR([Unexpected output of 'arch' on OSX]) |
| 1926 | ;; |
| 1927 | esac |
| 1928 | else |
Ronald Oussoren | bc0e83c | 2010-02-11 13:26:54 +0000 | [diff] [blame] | 1929 | case `/usr/bin/arch` in |
Ronald Oussoren | 2596758 | 2009-09-06 10:00:26 +0000 | [diff] [blame] | 1930 | i386) |
| 1931 | MACOSX_DEFAULT_ARCH="x86_64" |
| 1932 | ;; |
| 1933 | ppc) |
| 1934 | MACOSX_DEFAULT_ARCH="ppc64" |
| 1935 | ;; |
| 1936 | *) |
| 1937 | AC_MSG_ERROR([Unexpected output of 'arch' on OSX]) |
| 1938 | ;; |
| 1939 | esac |
| 1940 | |
| 1941 | #ARCH_RUN_32BIT="true" |
| 1942 | fi |
| 1943 | |
| 1944 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}" |
Jack Jansen | b36687a | 2004-07-16 08:43:47 +0000 | [diff] [blame] | 1945 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1946 | LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 1947 | esac |
| 1948 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1949 | AC_MSG_CHECKING(for --enable-framework) |
| 1950 | if test "$enable_framework" |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 1951 | then |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 1952 | BASECFLAGS="$BASECFLAGS -fno-common -dynamic" |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1953 | # -F. is needed to allow linking to the framework while |
| 1954 | # in the build location. |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1955 | AC_DEFINE(WITH_NEXT_FRAMEWORK, 1, |
| 1956 | [Define if you want to produce an OpenStep/Rhapsody framework |
| 1957 | (shared library plus accessory files).]) |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 1958 | AC_MSG_RESULT(yes) |
Ronald Oussoren | 450d561 | 2009-06-08 21:12:41 +0000 | [diff] [blame] | 1959 | if test $enable_shared = "yes" |
| 1960 | then |
Ronald Oussoren | 9ebd242 | 2009-09-29 13:00:44 +0000 | [diff] [blame] | 1961 | AC_MSG_ERROR([Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead. See Mac/README.]) |
Ronald Oussoren | 450d561 | 2009-06-08 21:12:41 +0000 | [diff] [blame] | 1962 | fi |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 1963 | else |
| 1964 | AC_MSG_RESULT(no) |
| 1965 | fi |
| 1966 | |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1967 | AC_MSG_CHECKING(for dyld) |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 1968 | case $ac_sys_system/$ac_sys_release in |
| 1969 | Darwin/*) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 1970 | AC_DEFINE(WITH_DYLD, 1, |
| 1971 | [Define if you want to use the new-style (Openstep, Rhapsody, MacOS) |
| 1972 | dynamic linker (dyld) instead of the old-style (NextStep) dynamic |
| 1973 | linker (rld). Dyld is necessary to support frameworks.]) |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 1974 | AC_MSG_RESULT(always on for Darwin) |
| 1975 | ;; |
| 1976 | *) |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 1977 | AC_MSG_RESULT(no) |
| 1978 | ;; |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 1979 | esac |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 1980 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 1981 | # Set info about shared libraries. |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 1982 | AC_SUBST(SO) |
| 1983 | AC_SUBST(LDSHARED) |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 1984 | AC_SUBST(LDCXXSHARED) |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 1985 | AC_SUBST(BLDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 1986 | AC_SUBST(CCSHARED) |
| 1987 | AC_SUBST(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 1988 | # SO is the extension of shared libraries `(including the dot!) |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 1989 | # -- usually .so, .sl on HP-UX, .dll on Cygwin |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1990 | AC_MSG_CHECKING(SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 1991 | if test -z "$SO" |
| 1992 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1993 | case $ac_sys_system in |
Neal Norwitz | 58e2888 | 2006-05-19 07:00:58 +0000 | [diff] [blame] | 1994 | hp*|HP*) |
| 1995 | case `uname -m` in |
| 1996 | ia64) SO=.so;; |
| 1997 | *) SO=.sl;; |
| 1998 | esac |
| 1999 | ;; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 2000 | CYGWIN*) SO=.dll;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 2001 | *) SO=.so;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2002 | esac |
Martin v. Löwis | 368de8f | 2003-06-14 14:46:38 +0000 | [diff] [blame] | 2003 | else |
| 2004 | # this might also be a termcap variable, see #610332 |
| 2005 | echo |
| 2006 | echo '=====================================================================' |
| 2007 | echo '+ +' |
| 2008 | echo '+ WARNING: You have set SO in your environment. +' |
| 2009 | echo '+ Do you really mean to change the extension for shared libraries? +' |
| 2010 | echo '+ Continuing in 10 seconds to let you to ponder. +' |
| 2011 | echo '+ +' |
| 2012 | echo '=====================================================================' |
| 2013 | sleep 10 |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2014 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2015 | AC_MSG_RESULT($SO) |
Ronald Oussoren | 79f9049 | 2009-01-02 10:44:46 +0000 | [diff] [blame] | 2016 | |
Neal Norwitz | 58e2888 | 2006-05-19 07:00:58 +0000 | [diff] [blame] | 2017 | AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).]) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2018 | # LDSHARED is the ld *command* used to create shared library |
Skip Montanaro | ce59c04 | 2004-01-17 14:19:44 +0000 | [diff] [blame] | 2019 | # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 2020 | # (Shared libraries in this instance are shared modules to be loaded into |
| 2021 | # Python, as opposed to building Python itself as a shared library.) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2022 | AC_MSG_CHECKING(LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2023 | if test -z "$LDSHARED" |
| 2024 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2025 | case $ac_sys_system/$ac_sys_release in |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 2026 | AIX*) |
Georg Brandl | 71f4fbb | 2011-02-25 11:04:50 +0000 | [diff] [blame] | 2027 | BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:\$(srcdir)/Modules/python.exp" |
Guido van Rossum | ce608b0 | 2001-09-28 15:59:38 +0000 | [diff] [blame] | 2028 | LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp" |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 2029 | ;; |
| 2030 | BeOS*) |
| 2031 | BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY" |
Guido van Rossum | ce608b0 | 2001-09-28 15:59:38 +0000 | [diff] [blame] | 2032 | LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY" |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 2033 | ;; |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 2034 | IRIX/5*) LDSHARED="ld -shared";; |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 2035 | IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; |
Greg Ward | 57c9a66 | 2000-05-26 12:22:54 +0000 | [diff] [blame] | 2036 | SunOS/5*) |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2037 | if test "$GCC" = "yes" ; then |
| 2038 | LDSHARED='$(CC) -shared' |
| 2039 | LDCXXSHARED='$(CXX) -shared' |
| 2040 | else |
| 2041 | LDSHARED='$(CC) -G' |
| 2042 | LDCXXSHARED='$(CXX) -G' |
Greg Ward | 57c9a66 | 2000-05-26 12:22:54 +0000 | [diff] [blame] | 2043 | fi ;; |
Thomas Heller | dc96a77 | 2008-04-04 10:07:55 +0000 | [diff] [blame] | 2044 | hp*|HP*) |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2045 | if test "$GCC" = "yes" ; then |
| 2046 | LDSHARED='$(CC) -shared' |
| 2047 | LDCXXSHARED='$(CXX) -shared' |
| 2048 | else |
| 2049 | LDSHARED='ld -b' |
Thomas Heller | dc96a77 | 2008-04-04 10:07:55 +0000 | [diff] [blame] | 2050 | fi ;; |
Guido van Rossum | 71001e4 | 1995-01-26 00:44:03 +0000 | [diff] [blame] | 2051 | OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; |
Jack Jansen | 418c3b1 | 2001-11-14 10:59:57 +0000 | [diff] [blame] | 2052 | Darwin/1.3*) |
Stefan Krah | 3a3e203 | 2010-11-28 15:30:05 +0000 | [diff] [blame] | 2053 | LDSHARED='$(CC) -bundle' |
| 2054 | LDCXXSHARED='$(CXX) -bundle' |
Jack Jansen | a3891ea | 2001-09-07 14:25:12 +0000 | [diff] [blame] | 2055 | if test "$enable_framework" ; then |
| 2056 | # Link against the framework. All externals should be defined. |
Jack Jansen | da49e19 | 2005-01-07 13:08:22 +0000 | [diff] [blame] | 2057 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
| 2058 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2059 | LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Jack Jansen | a3891ea | 2001-09-07 14:25:12 +0000 | [diff] [blame] | 2060 | else |
| 2061 | # No framework. Ignore undefined symbols, assuming they come from Python |
Jack Jansen | 418c3b1 | 2001-11-14 10:59:57 +0000 | [diff] [blame] | 2062 | LDSHARED="$LDSHARED -undefined suppress" |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2063 | LDCXXSHARED="$LDCXXSHARED -undefined suppress" |
Jack Jansen | a3891ea | 2001-09-07 14:25:12 +0000 | [diff] [blame] | 2064 | fi ;; |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 2065 | Darwin/1.4*|Darwin/5.*|Darwin/6.*) |
Stefan Krah | 3a3e203 | 2010-11-28 15:30:05 +0000 | [diff] [blame] | 2066 | LDSHARED='$(CC) -bundle' |
| 2067 | LDCXXSHARED='$(CXX) -bundle' |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2068 | if test "$enable_framework" ; then |
| 2069 | # Link against the framework. All externals should be defined. |
Jack Jansen | da49e19 | 2005-01-07 13:08:22 +0000 | [diff] [blame] | 2070 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
| 2071 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2072 | LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2073 | else |
Michael W. Hudson | 0c46c0c | 2002-03-07 09:58:56 +0000 | [diff] [blame] | 2074 | # No framework, use the Python app as bundle-loader |
| 2075 | BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)' |
Jack Jansen | c28fc37 | 2003-02-25 13:14:43 +0000 | [diff] [blame] | 2076 | LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2077 | LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 2078 | fi ;; |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 2079 | Darwin/*) |
| 2080 | # Use -undefined dynamic_lookup whenever possible (10.3 and later). |
| 2081 | # This allows an extension to be used in any Python |
Ronald Oussoren | 38f1b98 | 2007-09-02 09:46:07 +0000 | [diff] [blame] | 2082 | |
Ned Deily | c40b903 | 2014-06-25 13:48:46 -0700 | [diff] [blame] | 2083 | dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \ |
| 2084 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` |
| 2085 | dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \ |
| 2086 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` |
| 2087 | if test ${dep_target_major} -eq 10 && \ |
| 2088 | test ${dep_target_minor} -le 2 |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 2089 | then |
Ned Deily | c40b903 | 2014-06-25 13:48:46 -0700 | [diff] [blame] | 2090 | # building for OS X 10.0 through 10.2 |
Stefan Krah | 3a3e203 | 2010-11-28 15:30:05 +0000 | [diff] [blame] | 2091 | LDSHARED='$(CC) -bundle' |
| 2092 | LDCXXSHARED='$(CXX) -bundle' |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 2093 | if test "$enable_framework" ; then |
| 2094 | # Link against the framework. All externals should be defined. |
Jack Jansen | da49e19 | 2005-01-07 13:08:22 +0000 | [diff] [blame] | 2095 | BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
| 2096 | LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2097 | LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 2098 | else |
| 2099 | # No framework, use the Python app as bundle-loader |
| 2100 | BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)' |
| 2101 | LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2102 | LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 2103 | fi |
Ned Deily | c40b903 | 2014-06-25 13:48:46 -0700 | [diff] [blame] | 2104 | else |
| 2105 | # building for OS X 10.3 and later |
| 2106 | if test "${enable_universalsdk}"; then |
| 2107 | LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}" |
| 2108 | fi |
| 2109 | LDSHARED='$(CC) -bundle -undefined dynamic_lookup' |
| 2110 | LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup' |
| 2111 | BLDSHARED="$LDSHARED" |
Jack Jansen | 6b08a40 | 2004-06-03 12:41:45 +0000 | [diff] [blame] | 2112 | fi |
| 2113 | ;; |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2114 | Linux*|GNU*|QNX*) |
| 2115 | LDSHARED='$(CC) -shared' |
| 2116 | LDCXXSHARED='$(CXX) -shared';; |
| 2117 | BSD/OS*/4*) |
| 2118 | LDSHARED="gcc -shared" |
| 2119 | LDCXXSHARED="g++ -shared";; |
Martin v. Löwis | 222c515 | 2006-06-03 07:37:13 +0000 | [diff] [blame] | 2120 | FreeBSD*) |
Jeremy Hylton | 4bcc7c5 | 2000-08-31 17:45:35 +0000 | [diff] [blame] | 2121 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 2122 | then |
Stefan Krah | 3a3e203 | 2010-11-28 15:30:05 +0000 | [diff] [blame] | 2123 | LDSHARED='$(CC) -shared' |
| 2124 | LDCXXSHARED='$(CXX) -shared' |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 2125 | else |
Stefan Krah | 3a3e203 | 2010-11-28 15:30:05 +0000 | [diff] [blame] | 2126 | LDSHARED="ld -Bshareable" |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 2127 | fi;; |
Martin v. Löwis | 222c515 | 2006-06-03 07:37:13 +0000 | [diff] [blame] | 2128 | OpenBSD*) |
| 2129 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
| 2130 | then |
Stefan Krah | 3a3e203 | 2010-11-28 15:30:05 +0000 | [diff] [blame] | 2131 | LDSHARED='$(CC) -shared $(CCSHARED)' |
| 2132 | LDCXXSHARED='$(CXX) -shared $(CCSHARED)' |
Martin v. Löwis | 222c515 | 2006-06-03 07:37:13 +0000 | [diff] [blame] | 2133 | else |
| 2134 | case `uname -r` in |
| 2135 | [[01]].* | 2.[[0-7]] | 2.[[0-7]].*) |
| 2136 | LDSHARED="ld -Bshareable ${LDFLAGS}" |
| 2137 | ;; |
| 2138 | *) |
Stefan Krah | 3a3e203 | 2010-11-28 15:30:05 +0000 | [diff] [blame] | 2139 | LDSHARED='$(CC) -shared $(CCSHARED)' |
| 2140 | LDCXXSHARED='$(CXX) -shared $(CCSHARED)' |
Martin v. Löwis | 222c515 | 2006-06-03 07:37:13 +0000 | [diff] [blame] | 2141 | ;; |
| 2142 | esac |
| 2143 | fi;; |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2144 | NetBSD*|DragonFly*) |
Antoine Pitrou | cb40277 | 2011-01-02 20:51:34 +0000 | [diff] [blame] | 2145 | LDSHARED='$(CC) -shared' |
| 2146 | LDCXXSHARED='$(CXX) -shared';; |
Martin v. Löwis | 25ae43b | 2001-10-07 08:39:18 +0000 | [diff] [blame] | 2147 | OpenUNIX*|UnixWare*) |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2148 | if test "$GCC" = "yes" ; then |
| 2149 | LDSHARED='$(CC) -shared' |
| 2150 | LDCXXSHARED='$(CXX) -shared' |
| 2151 | else |
| 2152 | LDSHARED='$(CC) -G' |
| 2153 | LDCXXSHARED='$(CXX) -G' |
Martin v. Löwis | bec1958 | 2001-03-21 15:57:54 +0000 | [diff] [blame] | 2154 | fi;; |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2155 | SCO_SV*) |
| 2156 | LDSHARED='$(CC) -Wl,-G,-Bexport' |
| 2157 | LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';; |
| 2158 | CYGWIN*) |
| 2159 | LDSHARED="gcc -shared -Wl,--enable-auto-image-base" |
| 2160 | LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; |
| 2161 | atheos*) |
| 2162 | LDSHARED="gcc -shared" |
| 2163 | LDCXXSHARED="g++ -shared";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2164 | *) LDSHARED="ld";; |
| 2165 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2166 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2167 | AC_MSG_RESULT($LDSHARED) |
Tarek Ziadé | 0000295 | 2010-04-03 08:37:59 +0000 | [diff] [blame] | 2168 | LDCXXSHARED=${LDCXXSHARED-$LDSHARED} |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 2169 | BLDSHARED=${BLDSHARED-$LDSHARED} |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2170 | # CCSHARED are the C *flags* used to create objects to go into a shared |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 2171 | # library (module) -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2172 | AC_MSG_CHECKING(CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2173 | if test -z "$CCSHARED" |
| 2174 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 2175 | case $ac_sys_system/$ac_sys_release in |
Neil Schemenauer | 6625216 | 2001-02-19 04:47:42 +0000 | [diff] [blame] | 2176 | SunOS*) if test "$GCC" = yes; |
Martin v. Löwis | eb62357 | 2007-03-12 10:50:39 +0000 | [diff] [blame] | 2177 | then CCSHARED="-fPIC"; |
| 2178 | elif test `uname -p` = sparc; |
| 2179 | then CCSHARED="-xcode=pic32"; |
| 2180 | else CCSHARED="-Kpic"; |
| 2181 | fi;; |
Guido van Rossum | af07a44 | 1995-02-13 19:45:27 +0000 | [diff] [blame] | 2182 | hp*|HP*) if test "$GCC" = yes; |
Martin v. Löwis | 703ad70 | 2001-09-05 08:36:52 +0000 | [diff] [blame] | 2183 | then CCSHARED="-fPIC"; |
Guido van Rossum | af07a44 | 1995-02-13 19:45:27 +0000 | [diff] [blame] | 2184 | else CCSHARED="+z"; |
| 2185 | fi;; |
Martin v. Löwis | a6e9758 | 2002-01-01 18:41:33 +0000 | [diff] [blame] | 2186 | Linux*|GNU*) CCSHARED="-fPIC";; |
Guido van Rossum | f5957ea | 1999-10-05 21:59:33 +0000 | [diff] [blame] | 2187 | BSD/OS*/4*) CCSHARED="-fpic";; |
Martin v. Löwis | 86d6626 | 2006-02-17 08:40:11 +0000 | [diff] [blame] | 2188 | FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; |
Martin v. Löwis | 25ae43b | 2001-10-07 08:39:18 +0000 | [diff] [blame] | 2189 | OpenUNIX*|UnixWare*) |
Martin v. Löwis | bec1958 | 2001-03-21 15:57:54 +0000 | [diff] [blame] | 2190 | if test "$GCC" = "yes" |
| 2191 | then CCSHARED="-fPIC" |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2192 | else CCSHARED="-KPIC" |
Martin v. Löwis | bec1958 | 2001-03-21 15:57:54 +0000 | [diff] [blame] | 2193 | fi;; |
Martin v. Löwis | 21ee409 | 2002-09-30 16:19:48 +0000 | [diff] [blame] | 2194 | SCO_SV*) |
| 2195 | if test "$GCC" = "yes" |
| 2196 | then CCSHARED="-fPIC" |
| 2197 | else CCSHARED="-Kpic -belf" |
| 2198 | fi;; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 2199 | IRIX*/6*) case $CC in |
| 2200 | *gcc*) CCSHARED="-shared";; |
Guido van Rossum | ee21f41 | 1998-04-20 18:51:54 +0000 | [diff] [blame] | 2201 | *) CCSHARED="";; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 2202 | esac;; |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 2203 | atheos*) CCSHARED="-fPIC";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2204 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2205 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2206 | AC_MSG_RESULT($CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2207 | # LINKFORSHARED are the flags passed to the $(CC) command that links |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 2208 | # the python executable -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2209 | AC_MSG_CHECKING(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2210 | if test -z "$LINKFORSHARED" |
| 2211 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 2212 | case $ac_sys_system/$ac_sys_release in |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 2213 | AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';; |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 2214 | hp*|HP*) |
Martin v. Löwis | 1142de3 | 2002-03-29 16:28:31 +0000 | [diff] [blame] | 2215 | LINKFORSHARED="-Wl,-E -Wl,+s";; |
| 2216 | # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; |
Guido van Rossum | f5957ea | 1999-10-05 21:59:33 +0000 | [diff] [blame] | 2217 | BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; |
Martin v. Löwis | a6e9758 | 2002-01-01 18:41:33 +0000 | [diff] [blame] | 2218 | Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 2219 | # -u libsys_s pulls in all symbols in libsys |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2220 | Darwin/*) |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 2221 | # -u _PyMac_Error is needed to pull in the mac toolbox glue, |
| 2222 | # which is |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2223 | # not used by the core itself but which needs to be in the core so |
| 2224 | # that dynamically loaded extension modules have access to it. |
Jack Jansen | 97e3f00 | 2003-02-23 22:59:01 +0000 | [diff] [blame] | 2225 | # -prebind is no longer used, because it actually seems to give a |
| 2226 | # slowdown in stead of a speedup, maybe due to the large number of |
| 2227 | # dynamic loads Python does. |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 2228 | |
| 2229 | LINKFORSHARED="$extra_undefs" |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2230 | if test "$enable_framework" |
| 2231 | then |
Jack Jansen | da49e19 | 2005-01-07 13:08:22 +0000 | [diff] [blame] | 2232 | LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2233 | fi |
Raymond Hettinger | ec6eb36 | 2004-11-05 07:02:59 +0000 | [diff] [blame] | 2234 | LINKFORSHARED="$LINKFORSHARED";; |
Martin v. Löwis | 25ae43b | 2001-10-07 08:39:18 +0000 | [diff] [blame] | 2235 | OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";; |
Martin v. Löwis | 21ee409 | 2002-09-30 16:19:48 +0000 | [diff] [blame] | 2236 | SCO_SV*) LINKFORSHARED="-Wl,-Bexport";; |
Fred Drake | 02706f5 | 2000-09-25 15:08:46 +0000 | [diff] [blame] | 2237 | ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; |
Martin v. Löwis | 86d6626 | 2006-02-17 08:40:11 +0000 | [diff] [blame] | 2238 | FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) |
Guido van Rossum | df69365 | 1999-01-07 21:50:41 +0000 | [diff] [blame] | 2239 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
| 2240 | then |
| 2241 | LINKFORSHARED="-Wl,--export-dynamic" |
| 2242 | fi;; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 2243 | SunOS/5*) case $CC in |
| 2244 | *gcc*) |
Martin v. Löwis | a454857 | 2002-04-18 14:51:36 +0000 | [diff] [blame] | 2245 | if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null |
Guido van Rossum | 8f4ceb1 | 1997-12-18 23:42:19 +0000 | [diff] [blame] | 2246 | then |
| 2247 | LINKFORSHARED="-Xlinker --export-dynamic" |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 2248 | fi;; |
| 2249 | esac;; |
Jason Tishler | 3076559 | 2003-09-04 11:04:06 +0000 | [diff] [blame] | 2250 | CYGWIN*) |
| 2251 | if test $enable_shared = "no" |
| 2252 | then |
| 2253 | LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)' |
| 2254 | fi;; |
Martin v. Löwis | 8c255e4 | 2008-05-23 15:06:50 +0000 | [diff] [blame] | 2255 | QNX*) |
| 2256 | # -Wl,-E causes the symbols to be added to the dynamic |
| 2257 | # symbol table so that they can be found when a module |
| 2258 | # is loaded. -N 2048K causes the stack size to be set |
| 2259 | # to 2048 kilobytes so that the stack doesn't overflow |
| 2260 | # when running test_compile.py. |
| 2261 | LINKFORSHARED='-Wl,-E -N 2048K';; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2262 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2263 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2264 | AC_MSG_RESULT($LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 2265 | |
Ronald Oussoren | 0d236eb | 2008-06-06 21:31:33 +0000 | [diff] [blame] | 2266 | |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 2267 | AC_SUBST(CFLAGSFORSHARED) |
| 2268 | AC_MSG_CHECKING(CFLAGSFORSHARED) |
| 2269 | if test ! "$LIBRARY" = "$LDLIBRARY" |
| 2270 | then |
Neil Schemenauer | d9cf41c | 2001-01-27 21:39:17 +0000 | [diff] [blame] | 2271 | case $ac_sys_system in |
| 2272 | CYGWIN*) |
| 2273 | # Cygwin needs CCSHARED when building extension DLLs |
| 2274 | # but not when building the interpreter DLL. |
| 2275 | CFLAGSFORSHARED='';; |
| 2276 | *) |
| 2277 | CFLAGSFORSHARED='$(CCSHARED)' |
| 2278 | esac |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 2279 | fi |
| 2280 | AC_MSG_RESULT($CFLAGSFORSHARED) |
| 2281 | |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 2282 | # SHLIBS are libraries (except -lc and -lm) to link to the python shared |
| 2283 | # library (with --enable-shared). |
| 2284 | # For platforms on which shared libraries are not allowed to have unresolved |
Martin v. Löwis | d6359c5 | 2002-08-04 12:38:50 +0000 | [diff] [blame] | 2285 | # symbols, this must be set to $(LIBS) (expanded by make). We do this even |
| 2286 | # if it is not required, since it creates a dependency of the shared library |
| 2287 | # to LIBS. This, in turn, means that applications linking the shared libpython |
| 2288 | # don't need to link LIBS explicitly. The default should be only changed |
| 2289 | # on systems where this approach causes problems. |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 2290 | AC_SUBST(SHLIBS) |
| 2291 | AC_MSG_CHECKING(SHLIBS) |
| 2292 | case "$ac_sys_system" in |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 2293 | *) |
Martin v. Löwis | d6359c5 | 2002-08-04 12:38:50 +0000 | [diff] [blame] | 2294 | SHLIBS='$(LIBS)';; |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 2295 | esac |
| 2296 | AC_MSG_RESULT($SHLIBS) |
| 2297 | |
| 2298 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 2299 | # checks for libraries |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 2300 | AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV |
| 2301 | AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX |
Victor Stinner | 7c90667 | 2015-01-06 13:53:37 +0100 | [diff] [blame] | 2302 | AC_CHECK_LIB(crypto, RAND_egd, |
| 2303 | AC_DEFINE(HAVE_RAND_EGD, 1, |
| 2304 | [Define if the libcrypto has RAND_egd])) |
Martin v. Löwis | 519adae | 2003-09-20 10:47:47 +0000 | [diff] [blame] | 2305 | |
Skip Montanaro | 4d756af | 2008-12-01 01:55:22 +0000 | [diff] [blame] | 2306 | # only check for sem_init if thread support is requested |
Martin v. Löwis | 519adae | 2003-09-20 10:47:47 +0000 | [diff] [blame] | 2307 | if test "$with_threads" = "yes" -o -z "$with_threads"; then |
| 2308 | AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris |
| 2309 | # posix4 on Solaris 2.6 |
| 2310 | # pthread (first!) on Linux |
| 2311 | fi |
| 2312 | |
Martin v. Löwis | 19d1734 | 2003-06-14 21:03:05 +0000 | [diff] [blame] | 2313 | # check if we need libintl for locale functions |
| 2314 | AC_CHECK_LIB(intl, textdomain, |
| 2315 | AC_DEFINE(WITH_LIBINTL, 1, |
| 2316 | [Define to 1 if libintl is needed for locale functions.])) |
Guido van Rossum | 0eefa3f | 1999-11-16 15:57:37 +0000 | [diff] [blame] | 2317 | |
| 2318 | # checks for system dependent C++ extensions support |
| 2319 | case "$ac_sys_system" in |
| 2320 | AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2321 | AC_LINK_IFELSE([ |
Georg Brandl | 94800df | 2011-02-25 11:09:02 +0000 | [diff] [blame] | 2322 | AC_LANG_PROGRAM([[#include <load.h>]], |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2323 | [[loadAndInit("", 0, "")]]) |
| 2324 | ],[ |
| 2325 | AC_DEFINE(AIX_GENUINE_CPLUSPLUS, 1, |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2326 | [Define for AIX if your compiler is a genuine IBM xlC/xlC_r |
| 2327 | and you want support for AIX C++ shared extension modules.]) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2328 | AC_MSG_RESULT(yes) |
| 2329 | ],[ |
| 2330 | AC_MSG_RESULT(no) |
| 2331 | ]);; |
Guido van Rossum | 0eefa3f | 1999-11-16 15:57:37 +0000 | [diff] [blame] | 2332 | *) ;; |
| 2333 | esac |
| 2334 | |
Guido van Rossum | 70c7f48 | 1998-03-26 18:44:10 +0000 | [diff] [blame] | 2335 | # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 2336 | # BeOS' sockets are stashed in libnet. |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 2337 | AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 2338 | AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets |
Skip Montanaro | b9949db | 2004-01-17 04:04:13 +0000 | [diff] [blame] | 2339 | |
Jeremy Hylton | cb25d5e | 2000-07-27 21:23:28 +0000 | [diff] [blame] | 2340 | case "$ac_sys_system" in |
| 2341 | BeOS*) |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 2342 | AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS |
| 2343 | ;; |
| 2344 | esac |
Guido van Rossum | 70c7f48 | 1998-03-26 18:44:10 +0000 | [diff] [blame] | 2345 | |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 2346 | AC_MSG_CHECKING(for --with-libs) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2347 | AC_ARG_WITH(libs, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2348 | AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2349 | [ |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 2350 | AC_MSG_RESULT($withval) |
| 2351 | LIBS="$withval $LIBS" |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2352 | ], |
| 2353 | [AC_MSG_RESULT(no)]) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 2354 | |
Benjamin Peterson | 64e8f6e | 2014-12-15 00:00:23 -0500 | [diff] [blame] | 2355 | PKG_PROG_PKG_CONFIG |
Benjamin Peterson | e9e07bf | 2010-03-09 21:46:54 +0000 | [diff] [blame] | 2356 | |
Benjamin Peterson | 2c19674 | 2009-12-31 03:17:18 +0000 | [diff] [blame] | 2357 | # Check for use of the system expat library |
| 2358 | AC_MSG_CHECKING(for --with-system-expat) |
| 2359 | AC_ARG_WITH(system_expat, |
Benjamin Peterson | f2d1b2a | 2010-10-31 16:53:53 +0000 | [diff] [blame] | 2360 | AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]), |
| 2361 | [], |
| 2362 | [with_system_expat="no"]) |
Benjamin Peterson | 2c19674 | 2009-12-31 03:17:18 +0000 | [diff] [blame] | 2363 | |
| 2364 | AC_MSG_RESULT($with_system_expat) |
| 2365 | |
Martin v. Löwis | 9176fc1 | 2006-04-11 11:12:43 +0000 | [diff] [blame] | 2366 | # Check for use of the system libffi library |
| 2367 | AC_MSG_CHECKING(for --with-system-ffi) |
| 2368 | AC_ARG_WITH(system_ffi, |
Benjamin Peterson | f2d1b2a | 2010-10-31 16:53:53 +0000 | [diff] [blame] | 2369 | AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library]), |
| 2370 | [], |
| 2371 | [with_system_ffi="no"]) |
Martin v. Löwis | 9176fc1 | 2006-04-11 11:12:43 +0000 | [diff] [blame] | 2372 | |
Benjamin Peterson | e9e07bf | 2010-03-09 21:46:54 +0000 | [diff] [blame] | 2373 | if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then |
Benjamin Peterson | 1c335e6 | 2010-01-01 15:16:29 +0000 | [diff] [blame] | 2374 | LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`" |
| 2375 | else |
| 2376 | LIBFFI_INCLUDEDIR="" |
| 2377 | fi |
| 2378 | AC_SUBST(LIBFFI_INCLUDEDIR) |
| 2379 | |
Martin v. Löwis | 9176fc1 | 2006-04-11 11:12:43 +0000 | [diff] [blame] | 2380 | AC_MSG_RESULT($with_system_ffi) |
| 2381 | |
Ned Deily | a2a9f57 | 2013-10-25 00:30:10 -0700 | [diff] [blame] | 2382 | # Check for --with-tcltk-includes=path and --with-tcltk-libs=path |
| 2383 | AC_SUBST(TCLTK_INCLUDES) |
| 2384 | AC_SUBST(TCLTK_LIBS) |
| 2385 | AC_MSG_CHECKING(for --with-tcltk-includes) |
| 2386 | AC_ARG_WITH(tcltk-includes, |
| 2387 | AS_HELP_STRING([--with-tcltk-includes='-I...'], [override search for Tcl and Tk include files]), |
| 2388 | [], |
| 2389 | [with_tcltk_includes="default"]) |
| 2390 | AC_MSG_RESULT($with_tcltk_includes) |
| 2391 | AC_MSG_CHECKING(for --with-tcltk-libs) |
| 2392 | AC_ARG_WITH(tcltk-libs, |
| 2393 | AS_HELP_STRING([--with-tcltk-libs='-L...'], [override search for Tcl and Tk libs]), |
| 2394 | [], |
| 2395 | [with_tcltk_libs="default"]) |
| 2396 | AC_MSG_RESULT($with_tcltk_libs) |
| 2397 | if test "x$with_tcltk_includes" = xdefault || test "x$with_tcltk_libs" = xdefault |
| 2398 | then |
| 2399 | if test "x$with_tcltk_includes" != "x$with_tcltk_libs" |
| 2400 | then |
| 2401 | AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither]) |
| 2402 | fi |
| 2403 | TCLTK_INCLUDES="" |
| 2404 | TCLTK_LIBS="" |
| 2405 | else |
| 2406 | TCLTK_INCLUDES="$with_tcltk_includes" |
| 2407 | TCLTK_LIBS="$with_tcltk_libs" |
| 2408 | fi |
| 2409 | |
Matthias Klose | 10cbe48 | 2009-04-29 17:18:19 +0000 | [diff] [blame] | 2410 | # Check for --with-dbmliborder |
| 2411 | AC_MSG_CHECKING(for --with-dbmliborder) |
| 2412 | AC_ARG_WITH(dbmliborder, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2413 | AS_HELP_STRING([--with-dbmliborder=db1:db2:...], [order to check db backends for dbm. Valid value is a colon separated string with the backend names `ndbm', `gdbm' and `bdb'.]), |
Matthias Klose | 10cbe48 | 2009-04-29 17:18:19 +0000 | [diff] [blame] | 2414 | [ |
| 2415 | if test x$with_dbmliborder = xyes |
| 2416 | then |
| 2417 | AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...]) |
| 2418 | else |
| 2419 | for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do |
| 2420 | if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb |
| 2421 | then |
| 2422 | AC_MSG_ERROR([proper usage is --with-dbmliborder=db1:db2:...]) |
| 2423 | fi |
| 2424 | done |
Matthias Klose | 61dbdb9 | 2009-04-29 20:09:50 +0000 | [diff] [blame] | 2425 | fi]) |
| 2426 | AC_MSG_RESULT($with_dbmliborder) |
Matthias Klose | 10cbe48 | 2009-04-29 17:18:19 +0000 | [diff] [blame] | 2427 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 2428 | # Determine if signalmodule should be used. |
| 2429 | AC_SUBST(USE_SIGNAL_MODULE) |
| 2430 | AC_SUBST(SIGNAL_OBJS) |
| 2431 | AC_MSG_CHECKING(for --with-signal-module) |
| 2432 | AC_ARG_WITH(signal-module, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2433 | AS_HELP_STRING([--with-signal-module], [disable/enable signal module])) |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 2434 | |
| 2435 | if test -z "$with_signal_module" |
| 2436 | then with_signal_module="yes" |
| 2437 | fi |
| 2438 | AC_MSG_RESULT($with_signal_module) |
| 2439 | |
| 2440 | if test "${with_signal_module}" = "yes"; then |
| 2441 | USE_SIGNAL_MODULE="" |
| 2442 | SIGNAL_OBJS="" |
| 2443 | else |
| 2444 | USE_SIGNAL_MODULE="#" |
| 2445 | SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o" |
| 2446 | fi |
| 2447 | |
Guido van Rossum | 3d15bd8 | 2001-01-10 18:53:48 +0000 | [diff] [blame] | 2448 | # This is used to generate Setup.config |
Guido van Rossum | 009f787 | 1997-12-04 00:51:42 +0000 | [diff] [blame] | 2449 | AC_SUBST(USE_THREAD_MODULE) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2450 | USE_THREAD_MODULE="" |
Guido van Rossum | 009f787 | 1997-12-04 00:51:42 +0000 | [diff] [blame] | 2451 | |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 2452 | AC_MSG_CHECKING(for --with-dec-threads) |
| 2453 | AC_SUBST(LDLAST) |
| 2454 | AC_ARG_WITH(dec-threads, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2455 | AS_HELP_STRING([--with-dec-threads], [use DEC Alpha/OSF1 thread-safe libraries]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2456 | [ |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2457 | AC_MSG_RESULT($withval) |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 2458 | LDLAST=-threads |
Guido van Rossum | f78abae | 1997-01-21 22:02:36 +0000 | [diff] [blame] | 2459 | if test "${with_thread+set}" != set; then |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 2460 | with_thread="$withval"; |
| 2461 | fi], |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2462 | [AC_MSG_RESULT(no)]) |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 2463 | |
Martin v. Löwis | 1143799 | 2002-04-12 09:54:03 +0000 | [diff] [blame] | 2464 | # Templates for things AC_DEFINEd more than once. |
| 2465 | # For a single AC_DEFINE, no template is needed. |
| 2466 | AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package]) |
| 2467 | AH_TEMPLATE(_REENTRANT, |
| 2468 | [Define to force use of thread-safe errno, h_errno, and other functions]) |
| 2469 | AH_TEMPLATE(WITH_THREAD, |
| 2470 | [Define if you want to compile in rudimentary thread support]) |
| 2471 | |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 2472 | AC_MSG_CHECKING(for --with-threads) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2473 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2474 | AC_ARG_WITH(threads, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2475 | AS_HELP_STRING([--with(out)-threads@<:@=DIRECTORY@:>@], [disable/enable thread support])) |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 2476 | |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2477 | # --with-thread is deprecated, but check for it anyway |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2478 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output |
Barry Warsaw | a0f3c5c | 2000-06-30 16:39:35 +0000 | [diff] [blame] | 2479 | AC_ARG_WITH(thread, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2480 | AS_HELP_STRING([--with(out)-thread@<:@=DIRECTORY@:>@], [deprecated; use --with(out)-threads]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2481 | [with_threads=$with_thread]) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2482 | |
| 2483 | if test -z "$with_threads" |
| 2484 | then with_threads="yes" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 2485 | fi |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2486 | AC_MSG_RESULT($with_threads) |
Guido van Rossum | 6400c26 | 1997-05-22 20:34:27 +0000 | [diff] [blame] | 2487 | |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2488 | AC_SUBST(THREADOBJ) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2489 | if test "$with_threads" = "no" |
| 2490 | then |
| 2491 | USE_THREAD_MODULE="#" |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2492 | elif test "$ac_cv_pthread_is_default" = yes |
| 2493 | then |
| 2494 | AC_DEFINE(WITH_THREAD) |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2495 | # Defining _REENTRANT on system with POSIX threads should not hurt. |
| 2496 | AC_DEFINE(_REENTRANT) |
| 2497 | posix_threads=yes |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2498 | THREADOBJ="Python/thread.o" |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2499 | elif test "$ac_cv_kpthread" = "yes" |
| 2500 | then |
| 2501 | CC="$CC -Kpthread" |
Martin v. Löwis | 519adae | 2003-09-20 10:47:47 +0000 | [diff] [blame] | 2502 | if test "$ac_cv_cxx_thread" = "yes"; then |
| 2503 | CXX="$CXX -Kpthread" |
| 2504 | fi |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2505 | AC_DEFINE(WITH_THREAD) |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2506 | posix_threads=yes |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2507 | THREADOBJ="Python/thread.o" |
Martin v. Löwis | 5f433f0 | 2003-05-05 05:05:30 +0000 | [diff] [blame] | 2508 | elif test "$ac_cv_kthread" = "yes" |
| 2509 | then |
| 2510 | CC="$CC -Kthread" |
Martin v. Löwis | 519adae | 2003-09-20 10:47:47 +0000 | [diff] [blame] | 2511 | if test "$ac_cv_cxx_thread" = "yes"; then |
| 2512 | CXX="$CXX -Kthread" |
| 2513 | fi |
Martin v. Löwis | 5f433f0 | 2003-05-05 05:05:30 +0000 | [diff] [blame] | 2514 | AC_DEFINE(WITH_THREAD) |
| 2515 | posix_threads=yes |
| 2516 | THREADOBJ="Python/thread.o" |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 2517 | elif test "$ac_cv_pthread" = "yes" |
| 2518 | then |
| 2519 | CC="$CC -pthread" |
Martin v. Löwis | 519adae | 2003-09-20 10:47:47 +0000 | [diff] [blame] | 2520 | if test "$ac_cv_cxx_thread" = "yes"; then |
| 2521 | CXX="$CXX -pthread" |
| 2522 | fi |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 2523 | AC_DEFINE(WITH_THREAD) |
| 2524 | posix_threads=yes |
| 2525 | THREADOBJ="Python/thread.o" |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2526 | else |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2527 | if test ! -z "$with_threads" -a -d "$with_threads" |
| 2528 | then LDFLAGS="$LDFLAGS -L$with_threads" |
| 2529 | fi |
| 2530 | if test ! -z "$withval" -a -d "$withval" |
| 2531 | then LDFLAGS="$LDFLAGS -L$withval" |
| 2532 | fi |
Martin v. Löwis | 69c0ff3 | 2001-10-15 14:34:42 +0000 | [diff] [blame] | 2533 | |
| 2534 | # According to the POSIX spec, a pthreads implementation must |
Matthias Klose | a2542be | 2004-08-16 11:35:51 +0000 | [diff] [blame] | 2535 | # define _POSIX_THREADS in unistd.h. Some apparently don't |
| 2536 | # (e.g. gnu pth with pthread emulation) |
Martin v. Löwis | 69c0ff3 | 2001-10-15 14:34:42 +0000 | [diff] [blame] | 2537 | AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h) |
| 2538 | AC_EGREP_CPP(yes, |
Neal Norwitz | 6eb37f0 | 2003-02-23 23:28:15 +0000 | [diff] [blame] | 2539 | [ |
| 2540 | #include <unistd.h> |
| 2541 | #ifdef _POSIX_THREADS |
| 2542 | yes |
| 2543 | #endif |
Martin v. Löwis | 69c0ff3 | 2001-10-15 14:34:42 +0000 | [diff] [blame] | 2544 | ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no) |
| 2545 | AC_MSG_RESULT($unistd_defines_pthreads) |
| 2546 | |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2547 | AC_DEFINE(_REENTRANT) |
Martin v. Löwis | a6e9758 | 2002-01-01 18:41:33 +0000 | [diff] [blame] | 2548 | AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD) |
| 2549 | AC_DEFINE(C_THREADS) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2550 | AC_DEFINE(HURD_C_THREADS, 1, |
| 2551 | [Define if you are using Mach cthreads directly under /include]) |
Martin v. Löwis | a6e9758 | 2002-01-01 18:41:33 +0000 | [diff] [blame] | 2552 | LIBS="$LIBS -lthreads" |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2553 | THREADOBJ="Python/thread.o"],[ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2554 | AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD) |
| 2555 | AC_DEFINE(C_THREADS) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2556 | AC_DEFINE(MACH_C_THREADS, 1, |
| 2557 | [Define if you are using Mach cthreads under mach /]) |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2558 | THREADOBJ="Python/thread.o"],[ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2559 | AC_MSG_CHECKING(for --with-pth) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2560 | AC_ARG_WITH([pth], |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2561 | AS_HELP_STRING([--with-pth], [use GNU pth threading libraries]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2562 | [AC_MSG_RESULT($withval) |
| 2563 | AC_DEFINE([WITH_THREAD]) |
| 2564 | AC_DEFINE([HAVE_PTH], 1, |
| 2565 | [Define if you have GNU PTH threads.]) |
| 2566 | LIBS="-lpth $LIBS" |
| 2567 | THREADOBJ="Python/thread.o"], |
| 2568 | [AC_MSG_RESULT(no) |
Martin v. Löwis | 8158b5a | 2001-10-08 13:17:28 +0000 | [diff] [blame] | 2569 | |
| 2570 | # Just looking for pthread_create in libpthread is not enough: |
| 2571 | # on HP/UX, pthread.h renames pthread_create to a different symbol name. |
| 2572 | # So we really have to include pthread.h, and then link. |
| 2573 | _libs=$LIBS |
| 2574 | LIBS="$LIBS -lpthread" |
| 2575 | AC_MSG_CHECKING([for pthread_create in -lpthread]) |
Stefan Krah | ae66ca6 | 2012-11-22 22:36:57 +0100 | [diff] [blame] | 2576 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
| 2577 | #include <stdio.h> |
| 2578 | #include <pthread.h> |
Martin v. Löwis | 8158b5a | 2001-10-08 13:17:28 +0000 | [diff] [blame] | 2579 | |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2580 | void * start_routine (void *arg) { exit (0); }]], [[ |
| 2581 | pthread_create (NULL, NULL, start_routine, NULL)]])],[ |
Martin v. Löwis | 8158b5a | 2001-10-08 13:17:28 +0000 | [diff] [blame] | 2582 | AC_MSG_RESULT(yes) |
| 2583 | AC_DEFINE(WITH_THREAD) |
Martin v. Löwis | 69c0ff3 | 2001-10-15 14:34:42 +0000 | [diff] [blame] | 2584 | posix_threads=yes |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2585 | THREADOBJ="Python/thread.o"],[ |
Martin v. Löwis | 8158b5a | 2001-10-08 13:17:28 +0000 | [diff] [blame] | 2586 | LIBS=$_libs |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2587 | AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD) |
Martin v. Löwis | 69c0ff3 | 2001-10-15 14:34:42 +0000 | [diff] [blame] | 2588 | posix_threads=yes |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2589 | THREADOBJ="Python/thread.o"],[ |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 2590 | AC_CHECK_HEADER(atheos/threads.h, [AC_DEFINE(WITH_THREAD) |
| 2591 | AC_DEFINE(ATHEOS_THREADS, 1, |
| 2592 | [Define this if you have AtheOS threads.]) |
| 2593 | THREADOBJ="Python/thread.o"],[ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2594 | AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2595 | AC_DEFINE(BEOS_THREADS, 1, |
| 2596 | [Define this if you have BeOS threads.]) |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2597 | THREADOBJ="Python/thread.o"],[ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2598 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2599 | posix_threads=yes |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2600 | LIBS="$LIBS -lpthreads" |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2601 | THREADOBJ="Python/thread.o"], [ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2602 | AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2603 | posix_threads=yes |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2604 | LIBS="$LIBS -lc_r" |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2605 | THREADOBJ="Python/thread.o"], [ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2606 | AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2607 | posix_threads=yes |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2608 | LIBS="$LIBS -lpthread" |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2609 | THREADOBJ="Python/thread.o"], [ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2610 | AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2611 | posix_threads=yes |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2612 | LIBS="$LIBS -lcma" |
Martin v. Löwis | 2d7e264 | 2002-04-05 16:50:53 +0000 | [diff] [blame] | 2613 | THREADOBJ="Python/thread.o"],[ |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 2614 | USE_THREAD_MODULE="#"]) |
Skip Montanaro | f8712e5 | 2004-01-17 03:04:46 +0000 | [diff] [blame] | 2615 | ])])])])])])])])])]) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2616 | |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 2617 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) |
| 2618 | LIBS="$LIBS -lmpc" |
| 2619 | THREADOBJ="Python/thread.o" |
| 2620 | USE_THREAD_MODULE=""]) |
| 2621 | |
| 2622 | if test "$posix_threads" != "yes"; then |
| 2623 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) |
| 2624 | LIBS="$LIBS -lthread" |
| 2625 | THREADOBJ="Python/thread.o" |
| 2626 | USE_THREAD_MODULE=""]) |
| 2627 | fi |
| 2628 | |
| 2629 | if test "$USE_THREAD_MODULE" != "#" |
| 2630 | then |
| 2631 | # If the above checks didn't disable threads, (at least) OSF1 |
| 2632 | # needs this '-threads' argument during linking. |
| 2633 | case $ac_sys_system in |
| 2634 | OSF1) LDLAST=-threads;; |
| 2635 | esac |
| 2636 | fi |
| 2637 | fi |
| 2638 | |
| 2639 | if test "$posix_threads" = "yes"; then |
Martin v. Löwis | 69c0ff3 | 2001-10-15 14:34:42 +0000 | [diff] [blame] | 2640 | if test "$unistd_defines_pthreads" = "no"; then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2641 | AC_DEFINE(_POSIX_THREADS, 1, |
| 2642 | [Define if you have POSIX threads, |
| 2643 | and your system does not define that.]) |
Martin v. Löwis | 69c0ff3 | 2001-10-15 14:34:42 +0000 | [diff] [blame] | 2644 | fi |
| 2645 | |
Martin v. Löwis | dfc33fd | 2003-01-21 10:14:41 +0000 | [diff] [blame] | 2646 | # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8. |
| 2647 | case $ac_sys_system/$ac_sys_release in |
Charles-François Natali | 4929eb9 | 2011-07-21 19:41:04 +0200 | [diff] [blame] | 2648 | SunOS/5.6) AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1, |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 2649 | [Defined for Solaris 2.6 bug in pthread header.]) |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 2650 | ;; |
Martin v. Löwis | dfc33fd | 2003-01-21 10:14:41 +0000 | [diff] [blame] | 2651 | SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 2652 | [Define if the Posix semaphores do not work on your system]) |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 2653 | ;; |
Charles-François Natali | 4929eb9 | 2011-07-21 19:41:04 +0200 | [diff] [blame] | 2654 | AIX/*) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 2655 | [Define if the Posix semaphores do not work on your system]) |
Christian Heimes | cba36bb | 2008-01-30 22:54:18 +0000 | [diff] [blame] | 2656 | ;; |
Martin v. Löwis | dfc33fd | 2003-01-21 10:14:41 +0000 | [diff] [blame] | 2657 | esac |
| 2658 | |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2659 | AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported) |
| 2660 | AC_CACHE_VAL(ac_cv_pthread_system_supported, |
Stefan Krah | ae66ca6 | 2012-11-22 22:36:57 +0100 | [diff] [blame] | 2661 | [AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
| 2662 | #include <stdio.h> |
| 2663 | #include <pthread.h> |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2664 | void *foo(void *parm) { |
| 2665 | return NULL; |
| 2666 | } |
| 2667 | main() { |
| 2668 | pthread_attr_t attr; |
Martin v. Löwis | a82d347 | 2002-02-24 16:05:05 +0000 | [diff] [blame] | 2669 | pthread_t id; |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2670 | if (pthread_attr_init(&attr)) exit(-1); |
| 2671 | if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1); |
Martin v. Löwis | a82d347 | 2002-02-24 16:05:05 +0000 | [diff] [blame] | 2672 | if (pthread_create(&id, &attr, foo, NULL)) exit(-1); |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2673 | exit(0); |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2674 | }]])], |
| 2675 | [ac_cv_pthread_system_supported=yes], |
| 2676 | [ac_cv_pthread_system_supported=no], |
| 2677 | [ac_cv_pthread_system_supported=no]) |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2678 | ]) |
| 2679 | AC_MSG_RESULT($ac_cv_pthread_system_supported) |
| 2680 | if test "$ac_cv_pthread_system_supported" = "yes"; then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2681 | AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED, 1, [Defined if PTHREAD_SCOPE_SYSTEM supported.]) |
Guido van Rossum | d0b69ec | 2001-09-10 14:10:54 +0000 | [diff] [blame] | 2682 | fi |
Jason Tishler | fac083d | 2003-07-22 15:20:49 +0000 | [diff] [blame] | 2683 | AC_CHECK_FUNCS(pthread_sigmask, |
| 2684 | [case $ac_sys_system in |
| 2685 | CYGWIN*) |
| 2686 | AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1, |
| 2687 | [Define if pthread_sigmask() does not work on your system.]) |
| 2688 | ;; |
| 2689 | esac]) |
Christian Heimes | 0d604cf | 2013-08-21 13:26:05 +0200 | [diff] [blame] | 2690 | AC_CHECK_FUNCS(pthread_atfork) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 2691 | fi |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 2692 | |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 2693 | |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2694 | # Check for enable-ipv6 |
Martin v. Löwis | 1143799 | 2002-04-12 09:54:03 +0000 | [diff] [blame] | 2695 | AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) |
Martin v. Löwis | a5f8bb5 | 2001-09-05 08:22:34 +0000 | [diff] [blame] | 2696 | AC_MSG_CHECKING([if --enable-ipv6 is specified]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2697 | AC_ARG_ENABLE(ipv6, |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2698 | [ --enable-ipv6 Enable ipv6 (with ipv4) support |
| 2699 | --disable-ipv6 Disable ipv6 support], |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2700 | [ case "$enableval" in |
| 2701 | no) |
| 2702 | AC_MSG_RESULT(no) |
| 2703 | ipv6=no |
| 2704 | ;; |
| 2705 | *) AC_MSG_RESULT(yes) |
| 2706 | AC_DEFINE(ENABLE_IPV6) |
| 2707 | ipv6=yes |
| 2708 | ;; |
| 2709 | esac ], |
| 2710 | |
Martin v. Löwis | a5f8bb5 | 2001-09-05 08:22:34 +0000 | [diff] [blame] | 2711 | [ |
| 2712 | dnl the check does not work on cross compilation case... |
Charles-François Natali | be2b907 | 2013-01-08 19:47:00 +0100 | [diff] [blame] | 2713 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* AF_INET6 available check */ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2714 | #include <sys/types.h> |
Charles-François Natali | be2b907 | 2013-01-08 19:47:00 +0100 | [diff] [blame] | 2715 | #include <sys/socket.h>]], |
| 2716 | [[int domain = AF_INET6;]])],[ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2717 | AC_MSG_RESULT(yes) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2718 | ipv6=yes |
| 2719 | ],[ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2720 | AC_MSG_RESULT(no) |
| 2721 | ipv6=no |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2722 | ]) |
Martin v. Löwis | a5f8bb5 | 2001-09-05 08:22:34 +0000 | [diff] [blame] | 2723 | |
| 2724 | if test "$ipv6" = "yes"; then |
| 2725 | AC_MSG_CHECKING(if RFC2553 API is available) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2726 | AC_COMPILE_IFELSE([ |
| 2727 | AC_LANG_PROGRAM([[#include <sys/types.h> |
| 2728 | #include <netinet/in.h>]], |
| 2729 | [[struct sockaddr_in6 x; |
| 2730 | x.sin6_scope_id;]]) |
| 2731 | ],[ |
| 2732 | AC_MSG_RESULT(yes) |
| 2733 | ipv6=yes |
| 2734 | ],[ |
| 2735 | AC_MSG_RESULT(no, IPv6 disabled) |
| 2736 | ipv6=no |
| 2737 | ]) |
Martin v. Löwis | a5f8bb5 | 2001-09-05 08:22:34 +0000 | [diff] [blame] | 2738 | fi |
| 2739 | |
| 2740 | if test "$ipv6" = "yes"; then |
| 2741 | AC_DEFINE(ENABLE_IPV6) |
| 2742 | fi |
| 2743 | ]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2744 | |
| 2745 | ipv6type=unknown |
| 2746 | ipv6lib=none |
| 2747 | ipv6trylibc=no |
| 2748 | |
| 2749 | if test "$ipv6" = "yes"; then |
| 2750 | AC_MSG_CHECKING([ipv6 stack type]) |
Guido van Rossum | b855216 | 2001-09-05 14:58:11 +0000 | [diff] [blame] | 2751 | for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; |
| 2752 | do |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2753 | case $i in |
| 2754 | inria) |
| 2755 | dnl http://www.kame.net/ |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2756 | AC_EGREP_CPP(yes, [ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2757 | #include <netinet/in.h> |
| 2758 | #ifdef IPV6_INRIA_VERSION |
| 2759 | yes |
| 2760 | #endif], |
Martin v. Löwis | 44ddbde | 2001-12-02 10:15:37 +0000 | [diff] [blame] | 2761 | [ipv6type=$i]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2762 | ;; |
| 2763 | kame) |
| 2764 | dnl http://www.kame.net/ |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2765 | AC_EGREP_CPP(yes, [ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2766 | #include <netinet/in.h> |
| 2767 | #ifdef __KAME__ |
| 2768 | yes |
| 2769 | #endif], |
| 2770 | [ipv6type=$i; |
| 2771 | ipv6lib=inet6 |
| 2772 | ipv6libdir=/usr/local/v6/lib |
Martin v. Löwis | 44ddbde | 2001-12-02 10:15:37 +0000 | [diff] [blame] | 2773 | ipv6trylibc=yes]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2774 | ;; |
| 2775 | linux-glibc) |
| 2776 | dnl http://www.v6.linux.or.jp/ |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2777 | AC_EGREP_CPP(yes, [ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2778 | #include <features.h> |
| 2779 | #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)) |
| 2780 | yes |
| 2781 | #endif], |
| 2782 | [ipv6type=$i; |
Martin v. Löwis | 44ddbde | 2001-12-02 10:15:37 +0000 | [diff] [blame] | 2783 | ipv6trylibc=yes]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2784 | ;; |
| 2785 | linux-inet6) |
| 2786 | dnl http://www.v6.linux.or.jp/ |
| 2787 | if test -d /usr/inet6; then |
| 2788 | ipv6type=$i |
| 2789 | ipv6lib=inet6 |
| 2790 | ipv6libdir=/usr/inet6/lib |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 2791 | BASECFLAGS="-I/usr/inet6/include $BASECFLAGS" |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2792 | fi |
| 2793 | ;; |
| 2794 | solaris) |
| 2795 | if test -f /etc/netconfig; then |
Antoine Pitrou | 31e8595 | 2011-01-03 18:57:14 +0000 | [diff] [blame] | 2796 | if $GREP -q tcp6 /etc/netconfig; then |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2797 | ipv6type=$i |
| 2798 | ipv6trylibc=yes |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2799 | fi |
| 2800 | fi |
| 2801 | ;; |
| 2802 | toshiba) |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2803 | AC_EGREP_CPP(yes, [ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2804 | #include <sys/param.h> |
| 2805 | #ifdef _TOSHIBA_INET6 |
| 2806 | yes |
| 2807 | #endif], |
| 2808 | [ipv6type=$i; |
| 2809 | ipv6lib=inet6; |
Martin v. Löwis | 44ddbde | 2001-12-02 10:15:37 +0000 | [diff] [blame] | 2810 | ipv6libdir=/usr/local/v6/lib]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2811 | ;; |
| 2812 | v6d) |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2813 | AC_EGREP_CPP(yes, [ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2814 | #include </usr/local/v6/include/sys/v6config.h> |
| 2815 | #ifdef __V6D__ |
| 2816 | yes |
| 2817 | #endif], |
| 2818 | [ipv6type=$i; |
| 2819 | ipv6lib=v6; |
| 2820 | ipv6libdir=/usr/local/v6/lib; |
Skip Montanaro | decc6a4 | 2003-01-01 20:07:49 +0000 | [diff] [blame] | 2821 | BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2822 | ;; |
| 2823 | zeta) |
Martin v. Löwis | a5f73f9 | 2001-10-15 08:06:29 +0000 | [diff] [blame] | 2824 | AC_EGREP_CPP(yes, [ |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2825 | #include <sys/param.h> |
| 2826 | #ifdef _ZETA_MINAMI_INET6 |
| 2827 | yes |
| 2828 | #endif], |
| 2829 | [ipv6type=$i; |
| 2830 | ipv6lib=inet6; |
Martin v. Löwis | 44ddbde | 2001-12-02 10:15:37 +0000 | [diff] [blame] | 2831 | ipv6libdir=/usr/local/v6/lib]) |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 2832 | ;; |
| 2833 | esac |
| 2834 | if test "$ipv6type" != "unknown"; then |
| 2835 | break |
| 2836 | fi |
| 2837 | done |
| 2838 | AC_MSG_RESULT($ipv6type) |
| 2839 | fi |
| 2840 | |
| 2841 | if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then |
| 2842 | if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then |
| 2843 | LIBS="-L$ipv6libdir -l$ipv6lib $LIBS" |
| 2844 | echo "using lib$ipv6lib" |
| 2845 | else |
| 2846 | if test $ipv6trylibc = "yes"; then |
| 2847 | echo "using libc" |
| 2848 | else |
| 2849 | echo 'Fatal: no $ipv6lib library found. cannot continue.' |
| 2850 | echo "You need to fetch lib$ipv6lib.a from appropriate" |
| 2851 | echo 'ipv6 kit and compile beforehand.' |
| 2852 | exit 1 |
| 2853 | fi |
| 2854 | fi |
| 2855 | fi |
| 2856 | |
Ronald Oussoren | 0d236eb | 2008-06-06 21:31:33 +0000 | [diff] [blame] | 2857 | AC_MSG_CHECKING(for OSX 10.5 SDK or later) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2858 | AC_COMPILE_IFELSE([ |
Mark Dickinson | 0712b56 | 2010-05-08 19:13:21 +0000 | [diff] [blame] | 2859 | AC_LANG_PROGRAM([[#include <Carbon/Carbon.h>]], [[FSIORefNum fRef = 0]]) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2860 | ],[ |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 2861 | AC_DEFINE(HAVE_OSX105_SDK, 1, [Define if compiling using MacOS X 10.5 SDK or later.]) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2862 | AC_MSG_RESULT(yes) |
| 2863 | ],[ |
Ronald Oussoren | 0d236eb | 2008-06-06 21:31:33 +0000 | [diff] [blame] | 2864 | AC_MSG_RESULT(no) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 2865 | ]) |
Ronald Oussoren | 0d236eb | 2008-06-06 21:31:33 +0000 | [diff] [blame] | 2866 | |
Martin v. Löwis | a3fb4f7 | 2002-06-09 13:33:54 +0000 | [diff] [blame] | 2867 | # Check for --with-doc-strings |
| 2868 | AC_MSG_CHECKING(for --with-doc-strings) |
| 2869 | AC_ARG_WITH(doc-strings, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2870 | AS_HELP_STRING([--with(out)-doc-strings], [disable/enable documentation strings])) |
Martin v. Löwis | a3fb4f7 | 2002-06-09 13:33:54 +0000 | [diff] [blame] | 2871 | |
| 2872 | if test -z "$with_doc_strings" |
| 2873 | then with_doc_strings="yes" |
| 2874 | fi |
| 2875 | if test "$with_doc_strings" != "no" |
| 2876 | then |
| 2877 | AC_DEFINE(WITH_DOC_STRINGS, 1, |
| 2878 | [Define if you want documentation strings in extension modules]) |
| 2879 | fi |
| 2880 | AC_MSG_RESULT($with_doc_strings) |
| 2881 | |
Neil Schemenauer | a35c688 | 2001-02-27 04:45:05 +0000 | [diff] [blame] | 2882 | # Check for Python-specific malloc support |
Martin v. Löwis | f30d60e | 2004-06-08 08:17:44 +0000 | [diff] [blame] | 2883 | AC_MSG_CHECKING(for --with-tsc) |
| 2884 | AC_ARG_WITH(tsc, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2885 | AS_HELP_STRING([--with(out)-tsc],[enable/disable timestamp counter profile]),[ |
Martin v. Löwis | f30d60e | 2004-06-08 08:17:44 +0000 | [diff] [blame] | 2886 | if test "$withval" != no |
| 2887 | then |
| 2888 | AC_DEFINE(WITH_TSC, 1, |
| 2889 | [Define to profile with the Pentium timestamp counter]) |
| 2890 | AC_MSG_RESULT(yes) |
| 2891 | else AC_MSG_RESULT(no) |
| 2892 | fi], |
| 2893 | [AC_MSG_RESULT(no)]) |
| 2894 | |
| 2895 | # Check for Python-specific malloc support |
Neil Schemenauer | a35c688 | 2001-02-27 04:45:05 +0000 | [diff] [blame] | 2896 | AC_MSG_CHECKING(for --with-pymalloc) |
| 2897 | AC_ARG_WITH(pymalloc, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2898 | AS_HELP_STRING([--with(out)-pymalloc], [disable/enable specialized mallocs])) |
Neil Schemenauer | 16c2297 | 2002-03-22 15:34:49 +0000 | [diff] [blame] | 2899 | |
| 2900 | if test -z "$with_pymalloc" |
| 2901 | then with_pymalloc="yes" |
| 2902 | fi |
| 2903 | if test "$with_pymalloc" != "no" |
| 2904 | then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2905 | AC_DEFINE(WITH_PYMALLOC, 1, |
| 2906 | [Define if you want to compile in Python-specific mallocs]) |
Neil Schemenauer | 16c2297 | 2002-03-22 15:34:49 +0000 | [diff] [blame] | 2907 | fi |
| 2908 | AC_MSG_RESULT($with_pymalloc) |
Neil Schemenauer | a35c688 | 2001-02-27 04:45:05 +0000 | [diff] [blame] | 2909 | |
Benjamin Peterson | 91c12eb | 2009-12-03 02:52:39 +0000 | [diff] [blame] | 2910 | # Check for Valgrind support |
| 2911 | AC_MSG_CHECKING([for --with-valgrind]) |
| 2912 | AC_ARG_WITH([valgrind], |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2913 | AS_HELP_STRING([--with-valgrind], [Enable Valgrind support]),, |
Benjamin Peterson | 91c12eb | 2009-12-03 02:52:39 +0000 | [diff] [blame] | 2914 | with_valgrind=no) |
| 2915 | AC_MSG_RESULT([$with_valgrind]) |
| 2916 | if test "$with_valgrind" != no; then |
| 2917 | AC_CHECK_HEADER([valgrind/valgrind.h], |
| 2918 | [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when running under valgrind])], |
| 2919 | [AC_MSG_ERROR([Valgrind support requested but headers not available])] |
| 2920 | ) |
| 2921 | fi |
| 2922 | |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 2923 | # Check for --with-wctype-functions |
| 2924 | AC_MSG_CHECKING(for --with-wctype-functions) |
| 2925 | AC_ARG_WITH(wctype-functions, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 2926 | AS_HELP_STRING([--with-wctype-functions], [use wctype.h functions]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 2927 | [ |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 2928 | if test "$withval" != no |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2929 | then |
| 2930 | AC_DEFINE(WANT_WCTYPE_FUNCTIONS, 1, |
| 2931 | [Define if you want wctype.h functions to be used instead of the |
| 2932 | one supplied by Python itself. (see Include/unicodectype.h).]) |
| 2933 | AC_MSG_RESULT(yes) |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 2934 | else AC_MSG_RESULT(no) |
| 2935 | fi], |
| 2936 | [AC_MSG_RESULT(no)]) |
| 2937 | |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 2938 | # -I${DLINCLDIR} is added to the compile rule for importdl.o |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 2939 | AC_SUBST(DLINCLDIR) |
Guido van Rossum | 98935bf | 2001-09-05 19:13:16 +0000 | [diff] [blame] | 2940 | DLINCLDIR=. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 2941 | |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 2942 | # the dlopen() function means we might want to use dynload_shlib.o. some |
| 2943 | # platforms, such as AIX, have dlopen(), but don't want to use it. |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 2944 | AC_CHECK_FUNCS(dlopen) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 2945 | |
| 2946 | # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic |
| 2947 | # loading of modules. |
| 2948 | AC_SUBST(DYNLOADFILE) |
| 2949 | AC_MSG_CHECKING(DYNLOADFILE) |
| 2950 | if test -z "$DYNLOADFILE" |
| 2951 | then |
| 2952 | case $ac_sys_system/$ac_sys_release in |
Martin v. Löwis | c19c5a6 | 2003-11-18 20:00:44 +0000 | [diff] [blame] | 2953 | AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c |
| 2954 | if test "$ac_cv_func_dlopen" = yes |
| 2955 | then DYNLOADFILE="dynload_shlib.o" |
| 2956 | else DYNLOADFILE="dynload_aix.o" |
| 2957 | fi |
| 2958 | ;; |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 2959 | BeOS*) DYNLOADFILE="dynload_beos.o";; |
| 2960 | hp*|HP*) DYNLOADFILE="dynload_hpux.o";; |
Anthony Baxter | 8220174 | 2006-04-09 15:07:40 +0000 | [diff] [blame] | 2961 | # Use dynload_next.c only on 10.2 and below, which don't have native dlopen() |
| 2962 | Darwin/@<:@0156@:>@\..*) DYNLOADFILE="dynload_next.o";; |
Martin v. Löwis | f90ae20 | 2002-06-11 06:22:31 +0000 | [diff] [blame] | 2963 | atheos*) DYNLOADFILE="dynload_atheos.o";; |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 2964 | *) |
| 2965 | # use dynload_shlib.c and dlopen() if we have it; otherwise stub |
| 2966 | # out any dynamic loading |
| 2967 | if test "$ac_cv_func_dlopen" = yes |
| 2968 | then DYNLOADFILE="dynload_shlib.o" |
| 2969 | else DYNLOADFILE="dynload_stub.o" |
| 2970 | fi |
| 2971 | ;; |
| 2972 | esac |
| 2973 | fi |
| 2974 | AC_MSG_RESULT($DYNLOADFILE) |
| 2975 | if test "$DYNLOADFILE" != "dynload_stub.o" |
| 2976 | then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 2977 | AC_DEFINE(HAVE_DYNAMIC_LOADING, 1, |
| 2978 | [Defined when any dynamic module loading is enabled.]) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 2979 | fi |
| 2980 | |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 2981 | # MACHDEP_OBJS can be set to platform-specific object files needed by Python |
| 2982 | |
| 2983 | AC_SUBST(MACHDEP_OBJS) |
| 2984 | AC_MSG_CHECKING(MACHDEP_OBJS) |
| 2985 | if test -z "$MACHDEP_OBJS" |
| 2986 | then |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2987 | MACHDEP_OBJS=$extra_machdep_objs |
| 2988 | else |
| 2989 | MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 2990 | fi |
Jack Jansen | b6e9cad | 2001-08-15 01:26:28 +0000 | [diff] [blame] | 2991 | AC_MSG_RESULT(MACHDEP_OBJS) |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 2992 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 2993 | # checks for library functions |
Martin v. Löwis | aef18b1 | 2008-03-24 13:31:16 +0000 | [diff] [blame] | 2994 | AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \ |
| 2995 | clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ |
Martin v. Löwis | 438b534 | 2002-12-27 10:16:42 +0000 | [diff] [blame] | 2996 | gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ |
Benjamin Peterson | 27c269a | 2014-12-26 11:09:00 -0600 | [diff] [blame] | 2997 | getentropy \ |
Martin v. Löwis | 50ea456 | 2009-11-27 13:56:01 +0000 | [diff] [blame] | 2998 | getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ |
Benjamin Peterson | d16e01c | 2014-02-04 10:20:26 -0500 | [diff] [blame] | 2999 | initgroups kill killpg lchmod lchown lstat mkfifo mknod mktime mmap \ |
Martin v. Löwis | a5f0907 | 2002-10-11 05:37:59 +0000 | [diff] [blame] | 3000 | mremap nice pathconf pause plock poll pthread_init \ |
Guido van Rossum | 162e38c | 2003-02-19 15:25:10 +0000 | [diff] [blame] | 3001 | putenv readlink realpath \ |
Jesse Noller | 355b126 | 2009-04-02 00:03:28 +0000 | [diff] [blame] | 3002 | select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \ |
| 3003 | setgid \ |
Martin v. Löwis | 4daacb1 | 2003-03-28 18:37:01 +0000 | [diff] [blame] | 3004 | setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ |
Martin v. Löwis | 50ea456 | 2009-11-27 13:56:01 +0000 | [diff] [blame] | 3005 | setlocale setregid setreuid setresuid setresgid \ |
| 3006 | setsid setpgid setpgrp setuid setvbuf snprintf \ |
Skip Montanaro | 7e11a01 | 2004-02-07 12:55:46 +0000 | [diff] [blame] | 3007 | sigaction siginterrupt sigrelse strftime \ |
Michael W. Hudson | 34f20ea | 2002-05-27 15:08:24 +0000 | [diff] [blame] | 3008 | sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ |
Neal Norwitz | 05a4559 | 2006-03-20 06:30:08 +0000 | [diff] [blame] | 3009 | truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty) |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 3010 | |
Martin v. Löwis | c8ad7cc | 2002-11-11 13:23:45 +0000 | [diff] [blame] | 3011 | # For some functions, having a definition is not sufficient, since |
| 3012 | # we want to take their address. |
| 3013 | AC_MSG_CHECKING(for chroot) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3014 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=chroot]])], |
| 3015 | [AC_DEFINE(HAVE_CHROOT, 1, Define if you have the 'chroot' function.) |
| 3016 | AC_MSG_RESULT(yes)], |
| 3017 | [AC_MSG_RESULT(no) |
| 3018 | ]) |
Martin v. Löwis | c8ad7cc | 2002-11-11 13:23:45 +0000 | [diff] [blame] | 3019 | AC_MSG_CHECKING(for link) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3020 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=link]])], |
| 3021 | [AC_DEFINE(HAVE_LINK, 1, Define if you have the 'link' function.) |
| 3022 | AC_MSG_RESULT(yes)], |
| 3023 | [AC_MSG_RESULT(no) |
| 3024 | ]) |
Martin v. Löwis | c8ad7cc | 2002-11-11 13:23:45 +0000 | [diff] [blame] | 3025 | AC_MSG_CHECKING(for symlink) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3026 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=symlink]])], |
| 3027 | [AC_DEFINE(HAVE_SYMLINK, 1, Define if you have the 'symlink' function.) |
| 3028 | AC_MSG_RESULT(yes)], |
| 3029 | [AC_MSG_RESULT(no) |
| 3030 | ]) |
Martin v. Löwis | a64988c | 2003-09-20 15:30:20 +0000 | [diff] [blame] | 3031 | AC_MSG_CHECKING(for fchdir) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3032 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fchdir]])], |
| 3033 | [AC_DEFINE(HAVE_FCHDIR, 1, Define if you have the 'fchdir' function.) |
| 3034 | AC_MSG_RESULT(yes)], |
| 3035 | [AC_MSG_RESULT(no) |
| 3036 | ]) |
Martin v. Löwis | a64988c | 2003-09-20 15:30:20 +0000 | [diff] [blame] | 3037 | AC_MSG_CHECKING(for fsync) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3038 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fsync]])], |
| 3039 | [AC_DEFINE(HAVE_FSYNC, 1, Define if you have the 'fsync' function.) |
| 3040 | AC_MSG_RESULT(yes)], |
| 3041 | [AC_MSG_RESULT(no) |
| 3042 | ]) |
Martin v. Löwis | a64988c | 2003-09-20 15:30:20 +0000 | [diff] [blame] | 3043 | AC_MSG_CHECKING(for fdatasync) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3044 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[void *x=fdatasync]])], |
| 3045 | [AC_DEFINE(HAVE_FDATASYNC, 1, Define if you have the 'fdatasync' function.) |
| 3046 | AC_MSG_RESULT(yes)], |
| 3047 | [AC_MSG_RESULT(no) |
| 3048 | ]) |
Christian Heimes | 0e9ab5f | 2008-03-21 23:49:44 +0000 | [diff] [blame] | 3049 | AC_MSG_CHECKING(for epoll) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3050 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/epoll.h>]], [[void *x=epoll_create]])], |
| 3051 | [AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.) |
| 3052 | AC_MSG_RESULT(yes)], |
| 3053 | [AC_MSG_RESULT(no) |
| 3054 | ]) |
Christian Heimes | 0e9ab5f | 2008-03-21 23:49:44 +0000 | [diff] [blame] | 3055 | AC_MSG_CHECKING(for kqueue) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3056 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Christian Heimes | 0e9ab5f | 2008-03-21 23:49:44 +0000 | [diff] [blame] | 3057 | #include <sys/types.h> |
| 3058 | #include <sys/event.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3059 | ]], [[int x=kqueue()]])], |
| 3060 | [AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.) |
| 3061 | AC_MSG_RESULT(yes)], |
| 3062 | [AC_MSG_RESULT(no) |
| 3063 | ]) |
Martin v. Löwis | d584368 | 2002-11-21 20:41:28 +0000 | [diff] [blame] | 3064 | # On some systems (eg. FreeBSD 5), we would find a definition of the |
| 3065 | # functions ctermid_r, setgroups in the library, but no prototype |
| 3066 | # (e.g. because we use _XOPEN_SOURCE). See whether we can take their |
| 3067 | # address to avoid compiler warnings and potential miscompilations |
| 3068 | # because of the missing prototypes. |
| 3069 | |
| 3070 | AC_MSG_CHECKING(for ctermid_r) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3071 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | d584368 | 2002-11-21 20:41:28 +0000 | [diff] [blame] | 3072 | #include <stdio.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3073 | ]], [[void* p = ctermid_r]])], |
| 3074 | [AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.) |
| 3075 | AC_MSG_RESULT(yes)], |
| 3076 | [AC_MSG_RESULT(no) |
| 3077 | ]) |
Martin v. Löwis | d584368 | 2002-11-21 20:41:28 +0000 | [diff] [blame] | 3078 | |
Antoine Pitrou | b170f17 | 2010-09-10 18:47:36 +0000 | [diff] [blame] | 3079 | AC_CACHE_CHECK([for flock declaration], [ac_cv_flock_decl], |
| 3080 | [AC_COMPILE_IFELSE( |
| 3081 | [AC_LANG_PROGRAM( |
| 3082 | [#include <sys/file.h>], |
| 3083 | [void* p = flock] |
| 3084 | )], |
| 3085 | [ac_cv_flock_decl=yes], |
| 3086 | [ac_cv_flock_decl=no] |
| 3087 | ) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3088 | ]) |
Antoine Pitrou | b170f17 | 2010-09-10 18:47:36 +0000 | [diff] [blame] | 3089 | if test "x${ac_cv_flock_decl}" = xyes; then |
| 3090 | AC_CHECK_FUNCS(flock,, |
| 3091 | AC_CHECK_LIB(bsd,flock, |
| 3092 | [AC_DEFINE(HAVE_FLOCK) |
| 3093 | AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with bsd library.) |
| 3094 | ]) |
| 3095 | ) |
Antoine Pitrou | 8572981 | 2010-09-07 14:55:24 +0000 | [diff] [blame] | 3096 | fi |
Martin v. Löwis | f26d63b | 2003-03-30 17:23:49 +0000 | [diff] [blame] | 3097 | |
| 3098 | AC_MSG_CHECKING(for getpagesize) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3099 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | f26d63b | 2003-03-30 17:23:49 +0000 | [diff] [blame] | 3100 | #include <unistd.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3101 | ]], [[void* p = getpagesize]])], |
| 3102 | [AC_DEFINE(HAVE_GETPAGESIZE, 1, Define if you have the 'getpagesize' function.) |
| 3103 | AC_MSG_RESULT(yes)], |
| 3104 | [AC_MSG_RESULT(no) |
| 3105 | ]) |
Martin v. Löwis | f26d63b | 2003-03-30 17:23:49 +0000 | [diff] [blame] | 3106 | |
Charles-François Natali | 93a1175 | 2011-11-27 13:01:35 +0100 | [diff] [blame] | 3107 | AC_MSG_CHECKING(for broken unsetenv) |
| 3108 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3109 | #include <stdlib.h> |
| 3110 | ]], [[int res = unsetenv("DUMMY")]])], |
| 3111 | [AC_MSG_RESULT(no)], |
| 3112 | [AC_DEFINE(HAVE_BROKEN_UNSETENV, 1, Define if `unsetenv` does not return an int.) |
| 3113 | AC_MSG_RESULT(yes) |
| 3114 | ]) |
| 3115 | |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 3116 | dnl check for true |
| 3117 | AC_CHECK_PROGS(TRUE, true, /bin/true) |
| 3118 | |
Martin v. Löwis | 95c419b | 2003-05-03 12:10:48 +0000 | [diff] [blame] | 3119 | dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv |
| 3120 | dnl On others, they are in the C library, so we to take no action |
Martin v. Löwis | 4ee6eef | 2003-05-26 05:37:51 +0000 | [diff] [blame] | 3121 | AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE], |
Martin v. Löwis | 95c419b | 2003-05-03 12:10:48 +0000 | [diff] [blame] | 3122 | AC_CHECK_LIB(resolv, inet_aton) |
| 3123 | ) |
| 3124 | |
Martin v. Löwis | a51d5c8 | 2007-12-04 08:37:59 +0000 | [diff] [blame] | 3125 | # On Tru64, chflags seems to be present, but calling it will |
| 3126 | # exit Python |
Gregory P. Smith | bb21389 | 2009-11-02 01:37:37 +0000 | [diff] [blame] | 3127 | AC_CACHE_CHECK([for chflags], [ac_cv_have_chflags], [dnl |
Ned Deily | 43e1054 | 2011-06-27 23:41:53 -0700 | [diff] [blame] | 3128 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Martin v. Löwis | a51d5c8 | 2007-12-04 08:37:59 +0000 | [diff] [blame] | 3129 | #include <sys/stat.h> |
| 3130 | #include <unistd.h> |
| 3131 | int main(int argc, char*argv[]) |
| 3132 | { |
| 3133 | if(chflags(argv[0], 0) != 0) |
| 3134 | return 1; |
| 3135 | return 0; |
| 3136 | } |
Ned Deily | 43e1054 | 2011-06-27 23:41:53 -0700 | [diff] [blame] | 3137 | ]])], |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3138 | [ac_cv_have_chflags=yes], |
| 3139 | [ac_cv_have_chflags=no], |
| 3140 | [ac_cv_have_chflags=cross]) |
Gregory P. Smith | bb21389 | 2009-11-02 01:37:37 +0000 | [diff] [blame] | 3141 | ]) |
| 3142 | if test "$ac_cv_have_chflags" = cross ; then |
| 3143 | AC_CHECK_FUNC([chflags], [ac_cv_have_chflags="yes"], [ac_cv_have_chflags="no"]) |
| 3144 | fi |
| 3145 | if test "$ac_cv_have_chflags" = yes ; then |
Ned Deily | 43e1054 | 2011-06-27 23:41:53 -0700 | [diff] [blame] | 3146 | AC_DEFINE(HAVE_CHFLAGS, 1, [Define to 1 if you have the 'chflags' function.]) |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3147 | fi |
Martin v. Löwis | a51d5c8 | 2007-12-04 08:37:59 +0000 | [diff] [blame] | 3148 | |
Gregory P. Smith | bb21389 | 2009-11-02 01:37:37 +0000 | [diff] [blame] | 3149 | AC_CACHE_CHECK([for lchflags], [ac_cv_have_lchflags], [dnl |
Ned Deily | 43e1054 | 2011-06-27 23:41:53 -0700 | [diff] [blame] | 3150 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Martin v. Löwis | a51d5c8 | 2007-12-04 08:37:59 +0000 | [diff] [blame] | 3151 | #include <sys/stat.h> |
| 3152 | #include <unistd.h> |
| 3153 | int main(int argc, char*argv[]) |
| 3154 | { |
| 3155 | if(lchflags(argv[0], 0) != 0) |
| 3156 | return 1; |
| 3157 | return 0; |
| 3158 | } |
Ned Deily | 43e1054 | 2011-06-27 23:41:53 -0700 | [diff] [blame] | 3159 | ]])],[ac_cv_have_lchflags=yes],[ac_cv_have_lchflags=no],[ac_cv_have_lchflags=cross]) |
Gregory P. Smith | bb21389 | 2009-11-02 01:37:37 +0000 | [diff] [blame] | 3160 | ]) |
| 3161 | if test "$ac_cv_have_lchflags" = cross ; then |
| 3162 | AC_CHECK_FUNC([lchflags], [ac_cv_have_lchflags="yes"], [ac_cv_have_lchflags="no"]) |
| 3163 | fi |
| 3164 | if test "$ac_cv_have_lchflags" = yes ; then |
Ned Deily | 43e1054 | 2011-06-27 23:41:53 -0700 | [diff] [blame] | 3165 | AC_DEFINE(HAVE_LCHFLAGS, 1, [Define to 1 if you have the 'lchflags' function.]) |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3166 | fi |
Martin v. Löwis | a51d5c8 | 2007-12-04 08:37:59 +0000 | [diff] [blame] | 3167 | |
Neal Norwitz | 6e73aaa | 2006-06-12 03:33:09 +0000 | [diff] [blame] | 3168 | dnl Check if system zlib has *Copy() functions |
Ronald Oussoren | f875264 | 2006-07-06 10:13:35 +0000 | [diff] [blame] | 3169 | dnl |
| 3170 | dnl On MacOSX the linker will search for dylibs on the entire linker path |
| 3171 | dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first |
| 3172 | dnl to revert to a more traditional unix behaviour and make it possible to |
| 3173 | dnl override the system libz with a local static library of libz. Temporarily |
| 3174 | dnl add that flag to our CFLAGS as well to ensure that we check the version |
| 3175 | dnl of libz that will be used by setup.py. |
| 3176 | dnl The -L/usr/local/lib is needed as wel to get the same compilation |
| 3177 | dnl environment as setup.py (and leaving it out can cause configure to use the |
| 3178 | dnl wrong version of the library) |
| 3179 | case $ac_sys_system/$ac_sys_release in |
| 3180 | Darwin/*) |
| 3181 | _CUR_CFLAGS="${CFLAGS}" |
| 3182 | _CUR_LDFLAGS="${LDFLAGS}" |
| 3183 | CFLAGS="${CFLAGS} -Wl,-search_paths_first" |
| 3184 | LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib" |
| 3185 | ;; |
| 3186 | esac |
| 3187 | |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 3188 | AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, [Define if the zlib library has inflateCopy])) |
Neal Norwitz | 6e73aaa | 2006-06-12 03:33:09 +0000 | [diff] [blame] | 3189 | |
Ronald Oussoren | f875264 | 2006-07-06 10:13:35 +0000 | [diff] [blame] | 3190 | case $ac_sys_system/$ac_sys_release in |
| 3191 | Darwin/*) |
| 3192 | CFLAGS="${_CUR_CFLAGS}" |
| 3193 | LDFLAGS="${_CUR_LDFLAGS}" |
| 3194 | ;; |
| 3195 | esac |
| 3196 | |
Martin v. Löwis | e941617 | 2003-05-03 10:12:45 +0000 | [diff] [blame] | 3197 | AC_MSG_CHECKING(for hstrerror) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3198 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | e941617 | 2003-05-03 10:12:45 +0000 | [diff] [blame] | 3199 | #include <netdb.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3200 | ]], [[void* p = hstrerror; hstrerror(0)]])], |
| 3201 | [AC_DEFINE(HAVE_HSTRERROR, 1, Define if you have the 'hstrerror' function.) |
| 3202 | AC_MSG_RESULT(yes)], |
| 3203 | [AC_MSG_RESULT(no) |
| 3204 | ]) |
Martin v. Löwis | e941617 | 2003-05-03 10:12:45 +0000 | [diff] [blame] | 3205 | |
| 3206 | AC_MSG_CHECKING(for inet_aton) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3207 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | 86d6626 | 2006-02-17 08:40:11 +0000 | [diff] [blame] | 3208 | #include <sys/types.h> |
Martin v. Löwis | e941617 | 2003-05-03 10:12:45 +0000 | [diff] [blame] | 3209 | #include <sys/socket.h> |
| 3210 | #include <netinet/in.h> |
| 3211 | #include <arpa/inet.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3212 | ]], [[void* p = inet_aton;inet_aton(0,0)]])], |
| 3213 | [AC_DEFINE(HAVE_INET_ATON, 1, Define if you have the 'inet_aton' function.) |
| 3214 | AC_MSG_RESULT(yes)], |
| 3215 | [AC_MSG_RESULT(no) |
| 3216 | ]) |
Martin v. Löwis | e941617 | 2003-05-03 10:12:45 +0000 | [diff] [blame] | 3217 | |
| 3218 | AC_MSG_CHECKING(for inet_pton) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3219 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | f2e488d | 2003-05-05 22:00:11 +0000 | [diff] [blame] | 3220 | #include <sys/types.h> |
Martin v. Löwis | e941617 | 2003-05-03 10:12:45 +0000 | [diff] [blame] | 3221 | #include <sys/socket.h> |
| 3222 | #include <netinet/in.h> |
| 3223 | #include <arpa/inet.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3224 | ]], [[void* p = inet_pton]])], |
| 3225 | [AC_DEFINE(HAVE_INET_PTON, 1, Define if you have the 'inet_pton' function.) |
| 3226 | AC_MSG_RESULT(yes)], |
| 3227 | [AC_MSG_RESULT(no) |
| 3228 | ]) |
Martin v. Löwis | e941617 | 2003-05-03 10:12:45 +0000 | [diff] [blame] | 3229 | |
Martin v. Löwis | d6640d4 | 2003-07-06 09:29:52 +0000 | [diff] [blame] | 3230 | # On some systems, setgroups is in unistd.h, on others, in grp.h |
Martin v. Löwis | d584368 | 2002-11-21 20:41:28 +0000 | [diff] [blame] | 3231 | AC_MSG_CHECKING(for setgroups) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3232 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | f2e488d | 2003-05-05 22:00:11 +0000 | [diff] [blame] | 3233 | #include <unistd.h> |
Martin v. Löwis | d6640d4 | 2003-07-06 09:29:52 +0000 | [diff] [blame] | 3234 | #ifdef HAVE_GRP_H |
| 3235 | #include <grp.h> |
| 3236 | #endif |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3237 | ]], [[void* p = setgroups]])], |
| 3238 | [AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.) |
| 3239 | AC_MSG_RESULT(yes)], |
| 3240 | [AC_MSG_RESULT(no) |
| 3241 | ]) |
Martin v. Löwis | d584368 | 2002-11-21 20:41:28 +0000 | [diff] [blame] | 3242 | |
Fred Drake | 8cef4cf | 2000-06-28 16:40:38 +0000 | [diff] [blame] | 3243 | # check for openpty and forkpty |
| 3244 | |
Martin v. Löwis | fd9a72a | 2006-01-08 10:07:33 +0000 | [diff] [blame] | 3245 | AC_CHECK_FUNCS(openpty,, |
| 3246 | AC_CHECK_LIB(util,openpty, |
| 3247 | [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"], |
| 3248 | AC_CHECK_LIB(bsd,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lbsd"]) |
| 3249 | ) |
| 3250 | ) |
| 3251 | AC_CHECK_FUNCS(forkpty,, |
| 3252 | AC_CHECK_LIB(util,forkpty, |
| 3253 | [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lutil"], |
| 3254 | AC_CHECK_LIB(bsd,forkpty, [AC_DEFINE(HAVE_FORKPTY) LIBS="$LIBS -lbsd"]) |
| 3255 | ) |
| 3256 | ) |
Fred Drake | 8cef4cf | 2000-06-28 16:40:38 +0000 | [diff] [blame] | 3257 | |
Brett Cannon | aa5778d | 2008-03-18 04:09:00 +0000 | [diff] [blame] | 3258 | # Stuff for expat. |
| 3259 | AC_CHECK_FUNCS(memmove) |
| 3260 | |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 3261 | # check for long file support functions |
| 3262 | AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs) |
| 3263 | |
Brett Cannon | aa5778d | 2008-03-18 04:09:00 +0000 | [diff] [blame] | 3264 | AC_REPLACE_FUNCS(dup2 getcwd strdup) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3265 | AC_CHECK_FUNCS(getpgrp, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3266 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[getpgrp(0);]])], |
| 3267 | [AC_DEFINE(GETPGRP_HAVE_ARG, 1, [Define if getpgrp() must be called as getpgrp(0).])], |
| 3268 | []) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3269 | ) |
Jack Jansen | 150753c | 2003-03-29 22:07:47 +0000 | [diff] [blame] | 3270 | AC_CHECK_FUNCS(setpgrp, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3271 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[setpgrp(0,0);]])], |
| 3272 | [AC_DEFINE(SETPGRP_HAVE_ARG, 1, [Define if setpgrp() must be called as setpgrp(0, 0).])], |
| 3273 | []) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3274 | ) |
| 3275 | AC_CHECK_FUNCS(gettimeofday, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3276 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>]], |
| 3277 | [[gettimeofday((struct timeval*)0,(struct timezone*)0);]])], |
| 3278 | [], |
| 3279 | [AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1, |
| 3280 | [Define if gettimeofday() does not have second (timezone) argument |
| 3281 | This is the case on Motorola V4 (R40V4.2)]) |
| 3282 | ]) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3283 | ) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 3284 | |
Martin v. Löwis | dbe3f76 | 2002-10-10 14:27:30 +0000 | [diff] [blame] | 3285 | AC_MSG_CHECKING(for major, minor, and makedev) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3286 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Neal Norwitz | 6eb37f0 | 2003-02-23 23:28:15 +0000 | [diff] [blame] | 3287 | #if defined(MAJOR_IN_MKDEV) |
| 3288 | #include <sys/mkdev.h> |
| 3289 | #elif defined(MAJOR_IN_SYSMACROS) |
| 3290 | #include <sys/sysmacros.h> |
| 3291 | #else |
| 3292 | #include <sys/types.h> |
| 3293 | #endif |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3294 | ]], [[ |
Martin v. Löwis | dbe3f76 | 2002-10-10 14:27:30 +0000 | [diff] [blame] | 3295 | makedev(major(0),minor(0)); |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3296 | ]])],[ |
Martin v. Löwis | dbe3f76 | 2002-10-10 14:27:30 +0000 | [diff] [blame] | 3297 | AC_DEFINE(HAVE_DEVICE_MACROS, 1, |
| 3298 | [Define to 1 if you have the device macros.]) |
| 3299 | AC_MSG_RESULT(yes) |
| 3300 | ],[ |
| 3301 | AC_MSG_RESULT(no) |
| 3302 | ]) |
Martin v. Löwis | 861a65b | 2001-10-24 14:36:00 +0000 | [diff] [blame] | 3303 | |
| 3304 | # On OSF/1 V5.1, getaddrinfo is available, but a define |
| 3305 | # for [no]getaddrinfo in netdb.h. |
| 3306 | AC_MSG_CHECKING(for getaddrinfo) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3307 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | c010b6d | 2001-11-09 17:50:52 +0000 | [diff] [blame] | 3308 | #include <sys/types.h> |
Martin v. Löwis | 861a65b | 2001-10-24 14:36:00 +0000 | [diff] [blame] | 3309 | #include <sys/socket.h> |
| 3310 | #include <netdb.h> |
Martin v. Löwis | c010b6d | 2001-11-09 17:50:52 +0000 | [diff] [blame] | 3311 | #include <stdio.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3312 | ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], |
| 3313 | [have_getaddrinfo=yes], |
| 3314 | [have_getaddrinfo=no]) |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3315 | AC_MSG_RESULT($have_getaddrinfo) |
| 3316 | if test $have_getaddrinfo = yes |
| 3317 | then |
| 3318 | AC_MSG_CHECKING(getaddrinfo bug) |
| 3319 | AC_CACHE_VAL(ac_cv_buggy_getaddrinfo, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3320 | AC_RUN_IFELSE([AC_LANG_SOURCE([[[ |
Stefan Krah | 0afe4e4 | 2012-11-22 23:56:51 +0100 | [diff] [blame] | 3321 | #include <stdio.h> |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3322 | #include <sys/types.h> |
| 3323 | #include <netdb.h> |
| 3324 | #include <string.h> |
| 3325 | #include <sys/socket.h> |
| 3326 | #include <netinet/in.h> |
| 3327 | |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3328 | int main() |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3329 | { |
| 3330 | int passive, gaierr, inet4 = 0, inet6 = 0; |
| 3331 | struct addrinfo hints, *ai, *aitop; |
| 3332 | char straddr[INET6_ADDRSTRLEN], strport[16]; |
| 3333 | |
| 3334 | for (passive = 0; passive <= 1; passive++) { |
| 3335 | memset(&hints, 0, sizeof(hints)); |
| 3336 | hints.ai_family = AF_UNSPEC; |
| 3337 | hints.ai_flags = passive ? AI_PASSIVE : 0; |
| 3338 | hints.ai_socktype = SOCK_STREAM; |
Hye-Shik Chang | 54f9439 | 2004-04-14 07:55:31 +0000 | [diff] [blame] | 3339 | hints.ai_protocol = IPPROTO_TCP; |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3340 | if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { |
| 3341 | (void)gai_strerror(gaierr); |
| 3342 | goto bad; |
| 3343 | } |
| 3344 | for (ai = aitop; ai; ai = ai->ai_next) { |
| 3345 | if (ai->ai_addr == NULL || |
| 3346 | ai->ai_addrlen == 0 || |
| 3347 | getnameinfo(ai->ai_addr, ai->ai_addrlen, |
| 3348 | straddr, sizeof(straddr), strport, sizeof(strport), |
| 3349 | NI_NUMERICHOST|NI_NUMERICSERV) != 0) { |
| 3350 | goto bad; |
| 3351 | } |
| 3352 | switch (ai->ai_family) { |
| 3353 | case AF_INET: |
| 3354 | if (strcmp(strport, "54321") != 0) { |
| 3355 | goto bad; |
| 3356 | } |
| 3357 | if (passive) { |
| 3358 | if (strcmp(straddr, "0.0.0.0") != 0) { |
| 3359 | goto bad; |
| 3360 | } |
| 3361 | } else { |
| 3362 | if (strcmp(straddr, "127.0.0.1") != 0) { |
| 3363 | goto bad; |
| 3364 | } |
| 3365 | } |
| 3366 | inet4++; |
| 3367 | break; |
| 3368 | case AF_INET6: |
| 3369 | if (strcmp(strport, "54321") != 0) { |
| 3370 | goto bad; |
| 3371 | } |
| 3372 | if (passive) { |
| 3373 | if (strcmp(straddr, "::") != 0) { |
| 3374 | goto bad; |
| 3375 | } |
| 3376 | } else { |
| 3377 | if (strcmp(straddr, "::1") != 0) { |
| 3378 | goto bad; |
| 3379 | } |
| 3380 | } |
| 3381 | inet6++; |
| 3382 | break; |
| 3383 | case AF_UNSPEC: |
| 3384 | goto bad; |
| 3385 | break; |
| 3386 | default: |
| 3387 | /* another family support? */ |
| 3388 | break; |
| 3389 | } |
| 3390 | } |
| 3391 | } |
| 3392 | |
| 3393 | if (!(inet4 == 0 || inet4 == 2)) |
| 3394 | goto bad; |
| 3395 | if (!(inet6 == 0 || inet6 == 2)) |
| 3396 | goto bad; |
| 3397 | |
| 3398 | if (aitop) |
| 3399 | freeaddrinfo(aitop); |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3400 | return 0; |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3401 | |
| 3402 | bad: |
| 3403 | if (aitop) |
| 3404 | freeaddrinfo(aitop); |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3405 | return 1; |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3406 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3407 | ]]])], |
| 3408 | [ac_cv_buggy_getaddrinfo=no], |
| 3409 | [ac_cv_buggy_getaddrinfo=yes], |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 3410 | [ |
| 3411 | if test "${enable_ipv6+set}" = set; then |
| 3412 | ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6" |
| 3413 | else |
| 3414 | ac_cv_buggy_getaddrinfo=yes |
| 3415 | fi])) |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3416 | fi |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3417 | |
Benjamin Peterson | 75fed81 | 2010-11-01 01:47:19 +0000 | [diff] [blame] | 3418 | AC_MSG_RESULT($ac_cv_buggy_getaddrinfo) |
| 3419 | |
Mark Dickinson | 0ef0b91 | 2009-12-31 21:11:48 +0000 | [diff] [blame] | 3420 | if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3421 | then |
| 3422 | if test $ipv6 = yes |
| 3423 | then |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3424 | echo 'Fatal: You must get working getaddrinfo() function.' |
| 3425 | echo ' or you can specify "--disable-ipv6"'. |
| 3426 | exit 1 |
| 3427 | fi |
Martin v. Löwis | 861a65b | 2001-10-24 14:36:00 +0000 | [diff] [blame] | 3428 | else |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3429 | AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.]) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3430 | fi |
Benjamin Peterson | 75fed81 | 2010-11-01 01:47:19 +0000 | [diff] [blame] | 3431 | |
Thomas Wouters | b0db85a | 2001-08-08 10:39:03 +0000 | [diff] [blame] | 3432 | AC_CHECK_FUNCS(getnameinfo) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3433 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 3434 | # checks for structures |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3435 | AC_HEADER_TIME |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 3436 | AC_STRUCT_TM |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3437 | AC_STRUCT_TIMEZONE |
Martin v. Löwis | 60a5d72 | 2002-10-16 20:28:25 +0000 | [diff] [blame] | 3438 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
| 3439 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
Hye-Shik Chang | 5f937a7 | 2005-06-02 13:09:30 +0000 | [diff] [blame] | 3440 | AC_CHECK_MEMBERS([struct stat.st_flags]) |
Martin v. Löwis | ebd9d5b | 2005-08-09 15:00:59 +0000 | [diff] [blame] | 3441 | AC_CHECK_MEMBERS([struct stat.st_gen]) |
| 3442 | AC_CHECK_MEMBERS([struct stat.st_birthtime]) |
Martin Panter | a45120d | 2016-03-18 02:36:41 +0000 | [diff] [blame] | 3443 | AC_CHECK_MEMBERS([struct stat.st_blocks]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3444 | |
| 3445 | AC_MSG_CHECKING(for time.h that defines altzone) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3446 | AC_CACHE_VAL(ac_cv_header_time_altzone,[ |
| 3447 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[return altzone;]])], |
| 3448 | [ac_cv_header_time_altzone=yes], |
| 3449 | [ac_cv_header_time_altzone=no]) |
| 3450 | ]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3451 | AC_MSG_RESULT($ac_cv_header_time_altzone) |
| 3452 | if test $ac_cv_header_time_altzone = yes; then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3453 | AC_DEFINE(HAVE_ALTZONE, 1, [Define this if your time.h defines altzone.]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3454 | fi |
| 3455 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3456 | was_it_defined=no |
| 3457 | AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3458 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3459 | #include <sys/types.h> |
| 3460 | #include <sys/select.h> |
| 3461 | #include <sys/time.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3462 | ]], [[;]])],[ |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3463 | AC_DEFINE(SYS_SELECT_WITH_SYS_TIME, 1, |
| 3464 | [Define if you can safely include both <sys/select.h> and <sys/time.h> |
| 3465 | (which you can't on SCO ODT 3.0).]) |
| 3466 | was_it_defined=yes |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3467 | ],[]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3468 | AC_MSG_RESULT($was_it_defined) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 3469 | |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3470 | AC_MSG_CHECKING(for addrinfo) |
| 3471 | AC_CACHE_VAL(ac_cv_struct_addrinfo, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3472 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[struct addrinfo a]])], |
| 3473 | [ac_cv_struct_addrinfo=yes], |
| 3474 | [ac_cv_struct_addrinfo=no])) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3475 | AC_MSG_RESULT($ac_cv_struct_addrinfo) |
| 3476 | if test $ac_cv_struct_addrinfo = yes; then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3477 | AC_DEFINE(HAVE_ADDRINFO, 1, [struct addrinfo (netdb.h)]) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3478 | fi |
| 3479 | |
| 3480 | AC_MSG_CHECKING(for sockaddr_storage) |
| 3481 | AC_CACHE_VAL(ac_cv_struct_sockaddr_storage, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3482 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3483 | # include <sys/types.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3484 | # include <sys/socket.h>]], [[struct sockaddr_storage s]])], |
| 3485 | [ac_cv_struct_sockaddr_storage=yes], |
| 3486 | [ac_cv_struct_sockaddr_storage=no])) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3487 | AC_MSG_RESULT($ac_cv_struct_sockaddr_storage) |
| 3488 | if test $ac_cv_struct_sockaddr_storage = yes; then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3489 | AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)]) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3490 | fi |
| 3491 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 3492 | # checks for compiler characteristics |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3493 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3494 | AC_C_CHAR_UNSIGNED |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3495 | AC_C_CONST |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3496 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3497 | works=no |
| 3498 | AC_MSG_CHECKING(for working volatile) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3499 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[volatile int x; x = 0;]])], |
| 3500 | [works=yes], |
| 3501 | [AC_DEFINE(volatile, , [Define to empty if the keyword does not work.])] |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3502 | ) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3503 | AC_MSG_RESULT($works) |
Guido van Rossum | dabb11b | 1994-10-11 15:04:27 +0000 | [diff] [blame] | 3504 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3505 | works=no |
| 3506 | AC_MSG_CHECKING(for working signed char) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3507 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char c;]])], |
| 3508 | [works=yes], |
| 3509 | [AC_DEFINE(signed, , [Define to empty if the keyword does not work.])] |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3510 | ) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3511 | AC_MSG_RESULT($works) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3512 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3513 | have_prototypes=no |
| 3514 | AC_MSG_CHECKING(for prototypes) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3515 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int x) { return 0; }]], [[return foo(10);]])], |
| 3516 | [AC_DEFINE(HAVE_PROTOTYPES, 1, |
| 3517 | [Define if your compiler supports function prototype]) |
| 3518 | have_prototypes=yes], |
| 3519 | [] |
| 3520 | ) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3521 | AC_MSG_RESULT($have_prototypes) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3522 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3523 | works=no |
| 3524 | AC_MSG_CHECKING(for variable length prototypes and stdarg.h) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3525 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3526 | #include <stdarg.h> |
Guido van Rossum | 3f13e48 | 1996-08-30 20:58:11 +0000 | [diff] [blame] | 3527 | int foo(int x, ...) { |
| 3528 | va_list va; |
| 3529 | va_start(va, x); |
| 3530 | va_arg(va, int); |
| 3531 | va_arg(va, char *); |
| 3532 | va_arg(va, double); |
| 3533 | return 0; |
| 3534 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3535 | ]], [[return foo(10, "", 3.14);]])],[ |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3536 | AC_DEFINE(HAVE_STDARG_PROTOTYPES, 1, |
| 3537 | [Define if your compiler supports variable length function prototypes |
| 3538 | (e.g. void fprintf(FILE *, char *, ...);) *and* <stdarg.h>]) |
| 3539 | works=yes |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3540 | ],[]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3541 | AC_MSG_RESULT($works) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3542 | |
Dave Cole | 331708b | 2004-08-09 04:51:41 +0000 | [diff] [blame] | 3543 | # check for socketpair |
| 3544 | AC_MSG_CHECKING(for socketpair) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3545 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Dave Cole | 331708b | 2004-08-09 04:51:41 +0000 | [diff] [blame] | 3546 | #include <sys/types.h> |
| 3547 | #include <sys/socket.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3548 | ]], [[void *x=socketpair]])], |
| 3549 | [AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define if you have the 'socketpair' function.]) |
| 3550 | AC_MSG_RESULT(yes)], |
| 3551 | [AC_MSG_RESULT(no)] |
Dave Cole | 331708b | 2004-08-09 04:51:41 +0000 | [diff] [blame] | 3552 | ) |
| 3553 | |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3554 | # check if sockaddr has sa_len member |
| 3555 | AC_MSG_CHECKING(if sockaddr has sa_len member) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3556 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> |
| 3557 | #include <sys/socket.h>]], [[struct sockaddr x; |
| 3558 | x.sa_len = 0;]])], |
| 3559 | [AC_MSG_RESULT(yes) |
| 3560 | AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])], |
| 3561 | [AC_MSG_RESULT(no)] |
| 3562 | ) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 3563 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3564 | va_list_is_array=no |
| 3565 | AC_MSG_CHECKING(whether va_list is an array) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3566 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3567 | #ifdef HAVE_STDARG_PROTOTYPES |
| 3568 | #include <stdarg.h> |
| 3569 | #else |
| 3570 | #include <varargs.h> |
| 3571 | #endif |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3572 | ]], [[va_list list1, list2; list1 = list2;]])],[],[ |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3573 | AC_DEFINE(VA_LIST_IS_ARRAY, 1, [Define if a va_list is an array of some kind]) |
| 3574 | va_list_is_array=yes |
| 3575 | ]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 3576 | AC_MSG_RESULT($va_list_is_array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3577 | |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3578 | # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( |
Martin v. Löwis | 1143799 | 2002-04-12 09:54:03 +0000 | [diff] [blame] | 3579 | AH_TEMPLATE(HAVE_GETHOSTBYNAME_R, |
| 3580 | [Define this if you have some version of gethostbyname_r()]) |
| 3581 | |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3582 | AC_CHECK_FUNC(gethostbyname_r, [ |
| 3583 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
| 3584 | AC_MSG_CHECKING([gethostbyname_r with 6 args]) |
| 3585 | OLD_CFLAGS=$CFLAGS |
| 3586 | CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3587 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3588 | # include <netdb.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3589 | ]], [[ |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3590 | char *name; |
| 3591 | struct hostent *he, *res; |
| 3592 | char buffer[2048]; |
| 3593 | int buflen = 2048; |
| 3594 | int h_errnop; |
| 3595 | |
| 3596 | (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3597 | ]])],[ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 3598 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3599 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG, 1, |
| 3600 | [Define this if you have the 6-arg version of gethostbyname_r().]) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3601 | AC_MSG_RESULT(yes) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3602 | ],[ |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3603 | AC_MSG_RESULT(no) |
| 3604 | AC_MSG_CHECKING([gethostbyname_r with 5 args]) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3605 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3606 | # include <netdb.h> |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3607 | ]], [[ |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3608 | char *name; |
| 3609 | struct hostent *he; |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3610 | char buffer[2048]; |
| 3611 | int buflen = 2048; |
| 3612 | int h_errnop; |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3613 | |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3614 | (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop) |
| 3615 | ]])], |
| 3616 | [ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 3617 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3618 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG, 1, |
| 3619 | [Define this if you have the 5-arg version of gethostbyname_r().]) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3620 | AC_MSG_RESULT(yes) |
| 3621 | ], [ |
| 3622 | AC_MSG_RESULT(no) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3623 | AC_MSG_CHECKING([gethostbyname_r with 3 args]) |
| 3624 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 3625 | # include <netdb.h> |
| 3626 | ]], [[ |
| 3627 | char *name; |
| 3628 | struct hostent *he; |
| 3629 | struct hostent_data data; |
| 3630 | |
| 3631 | (void) gethostbyname_r(name, he, &data); |
| 3632 | ]])], |
| 3633 | [ |
| 3634 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
| 3635 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG, 1, |
| 3636 | [Define this if you have the 3-arg version of gethostbyname_r().]) |
| 3637 | AC_MSG_RESULT(yes) |
| 3638 | ], [ |
| 3639 | AC_MSG_RESULT(no) |
| 3640 | ]) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3641 | ]) |
| 3642 | ]) |
| 3643 | CFLAGS=$OLD_CFLAGS |
| 3644 | ], [ |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 3645 | AC_CHECK_FUNCS(gethostbyname) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3646 | ]) |
| 3647 | AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG) |
| 3648 | AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG) |
| 3649 | AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG) |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 3650 | AC_SUBST(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 3651 | AC_SUBST(HAVE_GETHOSTBYNAME) |
| 3652 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 3653 | # checks for system services |
| 3654 | # (none yet) |
| 3655 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 3656 | # Linux requires this for correct f.p. operations |
Jeremy Hylton | be28f5b | 2000-07-27 21:03:04 +0000 | [diff] [blame] | 3657 | AC_CHECK_FUNC(__fpu_control, |
| 3658 | [], |
| 3659 | [AC_CHECK_LIB(ieee, __fpu_control) |
| 3660 | ]) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 3661 | |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3662 | # Check for --with-fpectl |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3663 | AC_MSG_CHECKING(for --with-fpectl) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 3664 | AC_ARG_WITH(fpectl, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 3665 | AS_HELP_STRING([--with-fpectl], [enable SIGFPE catching]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3666 | [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3667 | if test "$withval" != no |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3668 | then |
| 3669 | AC_DEFINE(WANT_SIGFPE_HANDLER, 1, |
| 3670 | [Define if you want SIGFPE handled (see Include/pyfpe.h).]) |
| 3671 | AC_MSG_RESULT(yes) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3672 | else AC_MSG_RESULT(no) |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 3673 | fi], |
| 3674 | [AC_MSG_RESULT(no)]) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3675 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3676 | # check for --with-libm=... |
| 3677 | AC_SUBST(LIBM) |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 3678 | case $ac_sys_system in |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 3679 | Darwin) ;; |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 3680 | BeOS) ;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 3681 | *) LIBM=-lm |
| 3682 | esac |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3683 | AC_MSG_CHECKING(for --with-libm=STRING) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3684 | AC_ARG_WITH(libm, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 3685 | AS_HELP_STRING([--with-libm=STRING], [math library]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3686 | [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3687 | if test "$withval" = no |
| 3688 | then LIBM= |
| 3689 | AC_MSG_RESULT(force LIBM empty) |
| 3690 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3691 | then LIBM=$withval |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3692 | AC_MSG_RESULT(set LIBM="$withval") |
| 3693 | else AC_MSG_ERROR([proper usage is --with-libm=STRING]) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3694 | fi], |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3695 | [AC_MSG_RESULT(default LIBM="$LIBM")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3696 | |
| 3697 | # check for --with-libc=... |
| 3698 | AC_SUBST(LIBC) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3699 | AC_MSG_CHECKING(for --with-libc=STRING) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3700 | AC_ARG_WITH(libc, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 3701 | AS_HELP_STRING([--with-libc=STRING], [C library]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3702 | [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3703 | if test "$withval" = no |
| 3704 | then LIBC= |
| 3705 | AC_MSG_RESULT(force LIBC empty) |
| 3706 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3707 | then LIBC=$withval |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3708 | AC_MSG_RESULT(set LIBC="$withval") |
| 3709 | else AC_MSG_ERROR([proper usage is --with-libc=STRING]) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 3710 | fi], |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 3711 | [AC_MSG_RESULT(default LIBC="$LIBC")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 3712 | |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3713 | # ************************************************** |
| 3714 | # * Check for various properties of floating point * |
| 3715 | # ************************************************** |
Mark Dickinson | 265d738 | 2008-04-21 22:32:24 +0000 | [diff] [blame] | 3716 | |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3717 | AC_MSG_CHECKING(whether C doubles are little-endian IEEE 754 binary64) |
| 3718 | AC_CACHE_VAL(ac_cv_little_endian_double, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3719 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3720 | #include <string.h> |
| 3721 | int main() { |
| 3722 | double x = 9006104071832581.0; |
| 3723 | if (memcmp(&x, "\x05\x04\x03\x02\x01\xff\x3f\x43", 8) == 0) |
| 3724 | return 0; |
| 3725 | else |
| 3726 | return 1; |
| 3727 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3728 | ]])], |
| 3729 | [ac_cv_little_endian_double=yes], |
| 3730 | [ac_cv_little_endian_double=no], |
| 3731 | [ac_cv_little_endian_double=no])]) |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3732 | AC_MSG_RESULT($ac_cv_little_endian_double) |
| 3733 | if test "$ac_cv_little_endian_double" = yes |
| 3734 | then |
| 3735 | AC_DEFINE(DOUBLE_IS_LITTLE_ENDIAN_IEEE754, 1, |
| 3736 | [Define if C doubles are 64-bit IEEE 754 binary format, stored |
| 3737 | with the least significant byte first]) |
| 3738 | fi |
| 3739 | |
| 3740 | AC_MSG_CHECKING(whether C doubles are big-endian IEEE 754 binary64) |
| 3741 | AC_CACHE_VAL(ac_cv_big_endian_double, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3742 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3743 | #include <string.h> |
| 3744 | int main() { |
| 3745 | double x = 9006104071832581.0; |
| 3746 | if (memcmp(&x, "\x43\x3f\xff\x01\x02\x03\x04\x05", 8) == 0) |
| 3747 | return 0; |
| 3748 | else |
| 3749 | return 1; |
| 3750 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3751 | ]])], |
| 3752 | [ac_cv_big_endian_double=yes], |
| 3753 | [ac_cv_big_endian_double=no], |
| 3754 | [ac_cv_big_endian_double=no])]) |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3755 | AC_MSG_RESULT($ac_cv_big_endian_double) |
| 3756 | if test "$ac_cv_big_endian_double" = yes |
| 3757 | then |
| 3758 | AC_DEFINE(DOUBLE_IS_BIG_ENDIAN_IEEE754, 1, |
| 3759 | [Define if C doubles are 64-bit IEEE 754 binary format, stored |
| 3760 | with the most significant byte first]) |
| 3761 | fi |
| 3762 | |
| 3763 | # Some ARM platforms use a mixed-endian representation for doubles. |
| 3764 | # While Python doesn't currently have full support for these platforms |
| 3765 | # (see e.g., issue 1762561), we can at least make sure that float <-> string |
| 3766 | # conversions work. |
| 3767 | AC_MSG_CHECKING(whether C doubles are ARM mixed-endian IEEE 754 binary64) |
| 3768 | AC_CACHE_VAL(ac_cv_mixed_endian_double, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3769 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3770 | #include <string.h> |
| 3771 | int main() { |
| 3772 | double x = 9006104071832581.0; |
| 3773 | if (memcmp(&x, "\x01\xff\x3f\x43\x05\x04\x03\x02", 8) == 0) |
| 3774 | return 0; |
| 3775 | else |
| 3776 | return 1; |
| 3777 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3778 | ]])], |
| 3779 | [ac_cv_mixed_endian_double=yes], |
| 3780 | [ac_cv_mixed_endian_double=no], |
| 3781 | [ac_cv_mixed_endian_double=no])]) |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3782 | AC_MSG_RESULT($ac_cv_mixed_endian_double) |
| 3783 | if test "$ac_cv_mixed_endian_double" = yes |
| 3784 | then |
| 3785 | AC_DEFINE(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754, 1, |
| 3786 | [Define if C doubles are 64-bit IEEE 754 binary format, stored |
| 3787 | in ARM mixed-endian order (byte order 45670123)]) |
| 3788 | fi |
| 3789 | |
| 3790 | # The short float repr introduced in Python 3.1 requires the |
| 3791 | # correctly-rounded string <-> double conversion functions from |
| 3792 | # Python/dtoa.c, which in turn require that the FPU uses 53-bit |
| 3793 | # rounding; this is a problem on x86, where the x87 FPU has a default |
Mark Dickinson | a548dee | 2009-11-15 13:12:43 +0000 | [diff] [blame] | 3794 | # rounding precision of 64 bits. For gcc/x86, we can fix this by |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3795 | # using inline assembler to get and set the x87 FPU control word. |
Mark Dickinson | a548dee | 2009-11-15 13:12:43 +0000 | [diff] [blame] | 3796 | |
| 3797 | # This inline assembler syntax may also work for suncc and icc, |
| 3798 | # so we try it on all platforms. |
| 3799 | |
| 3800 | AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 control word) |
Stefan Krah | 99e36b9 | 2015-07-03 15:30:54 +0200 | [diff] [blame] | 3801 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ |
Mark Dickinson | a548dee | 2009-11-15 13:12:43 +0000 | [diff] [blame] | 3802 | unsigned short cw; |
| 3803 | __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); |
| 3804 | __asm__ __volatile__ ("fldcw %0" : : "m" (cw)); |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3805 | ]])],[have_gcc_asm_for_x87=yes],[have_gcc_asm_for_x87=no]) |
Mark Dickinson | a548dee | 2009-11-15 13:12:43 +0000 | [diff] [blame] | 3806 | AC_MSG_RESULT($have_gcc_asm_for_x87) |
| 3807 | if test "$have_gcc_asm_for_x87" = yes |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3808 | then |
Mark Dickinson | a548dee | 2009-11-15 13:12:43 +0000 | [diff] [blame] | 3809 | AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1, |
| 3810 | [Define if we can use gcc inline assembler to get and set x87 control word]) |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3811 | fi |
Mark Dickinson | 7a3d864 | 2008-04-22 00:54:27 +0000 | [diff] [blame] | 3812 | |
Mark Dickinson | 04b2723 | 2009-01-04 12:29:36 +0000 | [diff] [blame] | 3813 | # Detect whether system arithmetic is subject to x87-style double |
| 3814 | # rounding issues. The result of this test has little meaning on non |
| 3815 | # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding |
| 3816 | # mode is round-to-nearest and double rounding issues are present, and |
| 3817 | # 0 otherwise. See http://bugs.python.org/issue2937 for more info. |
| 3818 | AC_MSG_CHECKING(for x87-style double rounding) |
Mark Dickinson | 99abd14 | 2009-10-24 13:44:16 +0000 | [diff] [blame] | 3819 | # $BASECFLAGS may affect the result |
| 3820 | ac_save_cc="$CC" |
| 3821 | CC="$CC $BASECFLAGS" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3822 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Mark Dickinson | 04b2723 | 2009-01-04 12:29:36 +0000 | [diff] [blame] | 3823 | #include <stdlib.h> |
| 3824 | #include <math.h> |
| 3825 | int main() { |
| 3826 | volatile double x, y, z; |
| 3827 | /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ |
| 3828 | x = 0.99999999999999989; /* 1-2**-53 */ |
| 3829 | y = 1./x; |
| 3830 | if (y != 1.) |
| 3831 | exit(0); |
| 3832 | /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ |
| 3833 | x = 1e16; |
| 3834 | y = 2.99999; |
| 3835 | z = x + y; |
| 3836 | if (z != 1e16+4.) |
| 3837 | exit(0); |
| 3838 | /* both tests show evidence of double rounding */ |
| 3839 | exit(1); |
| 3840 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3841 | ]])], |
| 3842 | [ac_cv_x87_double_rounding=no], |
| 3843 | [ac_cv_x87_double_rounding=yes], |
| 3844 | [ac_cv_x87_double_rounding=no]) |
Mark Dickinson | 99abd14 | 2009-10-24 13:44:16 +0000 | [diff] [blame] | 3845 | CC="$ac_save_cc" |
Mark Dickinson | 04b2723 | 2009-01-04 12:29:36 +0000 | [diff] [blame] | 3846 | AC_MSG_RESULT($ac_cv_x87_double_rounding) |
| 3847 | if test "$ac_cv_x87_double_rounding" = yes |
| 3848 | then |
| 3849 | AC_DEFINE(X87_DOUBLE_ROUNDING, 1, |
| 3850 | [Define if arithmetic is subject to x87-style double rounding issue]) |
| 3851 | fi |
| 3852 | |
Mark Dickinson | 1d6e2e1 | 2009-10-24 13:28:38 +0000 | [diff] [blame] | 3853 | # ************************************ |
| 3854 | # * Check for mathematical functions * |
| 3855 | # ************************************ |
| 3856 | |
| 3857 | LIBS_SAVE=$LIBS |
| 3858 | LIBS="$LIBS $LIBM" |
| 3859 | |
Mark Dickinson | c63392c | 2009-11-28 13:13:13 +0000 | [diff] [blame] | 3860 | # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of |
| 3861 | # -0. on some architectures. |
| 3862 | AC_MSG_CHECKING(whether tanh preserves the sign of zero) |
| 3863 | AC_CACHE_VAL(ac_cv_tanh_preserves_zero_sign, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3864 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Mark Dickinson | c63392c | 2009-11-28 13:13:13 +0000 | [diff] [blame] | 3865 | #include <math.h> |
| 3866 | #include <stdlib.h> |
| 3867 | int main() { |
| 3868 | /* return 0 if either negative zeros don't exist |
| 3869 | on this platform or if negative zeros exist |
| 3870 | and tanh(-0.) == -0. */ |
| 3871 | if (atan2(0., -1.) == atan2(-0., -1.) || |
| 3872 | atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0); |
| 3873 | else exit(1); |
| 3874 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3875 | ]])], |
| 3876 | [ac_cv_tanh_preserves_zero_sign=yes], |
| 3877 | [ac_cv_tanh_preserves_zero_sign=no], |
| 3878 | [ac_cv_tanh_preserves_zero_sign=no])]) |
Mark Dickinson | c63392c | 2009-11-28 13:13:13 +0000 | [diff] [blame] | 3879 | AC_MSG_RESULT($ac_cv_tanh_preserves_zero_sign) |
| 3880 | if test "$ac_cv_tanh_preserves_zero_sign" = yes |
| 3881 | then |
| 3882 | AC_DEFINE(TANH_PRESERVES_ZERO_SIGN, 1, |
| 3883 | [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) |
| 3884 | fi |
| 3885 | |
| 3886 | AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma]) |
| 3887 | AC_CHECK_FUNCS([hypot lgamma log1p round tgamma]) |
| 3888 | AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]]) |
| 3889 | |
| 3890 | LIBS=$LIBS_SAVE |
| 3891 | |
Mark Dickinson | c4920e8 | 2009-11-20 19:30:22 +0000 | [diff] [blame] | 3892 | # For multiprocessing module, check that sem_open |
| 3893 | # actually works. For FreeBSD versions <= 7.2, |
| 3894 | # the kernel module that provides POSIX semaphores |
| 3895 | # isn't loaded by default, so an attempt to call |
| 3896 | # sem_open results in a 'Signal 12' error. |
| 3897 | AC_MSG_CHECKING(whether POSIX semaphores are enabled) |
| 3898 | AC_CACHE_VAL(ac_cv_posix_semaphores_enabled, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3899 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Mark Dickinson | c4920e8 | 2009-11-20 19:30:22 +0000 | [diff] [blame] | 3900 | #include <unistd.h> |
| 3901 | #include <fcntl.h> |
| 3902 | #include <stdio.h> |
| 3903 | #include <semaphore.h> |
| 3904 | #include <sys/stat.h> |
| 3905 | |
| 3906 | int main(void) { |
| 3907 | sem_t *a = sem_open("/autoconf", O_CREAT, S_IRUSR|S_IWUSR, 0); |
| 3908 | if (a == SEM_FAILED) { |
| 3909 | perror("sem_open"); |
| 3910 | return 1; |
| 3911 | } |
| 3912 | sem_close(a); |
Mark Dickinson | 59dc89e | 2009-12-13 21:06:06 +0000 | [diff] [blame] | 3913 | sem_unlink("/autoconf"); |
Mark Dickinson | c4920e8 | 2009-11-20 19:30:22 +0000 | [diff] [blame] | 3914 | return 0; |
| 3915 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3916 | ]])], |
| 3917 | [ac_cv_posix_semaphores_enabled=yes], |
| 3918 | [ac_cv_posix_semaphores_enabled=no], |
| 3919 | [ac_cv_posix_semaphores_enabled=yes]) |
Mark Dickinson | c4920e8 | 2009-11-20 19:30:22 +0000 | [diff] [blame] | 3920 | ) |
| 3921 | AC_MSG_RESULT($ac_cv_posix_semaphores_enabled) |
| 3922 | if test $ac_cv_posix_semaphores_enabled = no |
| 3923 | then |
Mark Dickinson | 5afa6d4 | 2009-11-28 10:44:20 +0000 | [diff] [blame] | 3924 | AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1, |
| 3925 | [Define if POSIX semaphores aren't enabled on your system]) |
Mark Dickinson | c4920e8 | 2009-11-20 19:30:22 +0000 | [diff] [blame] | 3926 | fi |
| 3927 | |
Jesse Noller | 355b126 | 2009-04-02 00:03:28 +0000 | [diff] [blame] | 3928 | # Multiprocessing check for broken sem_getvalue |
| 3929 | AC_MSG_CHECKING(for broken sem_getvalue) |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3930 | AC_CACHE_VAL(ac_cv_broken_sem_getvalue, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3931 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Jesse Noller | 355b126 | 2009-04-02 00:03:28 +0000 | [diff] [blame] | 3932 | #include <unistd.h> |
| 3933 | #include <fcntl.h> |
| 3934 | #include <stdio.h> |
| 3935 | #include <semaphore.h> |
| 3936 | #include <sys/stat.h> |
| 3937 | |
| 3938 | int main(void){ |
Mark Dickinson | 59dc89e | 2009-12-13 21:06:06 +0000 | [diff] [blame] | 3939 | sem_t *a = sem_open("/autocftw", O_CREAT, S_IRUSR|S_IWUSR, 0); |
Jesse Noller | 355b126 | 2009-04-02 00:03:28 +0000 | [diff] [blame] | 3940 | int count; |
| 3941 | int res; |
| 3942 | if(a==SEM_FAILED){ |
| 3943 | perror("sem_open"); |
| 3944 | return 1; |
| 3945 | |
| 3946 | } |
| 3947 | res = sem_getvalue(a, &count); |
| 3948 | sem_close(a); |
Mark Dickinson | 59dc89e | 2009-12-13 21:06:06 +0000 | [diff] [blame] | 3949 | sem_unlink("/autocftw"); |
Jesse Noller | 355b126 | 2009-04-02 00:03:28 +0000 | [diff] [blame] | 3950 | return res==-1 ? 1 : 0; |
| 3951 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 3952 | ]])], |
| 3953 | [ac_cv_broken_sem_getvalue=no], |
| 3954 | [ac_cv_broken_sem_getvalue=yes], |
| 3955 | [ac_cv_broken_sem_getvalue=yes]) |
Jesse Noller | 355b126 | 2009-04-02 00:03:28 +0000 | [diff] [blame] | 3956 | ) |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 3957 | AC_MSG_RESULT($ac_cv_broken_sem_getvalue) |
| 3958 | if test $ac_cv_broken_sem_getvalue = yes |
| 3959 | then |
| 3960 | AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, |
| 3961 | [define to 1 if your sem_getvalue is broken.]) |
| 3962 | fi |
Mark Dickinson | 04b2723 | 2009-01-04 12:29:36 +0000 | [diff] [blame] | 3963 | |
Mark Dickinson | efc82f7 | 2009-03-20 15:51:55 +0000 | [diff] [blame] | 3964 | # determine what size digit to use for Python's longs |
| 3965 | AC_MSG_CHECKING([digit size for Python's longs]) |
| 3966 | AC_ARG_ENABLE(big-digits, |
Matthias Klose | 22520ea | 2010-05-08 10:14:46 +0000 | [diff] [blame] | 3967 | AS_HELP_STRING([--enable-big-digits@<:@=BITS@:>@],[use big digits for Python longs [[BITS=30]]]), |
Mark Dickinson | efc82f7 | 2009-03-20 15:51:55 +0000 | [diff] [blame] | 3968 | [case $enable_big_digits in |
| 3969 | yes) |
| 3970 | enable_big_digits=30 ;; |
| 3971 | no) |
| 3972 | enable_big_digits=15 ;; |
| 3973 | [15|30]) |
| 3974 | ;; |
| 3975 | *) |
| 3976 | AC_MSG_ERROR([bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30]) ;; |
| 3977 | esac |
| 3978 | AC_MSG_RESULT($enable_big_digits) |
| 3979 | AC_DEFINE_UNQUOTED(PYLONG_BITS_IN_DIGIT, $enable_big_digits, [Define as the preferred size in bits of long digits]) |
| 3980 | ], |
| 3981 | [AC_MSG_RESULT(no value specified)]) |
| 3982 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 3983 | # check for wchar.h |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 3984 | AC_CHECK_HEADER(wchar.h, [ |
| 3985 | AC_DEFINE(HAVE_WCHAR_H, 1, |
| 3986 | [Define if the compiler provides a wchar.h header file.]) |
| 3987 | wchar_h="yes" |
| 3988 | ], |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 3989 | wchar_h="no" |
| 3990 | ) |
| 3991 | |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 3992 | # determine wchar_t size |
| 3993 | if test "$wchar_h" = yes |
| 3994 | then |
Guido van Rossum | 67b2659 | 2001-10-20 14:21:45 +0000 | [diff] [blame] | 3995 | AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>]) |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 3996 | fi |
| 3997 | |
Martin v. Löwis | fa3bdea | 2003-09-04 18:50:54 +0000 | [diff] [blame] | 3998 | AC_MSG_CHECKING(for UCS-4 tcl) |
| 3999 | have_ucs4_tcl=no |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4000 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
Martin v. Löwis | fa3bdea | 2003-09-04 18:50:54 +0000 | [diff] [blame] | 4001 | #include <tcl.h> |
| 4002 | #if TCL_UTF_MAX != 6 |
| 4003 | # error "NOT UCS4_TCL" |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4004 | #endif]], [[]])],[ |
Martin v. Löwis | fa3bdea | 2003-09-04 18:50:54 +0000 | [diff] [blame] | 4005 | AC_DEFINE(HAVE_UCS4_TCL, 1, [Define this if you have tcl and TCL_UTF_MAX==6]) |
| 4006 | have_ucs4_tcl=yes |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4007 | ],[]) |
Martin v. Löwis | fa3bdea | 2003-09-04 18:50:54 +0000 | [diff] [blame] | 4008 | AC_MSG_RESULT($have_ucs4_tcl) |
| 4009 | |
Marc-André Lemburg | d7160f8 | 2003-09-22 11:14:40 +0000 | [diff] [blame] | 4010 | # check whether wchar_t is signed or not |
| 4011 | if test "$wchar_h" = yes |
| 4012 | then |
| 4013 | # check whether wchar_t is signed or not |
| 4014 | AC_MSG_CHECKING(whether wchar_t is signed) |
| 4015 | AC_CACHE_VAL(ac_cv_wchar_t_signed, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4016 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Marc-André Lemburg | d7160f8 | 2003-09-22 11:14:40 +0000 | [diff] [blame] | 4017 | #include <wchar.h> |
| 4018 | int main() |
| 4019 | { |
Martin v. Löwis | 44fe0e4 | 2006-04-11 07:15:30 +0000 | [diff] [blame] | 4020 | /* Success: exit code 0 */ |
| 4021 | exit((((wchar_t) -1) < ((wchar_t) 0)) ? 0 : 1); |
Marc-André Lemburg | d7160f8 | 2003-09-22 11:14:40 +0000 | [diff] [blame] | 4022 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4023 | ]])], |
| 4024 | [ac_cv_wchar_t_signed=yes], |
| 4025 | [ac_cv_wchar_t_signed=no], |
| 4026 | [ac_cv_wchar_t_signed=yes])]) |
Marc-André Lemburg | d7160f8 | 2003-09-22 11:14:40 +0000 | [diff] [blame] | 4027 | AC_MSG_RESULT($ac_cv_wchar_t_signed) |
| 4028 | fi |
| 4029 | |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4030 | AC_MSG_CHECKING(what type to use for unicode) |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 4031 | dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4032 | AC_ARG_ENABLE(unicode, |
Benjamin Peterson | 66556b0 | 2010-05-25 02:23:32 +0000 | [diff] [blame] | 4033 | AS_HELP_STRING([--enable-unicode@<:@=ucs@<:@24@:>@@:>@], [Enable Unicode strings (default is ucs2)]), |
Martin v. Löwis | 3e2c632 | 2002-10-29 10:07:43 +0000 | [diff] [blame] | 4034 | [], |
| 4035 | [enable_unicode=yes]) |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4036 | |
| 4037 | if test $enable_unicode = yes |
| 4038 | then |
Martin v. Löwis | fd91779 | 2001-06-27 20:22:04 +0000 | [diff] [blame] | 4039 | # Without any arguments, Py_UNICODE defaults to two-byte mode |
Martin v. Löwis | fa3bdea | 2003-09-04 18:50:54 +0000 | [diff] [blame] | 4040 | case "$have_ucs4_tcl" in |
| 4041 | yes) enable_unicode="ucs4" |
| 4042 | ;; |
| 4043 | *) enable_unicode="ucs2" |
| 4044 | ;; |
| 4045 | esac |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4046 | fi |
| 4047 | |
Martin v. Löwis | 0036cba | 2002-04-12 09:58:45 +0000 | [diff] [blame] | 4048 | AH_TEMPLATE(Py_UNICODE_SIZE, |
| 4049 | [Define as the size of the unicode type.]) |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4050 | case "$enable_unicode" in |
| 4051 | ucs2) unicode_size="2" |
| 4052 | AC_DEFINE(Py_UNICODE_SIZE,2) |
| 4053 | ;; |
| 4054 | ucs4) unicode_size="4" |
| 4055 | AC_DEFINE(Py_UNICODE_SIZE,4) |
| 4056 | ;; |
Martin v. Löwis | ed11a5d | 2012-05-20 10:42:17 +0200 | [diff] [blame] | 4057 | no) ;; # To allow --disable-unicode |
Ezio Melotti | 5820efb | 2010-02-27 00:05:42 +0000 | [diff] [blame] | 4058 | *) AC_MSG_ERROR([invalid value for --enable-unicode. Use either ucs2 or ucs4 (lowercase).]) ;; |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4059 | esac |
| 4060 | |
Martin v. Löwis | 1143799 | 2002-04-12 09:54:03 +0000 | [diff] [blame] | 4061 | AH_TEMPLATE(PY_UNICODE_TYPE, |
| 4062 | [Define as the integral type used for Unicode representation.]) |
Martin v. Löwis | 0036cba | 2002-04-12 09:58:45 +0000 | [diff] [blame] | 4063 | |
Martin v. Löwis | 339d0f7 | 2001-08-17 18:39:25 +0000 | [diff] [blame] | 4064 | AC_SUBST(UNICODE_OBJS) |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4065 | if test "$enable_unicode" = "no" |
| 4066 | then |
Martin v. Löwis | 339d0f7 | 2001-08-17 18:39:25 +0000 | [diff] [blame] | 4067 | UNICODE_OBJS="" |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4068 | AC_MSG_RESULT(not used) |
| 4069 | else |
Martin v. Löwis | 339d0f7 | 2001-08-17 18:39:25 +0000 | [diff] [blame] | 4070 | UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o" |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4071 | AC_DEFINE(Py_USING_UNICODE, 1, |
| 4072 | [Define if you want to have a Unicode type.]) |
Marc-André Lemburg | d7160f8 | 2003-09-22 11:14:40 +0000 | [diff] [blame] | 4073 | |
| 4074 | # wchar_t is only usable if it maps to an unsigned type |
| 4075 | if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \ |
Matthias Klose | 7dbeed7 | 2004-12-24 08:22:17 +0000 | [diff] [blame] | 4076 | -a "$ac_cv_wchar_t_signed" = "no" |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4077 | then |
| 4078 | PY_UNICODE_TYPE="wchar_t" |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4079 | AC_DEFINE(HAVE_USABLE_WCHAR_T, 1, |
| 4080 | [Define if you have a useable wchar_t type defined in wchar.h; useable |
Marc-André Lemburg | d7160f8 | 2003-09-22 11:14:40 +0000 | [diff] [blame] | 4081 | means wchar_t must be an unsigned type with at least 16 bits. (see |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4082 | Include/unicodeobject.h).]) |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 4083 | AC_DEFINE(PY_UNICODE_TYPE,wchar_t) |
| 4084 | elif test "$ac_cv_sizeof_short" = "$unicode_size" |
| 4085 | then |
| 4086 | PY_UNICODE_TYPE="unsigned short" |
| 4087 | AC_DEFINE(PY_UNICODE_TYPE,unsigned short) |
| 4088 | elif test "$ac_cv_sizeof_long" = "$unicode_size" |
| 4089 | then |
| 4090 | PY_UNICODE_TYPE="unsigned long" |
| 4091 | AC_DEFINE(PY_UNICODE_TYPE,unsigned long) |
| 4092 | else |
| 4093 | PY_UNICODE_TYPE="no type found" |
| 4094 | fi |
| 4095 | AC_MSG_RESULT($PY_UNICODE_TYPE) |
| 4096 | fi |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 4097 | |
| 4098 | # check for endianness |
| 4099 | AC_C_BIGENDIAN |
| 4100 | |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 4101 | # Check whether right shifting a negative integer extends the sign bit |
| 4102 | # or fills with zeros (like the Cray J90, according to Tim Peters). |
| 4103 | AC_MSG_CHECKING(whether right shift extends the sign bit) |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 4104 | AC_CACHE_VAL(ac_cv_rshift_extends_sign, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4105 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 4106 | int main() |
| 4107 | { |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 4108 | exit(((-1)>>3 == -1) ? 0 : 1); |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 4109 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4110 | ]])], |
| 4111 | [ac_cv_rshift_extends_sign=yes], |
| 4112 | [ac_cv_rshift_extends_sign=no], |
| 4113 | [ac_cv_rshift_extends_sign=yes])]) |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 4114 | AC_MSG_RESULT($ac_cv_rshift_extends_sign) |
| 4115 | if test "$ac_cv_rshift_extends_sign" = no |
| 4116 | then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4117 | AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS, 1, |
| 4118 | [Define if i>>j for signed int i does not extend the sign bit |
| 4119 | when i < 0]) |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 4120 | fi |
| 4121 | |
Guido van Rossum | cadfaec | 2001-01-05 14:45:49 +0000 | [diff] [blame] | 4122 | # check for getc_unlocked and related locking functions |
| 4123 | AC_MSG_CHECKING(for getc_unlocked() and friends) |
| 4124 | AC_CACHE_VAL(ac_cv_have_getc_unlocked, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4125 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[ |
Guido van Rossum | cadfaec | 2001-01-05 14:45:49 +0000 | [diff] [blame] | 4126 | FILE *f = fopen("/dev/null", "r"); |
| 4127 | flockfile(f); |
| 4128 | getc_unlocked(f); |
| 4129 | funlockfile(f); |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4130 | ]])],[ac_cv_have_getc_unlocked=yes],[ac_cv_have_getc_unlocked=no])]) |
Guido van Rossum | cadfaec | 2001-01-05 14:45:49 +0000 | [diff] [blame] | 4131 | AC_MSG_RESULT($ac_cv_have_getc_unlocked) |
| 4132 | if test "$ac_cv_have_getc_unlocked" = yes |
| 4133 | then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4134 | AC_DEFINE(HAVE_GETC_UNLOCKED, 1, |
| 4135 | [Define this if you have flockfile(), getc_unlocked(), and funlockfile()]) |
Guido van Rossum | cadfaec | 2001-01-05 14:45:49 +0000 | [diff] [blame] | 4136 | fi |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 4137 | |
Neal Norwitz | fe8e3d9 | 2006-01-07 21:07:20 +0000 | [diff] [blame] | 4138 | # check where readline lives |
Martin v. Löwis | 82bca63 | 2006-02-10 20:49:30 +0000 | [diff] [blame] | 4139 | # save the value of LIBS so we don't actually link Python with readline |
| 4140 | LIBS_no_readline=$LIBS |
Gregory P. Smith | 980b99b | 2008-09-07 05:15:18 +0000 | [diff] [blame] | 4141 | |
| 4142 | # On some systems we need to link readline to a termcap compatible |
| 4143 | # library. NOTE: Keep the precedence of listed libraries synchronised |
| 4144 | # with setup.py. |
| 4145 | py_cv_lib_readline=no |
| 4146 | AC_MSG_CHECKING([how to link readline libs]) |
| 4147 | for py_libtermcap in "" ncursesw ncurses curses termcap; do |
| 4148 | if test -z "$py_libtermcap"; then |
| 4149 | READLINE_LIBS="-lreadline" |
| 4150 | else |
| 4151 | READLINE_LIBS="-lreadline -l$py_libtermcap" |
| 4152 | fi |
| 4153 | LIBS="$READLINE_LIBS $LIBS_no_readline" |
| 4154 | AC_LINK_IFELSE( |
| 4155 | [AC_LANG_CALL([],[readline])], |
| 4156 | [py_cv_lib_readline=yes]) |
| 4157 | if test $py_cv_lib_readline = yes; then |
| 4158 | break |
| 4159 | fi |
| 4160 | done |
| 4161 | # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts |
| 4162 | #AC_SUBST([READLINE_LIBS]) |
Gregory P. Smith | 29ec750 | 2008-09-07 19:18:16 +0000 | [diff] [blame] | 4163 | if test $py_cv_lib_readline = no; then |
Gregory P. Smith | 980b99b | 2008-09-07 05:15:18 +0000 | [diff] [blame] | 4164 | AC_MSG_RESULT([none]) |
| 4165 | else |
| 4166 | AC_MSG_RESULT([$READLINE_LIBS]) |
| 4167 | AC_DEFINE(HAVE_LIBREADLINE, 1, |
| 4168 | [Define if you have the readline library (-lreadline).]) |
Neal Norwitz | fe8e3d9 | 2006-01-07 21:07:20 +0000 | [diff] [blame] | 4169 | fi |
| 4170 | |
Michael W. Hudson | 30ea2f2 | 2004-07-07 17:44:12 +0000 | [diff] [blame] | 4171 | # check for readline 2.1 |
| 4172 | AC_CHECK_LIB(readline, rl_callback_handler_install, |
| 4173 | AC_DEFINE(HAVE_RL_CALLBACK, 1, |
Gregory P. Smith | ff7b2d5 | 2008-09-03 05:57:48 +0000 | [diff] [blame] | 4174 | [Define if you have readline 2.1]), ,$READLINE_LIBS) |
Michael W. Hudson | 30ea2f2 | 2004-07-07 17:44:12 +0000 | [diff] [blame] | 4175 | |
Guido van Rossum | faf5e4d | 2002-12-30 16:25:41 +0000 | [diff] [blame] | 4176 | # check for readline 2.2 |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4177 | AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])], |
| 4178 | [have_readline=yes], |
| 4179 | [have_readline=no] |
| 4180 | ) |
Guido van Rossum | faf5e4d | 2002-12-30 16:25:41 +0000 | [diff] [blame] | 4181 | if test $have_readline = yes |
| 4182 | then |
| 4183 | AC_EGREP_HEADER([extern int rl_completion_append_character;], |
| 4184 | [readline/readline.h], |
| 4185 | AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1, |
| 4186 | [Define if you have readline 2.2]), ) |
Antoine Pitrou | d9ff74e | 2009-10-26 19:16:46 +0000 | [diff] [blame] | 4187 | AC_EGREP_HEADER([extern int rl_completion_suppress_append;], |
| 4188 | [readline/readline.h], |
| 4189 | AC_DEFINE(HAVE_RL_COMPLETION_SUPPRESS_APPEND, 1, |
| 4190 | [Define if you have rl_completion_suppress_append]), ) |
Guido van Rossum | faf5e4d | 2002-12-30 16:25:41 +0000 | [diff] [blame] | 4191 | fi |
| 4192 | |
Martin v. Löwis | 0daad59 | 2001-09-30 21:09:59 +0000 | [diff] [blame] | 4193 | # check for readline 4.0 |
| 4194 | AC_CHECK_LIB(readline, rl_pre_input_hook, |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4195 | AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1, |
Gregory P. Smith | ff7b2d5 | 2008-09-03 05:57:48 +0000 | [diff] [blame] | 4196 | [Define if you have readline 4.0]), ,$READLINE_LIBS) |
Martin v. Löwis | 0daad59 | 2001-09-30 21:09:59 +0000 | [diff] [blame] | 4197 | |
Martin v. Löwis | 58bd49f | 2007-09-04 13:13:14 +0000 | [diff] [blame] | 4198 | # also in 4.0 |
| 4199 | AC_CHECK_LIB(readline, rl_completion_display_matches_hook, |
| 4200 | AC_DEFINE(HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK, 1, |
Gregory P. Smith | ff7b2d5 | 2008-09-03 05:57:48 +0000 | [diff] [blame] | 4201 | [Define if you have readline 4.0]), ,$READLINE_LIBS) |
Martin v. Löwis | 58bd49f | 2007-09-04 13:13:14 +0000 | [diff] [blame] | 4202 | |
Martin Panter | a70c323 | 2016-04-03 02:54:58 +0000 | [diff] [blame] | 4203 | # also in 4.0, but not in editline |
| 4204 | AC_CHECK_LIB(readline, rl_resize_terminal, |
| 4205 | AC_DEFINE(HAVE_RL_RESIZE_TERMINAL, 1, |
| 4206 | [Define if you have readline 4.0]), ,$READLINE_LIBS) |
| 4207 | |
Guido van Rossum | 353ae58 | 2001-07-10 16:45:32 +0000 | [diff] [blame] | 4208 | # check for readline 4.2 |
| 4209 | AC_CHECK_LIB(readline, rl_completion_matches, |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4210 | AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1, |
Gregory P. Smith | ff7b2d5 | 2008-09-03 05:57:48 +0000 | [diff] [blame] | 4211 | [Define if you have readline 4.2]), ,$READLINE_LIBS) |
Guido van Rossum | 353ae58 | 2001-07-10 16:45:32 +0000 | [diff] [blame] | 4212 | |
Michael W. Hudson | 30ea2f2 | 2004-07-07 17:44:12 +0000 | [diff] [blame] | 4213 | # also in readline 4.2 |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4214 | AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <readline/readline.h>]])], |
| 4215 | [have_readline=yes], |
| 4216 | [have_readline=no] |
| 4217 | ) |
Michael W. Hudson | 30ea2f2 | 2004-07-07 17:44:12 +0000 | [diff] [blame] | 4218 | if test $have_readline = yes |
| 4219 | then |
| 4220 | AC_EGREP_HEADER([extern int rl_catch_signals;], |
| 4221 | [readline/readline.h], |
| 4222 | AC_DEFINE(HAVE_RL_CATCH_SIGNAL, 1, |
| 4223 | [Define if you can turn off readline's signal handling.]), ) |
| 4224 | fi |
| 4225 | |
Martin v. Löwis | 82bca63 | 2006-02-10 20:49:30 +0000 | [diff] [blame] | 4226 | # End of readline checks: restore LIBS |
| 4227 | LIBS=$LIBS_no_readline |
| 4228 | |
Thomas Wouters | e38b2f1 | 2001-07-11 22:35:31 +0000 | [diff] [blame] | 4229 | AC_MSG_CHECKING(for broken nice()) |
| 4230 | AC_CACHE_VAL(ac_cv_broken_nice, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4231 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Thomas Wouters | e38b2f1 | 2001-07-11 22:35:31 +0000 | [diff] [blame] | 4232 | int main() |
| 4233 | { |
| 4234 | int val1 = nice(1); |
| 4235 | if (val1 != -1 && val1 == nice(2)) |
| 4236 | exit(0); |
| 4237 | exit(1); |
| 4238 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4239 | ]])], |
| 4240 | [ac_cv_broken_nice=yes], |
| 4241 | [ac_cv_broken_nice=no], |
| 4242 | [ac_cv_broken_nice=no])]) |
Thomas Wouters | e38b2f1 | 2001-07-11 22:35:31 +0000 | [diff] [blame] | 4243 | AC_MSG_RESULT($ac_cv_broken_nice) |
| 4244 | if test "$ac_cv_broken_nice" = yes |
| 4245 | then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4246 | AC_DEFINE(HAVE_BROKEN_NICE, 1, |
| 4247 | [Define if nice() returns success/failure instead of the new priority.]) |
Thomas Wouters | e38b2f1 | 2001-07-11 22:35:31 +0000 | [diff] [blame] | 4248 | fi |
| 4249 | |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4250 | AC_MSG_CHECKING(for broken poll()) |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 4251 | AC_CACHE_VAL(ac_cv_broken_poll, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4252 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4253 | #include <poll.h> |
| 4254 | |
Alexandre Vassalotti | 66da263 | 2009-07-17 06:17:33 +0000 | [diff] [blame] | 4255 | int main() |
| 4256 | { |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4257 | struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 }; |
Alexandre Vassalotti | 66da263 | 2009-07-17 06:17:33 +0000 | [diff] [blame] | 4258 | int poll_test; |
| 4259 | |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4260 | close (42); |
| 4261 | |
Alexandre Vassalotti | 66da263 | 2009-07-17 06:17:33 +0000 | [diff] [blame] | 4262 | poll_test = poll(&poll_struct, 1, 0); |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4263 | if (poll_test < 0) |
Alexandre Vassalotti | 66da263 | 2009-07-17 06:17:33 +0000 | [diff] [blame] | 4264 | return 0; |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4265 | else if (poll_test == 0 && poll_struct.revents != POLLNVAL) |
Alexandre Vassalotti | 66da263 | 2009-07-17 06:17:33 +0000 | [diff] [blame] | 4266 | return 0; |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4267 | else |
Alexandre Vassalotti | 66da263 | 2009-07-17 06:17:33 +0000 | [diff] [blame] | 4268 | return 1; |
| 4269 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4270 | ]])], |
| 4271 | [ac_cv_broken_poll=yes], |
| 4272 | [ac_cv_broken_poll=no], |
| 4273 | [ac_cv_broken_poll=no])) |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4274 | AC_MSG_RESULT($ac_cv_broken_poll) |
| 4275 | if test "$ac_cv_broken_poll" = yes |
| 4276 | then |
| 4277 | AC_DEFINE(HAVE_BROKEN_POLL, 1, |
| 4278 | [Define if poll() sets errno on invalid file descriptors.]) |
| 4279 | fi |
| 4280 | |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4281 | # Before we can test tzset, we need to check if struct tm has a tm_zone |
| 4282 | # (which is not required by ISO C or UNIX spec) and/or if we support |
| 4283 | # tzname[] |
| 4284 | AC_STRUCT_TIMEZONE |
Nicholas Bastin | e62c5c8 | 2004-03-21 23:45:42 +0000 | [diff] [blame] | 4285 | |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4286 | # check tzset(3) exists and works like we expect it to |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4287 | AC_MSG_CHECKING(for working tzset()) |
| 4288 | AC_CACHE_VAL(ac_cv_working_tzset, [ |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4289 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4290 | #include <stdlib.h> |
| 4291 | #include <time.h> |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4292 | #include <string.h> |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4293 | |
| 4294 | #if HAVE_TZNAME |
| 4295 | extern char *tzname[]; |
| 4296 | #endif |
| 4297 | |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4298 | int main() |
| 4299 | { |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4300 | /* Note that we need to ensure that not only does tzset(3) |
| 4301 | do 'something' with localtime, but it works as documented |
| 4302 | in the library reference and as expected by the test suite. |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4303 | This includes making sure that tzname is set properly if |
| 4304 | tm->tm_zone does not exist since it is the alternative way |
| 4305 | of getting timezone info. |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4306 | |
| 4307 | Red Hat 6.2 doesn't understand the southern hemisphere |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4308 | after New Year's Day. |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4309 | */ |
| 4310 | |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4311 | time_t groundhogday = 1044144000; /* GMT-based */ |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4312 | time_t midyear = groundhogday + (365 * 24 * 3600 / 2); |
| 4313 | |
Neal Norwitz | 7f2588c | 2003-04-11 15:35:53 +0000 | [diff] [blame] | 4314 | putenv("TZ=UTC+0"); |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4315 | tzset(); |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4316 | if (localtime(&groundhogday)->tm_hour != 0) |
| 4317 | exit(1); |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4318 | #if HAVE_TZNAME |
| 4319 | /* For UTC, tzname[1] is sometimes "", sometimes " " */ |
| 4320 | if (strcmp(tzname[0], "UTC") || |
| 4321 | (tzname[1][0] != 0 && tzname[1][0] != ' ')) |
| 4322 | exit(1); |
| 4323 | #endif |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4324 | |
Neal Norwitz | 7f2588c | 2003-04-11 15:35:53 +0000 | [diff] [blame] | 4325 | putenv("TZ=EST+5EDT,M4.1.0,M10.5.0"); |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4326 | tzset(); |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4327 | if (localtime(&groundhogday)->tm_hour != 19) |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4328 | exit(1); |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4329 | #if HAVE_TZNAME |
| 4330 | if (strcmp(tzname[0], "EST") || strcmp(tzname[1], "EDT")) |
| 4331 | exit(1); |
| 4332 | #endif |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4333 | |
| 4334 | putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0"); |
| 4335 | tzset(); |
| 4336 | if (localtime(&groundhogday)->tm_hour != 11) |
| 4337 | exit(1); |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4338 | #if HAVE_TZNAME |
| 4339 | if (strcmp(tzname[0], "AEST") || strcmp(tzname[1], "AEDT")) |
| 4340 | exit(1); |
| 4341 | #endif |
| 4342 | |
| 4343 | #if HAVE_STRUCT_TM_TM_ZONE |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4344 | if (strcmp(localtime(&groundhogday)->tm_zone, "AEDT")) |
| 4345 | exit(1); |
| 4346 | if (strcmp(localtime(&midyear)->tm_zone, "AEST")) |
| 4347 | exit(1); |
Brett Cannon | 4380242 | 2005-02-10 20:48:03 +0000 | [diff] [blame] | 4348 | #endif |
Brett Cannon | 1836781 | 2003-09-19 00:59:16 +0000 | [diff] [blame] | 4349 | |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4350 | exit(0); |
| 4351 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4352 | ]])], |
| 4353 | [ac_cv_working_tzset=yes], |
| 4354 | [ac_cv_working_tzset=no], |
| 4355 | [ac_cv_working_tzset=no])]) |
Guido van Rossum | d11b62e | 2003-03-14 21:51:36 +0000 | [diff] [blame] | 4356 | AC_MSG_RESULT($ac_cv_working_tzset) |
| 4357 | if test "$ac_cv_working_tzset" = yes |
| 4358 | then |
| 4359 | AC_DEFINE(HAVE_WORKING_TZSET, 1, |
| 4360 | [Define if tzset() actually switches the local timezone in a meaningful way.]) |
| 4361 | fi |
| 4362 | |
Martin v. Löwis | 94717ed | 2002-09-09 14:24:16 +0000 | [diff] [blame] | 4363 | # Look for subsecond timestamps in struct stat |
| 4364 | AC_MSG_CHECKING(for tv_nsec in struct stat) |
| 4365 | AC_CACHE_VAL(ac_cv_stat_tv_nsec, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4366 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[ |
Martin v. Löwis | 94717ed | 2002-09-09 14:24:16 +0000 | [diff] [blame] | 4367 | struct stat st; |
| 4368 | st.st_mtim.tv_nsec = 1; |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4369 | ]])], |
| 4370 | [ac_cv_stat_tv_nsec=yes], |
| 4371 | [ac_cv_stat_tv_nsec=no])) |
Martin v. Löwis | 94717ed | 2002-09-09 14:24:16 +0000 | [diff] [blame] | 4372 | AC_MSG_RESULT($ac_cv_stat_tv_nsec) |
| 4373 | if test "$ac_cv_stat_tv_nsec" = yes |
| 4374 | then |
| 4375 | AC_DEFINE(HAVE_STAT_TV_NSEC, 1, |
| 4376 | [Define if you have struct stat.st_mtim.tv_nsec]) |
| 4377 | fi |
| 4378 | |
Martin v. Löwis | ebd9d5b | 2005-08-09 15:00:59 +0000 | [diff] [blame] | 4379 | # Look for BSD style subsecond timestamps in struct stat |
| 4380 | AC_MSG_CHECKING(for tv_nsec2 in struct stat) |
| 4381 | AC_CACHE_VAL(ac_cv_stat_tv_nsec2, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4382 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[ |
Martin v. Löwis | ebd9d5b | 2005-08-09 15:00:59 +0000 | [diff] [blame] | 4383 | struct stat st; |
| 4384 | st.st_mtimespec.tv_nsec = 1; |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4385 | ]])], |
| 4386 | [ac_cv_stat_tv_nsec2=yes], |
| 4387 | [ac_cv_stat_tv_nsec2=no])) |
Martin v. Löwis | ebd9d5b | 2005-08-09 15:00:59 +0000 | [diff] [blame] | 4388 | AC_MSG_RESULT($ac_cv_stat_tv_nsec2) |
| 4389 | if test "$ac_cv_stat_tv_nsec2" = yes |
| 4390 | then |
| 4391 | AC_DEFINE(HAVE_STAT_TV_NSEC2, 1, |
| 4392 | [Define if you have struct stat.st_mtimensec]) |
| 4393 | fi |
| 4394 | |
doko@ubuntu.com | f27ec3e | 2014-04-17 20:11:19 +0200 | [diff] [blame] | 4395 | # first curses configure check |
| 4396 | ac_save_cppflags="$CPPFLAGS" |
| 4397 | CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" |
| 4398 | |
| 4399 | AC_CHECK_HEADERS(curses.h ncurses.h) |
| 4400 | |
| 4401 | # On Solaris, term.h requires curses.h |
| 4402 | AC_CHECK_HEADERS(term.h,,,[ |
| 4403 | #ifdef HAVE_CURSES_H |
| 4404 | #include <curses.h> |
| 4405 | #endif |
| 4406 | ]) |
| 4407 | |
Martin v. Löwis | eb9b103 | 2001-10-24 17:10:49 +0000 | [diff] [blame] | 4408 | # On HP/UX 11.0, mvwdelch is a block with a return statement |
| 4409 | AC_MSG_CHECKING(whether mvwdelch is an expression) |
| 4410 | AC_CACHE_VAL(ac_cv_mvwdelch_is_expression, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4411 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[ |
Martin v. Löwis | eb9b103 | 2001-10-24 17:10:49 +0000 | [diff] [blame] | 4412 | int rtn; |
| 4413 | rtn = mvwdelch(0,0,0); |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4414 | ]])], |
| 4415 | [ac_cv_mvwdelch_is_expression=yes], |
| 4416 | [ac_cv_mvwdelch_is_expression=no])) |
Martin v. Löwis | eb9b103 | 2001-10-24 17:10:49 +0000 | [diff] [blame] | 4417 | AC_MSG_RESULT($ac_cv_mvwdelch_is_expression) |
| 4418 | |
| 4419 | if test "$ac_cv_mvwdelch_is_expression" = yes |
| 4420 | then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4421 | AC_DEFINE(MVWDELCH_IS_EXPRESSION, 1, |
| 4422 | [Define if mvwdelch in curses.h is an expression.]) |
Martin v. Löwis | eb9b103 | 2001-10-24 17:10:49 +0000 | [diff] [blame] | 4423 | fi |
| 4424 | |
| 4425 | AC_MSG_CHECKING(whether WINDOW has _flags) |
| 4426 | AC_CACHE_VAL(ac_cv_window_has_flags, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4427 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[ |
Martin v. Löwis | eb9b103 | 2001-10-24 17:10:49 +0000 | [diff] [blame] | 4428 | WINDOW *w; |
| 4429 | w->_flags = 0; |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4430 | ]])], |
| 4431 | [ac_cv_window_has_flags=yes], |
| 4432 | [ac_cv_window_has_flags=no])) |
Martin v. Löwis | eb9b103 | 2001-10-24 17:10:49 +0000 | [diff] [blame] | 4433 | AC_MSG_RESULT($ac_cv_window_has_flags) |
| 4434 | |
| 4435 | |
| 4436 | if test "$ac_cv_window_has_flags" = yes |
| 4437 | then |
Martin v. Löwis | c45929e | 2002-04-06 10:10:49 +0000 | [diff] [blame] | 4438 | AC_DEFINE(WINDOW_HAS_FLAGS, 1, |
| 4439 | [Define if WINDOW in curses.h offers a field _flags.]) |
Martin v. Löwis | eb9b103 | 2001-10-24 17:10:49 +0000 | [diff] [blame] | 4440 | fi |
| 4441 | |
Walter Dörwald | 4994d95 | 2006-06-19 08:07:50 +0000 | [diff] [blame] | 4442 | AC_MSG_CHECKING(for is_term_resized) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4443 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=is_term_resized]])], |
| 4444 | [AC_DEFINE(HAVE_CURSES_IS_TERM_RESIZED, 1, Define if you have the 'is_term_resized' function.) |
| 4445 | AC_MSG_RESULT(yes)], |
| 4446 | [AC_MSG_RESULT(no)] |
Walter Dörwald | 4994d95 | 2006-06-19 08:07:50 +0000 | [diff] [blame] | 4447 | ) |
| 4448 | |
Walter Dörwald | 05fdbf1 | 2006-06-19 08:14:09 +0000 | [diff] [blame] | 4449 | AC_MSG_CHECKING(for resize_term) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4450 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resize_term]])], |
| 4451 | [AC_DEFINE(HAVE_CURSES_RESIZE_TERM, 1, Define if you have the 'resize_term' function.) |
| 4452 | AC_MSG_RESULT(yes)], |
| 4453 | [AC_MSG_RESULT(no)] |
Walter Dörwald | 4994d95 | 2006-06-19 08:07:50 +0000 | [diff] [blame] | 4454 | ) |
| 4455 | |
Walter Dörwald | 05fdbf1 | 2006-06-19 08:14:09 +0000 | [diff] [blame] | 4456 | AC_MSG_CHECKING(for resizeterm) |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4457 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resizeterm]])], |
| 4458 | [AC_DEFINE(HAVE_CURSES_RESIZETERM, 1, Define if you have the 'resizeterm' function.) |
| 4459 | AC_MSG_RESULT(yes)], |
| 4460 | [AC_MSG_RESULT(no)] |
Walter Dörwald | 4994d95 | 2006-06-19 08:07:50 +0000 | [diff] [blame] | 4461 | ) |
doko@ubuntu.com | f27ec3e | 2014-04-17 20:11:19 +0200 | [diff] [blame] | 4462 | # last curses configure check |
| 4463 | CPPFLAGS=$ac_save_cppflags |
Walter Dörwald | 4994d95 | 2006-06-19 08:07:50 +0000 | [diff] [blame] | 4464 | |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 4465 | AC_MSG_NOTICE([checking for device files]) |
Martin v. Löwis | fefbc20 | 2006-10-17 18:59:23 +0000 | [diff] [blame] | 4466 | |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 4467 | dnl NOTE: Inform user how to proceed with files when cross compiling. |
| 4468 | if test "x$cross_compiling" = xyes; then |
| 4469 | if test "${ac_cv_file__dev_ptmx+set}" != set; then |
| 4470 | AC_MSG_CHECKING([for /dev/ptmx]) |
| 4471 | AC_MSG_RESULT([not set]) |
| 4472 | AC_MSG_ERROR([set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling]) |
| 4473 | fi |
| 4474 | if test "${ac_cv_file__dev_ptc+set}" != set; then |
| 4475 | AC_MSG_CHECKING([for /dev/ptc]) |
| 4476 | AC_MSG_RESULT([not set]) |
| 4477 | AC_MSG_ERROR([set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling]) |
| 4478 | fi |
Martin v. Löwis | fefbc20 | 2006-10-17 18:59:23 +0000 | [diff] [blame] | 4479 | fi |
| 4480 | |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 4481 | AC_CHECK_FILE(/dev/ptmx, [], []) |
| 4482 | if test "x$ac_cv_file__dev_ptmx" = xyes; then |
| 4483 | AC_DEFINE(HAVE_DEV_PTMX, 1, |
| 4484 | [Define to 1 if you have the /dev/ptmx device file.]) |
| 4485 | fi |
| 4486 | AC_CHECK_FILE(/dev/ptc, [], []) |
| 4487 | if test "x$ac_cv_file__dev_ptc" = xyes; then |
Martin v. Löwis | fefbc20 | 2006-10-17 18:59:23 +0000 | [diff] [blame] | 4488 | AC_DEFINE(HAVE_DEV_PTC, 1, |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 4489 | [Define to 1 if you have the /dev/ptc device file.]) |
Martin v. Löwis | fefbc20 | 2006-10-17 18:59:23 +0000 | [diff] [blame] | 4490 | fi |
Neal Norwitz | 865400f | 2003-03-21 01:42:58 +0000 | [diff] [blame] | 4491 | |
Mark Dickinson | 82864d1 | 2009-11-15 16:18:58 +0000 | [diff] [blame] | 4492 | if test "$have_long_long" = yes |
| 4493 | then |
| 4494 | AC_MSG_CHECKING(for %lld and %llu printf() format support) |
| 4495 | AC_CACHE_VAL(ac_cv_have_long_long_format, |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4496 | AC_RUN_IFELSE([AC_LANG_SOURCE([[[ |
Mark Dickinson | 82864d1 | 2009-11-15 16:18:58 +0000 | [diff] [blame] | 4497 | #include <stdio.h> |
| 4498 | #include <stddef.h> |
| 4499 | #include <string.h> |
| 4500 | |
| 4501 | #ifdef HAVE_SYS_TYPES_H |
| 4502 | #include <sys/types.h> |
| 4503 | #endif |
| 4504 | |
| 4505 | int main() |
| 4506 | { |
| 4507 | char buffer[256]; |
| 4508 | |
| 4509 | if (sprintf(buffer, "%lld", (long long)123) < 0) |
| 4510 | return 1; |
| 4511 | if (strcmp(buffer, "123")) |
| 4512 | return 1; |
| 4513 | |
| 4514 | if (sprintf(buffer, "%lld", (long long)-123) < 0) |
| 4515 | return 1; |
| 4516 | if (strcmp(buffer, "-123")) |
| 4517 | return 1; |
| 4518 | |
| 4519 | if (sprintf(buffer, "%llu", (unsigned long long)123) < 0) |
| 4520 | return 1; |
| 4521 | if (strcmp(buffer, "123")) |
| 4522 | return 1; |
| 4523 | |
| 4524 | return 0; |
| 4525 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4526 | ]]])], |
| 4527 | [ac_cv_have_long_long_format=yes], |
| 4528 | [ac_cv_have_long_long_format=no], |
doko@python.org | d65e2ba | 2013-01-31 23:52:03 +0100 | [diff] [blame] | 4529 | [ac_cv_have_long_long_format="cross -- assuming no" |
| 4530 | if test x$GCC = xyes; then |
| 4531 | save_CFLAGS=$CFLAGS |
| 4532 | CFLAGS="$CFLAGS -Werror -Wformat" |
| 4533 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
| 4534 | #include <stdio.h> |
| 4535 | #include <stddef.h> |
| 4536 | ]], [[ |
| 4537 | char *buffer; |
| 4538 | sprintf(buffer, "%lld", (long long)123); |
| 4539 | sprintf(buffer, "%lld", (long long)-123); |
| 4540 | sprintf(buffer, "%llu", (unsigned long long)123); |
| 4541 | ]])], |
| 4542 | ac_cv_have_long_long_format=yes |
| 4543 | ) |
| 4544 | CFLAGS=$save_CFLAGS |
| 4545 | fi]) |
Mark Dickinson | 82864d1 | 2009-11-15 16:18:58 +0000 | [diff] [blame] | 4546 | ) |
| 4547 | AC_MSG_RESULT($ac_cv_have_long_long_format) |
| 4548 | fi |
| 4549 | |
Mark Dickinson | 5ce8474 | 2009-12-31 20:48:04 +0000 | [diff] [blame] | 4550 | if test "$ac_cv_have_long_long_format" = yes |
Mark Dickinson | 82864d1 | 2009-11-15 16:18:58 +0000 | [diff] [blame] | 4551 | then |
| 4552 | AC_DEFINE(PY_FORMAT_LONG_LONG, "ll", |
| 4553 | [Define to printf format modifier for long long type]) |
| 4554 | fi |
| 4555 | |
Ronald Oussoren | 315cd0c | 2009-11-19 16:25:21 +0000 | [diff] [blame] | 4556 | if test $ac_sys_system = Darwin |
| 4557 | then |
| 4558 | LIBS="$LIBS -framework CoreFoundation" |
| 4559 | fi |
| 4560 | |
Mark Dickinson | 82864d1 | 2009-11-15 16:18:58 +0000 | [diff] [blame] | 4561 | |
Gregory P. Smith | d8cb2d9 | 2009-11-02 02:02:38 +0000 | [diff] [blame] | 4562 | AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4563 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
Alexandre Vassalotti | e7cf118 | 2009-07-17 06:33:51 +0000 | [diff] [blame] | 4564 | #include <stdio.h> |
Brett Cannon | 09d1236 | 2006-05-11 05:11:33 +0000 | [diff] [blame] | 4565 | #include <stddef.h> |
| 4566 | #include <string.h> |
| 4567 | |
Christian Heimes | db3d6cb | 2007-12-16 21:39:43 +0000 | [diff] [blame] | 4568 | #ifdef HAVE_SYS_TYPES_H |
| 4569 | #include <sys/types.h> |
| 4570 | #endif |
Neal Norwitz | 4a8fbdb | 2006-09-22 08:16:26 +0000 | [diff] [blame] | 4571 | |
| 4572 | #ifdef HAVE_SSIZE_T |
| 4573 | typedef ssize_t Py_ssize_t; |
| 4574 | #elif SIZEOF_VOID_P == SIZEOF_LONG |
| 4575 | typedef long Py_ssize_t; |
| 4576 | #else |
| 4577 | typedef int Py_ssize_t; |
| 4578 | #endif |
Brett Cannon | 09d1236 | 2006-05-11 05:11:33 +0000 | [diff] [blame] | 4579 | |
Christian Heimes | db3d6cb | 2007-12-16 21:39:43 +0000 | [diff] [blame] | 4580 | int main() |
| 4581 | { |
| 4582 | char buffer[256]; |
| 4583 | |
Brett Cannon | 09d1236 | 2006-05-11 05:11:33 +0000 | [diff] [blame] | 4584 | if(sprintf(buffer, "%zd", (size_t)123) < 0) |
| 4585 | return 1; |
| 4586 | |
Neal Norwitz | 4a8fbdb | 2006-09-22 08:16:26 +0000 | [diff] [blame] | 4587 | if (strcmp(buffer, "123")) |
Brett Cannon | 09d1236 | 2006-05-11 05:11:33 +0000 | [diff] [blame] | 4588 | return 1; |
Neal Norwitz | 4a8fbdb | 2006-09-22 08:16:26 +0000 | [diff] [blame] | 4589 | |
| 4590 | if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0) |
| 4591 | return 1; |
| 4592 | |
| 4593 | if (strcmp(buffer, "-123")) |
| 4594 | return 1; |
| 4595 | |
Brett Cannon | 09d1236 | 2006-05-11 05:11:33 +0000 | [diff] [blame] | 4596 | return 0; |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 4597 | } |
Matthias Klose | c511b47 | 2010-05-08 11:01:39 +0000 | [diff] [blame] | 4598 | ]])], |
| 4599 | [ac_cv_have_size_t_format=yes], |
| 4600 | [ac_cv_have_size_t_format=no], |
| 4601 | [ac_cv_have_size_t_format="cross -- assuming yes" |
| 4602 | ])]) |
Gregory P. Smith | d8cb2d9 | 2009-11-02 02:02:38 +0000 | [diff] [blame] | 4603 | if test "$ac_cv_have_size_t_format" != no ; then |
Alexandre Vassalotti | 0090089 | 2009-07-17 05:26:39 +0000 | [diff] [blame] | 4604 | AC_DEFINE(PY_FORMAT_SIZE_T, "z", |
| 4605 | [Define to printf format modifier for Py_ssize_t]) |
| 4606 | fi |
Brett Cannon | 09d1236 | 2006-05-11 05:11:33 +0000 | [diff] [blame] | 4607 | |
Martin v. Löwis | 01c0401 | 2002-11-11 14:58:44 +0000 | [diff] [blame] | 4608 | AC_CHECK_TYPE(socklen_t,, |
| 4609 | AC_DEFINE(socklen_t,int, |
Matthias Klose | 5183ebd | 2010-04-24 16:38:36 +0000 | [diff] [blame] | 4610 | [Define to `int' if <sys/socket.h> does not define.]),[ |
Martin v. Löwis | 01c0401 | 2002-11-11 14:58:44 +0000 | [diff] [blame] | 4611 | #ifdef HAVE_SYS_TYPES_H |
| 4612 | #include <sys/types.h> |
| 4613 | #endif |
Guido van Rossum | 95713eb | 2000-05-18 20:53:31 +0000 | [diff] [blame] | 4614 | #ifdef HAVE_SYS_SOCKET_H |
| 4615 | #include <sys/socket.h> |
| 4616 | #endif |
Martin v. Löwis | 01c0401 | 2002-11-11 14:58:44 +0000 | [diff] [blame] | 4617 | ]) |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 4618 | |
R. David Murray | 1d9d16e | 2010-10-16 00:43:13 +0000 | [diff] [blame] | 4619 | case $ac_sys_system in |
| 4620 | AIX*) |
| 4621 | AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PIPE_BUF value.]) ;; |
| 4622 | esac |
| 4623 | |
| 4624 | |
Martin v. Löwis | 06f15bb | 2001-12-02 13:02:32 +0000 | [diff] [blame] | 4625 | AC_SUBST(THREADHEADERS) |
| 4626 | |
| 4627 | for h in `(cd $srcdir;echo Python/thread_*.h)` |
| 4628 | do |
| 4629 | THREADHEADERS="$THREADHEADERS \$(srcdir)/$h" |
| 4630 | done |
| 4631 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 4632 | AC_SUBST(SRCDIRS) |
Neal Norwitz | d24499d | 2005-12-18 21:36:39 +0000 | [diff] [blame] | 4633 | SRCDIRS="Parser Grammar Objects Python Modules Mac" |
Andrew M. Kuchling | 8abedde | 2001-01-26 22:55:24 +0000 | [diff] [blame] | 4634 | AC_MSG_CHECKING(for build directories) |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 4635 | for dir in $SRCDIRS; do |
| 4636 | if test ! -d $dir; then |
| 4637 | mkdir $dir |
Fred Drake | 884d3ba | 2000-11-02 17:52:56 +0000 | [diff] [blame] | 4638 | fi |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 4639 | done |
Benjamin Peterson | 2c992a0 | 2015-05-28 12:45:31 -0500 | [diff] [blame] | 4640 | |
| 4641 | # BEGIN_COMPUTED_GOTO |
| 4642 | # Check for --with-computed-gotos |
| 4643 | AC_MSG_CHECKING(for --with-computed-gotos) |
| 4644 | AC_ARG_WITH(computed-gotos, |
| 4645 | AS_HELP_STRING([--with(out)-computed-gotos], |
| 4646 | [Use computed gotos in evaluation loop (enabled by default on supported compilers)]), |
| 4647 | [ |
| 4648 | if test "$withval" = yes |
| 4649 | then |
| 4650 | AC_DEFINE(USE_COMPUTED_GOTOS, 1, |
| 4651 | [Define if you want to use computed gotos in ceval.c.]) |
| 4652 | AC_MSG_RESULT(yes) |
| 4653 | fi |
| 4654 | if test "$withval" = no |
| 4655 | then |
| 4656 | AC_DEFINE(USE_COMPUTED_GOTOS, 0, |
| 4657 | [Define if you want to use computed gotos in ceval.c.]) |
| 4658 | AC_MSG_RESULT(no) |
| 4659 | fi |
| 4660 | ], |
| 4661 | [AC_MSG_RESULT(no value specified)]) |
| 4662 | |
| 4663 | AC_MSG_CHECKING(whether $CC supports computed gotos) |
| 4664 | AC_CACHE_VAL(ac_cv_computed_gotos, |
| 4665 | AC_RUN_IFELSE([AC_LANG_SOURCE([[[ |
| 4666 | int main(int argc, char **argv) |
| 4667 | { |
| 4668 | static void *targets[1] = { &&LABEL1 }; |
| 4669 | goto LABEL2; |
| 4670 | LABEL1: |
| 4671 | return 0; |
| 4672 | LABEL2: |
| 4673 | goto *targets[0]; |
| 4674 | return 1; |
| 4675 | } |
| 4676 | ]]])], |
| 4677 | [ac_cv_computed_gotos=yes], |
| 4678 | [ac_cv_computed_gotos=no], |
| 4679 | [if test "${with_computed_gotos+set}" = set; then |
| 4680 | ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos" |
| 4681 | else |
| 4682 | ac_cv_computed_gotos=no |
| 4683 | fi])) |
| 4684 | AC_MSG_RESULT($ac_cv_computed_gotos) |
| 4685 | case "$ac_cv_computed_gotos" in yes*) |
| 4686 | AC_DEFINE(HAVE_COMPUTED_GOTOS, 1, |
| 4687 | [Define if the C compiler supports computed gotos.]) |
| 4688 | esac |
| 4689 | # END_COMPUTED_GOTO |
| 4690 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 4691 | AC_MSG_RESULT(done) |
Fred Drake | 036144d | 2000-10-26 17:09:35 +0000 | [diff] [blame] | 4692 | |
Ned Deily | 3f1d0b3 | 2014-11-20 02:11:03 -0800 | [diff] [blame] | 4693 | # ensurepip option |
| 4694 | AC_MSG_CHECKING(for ensurepip) |
| 4695 | AC_ARG_WITH(ensurepip, |
| 4696 | [AS_HELP_STRING([--with(out)-ensurepip=@<:@=OPTION@:>@], |
| 4697 | ["install" or "upgrade" using bundled pip, default is "no"])], |
| 4698 | [], |
| 4699 | [with_ensurepip=no]) |
| 4700 | AS_CASE($with_ensurepip, |
| 4701 | [yes|upgrade],[ENSUREPIP=upgrade], |
| 4702 | [install],[ENSUREPIP=install], |
| 4703 | [no],[ENSUREPIP=no], |
| 4704 | [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])]) |
| 4705 | AC_MSG_RESULT($ENSUREPIP) |
| 4706 | AC_SUBST(ENSUREPIP) |
| 4707 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 4708 | # generate output files |
Antoine Pitrou | f2caeed | 2009-05-24 20:23:57 +0000 | [diff] [blame] | 4709 | AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc) |
Antoine Pitrou | aabdceb | 2010-09-10 20:03:17 +0000 | [diff] [blame] | 4710 | AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) |
Martin v. Löwis | 88afe66 | 2002-10-26 13:47:44 +0000 | [diff] [blame] | 4711 | AC_OUTPUT |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 4712 | |
Martin v. Löwis | f7afe95 | 2006-04-14 15:16:15 +0000 | [diff] [blame] | 4713 | echo "creating Modules/Setup" |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 4714 | if test ! -f Modules/Setup |
| 4715 | then |
| 4716 | cp $srcdir/Modules/Setup.dist Modules/Setup |
| 4717 | fi |
| 4718 | |
Martin v. Löwis | f7afe95 | 2006-04-14 15:16:15 +0000 | [diff] [blame] | 4719 | echo "creating Modules/Setup.local" |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 4720 | if test ! -f Modules/Setup.local |
| 4721 | then |
| 4722 | echo "# Edit this file for local setup changes" >Modules/Setup.local |
| 4723 | fi |
| 4724 | |
| 4725 | echo "creating Makefile" |
| 4726 | $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ |
| 4727 | -s Modules Modules/Setup.config \ |
Neil Schemenauer | f8b71c5 | 2001-04-21 17:41:16 +0000 | [diff] [blame] | 4728 | Modules/Setup.local Modules/Setup |
Skip Montanaro | 7221d93 | 2007-08-22 19:02:16 +0000 | [diff] [blame] | 4729 | |
| 4730 | case $ac_sys_system in |
| 4731 | BeOS) |
| 4732 | AC_MSG_WARN([ |
| 4733 | |
| 4734 | Support for BeOS is deprecated as of Python 2.6. |
| 4735 | See PEP 11 for the gory details. |
| 4736 | ]) |
| 4737 | ;; |
| 4738 | *) ;; |
| 4739 | esac |
| 4740 | |
Neil Schemenauer | 6625216 | 2001-02-19 04:47:42 +0000 | [diff] [blame] | 4741 | mv config.c Modules |