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