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