Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf 2.0 or later to make a configure script. |
| 2 | AC_REVISION($Revision$) |
| 3 | AC_PREREQ(2.0) |
Guido van Rossum | 6085e32 | 1993-12-26 18:24:40 +0000 | [diff] [blame] | 4 | AC_INIT(Include/object.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 5 | AC_CONFIG_HEADER(config.h) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 6 | |
Guido van Rossum | 642b678 | 1997-07-19 19:35:41 +0000 | [diff] [blame] | 7 | # Set VERSION so we only need to edit in one place (i.e., here) |
| 8 | AC_SUBST(VERSION) |
Guido van Rossum | b9a22a1 | 2000-06-30 02:48:53 +0000 | [diff] [blame] | 9 | VERSION=2.0 |
Guido van Rossum | 642b678 | 1997-07-19 19:35:41 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 11 | # NEXTSTEP|MacOSX|Darwin stuff |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 12 | if test -f /usr/lib/NextStep/software_version -o -f /System/Library/CoreServices/software_version ; then |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 13 | |
| 14 | AC_MSG_CHECKING(for --with-next-archs) |
| 15 | AC_ARG_WITH(next-archs, |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 16 | [ --with-next-archs='arch1 arch2 ..' build MAB binary], [ |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 17 | if test -n "$withval"; then |
Guido van Rossum | 2bb4f55 | 1996-09-10 18:19:59 +0000 | [diff] [blame] | 18 | ac_arch_flags=`/usr/lib/arch_tool -archify_list $withval` |
| 19 | # GCC does not currently support multi archs on the NeXT |
| 20 | with_gcc=no |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 21 | fi |
| 22 | AC_MSG_RESULT($with_next_archs) |
| 23 | ], [AC_MSG_RESULT(none: using `arch`)]) |
| 24 | |
| 25 | if test -z "$MACHDEP" |
| 26 | then |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 27 | ac_sys_system=`uname -s` |
| 28 | if test "$ac_sys_system" = "Darwin" ; then |
| 29 | ac_sys_release=`uname -r` |
| 30 | else |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 31 | set X `hostinfo | egrep '(NeXT Mach|Kernel Release).*:' | \ |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 32 | sed -e 's/://' -e 's/\./_/'` && \ |
| 33 | ac_sys_system=next && ac_sys_release=$4 |
| 34 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 35 | |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 36 | MACHDEP="$ac_sys_system$ac_sys_release" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 37 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 38 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 39 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 40 | AC_ARG_WITH(next-framework, |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 41 | [ --with-next-framework Build (OpenStep|Rhapsody|MacOSX|Darwin) framework],,) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 42 | AC_ARG_WITH(dyld, |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 43 | [ --with-dyld Use (OpenStep|Rhapsody|MacOSX|Darwin) dynamic linker],,) |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 44 | |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 45 | # Set name for machine-dependent library files |
| 46 | AC_SUBST(MACHDEP) |
| 47 | AC_MSG_CHECKING(MACHDEP) |
| 48 | if test -z "$MACHDEP" |
| 49 | then |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 50 | ac_sys_system=`uname -s` |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 51 | if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64"; then |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 52 | ac_sys_release=`uname -v` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 53 | else |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 54 | ac_sys_release=`uname -r` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 55 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 56 | ac_md_system=`echo $ac_sys_system | |
| 57 | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'` |
| 58 | ac_md_release=`echo $ac_sys_release | |
| 59 | tr -d '[/ ]' | sed 's/\..*//'` |
Guido van Rossum | b97ef17 | 1997-09-28 05:44:03 +0000 | [diff] [blame] | 60 | MACHDEP="$ac_md_system$ac_md_release" |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 61 | |
Guido van Rossum | bcd91e0 | 1997-03-20 20:46:29 +0000 | [diff] [blame] | 62 | case $MACHDEP in |
Guido van Rossum | b97ef17 | 1997-09-28 05:44:03 +0000 | [diff] [blame] | 63 | '') MACHDEP="unknown";; |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 64 | esac |
| 65 | fi |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 66 | |
| 67 | # |
| 68 | # SGI compilers allow the specification of the both the ABI and the |
| 69 | # ISA on the command line. Depending on the values of these switches, |
| 70 | # different and often incompatable code will be generated. |
| 71 | # |
| 72 | # The SGI_ABI variable can be used to modify the CC and LDFLAGS and |
| 73 | # thus supply support for various ABI/ISA combinations. The MACHDEP |
| 74 | # variable is also adjusted. |
| 75 | # |
| 76 | AC_SUBST(SGI_ABI) |
| 77 | if test ! -z "$SGI_ABI" |
| 78 | then |
| 79 | CC="cc $SGI_ABI" |
| 80 | LDFLAGS="$SGI_ABI $LDFLAGS" |
| 81 | MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` |
| 82 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 83 | AC_MSG_RESULT($MACHDEP) |
| 84 | |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 85 | # |
| 86 | # CCC is the command that compiles C++ programs |
| 87 | # |
| 88 | # Not all make programs have this predefined. |
| 89 | # |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 90 | #AC_SUBST(SET_CCC) |
| 91 | #AC_MSG_CHECKING(CCC) |
| 92 | #if test -z "$CCC" |
| 93 | #then |
| 94 | # case $ac_sys_system in |
| 95 | # IRIX*) SET_CCC="CCC= CC ${SGI_ABI}";; |
| 96 | # Linux*) SET_CCC="CCC= g++";; |
| 97 | # *) SET_CCC="" |
| 98 | # esac |
| 99 | #else |
| 100 | # SET_CCC="CCC= ${CCC}" |
| 101 | #fi |
| 102 | #AC_MSG_RESULT($SET_CCC) |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 103 | |
| 104 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 105 | # checks for alternative programs |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 106 | AC_MSG_CHECKING(for --without-gcc) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 107 | AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 108 | case $withval in |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 109 | no) CC=cc |
| 110 | without_gcc=yes;; |
| 111 | yes) CC=gcc |
| 112 | without_gcc=no;; |
| 113 | *) CC=$withval |
| 114 | without_gcc=$withval;; |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 115 | esac], [ |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 116 | case $ac_sys_system in |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 117 | OSF1) CC=cc |
| 118 | without_gcc=;; |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 119 | BeOS*) |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 120 | case $BE_HOST_CPU in |
| 121 | ppc) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 122 | CC=mwcc |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 123 | without_gcc=yes |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 124 | OPT="-O -D'DL_EXPORT(RTYPE)=__declspec(dllexport) RTYPE' -D'DL_IMPORT(RTYPE)=__declspec(dllexport) RTYPE' -export pragma" |
| 125 | CCSHARED="UDL_IMPORT -D'DL_IMPORT(RTYPE)=__declspec(dllimport) RTYPE'" |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 126 | LDFLAGS="$LDFLAGS -nodup" |
| 127 | |
| 128 | AR="$PWD/BeOS/ar-fake" |
| 129 | RANLIB=: |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 130 | ;; |
| 131 | x86) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 132 | CC=gcc |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 133 | without_gcc=no |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 134 | OPT=-O |
| 135 | # Really should use srcdir instead of PWD |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 136 | AR="$PWD/BeOS/ar-fake" |
| 137 | RANLIB=: |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 138 | ;; |
| 139 | *) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 140 | AC_ERROR(Unknown BeOS platform \"$BE_HOST_CPU\") |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 141 | ;; |
| 142 | esac |
| 143 | ;; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 144 | Monterey*) |
| 145 | RANLIB=: |
| 146 | without_gcc=;; |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 147 | *) without_gcc=no;; |
| 148 | esac]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 149 | AC_MSG_RESULT($without_gcc) |
| 150 | |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 151 | AC_SUBST(SET_CXX) |
| 152 | AC_SUBST(MAINOBJ) |
| 153 | MAINOBJ=python.o |
| 154 | AC_MSG_CHECKING(for --with-cxx=<compiler>) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 155 | AC_ARG_WITH(cxx, [ --with-cxx=<compiler> enable C++ support],[ |
Martin v. Löwis | 537970f | 2000-12-13 17:37:02 +0000 | [diff] [blame] | 156 | check_cxx=no |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 157 | case $withval in |
| 158 | no) CXX= |
| 159 | with_cxx=no;; |
| 160 | *) CXX=$withval |
| 161 | MAINOBJ=ccpython.o |
| 162 | with_cxx=$withval;; |
| 163 | esac], [ |
| 164 | with_cxx=no |
Martin v. Löwis | 537970f | 2000-12-13 17:37:02 +0000 | [diff] [blame] | 165 | check_cxx=yes |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 166 | ]) |
| 167 | AC_MSG_RESULT($with_cxx) |
Martin v. Löwis | 537970f | 2000-12-13 17:37:02 +0000 | [diff] [blame] | 168 | |
| 169 | dnl The following fragment works similar to AC_PROG_CXX. |
| 170 | dnl It does not fail if CXX is not found, and it is not executed if |
| 171 | dnl --with-cxx was given. |
| 172 | dnl Finally, it does not test whether CXX is g++. |
| 173 | |
| 174 | if test "$check_cxx" = "yes" |
| 175 | then |
| 176 | AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound) |
| 177 | if test "$CXX" = "notfound" |
| 178 | then |
| 179 | CXX= |
| 180 | else |
| 181 | AC_PROG_CXX_WORKS |
| 182 | fi |
| 183 | fi |
| 184 | |
Guido van Rossum | e126233 | 2000-09-22 19:41:56 +0000 | [diff] [blame] | 185 | SET_CXX="CXX=$CXX" |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 186 | |
Martin v. Löwis | 537970f | 2000-12-13 17:37:02 +0000 | [diff] [blame] | 187 | |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 188 | #AC_MSG_CHECKING(CCC) |
| 189 | #if test -z "$CCC" |
| 190 | #then |
| 191 | # case $ac_sys_system in |
| 192 | # IRIX*) SET_CCC="CCC= CC ${SGI_ABI}";; |
| 193 | # Linux*) SET_CCC="CCC= g++";; |
| 194 | # *) SET_CCC="" |
| 195 | # esac |
| 196 | #else |
| 197 | # SET_CCC="CCC= ${CCC}" |
| 198 | #fi |
| 199 | #AC_MSG_RESULT($SET_CCC) |
| 200 | |
Guido van Rossum | 03ad99f | 1995-03-09 14:09:54 +0000 | [diff] [blame] | 201 | # If the user switches compilers, we can't believe the cache |
| 202 | if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" |
| 203 | then |
| 204 | AC_ERROR(cached CC is different -- throw away $cache_file |
| 205 | (it is also a good idea to do 'make clean' before compiling)) |
| 206 | fi |
| 207 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 208 | AC_PROG_CC |
Guido van Rossum | ff555e3 | 2000-09-22 15:38:21 +0000 | [diff] [blame] | 209 | AC_SUBST(EXE) |
| 210 | AC_MSG_CHECKING(for --with-suffix) |
| 211 | AC_ARG_WITH(suffix, [ --with-suffix=.exe set executable suffix],[ |
| 212 | case $withval in |
| 213 | no) EXE=;; |
| 214 | yes) EXE=.exe;; |
| 215 | *) EXE=$withval;; |
| 216 | esac]) |
| 217 | AC_MSG_RESULT($EXE) |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 218 | |
Guido van Rossum | dd997f7 | 1998-10-07 19:58:26 +0000 | [diff] [blame] | 219 | case $MACHDEP in |
| 220 | bsdos*) |
| 221 | case $CC in |
| 222 | gcc) CC="$CC -D_HAVE_BSDI";; |
| 223 | esac;; |
| 224 | esac |
| 225 | |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 226 | case $ac_sys_system in |
| 227 | hp*|HP*) |
| 228 | case $CC in |
Guido van Rossum | cd5ff9f | 2000-09-22 16:15:54 +0000 | [diff] [blame] | 229 | cc|*/cc) CC="$CC -Ae";; |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 230 | esac;; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 231 | Monterey*) |
| 232 | case $CC in |
| 233 | cc) CC="$CC -Wl,-Bexport";; |
| 234 | esac;; |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 235 | esac |
| 236 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 237 | # LDLIBRARY is the name of the library to link against (as opposed to the |
| 238 | # name of the library into which to insert object files). On systems |
| 239 | # without shared libraries, LDLIBRARY is the same as LIBRARY (defined in |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 240 | # the Makefiles). On Cygwin LDLIBRARY is the import library, DLLLIBRARY is the |
| 241 | # shared (i.e., DLL) library. |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 242 | AC_SUBST(MAKE_LDLIBRARY) |
| 243 | AC_SUBST(LDLIBRARY) |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 244 | AC_SUBST(SET_DLLLIBRARY) |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 245 | LDLIBRARY='' |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 246 | SET_DLLLIBRARY='' |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 247 | |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 248 | # LINKCC is the command that links the python executable -- default is $(CC). |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 249 | # 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] | 250 | # linking. |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 251 | AC_SUBST(LINKCC) |
| 252 | AC_MSG_CHECKING(LINKCC) |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 253 | if test -z "$LINKCC" -a ! -z "$CXX" |
| 254 | then |
| 255 | LINKCC="$CXX" |
| 256 | fi |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 257 | if test -z "$LINKCC" |
| 258 | then |
| 259 | case $ac_sys_system in |
| 260 | AIX*) |
Guido van Rossum | 45140f9 | 1997-08-29 18:44:06 +0000 | [diff] [blame] | 261 | LINKCC="\$(srcdir)/makexp_aix python.exp \"\" \$(LIBRARY); \$(PURIFY) \$(CC)";; |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 262 | dgux*) |
| 263 | LINKCC="LD_RUN_PATH=$libdir \$(PURIFY) \$(CC)";; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 264 | Monterey64*) |
| 265 | LINKCC="\$(PURIFY) \$(CC) -L/usr/lib/ia64l64";; |
Guido van Rossum | 25f9303 | 1997-08-18 16:00:04 +0000 | [diff] [blame] | 266 | *) LINKCC="\$(PURIFY) \$(CC)";; |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 267 | esac |
| 268 | fi |
| 269 | AC_MSG_RESULT($LINKCC) |
| 270 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 271 | AC_MSG_CHECKING(LDLIBRARY) |
| 272 | |
| 273 | # NeXT framework builds require that the 'ar' library be converted into |
| 274 | # a bundle using libtool. |
| 275 | if test "$with_next_framework" |
| 276 | then |
| 277 | LDLIBRARY='libpython$(VERSION).dylib' |
| 278 | fi |
| 279 | |
| 280 | # DG/UX requires some fancy ld contortions to produce a .so from an .a |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 281 | case $MACHDEP in |
| 282 | dguxR4) |
| 283 | LDLIBRARY='libpython$(VERSION).so' |
| 284 | OPT="$OPT -pic" |
| 285 | ;; |
| 286 | beos*) |
| 287 | LDLIBRARY='libpython$(VERSION).so' |
| 288 | ;; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 289 | cygwin*) |
| 290 | LDLIBRARY='libpython$(VERSION).dll.a' |
| 291 | SET_DLLLIBRARY='DLLLIBRARY= $(basename $(LDLIBRARY))' |
| 292 | ;; |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 293 | esac |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 294 | AC_MSG_RESULT($LDLIBRARY) |
| 295 | |
| 296 | # If LDLIBRARY is different from LIBRARY, emit a rule to build it. |
| 297 | if test -z "$LDLIBRARY" |
| 298 | then |
| 299 | LDLIBRARY='libpython$(VERSION).a' |
| 300 | MAKE_LDLIBRARY="true" |
| 301 | else |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 302 | case $MACHDEP in |
| 303 | cygwin*) MAKE_LDLIBRARY='$(MAKE) -C Modules ../$(DLLLIBRARY)';; |
| 304 | *) MAKE_LDLIBRARY='$(MAKE) $(LDLIBRARY)';; |
| 305 | esac |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 306 | fi |
| 307 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 308 | AC_PROG_RANLIB |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 309 | AC_SUBST(AR) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 310 | AC_CHECK_PROGS(AR, ar aal, ar) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 311 | AC_SUBST(INSTALL) |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 312 | AC_SUBST(INSTALL_PROGRAM) |
| 313 | AC_SUBST(INSTALL_DATA) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 314 | # Install just never works :-( |
| 315 | if test -z "$INSTALL" |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 316 | then |
| 317 | INSTALL=cp |
| 318 | INSTALL_PROGRAM=cp |
| 319 | INSTALL_DATA=cp |
| 320 | else |
| 321 | INSTALL_PROGRAM="$INSTALL" |
| 322 | INSTALL_DATA="$INSTALL -m 644" |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 323 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 324 | |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 325 | # Not every filesystem supports hard links |
| 326 | AC_SUBST(LN) |
| 327 | if test -z "$LN" ; then |
| 328 | case $ac_sys_system in |
| 329 | BeOS*) LN="ln -s";; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 330 | CYGWIN*) LN="ln -s";; |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 331 | *) LN=ln;; |
| 332 | esac |
| 333 | fi |
| 334 | |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 335 | # Optimizer/debugger flags passed between Makefiles |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 336 | AC_SUBST(OPT) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 337 | if test -z "$OPT" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 338 | then |
Guido van Rossum | b5875b6 | 1997-07-18 23:29:09 +0000 | [diff] [blame] | 339 | case $GCC in |
| 340 | yes) |
| 341 | case $ac_cv_prog_cc_g in |
Greg Ward | a1c4da2 | 2000-11-07 15:44:21 +0000 | [diff] [blame] | 342 | yes) OPT="-g -O2 -Wall -Wstrict-prototypes -fPIC";; |
| 343 | *) OPT="-O2 -Wall -Wstrict-prototypes -fPIC";; |
Guido van Rossum | b5875b6 | 1997-07-18 23:29:09 +0000 | [diff] [blame] | 344 | esac |
| 345 | ;; |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 346 | *) OPT="-O";; |
| 347 | esac |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 348 | fi |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 349 | |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 350 | # The current (beta) Monterey compiler dies with optimizations |
| 351 | case $ac_sys_system in |
| 352 | Monterey*) OPT="";; |
| 353 | esac |
| 354 | |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 355 | # Cygwin does not need PIC compiler option so remove it to prevent warnings |
| 356 | case $ac_sys_system in |
| 357 | CYGWIN*) OPT="`echo $OPT | sed 's/ *-fPIC//'`";; |
| 358 | esac |
| 359 | |
Guido van Rossum | 6f2260e | 1996-09-09 16:21:03 +0000 | [diff] [blame] | 360 | if test "$ac_arch_flags" |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 361 | then |
| 362 | OPT="$OPT $ac_arch_flags" |
| 363 | fi |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 364 | # checks for UNIX variants that set C preprocessor variables |
| 365 | AC_AIX |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 366 | AC_MINIX |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 367 | |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 368 | AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0) |
| 369 | AC_CACHE_VAL(ac_cv_opt_olimit_ok, |
| 370 | [ac_save_cc="$CC" |
| 371 | CC="$CC -OPT:Olimit=0" |
| 372 | AC_TRY_RUN([int main() { return 0; }], |
| 373 | ac_cv_opt_olimit_ok=yes, |
| 374 | ac_cv_opt_olimit_ok=no) |
| 375 | CC="$ac_save_cc"]) |
| 376 | AC_MSG_RESULT($ac_cv_opt_olimit_ok) |
Guido van Rossum | 2efa34b | 1997-10-23 17:43:11 +0000 | [diff] [blame] | 377 | if test $ac_cv_opt_olimit_ok = yes; then |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 378 | case $ac_sys_system in |
| 379 | Darwin*) OPT="$OPT" ;; |
| 380 | *) OPT="$OPT -OPT:Olimit=0";; |
| 381 | esac |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 382 | else |
| 383 | AC_MSG_CHECKING(whether $CC accepts -Olimit 1500) |
| 384 | AC_CACHE_VAL(ac_cv_olimit_ok, |
| 385 | [ac_save_cc="$CC" |
| 386 | CC="$CC -Olimit 1500" |
| 387 | AC_TRY_RUN([int main() { return 0; }], |
| 388 | ac_cv_olimit_ok=yes, |
| 389 | ac_cv_olimit_ok=no) |
| 390 | CC="$ac_save_cc"]) |
| 391 | AC_MSG_RESULT($ac_cv_olimit_ok) |
| 392 | if test $ac_cv_olimit_ok = yes; then |
| 393 | OPT="$OPT -Olimit 1500" |
| 394 | fi |
Guido van Rossum | 201afe5 | 1997-05-14 21:14:44 +0000 | [diff] [blame] | 395 | fi |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 396 | |
Fred Drake | ce81d59 | 2000-07-09 14:39:29 +0000 | [diff] [blame] | 397 | dnl # check for ANSI or K&R ("traditional") preprocessor |
| 398 | dnl AC_MSG_CHECKING(for C preprocessor type) |
| 399 | dnl AC_TRY_COMPILE([ |
| 400 | dnl #define spam(name, doc) {#name, &name, #name "() -- " doc} |
| 401 | dnl int foo; |
| 402 | dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something"); |
| 403 | dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional) |
| 404 | dnl AC_MSG_RESULT($cpp_type) |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 405 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 406 | # checks for header files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 407 | AC_HEADER_STDC |
Andrew M. Kuchling | 5821b77 | 2000-08-25 01:14:08 +0000 | [diff] [blame] | 408 | AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h locale.h ncurses.h poll.h pthread.h \ |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 409 | signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h \ |
Fred Drake | c9cb847 | 2000-08-31 16:11:07 +0000 | [diff] [blame] | 410 | sys/audioio.h sys/file.h sys/lock.h db_185.h db.h \ |
Guido van Rossum | 95713eb | 2000-05-18 20:53:31 +0000 | [diff] [blame] | 411 | sys/param.h sys/select.h sys/socket.h sys/time.h sys/times.h \ |
Fred Drake | ae90f8d | 2000-09-15 03:38:12 +0000 | [diff] [blame] | 412 | sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ |
| 413 | ndbm.h db1/ndbm.h gdbm/ndbm.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 414 | AC_HEADER_DIRENT |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 415 | |
| 416 | # checks for typedefs |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 417 | was_it_defined=no |
| 418 | AC_MSG_CHECKING(for clock_t in time.h) |
| 419 | AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, AC_DEFINE(clock_t, long)) |
| 420 | AC_MSG_RESULT($was_it_defined) |
| 421 | |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 422 | # Add some code to confdefs.h so that the test for off_t works on SCO |
| 423 | cat >> confdefs.h <<\EOF |
| 424 | #if defined(SCO_DS) |
| 425 | #undef _OFF_T |
| 426 | #endif |
| 427 | EOF |
| 428 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 429 | # Type availability checks |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 430 | AC_TYPE_MODE_T |
| 431 | AC_TYPE_OFF_T |
| 432 | AC_TYPE_PID_T |
| 433 | AC_TYPE_SIGNAL |
| 434 | AC_TYPE_SIZE_T |
| 435 | AC_TYPE_UID_T |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 436 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 437 | # Sizes of various common basic types |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 438 | AC_CHECK_SIZEOF(int) |
| 439 | AC_CHECK_SIZEOF(long) |
Guido van Rossum | fb4533c | 1998-10-02 14:39:42 +0000 | [diff] [blame] | 440 | AC_CHECK_SIZEOF(void *) |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 441 | AC_CHECK_SIZEOF(char) |
| 442 | AC_CHECK_SIZEOF(short) |
| 443 | AC_CHECK_SIZEOF(float) |
| 444 | AC_CHECK_SIZEOF(double) |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 445 | AC_CHECK_SIZEOF(fpos_t) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 446 | |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 447 | AC_MSG_CHECKING(for long long support) |
| 448 | have_long_long=no |
| 449 | AC_TRY_COMPILE([], [long long x; x = (long long)0;], AC_DEFINE(HAVE_LONG_LONG) have_long_long=yes) |
| 450 | AC_MSG_RESULT($have_long_long) |
Guido van Rossum | 8bc1dfd | 1999-04-10 16:01:48 +0000 | [diff] [blame] | 451 | if test "$have_long_long" = yes ; then |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 452 | AC_CHECK_SIZEOF(long long) |
| 453 | fi |
| 454 | |
Barry Warsaw | bc7c7f9 | 2000-08-18 04:53:33 +0000 | [diff] [blame] | 455 | AC_MSG_CHECKING(for uintptr_t support) |
| 456 | have_uintptr_t=no |
| 457 | AC_TRY_COMPILE([], [uintptr_t x; x = (uintptr_t)0;], AC_DEFINE(HAVE_UINTPTR_T) have_uintptr_t=yes) |
| 458 | AC_MSG_RESULT($have_uintptr_t) |
| 459 | if test "$have_uintptr_t" = yes ; then |
| 460 | AC_CHECK_SIZEOF(uintptr_t) |
| 461 | fi |
| 462 | |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 463 | # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>. |
| 464 | AC_MSG_CHECKING(size of off_t) |
| 465 | AC_CACHE_VAL(ac_cv_sizeof_off_t, |
| 466 | [AC_TRY_RUN([#include <stdio.h> |
| 467 | #include <sys/types.h> |
| 468 | main() |
| 469 | { |
| 470 | FILE *f=fopen("conftestval", "w"); |
| 471 | if (!f) exit(1); |
| 472 | fprintf(f, "%d\n", sizeof(off_t)); |
| 473 | exit(0); |
| 474 | }], ac_cv_sizeof_off_t=`cat conftestval`, ac_cv_sizeof_off_t=0) |
| 475 | ]) |
| 476 | AC_MSG_RESULT($ac_cv_sizeof_off_t) |
| 477 | AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t) |
| 478 | |
| 479 | AC_MSG_CHECKING(whether to enable large file support) |
Guido van Rossum | 8bc1dfd | 1999-04-10 16:01:48 +0000 | [diff] [blame] | 480 | if test "$have_long_long" = yes -a \ |
| 481 | "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ |
| 482 | "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 483 | AC_DEFINE(HAVE_LARGEFILE_SUPPORT) |
| 484 | AC_MSG_RESULT(yes) |
| 485 | else |
| 486 | AC_MSG_RESULT(no) |
| 487 | fi |
| 488 | |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 489 | # AC_CHECK_SIZEOF() doesn't include <time.h>. |
| 490 | AC_MSG_CHECKING(size of time_t) |
| 491 | AC_CACHE_VAL(ac_cv_sizeof_time_t, |
| 492 | [AC_TRY_RUN([#include <stdio.h> |
| 493 | #include <time.h> |
| 494 | main() |
| 495 | { |
| 496 | FILE *f=fopen("conftestval", "w"); |
| 497 | if (!f) exit(1); |
| 498 | fprintf(f, "%d\n", sizeof(time_t)); |
| 499 | exit(0); |
| 500 | }], ac_cv_sizeof_time_t=`cat conftestval`, ac_cv_sizeof_time_t=0) |
| 501 | ]) |
| 502 | AC_MSG_RESULT($ac_cv_sizeof_time_t) |
| 503 | AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t) |
| 504 | |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 505 | |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 506 | # if have pthread_t then define SIZEOF_PTHREAD_T |
| 507 | AC_MSG_CHECKING(for pthread_t) |
| 508 | have_pthread_t=no |
Guido van Rossum | 1258049 | 2000-09-24 16:47:19 +0000 | [diff] [blame] | 509 | AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes) |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 510 | AC_MSG_RESULT($have_pthread_t) |
| 511 | if test "$have_pthread_t" = yes ; then |
| 512 | # AC_CHECK_SIZEOF() doesn't include <pthread.h>. |
| 513 | AC_MSG_CHECKING(size of pthread_t) |
| 514 | AC_CACHE_VAL(ac_cv_sizeof_pthread_t, |
| 515 | [AC_TRY_RUN([#include <stdio.h> |
| 516 | #include <pthread.h> |
| 517 | main() |
| 518 | { |
| 519 | FILE *f=fopen("conftestval", "w"); |
| 520 | if (!f) exit(1); |
| 521 | fprintf(f, "%d\n", sizeof(pthread_t)); |
| 522 | exit(0); |
| 523 | }], ac_cv_sizeof_pthread_t=`cat conftestval`, ac_cv_sizeof_pthread_t=0) |
| 524 | ]) |
| 525 | AC_MSG_RESULT($ac_cv_sizeof_pthread_t) |
| 526 | AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t) |
| 527 | fi |
| 528 | |
| 529 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 530 | # Minor variations in building a framework between NextStep versions 4 and 5 |
| 531 | AC_SUBST(LIBTOOL_CRUFT) |
| 532 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 533 | Darwin/*) |
| 534 | ns_undef_sym='_environ' |
| 535 | LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -U $ns_undef_sym" ;; |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 536 | next/4*) |
| 537 | ns_undef_sym='__environ' |
| 538 | LIBTOOL_CRUFT="-U $ns_undef_sym" ;; |
| 539 | next/5*) |
| 540 | ns_undef_sym='_environ' |
| 541 | LIBTOOL_CRUFT="-lcc_dynamic -U $ns_undef_sym" ;; |
| 542 | esac |
| 543 | |
| 544 | AC_MSG_CHECKING(for --with-next-framework) |
| 545 | if test "$with_next_framework" |
| 546 | then |
| 547 | OPT="$OPT -fno-common" |
| 548 | # -U __environ is needed since bundles don't have access |
| 549 | # to crt0 when built but will always be linked against it |
| 550 | LDFLAGS="$LDFLAGS -Wl,-U,$ns_undef_sym" |
| 551 | AC_DEFINE(WITH_NEXT_FRAMEWORK) |
| 552 | AC_MSG_RESULT(yes) |
| 553 | else |
| 554 | AC_MSG_RESULT(no) |
| 555 | fi |
| 556 | |
| 557 | AC_MSG_CHECKING(for --with-dyld) |
| 558 | if test "$with_next_framework" -o "$with_dyld" |
| 559 | then |
| 560 | if test "$with_dyld" |
| 561 | then |
| 562 | AC_MSG_RESULT(yes) |
| 563 | else |
| 564 | AC_MSG_RESULT(required for framework build) |
| 565 | fi |
| 566 | AC_DEFINE(WITH_DYLD) |
| 567 | ns_dyld='set' |
| 568 | else |
| 569 | AC_MSG_RESULT(no) |
| 570 | fi |
| 571 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 572 | # Set info about shared libraries. |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 573 | AC_SUBST(SO) |
| 574 | AC_SUBST(LDSHARED) |
| 575 | AC_SUBST(CCSHARED) |
| 576 | AC_SUBST(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 577 | # SO is the extension of shared libraries `(including the dot!) |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 578 | # -- usually .so, .sl on HP-UX, .dll on Cygwin |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 579 | AC_MSG_CHECKING(SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 580 | if test -z "$SO" |
| 581 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 582 | case $ac_sys_system in |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 583 | hp*|HP*) SO=.sl;; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 584 | CYGWIN*) SO=.dll;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 585 | *) SO=.so;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 586 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 587 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 588 | AC_MSG_RESULT($SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 589 | # LDSHARED is the ld *command* used to create shared library |
| 590 | # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 591 | # (Shared libraries in this instance are shared modules to be loaded into |
| 592 | # Python, as opposed to building Python itself as a shared library.) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 593 | AC_MSG_CHECKING(LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 594 | if test -z "$LDSHARED" |
| 595 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 596 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | 45140f9 | 1997-08-29 18:44:06 +0000 | [diff] [blame] | 597 | AIX*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";; |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 598 | BeOS*) LDSHARED="\$(srcdir)/../BeOS/linkmodule -L.. -lpython\$(VERSION)";; |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 599 | IRIX/5*) LDSHARED="ld -shared";; |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 600 | IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 601 | SunOS/4*) LDSHARED="ld";; |
Greg Ward | 57c9a66 | 2000-05-26 12:22:54 +0000 | [diff] [blame] | 602 | SunOS/5*) |
| 603 | if test "$GCC" = "yes" |
Greg Ward | a1c4da2 | 2000-11-07 15:44:21 +0000 | [diff] [blame] | 604 | then LDSHARED='$(CC) -shared' |
Greg Ward | 57c9a66 | 2000-05-26 12:22:54 +0000 | [diff] [blame] | 605 | else LDSHARED="ld -G"; |
| 606 | fi ;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 607 | hp*|HP*) LDSHARED="ld -b";; |
Guido van Rossum | 71001e4 | 1995-01-26 00:44:03 +0000 | [diff] [blame] | 608 | OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 609 | DYNIX/ptx*) LDSHARED="ld -G";; |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 610 | Darwin/*|next/*) |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 611 | if test "$ns_dyld" |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 612 | then |
| 613 | if test "$ac_sys_system" = Darwin |
| 614 | then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' |
| 615 | else LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind' |
| 616 | fi |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 617 | else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r'; |
| 618 | fi |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 619 | if test "$with_next_framework" ; then |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 620 | LDSHARED="$LDSHARED \$(LDLIBRARY)" |
| 621 | fi ;; |
Guido van Rossum | 81652ab | 1996-07-21 02:53:27 +0000 | [diff] [blame] | 622 | Linux*) LDSHARED="gcc -shared";; |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 623 | dgux*) LDSHARED="ld -G";; |
Guido van Rossum | 458e7fa | 1999-09-17 15:40:40 +0000 | [diff] [blame] | 624 | BSD/OS*/4*) LDSHARED="gcc -shared";; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 625 | OpenBSD*) LDSHARED="ld -Bshareable";; |
Guido van Rossum | df69365 | 1999-01-07 21:50:41 +0000 | [diff] [blame] | 626 | NetBSD*) |
| 627 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
| 628 | then |
| 629 | LDSHARED="cc -shared" |
| 630 | else |
| 631 | LDSHARED="ld -Bshareable" |
| 632 | fi;; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 633 | FreeBSD*) |
Jeremy Hylton | 4bcc7c5 | 2000-08-31 17:45:35 +0000 | [diff] [blame] | 634 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 635 | then |
| 636 | LDSHARED="cc -shared ${LDFLAGS}" |
| 637 | else |
| 638 | LDSHARED="ld -Bshareable ${LDFLAGS}" |
| 639 | fi;; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 640 | SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 641 | Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 642 | CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 643 | *) LDSHARED="ld";; |
| 644 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 645 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 646 | AC_MSG_RESULT($LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 647 | # 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] | 648 | # library (module) -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 649 | AC_MSG_CHECKING(CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 650 | if test -z "$CCSHARED" |
| 651 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 652 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | af07a44 | 1995-02-13 19:45:27 +0000 | [diff] [blame] | 653 | hp*|HP*) if test "$GCC" = yes; |
| 654 | then CCSHARED="-fpic"; |
| 655 | else CCSHARED="+z"; |
| 656 | fi;; |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 657 | Linux*) CCSHARED="-fpic";; |
Guido van Rossum | f5957ea | 1999-10-05 21:59:33 +0000 | [diff] [blame] | 658 | BSD/OS*/4*) CCSHARED="-fpic";; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 659 | OpenBSD*) CCSHARED="-fpic";; |
| 660 | FreeBSD*|NetBSD*) CCSHARED="-fPIC";; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 661 | SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 662 | Monterey*) CCSHARED="-G";; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 663 | IRIX*/6*) case $CC in |
| 664 | *gcc*) CCSHARED="-shared";; |
Guido van Rossum | ee21f41 | 1998-04-20 18:51:54 +0000 | [diff] [blame] | 665 | *) CCSHARED="";; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 666 | esac;; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame^] | 667 | CYGWIN*) CCSHARED="-DUSE_DL_IMPORT";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 668 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 669 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 670 | AC_MSG_RESULT($CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 671 | # LINKFORSHARED are the flags passed to the $(CC) command that links |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 672 | # the python executable -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 673 | AC_MSG_CHECKING(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 674 | if test -z "$LINKFORSHARED" |
| 675 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 676 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | 69f6580 | 1998-03-03 21:47:00 +0000 | [diff] [blame] | 677 | AIX*) LINKFORSHARED='-Wl,-bE:python.exp -lld';; |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 678 | hp*|HP*) |
Guido van Rossum | 304dd2d | 1997-10-20 23:10:56 +0000 | [diff] [blame] | 679 | LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; |
Guido van Rossum | f5957ea | 1999-10-05 21:59:33 +0000 | [diff] [blame] | 680 | BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; |
Guido van Rossum | 2d9feed | 1997-11-24 17:36:21 +0000 | [diff] [blame] | 681 | Linux*) LINKFORSHARED="-Xlinker -export-dynamic";; |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 682 | # -u libsys_s pulls in all symbols in libsys |
| 683 | next/2*|next/3*) LINKFORSHARED="-u libsys_s";; |
| 684 | # -u __dummy makes the linker aware of the objc runtime |
| 685 | # in System.framework; otherwise, __objcInit (referenced in |
| 686 | # crt1.o) gets erroneously defined as common, which breaks dynamic |
| 687 | # loading of any modules which reference it in System.framework |
| 688 | next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;; |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 689 | Darwin/*) LINKFORSHARED="-framework System" ;; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 690 | SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; |
Fred Drake | 02706f5 | 2000-09-25 15:08:46 +0000 | [diff] [blame] | 691 | ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 692 | FreeBSD*|NetBSD*) |
Guido van Rossum | df69365 | 1999-01-07 21:50:41 +0000 | [diff] [blame] | 693 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
| 694 | then |
| 695 | LINKFORSHARED="-Wl,--export-dynamic" |
| 696 | fi;; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 697 | SunOS/5*) case $CC in |
| 698 | *gcc*) |
Guido van Rossum | 9c6ba9b | 2000-02-03 13:42:50 +0000 | [diff] [blame] | 699 | if $CC -Xlinker -V 2>&1 | grep BFD >/dev/null |
Guido van Rossum | 8f4ceb1 | 1997-12-18 23:42:19 +0000 | [diff] [blame] | 700 | then |
| 701 | LINKFORSHARED="-Xlinker --export-dynamic" |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 702 | fi;; |
| 703 | esac;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 704 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 705 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 706 | AC_MSG_RESULT($LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 707 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 708 | # checks for libraries |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 709 | AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV |
| 710 | AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX |
Guido van Rossum | 0eefa3f | 1999-11-16 15:57:37 +0000 | [diff] [blame] | 711 | |
Skip Montanaro | cb85326 | 2000-08-30 22:29:48 +0000 | [diff] [blame] | 712 | # Check for --with-pydebug |
| 713 | AC_MSG_CHECKING(for --with-pydebug) |
| 714 | AC_ARG_WITH(pydebug, |
| 715 | [ --with-pydebug build with Py_DEBUG defined], [ |
| 716 | if test "$withval" != no |
| 717 | then AC_DEFINE(Py_DEBUG) AC_MSG_RESULT(yes) |
| 718 | else AC_MSG_RESULT(no) |
| 719 | fi], |
| 720 | [AC_MSG_RESULT(no)]) |
| 721 | |
Guido van Rossum | 0eefa3f | 1999-11-16 15:57:37 +0000 | [diff] [blame] | 722 | # checks for system dependent C++ extensions support |
| 723 | case "$ac_sys_system" in |
| 724 | AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support) |
| 725 | AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"], |
| 726 | [loadAndInit("", 0, "")], |
| 727 | [AC_DEFINE(AIX_GENUINE_CPLUSPLUS) |
| 728 | AC_MSG_RESULT(yes)], |
| 729 | [AC_MSG_RESULT(no)]);; |
| 730 | *) ;; |
| 731 | esac |
| 732 | |
Guido van Rossum | 70c7f48 | 1998-03-26 18:44:10 +0000 | [diff] [blame] | 733 | # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. |
| 734 | # However on SGI IRIX, these exist but are broken. |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 735 | # BeOS' sockets are stashed in libnet. |
| 736 | case "$ac_sys_system" in |
| 737 | IRIX*) ;; |
Guido van Rossum | 2cb5660 | 1998-05-07 13:25:56 +0000 | [diff] [blame] | 738 | *) |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 739 | AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 740 | AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets |
Jeremy Hylton | cb25d5e | 2000-07-27 21:23:28 +0000 | [diff] [blame] | 741 | ;; |
| 742 | esac |
| 743 | case "$ac_sys_system" in |
| 744 | BeOS*) |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 745 | AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS |
| 746 | ;; |
| 747 | esac |
Guido van Rossum | 70c7f48 | 1998-03-26 18:44:10 +0000 | [diff] [blame] | 748 | |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 749 | AC_MSG_CHECKING(for --with-libs) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 750 | AC_ARG_WITH(libs, |
| 751 | [ --with-libs='lib1 ...' link against additional libs], [ |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 752 | AC_MSG_RESULT($withval) |
| 753 | LIBS="$withval $LIBS" |
| 754 | ], AC_MSG_RESULT(no)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 755 | |
Guido van Rossum | 3d15bd8 | 2001-01-10 18:53:48 +0000 | [diff] [blame] | 756 | # This is used to generate Setup.config |
| 757 | AC_SUBST(USE_NCURSES_MODULE) |
| 758 | AC_CHECK_LIB(ncurses, initscr, |
| 759 | [USE_NCURSES_MODULE=""], |
| 760 | [USE_NCURSES_MODULE="#"], |
| 761 | -ltermcap) |
| 762 | |
| 763 | # This is used to generate Setup.config |
| 764 | AC_SUBST(USE_READLINE_MODULE) |
| 765 | AC_CHECK_LIB(readline, readline, |
| 766 | [USE_READLINE_MODULE=""], |
| 767 | [USE_READLINE_MODULE="#"], |
| 768 | -ltermcap) |
| 769 | |
| 770 | # This is used to generate Setup.config |
Guido van Rossum | 009f787 | 1997-12-04 00:51:42 +0000 | [diff] [blame] | 771 | AC_SUBST(USE_THREAD_MODULE) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 772 | USE_THREAD_MODULE="" |
Guido van Rossum | 009f787 | 1997-12-04 00:51:42 +0000 | [diff] [blame] | 773 | |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 774 | AC_MSG_CHECKING(for --with-dec-threads) |
| 775 | AC_SUBST(LDLAST) |
| 776 | AC_ARG_WITH(dec-threads, |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 777 | [ --with-dec-threads use DEC Alpha/OSF1 thread-safe libraries], [ |
| 778 | AC_MSG_RESULT($withval) |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 779 | LDLAST=-threads |
Guido van Rossum | f78abae | 1997-01-21 22:02:36 +0000 | [diff] [blame] | 780 | if test "${with_thread+set}" != set; then |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 781 | with_thread="$withval"; |
| 782 | fi], |
| 783 | AC_MSG_RESULT(no)) |
| 784 | |
| 785 | AC_MSG_CHECKING(for --with-threads) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 786 | AC_ARG_WITH(threads, |
| 787 | [ --with(out)-threads[=DIRECTORY] disable/enable thread support]) |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 788 | |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 789 | # --with-thread is deprecated, but check for it anyway |
Barry Warsaw | a0f3c5c | 2000-06-30 16:39:35 +0000 | [diff] [blame] | 790 | AC_ARG_WITH(thread, |
| 791 | [ --with(out)-thread[=DIRECTORY] deprecated; use --with(out)-threads],[ |
| 792 | with_threads=$with_thread]) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 793 | |
| 794 | if test -z "$with_threads" |
| 795 | then with_threads="yes" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 796 | fi |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 797 | AC_MSG_RESULT($with_threads) |
Guido van Rossum | 6400c26 | 1997-05-22 20:34:27 +0000 | [diff] [blame] | 798 | |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 799 | if test "$with_threads" = "no" |
| 800 | then |
| 801 | USE_THREAD_MODULE="#" |
| 802 | else |
Guido van Rossum | 4095101 | 2000-10-07 16:21:27 +0000 | [diff] [blame] | 803 | if test ! -z "$with_threads" -a -d "$with_threads" |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 804 | then LDFLAGS="$LDFLAGS -L$with_threads" |
| 805 | fi |
Guido van Rossum | 4095101 | 2000-10-07 16:21:27 +0000 | [diff] [blame] | 806 | if test ! -z "$withval" -a -d "$withval" |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 807 | then LDFLAGS="$LDFLAGS -L$withval" |
| 808 | fi |
| 809 | AC_DEFINE(_REENTRANT) |
| 810 | AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD) |
| 811 | AC_DEFINE(C_THREADS) |
| 812 | LIBOBJS="$LIBOBJS thread.o"],[ |
Guido van Rossum | 9e8181b | 2000-09-19 00:46:46 +0000 | [diff] [blame] | 813 | AC_MSG_CHECKING(for --with-pth) |
| 814 | AC_ARG_WITH(pth, |
| 815 | [ --with-pth use GNU pth threading libraries], [ |
| 816 | AC_MSG_RESULT($withval) |
| 817 | AC_DEFINE(WITH_THREAD) |
| 818 | AC_DEFINE(HAVE_PTH) |
| 819 | LIBS="-lpth $LIBS" |
| 820 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 821 | AC_MSG_RESULT(no) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 822 | AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 823 | AC_DEFINE(_POSIX_THREADS) |
| 824 | LIBS="-lpthread $LIBS" |
| 825 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 826 | AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 827 | case $ac_sys_system in |
| 828 | Darwin*) ;; |
| 829 | *) AC_DEFINE(_POSIX_THREADS);; |
| 830 | esac |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 831 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 832 | AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD) |
| 833 | AC_DEFINE(BEOS_THREADS) |
| 834 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 835 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 836 | AC_DEFINE(_POSIX_THREADS) |
| 837 | LIBS="$LIBS -lpthreads" |
| 838 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 839 | AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 840 | AC_DEFINE(_POSIX_THREADS) |
| 841 | LIBS="$LIBS -lc_r" |
| 842 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 843 | AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD) |
| 844 | AC_DEFINE(_POSIX_THREADS) |
| 845 | LIBS="$LIBS -lthread" |
| 846 | LIBOBJS="$LIBOBJS thread.o"], [ |
Guido van Rossum | 8d6e8af | 2000-10-30 17:45:07 +0000 | [diff] [blame] | 847 | AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD) |
| 848 | AC_DEFINE(_POSIX_THREADS) |
| 849 | LIBS="$LIBS -lpthread" |
| 850 | LIBOBJS="$LIBOBJS thread.o"], [ |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 851 | AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 852 | AC_DEFINE(_POSIX_THREADS) |
| 853 | LIBS="$LIBS -lcma" |
Thomas Wouters | 0db2b2b | 2000-08-26 11:33:43 +0000 | [diff] [blame] | 854 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 855 | USE_THREAD_MODULE="#"]) |
Guido van Rossum | 8d6e8af | 2000-10-30 17:45:07 +0000 | [diff] [blame] | 856 | ])])])])])])])])]) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 857 | |
| 858 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) |
| 859 | LIBS="$LIBS -lmpc" |
Thomas Wouters | 0db2b2b | 2000-08-26 11:33:43 +0000 | [diff] [blame] | 860 | LIBOBJS="$LIBOBJS thread.o" |
| 861 | USE_THREAD_MODULE=""]) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 862 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) |
| 863 | LIBS="$LIBS -lthread" |
Thomas Wouters | 0db2b2b | 2000-08-26 11:33:43 +0000 | [diff] [blame] | 864 | LIBOBJS="$LIBOBJS thread.o" |
| 865 | USE_THREAD_MODULE=""]) |
Jeremy Hylton | 1a2ca86 | 2000-10-16 16:59:12 +0000 | [diff] [blame] | 866 | |
| 867 | if test "$USE_THREAD_MODULE" != "#" |
| 868 | then |
| 869 | # If the above checks didn't disable threads, (at least) OSF1 |
| 870 | # needs this '-threads' argument during linking. |
| 871 | case $ac_sys_system in |
| 872 | OSF1) LDLAST=-threads;; |
| 873 | esac |
| 874 | fi |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 875 | fi |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 876 | |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 877 | # Check for GC support |
| 878 | AC_SUBST(USE_GC_MODULE) |
| 879 | USE_GC_MODULE="" |
| 880 | AC_MSG_CHECKING(for --with-cycle-gc) |
| 881 | AC_ARG_WITH(cycle-gc, |
| 882 | [ --with(out)-cycle-gc disable/enable garbage collection]) |
| 883 | |
| 884 | if test -z "$with_cycle_gc" |
| 885 | then with_cycle_gc="yes" |
| 886 | fi |
| 887 | if test "$with_cycle_gc" = "no" |
| 888 | then |
| 889 | USE_GC_MODULE="#" |
| 890 | else |
| 891 | AC_DEFINE(WITH_CYCLE_GC) |
| 892 | fi |
| 893 | AC_MSG_RESULT($with_cycle_gc) |
| 894 | |
Fred Drake | c9cb847 | 2000-08-31 16:11:07 +0000 | [diff] [blame] | 895 | # Check for LIBDB support |
| 896 | # either --with-libdb or, in its absence, the presence of db.h |
| 897 | AC_SUBST(USE_BSDDB_MODULE) |
| 898 | USE_BSDDB_MODULE="" |
| 899 | AC_MSG_CHECKING(for --with-libdb) |
| 900 | AC_ARG_WITH(libdb, |
| 901 | [ --with(out)-libdb disable/enable bsddb module]) |
| 902 | |
Skip Montanaro | b89f41e | 2000-09-04 04:06:05 +0000 | [diff] [blame] | 903 | # enabled by default, but db.h must be found |
| 904 | if test "$ac_cv_header_db_h" = "yes" |
| 905 | then |
| 906 | if test "$with_libdb" != "no" |
| 907 | then with_libdb="yes" |
| 908 | fi |
| 909 | else |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 910 | # make sure user knows why bsddb support wasn't enabled even |
Skip Montanaro | b89f41e | 2000-09-04 04:06:05 +0000 | [diff] [blame] | 911 | # though s/he requested it |
| 912 | if test "$with_libdb" = "yes" |
| 913 | then echo $ac_n "(requested, but db.h was not found) $ac_c" |
| 914 | fi |
| 915 | with_libdb="no" |
Fred Drake | c9cb847 | 2000-08-31 16:11:07 +0000 | [diff] [blame] | 916 | fi |
Skip Montanaro | b89f41e | 2000-09-04 04:06:05 +0000 | [diff] [blame] | 917 | |
Fred Drake | c9cb847 | 2000-08-31 16:11:07 +0000 | [diff] [blame] | 918 | if test "$with_libdb" = "no" |
| 919 | then |
| 920 | USE_BSDDB_MODULE="#" |
| 921 | else |
| 922 | AC_DEFINE(WITH_LIBDB) |
| 923 | fi |
| 924 | AC_MSG_RESULT($with_libdb) |
| 925 | |
Skip Montanaro | ed33c9a | 2000-09-08 02:17:15 +0000 | [diff] [blame] | 926 | if test "$with_libdb" = "yes" |
| 927 | then |
| 928 | # check for libdb; BSD systems have the DB routines in libc --tg |
| 929 | AC_SUBST(HAVE_LIBDB) |
Martin v. Löwis | 05a65d6 | 2000-09-24 19:40:25 +0000 | [diff] [blame] | 930 | # If dbopen is not in libc, then checking whether it is in libdb |
| 931 | # is difficult: db_185.h may #define it as __db185_open |
| 932 | # Instead, we just trust it is in libdb; linking will fail if it |
| 933 | # is not. |
| 934 | AC_CHECK_FUNC(dbopen, [HAVE_LIBDB=], [HAVE_LIBDB=-ldb]) |
Skip Montanaro | ed33c9a | 2000-09-08 02:17:15 +0000 | [diff] [blame] | 935 | fi |
| 936 | |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 937 | # Check for --with-wctype-functions |
| 938 | AC_MSG_CHECKING(for --with-wctype-functions) |
| 939 | AC_ARG_WITH(wctype-functions, |
| 940 | [ --with-wctype-functions use wctype.h functions], [ |
| 941 | if test "$withval" != no |
| 942 | then AC_DEFINE(WANT_WCTYPE_FUNCTIONS) AC_MSG_RESULT(yes) |
| 943 | else AC_MSG_RESULT(no) |
| 944 | fi], |
| 945 | [AC_MSG_RESULT(no)]) |
| 946 | |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 947 | # -I${DLINCLDIR} is added to the compile rule for importdl.o |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 948 | AC_SUBST(DLINCLDIR) |
| 949 | DLINCLDIR=/ |
| 950 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 951 | AC_MSG_CHECKING(for --with-sgi-dl) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 952 | AC_ARG_WITH(sgi-dl, |
| 953 | [ --with-sgi-dl=DIRECTORY IRIX 4 dynamic linking], [ |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 954 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 955 | AC_DEFINE(WITH_SGI_DL) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 956 | DYNLOADFILE="dynload_dl.o" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 957 | dldir=$withval |
Guido van Rossum | 4095101 | 2000-10-07 16:21:27 +0000 | [diff] [blame] | 958 | if test ! -z "$dldir" -a -d "$dldir" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 959 | then LDFLAGS="$LDFLAGS -L$dldir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 960 | else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY) |
| 961 | fi |
| 962 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 963 | LIBS="$LIBS -ldl -lmld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 964 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 965 | AC_MSG_CHECKING(for --with-dl-dld) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 966 | AC_ARG_WITH(dl-dld, [ --with-dl-dld=DL_DIR,DLD_DIR GNU dynamic linking], [ |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 967 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 968 | AC_DEFINE(WITH_DL_DLD) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 969 | DYNLOADFILE="dynload_dl.o" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 970 | dldir=`echo "$withval" | sed 's/,.*//'` |
| 971 | dlddir=`echo "$withval" | sed 's/.*,//'` |
Barry Warsaw | 7d1219d | 2000-10-05 18:45:53 +0000 | [diff] [blame] | 972 | if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 973 | then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 974 | else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY) |
| 975 | fi |
| 976 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 977 | LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 978 | |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 979 | # the dlopen() function means we might want to use dynload_shlib.o. some |
| 980 | # 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] | 981 | AC_CHECK_FUNCS(dlopen) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 982 | |
| 983 | # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic |
| 984 | # loading of modules. |
| 985 | AC_SUBST(DYNLOADFILE) |
| 986 | AC_MSG_CHECKING(DYNLOADFILE) |
| 987 | if test -z "$DYNLOADFILE" |
| 988 | then |
| 989 | case $ac_sys_system/$ac_sys_release in |
| 990 | AIX*) DYNLOADFILE="dynload_aix.o";; |
| 991 | BeOS*) DYNLOADFILE="dynload_beos.o";; |
| 992 | hp*|HP*) DYNLOADFILE="dynload_hpux.o";; |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 993 | Darwin/*|next/*) DYNLOADFILE="dynload_next.o";; |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 994 | *) |
| 995 | # use dynload_shlib.c and dlopen() if we have it; otherwise stub |
| 996 | # out any dynamic loading |
| 997 | if test "$ac_cv_func_dlopen" = yes |
| 998 | then DYNLOADFILE="dynload_shlib.o" |
| 999 | else DYNLOADFILE="dynload_stub.o" |
| 1000 | fi |
| 1001 | ;; |
| 1002 | esac |
| 1003 | fi |
| 1004 | AC_MSG_RESULT($DYNLOADFILE) |
| 1005 | if test "$DYNLOADFILE" != "dynload_stub.o" |
| 1006 | then |
| 1007 | AC_DEFINE(HAVE_DYNAMIC_LOADING) |
| 1008 | fi |
| 1009 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1010 | # checks for library functions |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 1011 | AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \ |
Fred Drake | 35a092f | 1999-12-13 16:23:35 +0000 | [diff] [blame] | 1012 | flock fork fsync fdatasync fpathconf ftime ftruncate \ |
Andrew M. Kuchling | a9586c7 | 2001-01-08 17:58:56 +0000 | [diff] [blame] | 1013 | getgroups getlogin getpeername getpid getpwent getwd \ |
Andrew M. Kuchling | 898527b | 2000-06-18 14:54:13 +0000 | [diff] [blame] | 1014 | kill link lstat mkfifo mktime mremap \ |
Andrew M. Kuchling | 5821b77 | 2000-08-25 01:14:08 +0000 | [diff] [blame] | 1015 | nice pathconf pause plock poll pthread_init \ |
Fred Drake | 35a092f | 1999-12-13 16:23:35 +0000 | [diff] [blame] | 1016 | putenv readlink \ |
Andrew M. Kuchling | 8d2f2b2 | 2000-07-13 01:26:58 +0000 | [diff] [blame] | 1017 | select setegid seteuid setgid \ |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 1018 | setlocale setregid setreuid setsid setpgid setuid setvbuf \ |
Fred Drake | 35a092f | 1999-12-13 16:23:35 +0000 | [diff] [blame] | 1019 | sigaction siginterrupt sigrelse strftime strptime symlink sysconf \ |
Fred Drake | 89143df | 1999-12-09 22:03:25 +0000 | [diff] [blame] | 1020 | tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ |
Thomas Wouters | 70c21a1 | 2000-07-14 14:28:33 +0000 | [diff] [blame] | 1021 | truncate uname waitpid _getpty) |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1022 | |
Fred Drake | 8cef4cf | 2000-06-28 16:40:38 +0000 | [diff] [blame] | 1023 | # check for openpty and forkpty |
| 1024 | |
| 1025 | AC_CHECK_FUNCS(openpty,, AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])) |
| 1026 | AC_CHECK_FUNCS(forkpty,, AC_CHECK_LIB(util,forkpty, [AC_DEFINE(HAVE_FORKPTY)] [LIBS="$LIBS -lutil"])) |
| 1027 | |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1028 | # check for long file support functions |
| 1029 | AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs) |
| 1030 | |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 1031 | AC_REPLACE_FUNCS(dup2 getcwd strdup strerror memmove) |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 1032 | AC_CHECK_FUNCS(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG))) |
| 1033 | AC_CHECK_FUNCS(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG))) |
| 1034 | AC_CHECK_FUNCS(gettimeofday, AC_TRY_COMPILE([#include <sys/time.h>], [gettimeofday((struct timeval*)0,(struct timezone*)0);], ,AC_DEFINE(GETTIMEOFDAY_NO_TZ))) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1035 | |
| 1036 | # checks for structures |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1037 | AC_HEADER_TIME |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1038 | AC_STRUCT_TM |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1039 | AC_STRUCT_TIMEZONE |
| 1040 | |
| 1041 | AC_MSG_CHECKING(for time.h that defines altzone) |
| 1042 | AC_CACHE_VAL(ac_cv_header_time_altzone, |
| 1043 | [AC_TRY_COMPILE([#include <time.h>], [return altzone;], |
| 1044 | ac_cv_header_time_altzone=yes, |
| 1045 | ac_cv_header_time_altzone=no)]) |
| 1046 | AC_MSG_RESULT($ac_cv_header_time_altzone) |
| 1047 | if test $ac_cv_header_time_altzone = yes; then |
| 1048 | AC_DEFINE(HAVE_ALTZONE) |
| 1049 | fi |
| 1050 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1051 | was_it_defined=no |
| 1052 | AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1053 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1054 | #include <sys/types.h> |
| 1055 | #include <sys/select.h> |
| 1056 | #include <sys/time.h> |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1057 | ], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME) was_it_defined=yes]) |
| 1058 | AC_MSG_RESULT($was_it_defined) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1059 | |
| 1060 | # checks for compiler characteristics |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1061 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1062 | AC_C_CHAR_UNSIGNED |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1063 | AC_C_CONST |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1064 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1065 | works=no |
| 1066 | AC_MSG_CHECKING(for working volatile) |
| 1067 | AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes, AC_DEFINE(volatile, [])) |
| 1068 | AC_MSG_RESULT($works) |
Guido van Rossum | dabb11b | 1994-10-11 15:04:27 +0000 | [diff] [blame] | 1069 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1070 | works=no |
| 1071 | AC_MSG_CHECKING(for working signed char) |
| 1072 | AC_TRY_COMPILE([], [signed char c;], works=yes, AC_DEFINE(signed, [])) |
| 1073 | AC_MSG_RESULT($works) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1074 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1075 | have_prototypes=no |
| 1076 | AC_MSG_CHECKING(for prototypes) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1077 | AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], |
| 1078 | AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=yes) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1079 | AC_MSG_RESULT($have_prototypes) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1080 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1081 | works=no |
| 1082 | AC_MSG_CHECKING(for variable length prototypes and stdarg.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1083 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1084 | #include <stdarg.h> |
Guido van Rossum | 3f13e48 | 1996-08-30 20:58:11 +0000 | [diff] [blame] | 1085 | int foo(int x, ...) { |
| 1086 | va_list va; |
| 1087 | va_start(va, x); |
| 1088 | va_arg(va, int); |
| 1089 | va_arg(va, char *); |
| 1090 | va_arg(va, double); |
| 1091 | return 0; |
| 1092 | } |
| 1093 | ], [return foo(10, "", 3.14);], |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1094 | AC_DEFINE(HAVE_STDARG_PROTOTYPES) works=yes) |
| 1095 | AC_MSG_RESULT($works) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1096 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1097 | if test "$have_prototypes" = yes; then |
| 1098 | bad_prototypes=no |
| 1099 | AC_MSG_CHECKING(for bad exec* prototypes) |
| 1100 | AC_TRY_COMPILE([#include <unistd.h>], [char **t;execve("@",t,t);], , |
| 1101 | AC_DEFINE(BAD_EXEC_PROTOTYPES) bad_prototypes=yes) |
| 1102 | AC_MSG_RESULT($bad_prototypes) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1103 | fi |
| 1104 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1105 | bad_forward=no |
| 1106 | AC_MSG_CHECKING(for bad static forward) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1107 | AC_TRY_RUN([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1108 | struct s { int a; int b; }; |
| 1109 | static struct s foo; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 1110 | int foobar() { |
| 1111 | static int random; |
| 1112 | random = (int) &foo; |
| 1113 | return random; |
| 1114 | } |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1115 | static struct s foo = { 1, 2 }; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 1116 | main() { |
| 1117 | exit(!((int)&foo == foobar())); |
| 1118 | } |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1119 | ], , AC_DEFINE(BAD_STATIC_FORWARD) bad_forward=yes) |
| 1120 | AC_MSG_RESULT($bad_forward) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1121 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1122 | va_list_is_array=no |
| 1123 | AC_MSG_CHECKING(whether va_list is an array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1124 | AC_TRY_COMPILE([ |
| 1125 | #ifdef HAVE_STDARG_PROTOTYPES |
| 1126 | #include <stdarg.h> |
| 1127 | #else |
| 1128 | #include <varargs.h> |
| 1129 | #endif |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1130 | ], [va_list list1, list2; list1 = list2;], , |
| 1131 | AC_DEFINE(VA_LIST_IS_ARRAY) va_list_is_array=yes) |
| 1132 | AC_MSG_RESULT($va_list_is_array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1133 | |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1134 | # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( |
| 1135 | AC_CHECK_FUNC(gethostbyname_r, [ |
| 1136 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
| 1137 | AC_MSG_CHECKING([gethostbyname_r with 6 args]) |
| 1138 | OLD_CFLAGS=$CFLAGS |
| 1139 | CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" |
| 1140 | AC_TRY_COMPILE([ |
| 1141 | # include <netdb.h> |
| 1142 | ], [ |
| 1143 | char *name; |
| 1144 | struct hostent *he, *res; |
| 1145 | char buffer[2048]; |
| 1146 | int buflen = 2048; |
| 1147 | int h_errnop; |
| 1148 | |
| 1149 | (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop) |
| 1150 | ], [ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1151 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1152 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG) |
| 1153 | AC_MSG_RESULT(yes) |
| 1154 | ], [ |
| 1155 | AC_MSG_RESULT(no) |
| 1156 | AC_MSG_CHECKING([gethostbyname_r with 5 args]) |
| 1157 | AC_TRY_COMPILE([ |
| 1158 | # include <netdb.h> |
| 1159 | ], [ |
| 1160 | char *name; |
| 1161 | struct hostent *he; |
| 1162 | char buffer[2048]; |
| 1163 | int buflen = 2048; |
| 1164 | int h_errnop; |
| 1165 | |
| 1166 | (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop) |
| 1167 | ], [ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1168 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1169 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG) |
| 1170 | AC_MSG_RESULT(yes) |
| 1171 | ], [ |
| 1172 | AC_MSG_RESULT(no) |
| 1173 | AC_MSG_CHECKING([gethostbyname_r with 3 args]) |
| 1174 | AC_TRY_COMPILE([ |
| 1175 | # include <netdb.h> |
| 1176 | ], [ |
| 1177 | char *name; |
| 1178 | struct hostent *he; |
| 1179 | struct hostent_data data; |
| 1180 | |
| 1181 | (void) gethostbyname_r(name, he, &data); |
| 1182 | ], [ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1183 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1184 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG) |
| 1185 | AC_MSG_RESULT(yes) |
| 1186 | ], [ |
| 1187 | AC_MSG_RESULT(no) |
| 1188 | ]) |
| 1189 | ]) |
| 1190 | ]) |
| 1191 | CFLAGS=$OLD_CFLAGS |
| 1192 | ], [ |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 1193 | AC_CHECK_FUNCS(gethostbyname) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1194 | ]) |
| 1195 | AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG) |
| 1196 | AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG) |
| 1197 | AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG) |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1198 | AC_SUBST(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1199 | AC_SUBST(HAVE_GETHOSTBYNAME) |
| 1200 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1201 | # checks for system services |
| 1202 | # (none yet) |
| 1203 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1204 | # Linux requires this for correct f.p. operations |
Jeremy Hylton | be28f5b | 2000-07-27 21:03:04 +0000 | [diff] [blame] | 1205 | AC_CHECK_FUNC(__fpu_control, |
| 1206 | [], |
| 1207 | [AC_CHECK_LIB(ieee, __fpu_control) |
| 1208 | ]) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1209 | |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1210 | # Check for --with-fpectl |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1211 | AC_MSG_CHECKING(for --with-fpectl) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1212 | AC_ARG_WITH(fpectl, |
| 1213 | [ --with-fpectl enable SIGFPE catching], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1214 | if test "$withval" != no |
| 1215 | then AC_DEFINE(WANT_SIGFPE_HANDLER) AC_MSG_RESULT(yes) |
| 1216 | else AC_MSG_RESULT(no) |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 1217 | fi], |
| 1218 | [AC_MSG_RESULT(no)]) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1219 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1220 | # check for --with-libm=... |
| 1221 | AC_SUBST(LIBM) |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 1222 | case $ac_sys_system in |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 1223 | Darwin) ;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 1224 | next) ;; |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 1225 | BeOS) ;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 1226 | *) LIBM=-lm |
| 1227 | esac |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1228 | AC_MSG_CHECKING(for --with-libm=STRING) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1229 | AC_ARG_WITH(libm, [ --with-libm=STRING math library], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1230 | if test "$withval" = no |
| 1231 | then LIBM= |
| 1232 | AC_MSG_RESULT(force LIBM empty) |
| 1233 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1234 | then LIBM=$withval |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1235 | AC_MSG_RESULT(set LIBM=\"$withval\") |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1236 | else AC_ERROR(proper usage is --with-libm=STRING) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1237 | fi], |
| 1238 | [AC_MSG_RESULT(default LIBM=\"$LIBM\")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1239 | |
| 1240 | # check for --with-libc=... |
| 1241 | AC_SUBST(LIBC) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1242 | AC_MSG_CHECKING(for --with-libc=STRING) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1243 | AC_ARG_WITH(libc, [ --with-libc=STRING C library], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1244 | if test "$withval" = no |
| 1245 | then LIBC= |
| 1246 | AC_MSG_RESULT(force LIBC empty) |
| 1247 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1248 | then LIBC=$withval |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1249 | AC_MSG_RESULT(set LIBC=\"$withval\") |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1250 | else AC_ERROR(proper usage is --with-libc=STRING) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1251 | fi], |
| 1252 | [AC_MSG_RESULT(default LIBC=\"$LIBC\")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1253 | |
Guido van Rossum | 4c3f57c | 2001-01-10 20:40:46 +0000 | [diff] [blame] | 1254 | # check for --with-check-import-case |
| 1255 | AC_ARG_WITH(check-import-case, |
| 1256 | [ --with-check-import-case enable imported module name case checking],,) |
| 1257 | AC_MSG_CHECKING(for --with-check-import-case) |
| 1258 | if test "$with_check_import_case" |
| 1259 | then |
| 1260 | AC_DEFINE(CHECK_IMPORT_CASE) |
| 1261 | AC_MSG_RESULT(yes) |
| 1262 | else |
| 1263 | AC_MSG_RESULT(no) |
| 1264 | fi |
| 1265 | |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 1266 | # check for hypot() in math library |
| 1267 | LIBS_SAVE=$LIBS |
| 1268 | LIBS="$LIBS $LIBM" |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 1269 | AC_REPLACE_FUNCS(hypot) |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 1270 | LIBS=$LIBS_SAVE |
| 1271 | |
Guido van Rossum | ad71370 | 1997-07-10 22:42:38 +0000 | [diff] [blame] | 1272 | # check whether malloc(0) returns NULL or not |
Guido van Rossum | ad71370 | 1997-07-10 22:42:38 +0000 | [diff] [blame] | 1273 | AC_MSG_CHECKING(what malloc(0) returns) |
| 1274 | AC_CACHE_VAL(ac_cv_malloc_zero, |
| 1275 | [AC_TRY_RUN([#include <stdio.h> |
| 1276 | #ifdef HAVE_STDLIB |
| 1277 | #include <stdlib.h> |
| 1278 | #else |
| 1279 | char *malloc(), *realloc(); |
| 1280 | int *free(); |
| 1281 | #endif |
| 1282 | main() { |
| 1283 | char *p; |
| 1284 | p = malloc(0); |
| 1285 | if (p == NULL) exit(1); |
| 1286 | p = realloc(p, 0); |
| 1287 | if (p == NULL) exit(1); |
| 1288 | free(p); |
| 1289 | exit(0); |
| 1290 | }], ac_cv_malloc_zero=nonnull, ac_cv_malloc_zero=null)]) |
| 1291 | AC_MSG_RESULT($ac_cv_malloc_zero) |
| 1292 | if test "$ac_cv_malloc_zero" = null |
| 1293 | then |
| 1294 | AC_DEFINE(MALLOC_ZERO_RETURNS_NULL) |
| 1295 | fi |
| 1296 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 1297 | # check for wchar.h |
| 1298 | AC_CHECK_HEADER(wchar.h, |
| 1299 | AC_DEFINE(HAVE_WCHAR_H) wchar_h="yes", |
| 1300 | wchar_h="no" |
| 1301 | ) |
| 1302 | |
| 1303 | # check for usable wchar_t |
| 1304 | usable_wchar_t="unkown" |
| 1305 | AC_MSG_CHECKING(for usable wchar_t) |
| 1306 | AC_TRY_RUN([ |
| 1307 | #include "wchar.h" |
| 1308 | #include "wctype.h" |
| 1309 | main() { |
| 1310 | wchar_t s; |
| 1311 | if (sizeof(s) == 2) |
| 1312 | exit(0); |
| 1313 | else |
| 1314 | exit(1); |
| 1315 | } |
| 1316 | ], |
| 1317 | AC_DEFINE(HAVE_USABLE_WCHAR_T) usable_wchar_t="yes", |
| 1318 | usable_wchar_t="no") |
| 1319 | AC_MSG_RESULT($usable_wchar_t) |
| 1320 | |
| 1321 | # check for endianness |
| 1322 | AC_C_BIGENDIAN |
| 1323 | |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1324 | # Check whether right shifting a negative integer extends the sign bit |
| 1325 | # or fills with zeros (like the Cray J90, according to Tim Peters). |
| 1326 | AC_MSG_CHECKING(whether right shift extends the sign bit) |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 1327 | AC_CACHE_VAL(ac_cv_rshift_extends_sign, [ |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1328 | AC_TRY_RUN([ |
| 1329 | int main() |
| 1330 | { |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 1331 | exit(((-1)>>3 == -1) ? 0 : 1); |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1332 | } |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 1333 | ], ac_cv_rshift_extends_sign=yes, ac_cv_rshift_extends_sign=no)]) |
| 1334 | AC_MSG_RESULT($ac_cv_rshift_extends_sign) |
| 1335 | if test "$ac_cv_rshift_extends_sign" = no |
| 1336 | then |
| 1337 | AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS) |
| 1338 | fi |
| 1339 | |
Guido van Rossum | cadfaec | 2001-01-05 14:45:49 +0000 | [diff] [blame] | 1340 | # check for getc_unlocked and related locking functions |
| 1341 | AC_MSG_CHECKING(for getc_unlocked() and friends) |
| 1342 | AC_CACHE_VAL(ac_cv_have_getc_unlocked, [ |
| 1343 | AC_TRY_LINK([#include <stdio.h>],[ |
| 1344 | FILE *f = fopen("/dev/null", "r"); |
| 1345 | flockfile(f); |
| 1346 | getc_unlocked(f); |
| 1347 | funlockfile(f); |
| 1348 | ], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)]) |
| 1349 | AC_MSG_RESULT($ac_cv_have_getc_unlocked) |
| 1350 | if test "$ac_cv_have_getc_unlocked" = yes |
| 1351 | then |
| 1352 | AC_DEFINE(HAVE_GETC_UNLOCKED) |
| 1353 | fi |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1354 | |
Guido van Rossum | 95713eb | 2000-05-18 20:53:31 +0000 | [diff] [blame] | 1355 | # THIS MUST BE LAST, IT CAN BREAK OTHER TESTS! |
| 1356 | # Add sys/socket.h to confdefs.h |
| 1357 | cat >> confdefs.h <<\EOF |
| 1358 | #ifdef HAVE_SYS_SOCKET_H |
| 1359 | #include <sys/socket.h> |
| 1360 | #endif |
| 1361 | EOF |
| 1362 | AC_CHECK_TYPE(socklen_t, int) |
| 1363 | |
Fred Drake | 036144d | 2000-10-26 17:09:35 +0000 | [diff] [blame] | 1364 | AC_MSG_CHECKING(for Modules/Setup) |
| 1365 | if test ! -f Modules/Setup ; then |
Fred Drake | 884d3ba | 2000-11-02 17:52:56 +0000 | [diff] [blame] | 1366 | if test ! -d Modules ; then |
| 1367 | mkdir Modules |
| 1368 | fi |
Fred Drake | 036144d | 2000-10-26 17:09:35 +0000 | [diff] [blame] | 1369 | cp "$srcdir/Modules/Setup.dist" Modules/Setup |
| 1370 | AC_MSG_RESULT(creating) |
| 1371 | else |
| 1372 | AC_MSG_RESULT(already exists) |
| 1373 | fi |
| 1374 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1375 | # generate output files |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 1376 | AC_OUTPUT(Makefile \ |
| 1377 | Objects/Makefile \ |
| 1378 | Parser/Makefile \ |
Sjoerd Mullender | 59bb080 | 2000-08-17 11:38:18 +0000 | [diff] [blame] | 1379 | Grammar/Makefile \ |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 1380 | Python/Makefile \ |
Guido van Rossum | 009f787 | 1997-12-04 00:51:42 +0000 | [diff] [blame] | 1381 | Modules/Makefile.pre \ |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 1382 | Modules/Setup.config) |