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) |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 5 | AC_CONFIG_HEADER(pyconfig.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 | 6db412b | 2001-04-18 04:37:57 +0000 | [diff] [blame] | 9 | VERSION=2.2 |
Guido van Rossum | 642b678 | 1997-07-19 19:35:41 +0000 | [diff] [blame] | 10 | |
Neil Schemenauer | 4edbc2a | 2001-03-22 00:34:03 +0000 | [diff] [blame] | 11 | # Arguments passed to configure. |
| 12 | AC_SUBST(CONFIG_ARGS) |
| 13 | CONFIG_ARGS="$ac_configure_args" |
| 14 | |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 15 | # NEXTSTEP|MacOSX|Darwin stuff |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 16 | 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] | 17 | |
| 18 | AC_MSG_CHECKING(for --with-next-archs) |
| 19 | AC_ARG_WITH(next-archs, |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 20 | [ --with-next-archs='arch1 arch2 ..' build MAB binary], [ |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 21 | if test -n "$withval"; then |
Guido van Rossum | 2bb4f55 | 1996-09-10 18:19:59 +0000 | [diff] [blame] | 22 | ac_arch_flags=`/usr/lib/arch_tool -archify_list $withval` |
| 23 | # GCC does not currently support multi archs on the NeXT |
| 24 | with_gcc=no |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 25 | fi |
| 26 | AC_MSG_RESULT($with_next_archs) |
| 27 | ], [AC_MSG_RESULT(none: using `arch`)]) |
| 28 | |
| 29 | if test -z "$MACHDEP" |
| 30 | then |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 31 | ac_sys_system=`uname -s` |
| 32 | if test "$ac_sys_system" = "Darwin" ; then |
| 33 | ac_sys_release=`uname -r` |
| 34 | else |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 35 | set X `hostinfo | egrep '(NeXT Mach|Kernel Release).*:' | \ |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 36 | sed -e 's/://' -e 's/\./_/'` && \ |
| 37 | ac_sys_system=next && ac_sys_release=$4 |
| 38 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 39 | |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 40 | MACHDEP="$ac_sys_system$ac_sys_release" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 41 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 42 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 43 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 44 | AC_ARG_WITH(next-framework, |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 45 | [ --with-next-framework Build (OpenStep|Rhapsody|MacOSX|Darwin) framework],,) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 46 | AC_ARG_WITH(dyld, |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 47 | [ --with-dyld Use (OpenStep|Rhapsody) dynamic linker],,) |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 48 | |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 49 | # Set name for machine-dependent library files |
| 50 | AC_SUBST(MACHDEP) |
| 51 | AC_MSG_CHECKING(MACHDEP) |
| 52 | if test -z "$MACHDEP" |
| 53 | then |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 54 | ac_sys_system=`uname -s` |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 55 | 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] | 56 | ac_sys_release=`uname -v` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 57 | else |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 58 | ac_sys_release=`uname -r` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 59 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 60 | ac_md_system=`echo $ac_sys_system | |
| 61 | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'` |
| 62 | ac_md_release=`echo $ac_sys_release | |
| 63 | tr -d '[/ ]' | sed 's/\..*//'` |
Guido van Rossum | b97ef17 | 1997-09-28 05:44:03 +0000 | [diff] [blame] | 64 | MACHDEP="$ac_md_system$ac_md_release" |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 65 | |
Guido van Rossum | bcd91e0 | 1997-03-20 20:46:29 +0000 | [diff] [blame] | 66 | case $MACHDEP in |
Andrew M. Kuchling | 5a3e4cb | 2001-07-20 19:29:04 +0000 | [diff] [blame] | 67 | cygwin*) MACHDEP="cygwin";; |
Guido van Rossum | b97ef17 | 1997-09-28 05:44:03 +0000 | [diff] [blame] | 68 | '') MACHDEP="unknown";; |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 69 | esac |
| 70 | fi |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 71 | |
| 72 | # |
| 73 | # SGI compilers allow the specification of the both the ABI and the |
| 74 | # ISA on the command line. Depending on the values of these switches, |
| 75 | # different and often incompatable code will be generated. |
| 76 | # |
| 77 | # The SGI_ABI variable can be used to modify the CC and LDFLAGS and |
| 78 | # thus supply support for various ABI/ISA combinations. The MACHDEP |
| 79 | # variable is also adjusted. |
| 80 | # |
| 81 | AC_SUBST(SGI_ABI) |
| 82 | if test ! -z "$SGI_ABI" |
| 83 | then |
| 84 | CC="cc $SGI_ABI" |
| 85 | LDFLAGS="$SGI_ABI $LDFLAGS" |
| 86 | MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` |
| 87 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 88 | AC_MSG_RESULT($MACHDEP) |
| 89 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 90 | # checks for alternative programs |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 91 | AC_MSG_CHECKING(for --without-gcc) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 92 | AC_ARG_WITH(gcc, [ --without-gcc never use gcc], [ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 93 | case $withval in |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 94 | no) CC=cc |
| 95 | without_gcc=yes;; |
| 96 | yes) CC=gcc |
| 97 | without_gcc=no;; |
| 98 | *) CC=$withval |
| 99 | without_gcc=$withval;; |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 100 | esac], [ |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 101 | case $ac_sys_system in |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 102 | AIX*) CC=cc_r |
| 103 | without_gcc=;; |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 104 | BeOS*) |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 105 | case $BE_HOST_CPU in |
| 106 | ppc) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 107 | CC=mwcc |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 108 | without_gcc=yes |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 109 | OPT="-O -D'DL_EXPORT(RTYPE)=__declspec(dllexport) RTYPE' -D'DL_IMPORT(RTYPE)=__declspec(dllexport) RTYPE' -export pragma" |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 110 | CCSHARED="-UDL_IMPORT -D'DL_IMPORT(RTYPE)=__declspec(dllimport) RTYPE'" |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 111 | LDFLAGS="$LDFLAGS -nodup" |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 112 | ;; |
| 113 | x86) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 114 | CC=gcc |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 115 | without_gcc=no |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 116 | OPT=-O |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 117 | ;; |
| 118 | *) |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 119 | AC_ERROR(Unknown BeOS platform \"$BE_HOST_CPU\") |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 120 | ;; |
| 121 | esac |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 122 | AR="\$(srcdir)/Modules/ar_beos" |
| 123 | RANLIB=: |
Guido van Rossum | 7a5f420 | 1999-01-12 20:30:23 +0000 | [diff] [blame] | 124 | ;; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 125 | Monterey*) |
| 126 | RANLIB=: |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 127 | without_gcc=;; |
| 128 | *) without_gcc=no;; |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 129 | esac]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 130 | AC_MSG_RESULT($without_gcc) |
| 131 | |
Guido van Rossum | 2755290 | 2001-01-23 01:52:26 +0000 | [diff] [blame] | 132 | AC_SUBST(CXX) |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 133 | AC_SUBST(MAINOBJ) |
Fred Drake | a1a84e7 | 2001-03-06 05:52:16 +0000 | [diff] [blame] | 134 | MAINOBJ=python.o |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 135 | AC_MSG_CHECKING(for --with-cxx=<compiler>) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 136 | AC_ARG_WITH(cxx, [ --with-cxx=<compiler> enable C++ support],[ |
Martin v. Löwis | 537970f | 2000-12-13 17:37:02 +0000 | [diff] [blame] | 137 | check_cxx=no |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 138 | case $withval in |
| 139 | no) CXX= |
| 140 | with_cxx=no;; |
| 141 | *) CXX=$withval |
Fred Drake | a1a84e7 | 2001-03-06 05:52:16 +0000 | [diff] [blame] | 142 | MAINOBJ=ccpython.o |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 143 | with_cxx=$withval;; |
| 144 | esac], [ |
| 145 | with_cxx=no |
Martin v. Löwis | 537970f | 2000-12-13 17:37:02 +0000 | [diff] [blame] | 146 | check_cxx=yes |
Guido van Rossum | 9501219 | 1999-12-16 17:50:52 +0000 | [diff] [blame] | 147 | ]) |
| 148 | AC_MSG_RESULT($with_cxx) |
Martin v. Löwis | 537970f | 2000-12-13 17:37:02 +0000 | [diff] [blame] | 149 | |
| 150 | dnl The following fragment works similar to AC_PROG_CXX. |
| 151 | dnl It does not fail if CXX is not found, and it is not executed if |
| 152 | dnl --with-cxx was given. |
| 153 | dnl Finally, it does not test whether CXX is g++. |
| 154 | |
| 155 | if test "$check_cxx" = "yes" |
| 156 | then |
| 157 | AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound) |
| 158 | if test "$CXX" = "notfound" |
| 159 | then |
| 160 | CXX= |
| 161 | else |
| 162 | AC_PROG_CXX_WORKS |
| 163 | fi |
| 164 | fi |
| 165 | |
Guido van Rossum | 03ad99f | 1995-03-09 14:09:54 +0000 | [diff] [blame] | 166 | # If the user switches compilers, we can't believe the cache |
| 167 | if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" |
| 168 | then |
| 169 | AC_ERROR(cached CC is different -- throw away $cache_file |
| 170 | (it is also a good idea to do 'make clean' before compiling)) |
| 171 | fi |
| 172 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 173 | AC_PROG_CC |
Martin v. Löwis | 1d5ecb7 | 2001-08-09 10:29:44 +0000 | [diff] [blame] | 174 | |
| 175 | # checks for UNIX variants that set C preprocessor variables |
| 176 | AC_AIX |
| 177 | AC_MINIX |
| 178 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 179 | AC_EXEEXT |
Neil Schemenauer | 3ae1d0a | 2001-01-27 06:54:42 +0000 | [diff] [blame] | 180 | AC_MSG_CHECKING(for --with-suffix) |
| 181 | AC_ARG_WITH(suffix, [ --with-suffix=.exe set executable suffix],[ |
| 182 | case $withval in |
| 183 | no) EXEEXT=;; |
| 184 | yes) EXEEXT=.exe;; |
| 185 | *) EXEEXT=$withval;; |
| 186 | esac]) |
| 187 | AC_MSG_RESULT($EXEEXT) |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 188 | # Test whether we're running on a non-case-sensitive system, in which |
| 189 | # case we give a warning if no ext is given |
| 190 | if test -d "python" -a -z "$EXEEXT" |
| 191 | then |
| 192 | AC_MSG_WARN(This filesystem is not case-sensitive so you should probably use --with-suffix) |
| 193 | fi |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 194 | |
Guido van Rossum | dd997f7 | 1998-10-07 19:58:26 +0000 | [diff] [blame] | 195 | case $MACHDEP in |
| 196 | bsdos*) |
| 197 | case $CC in |
| 198 | gcc) CC="$CC -D_HAVE_BSDI";; |
| 199 | esac;; |
| 200 | esac |
| 201 | |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 202 | case $ac_sys_system in |
| 203 | hp*|HP*) |
| 204 | case $CC in |
Guido van Rossum | cd5ff9f | 2000-09-22 16:15:54 +0000 | [diff] [blame] | 205 | cc|*/cc) CC="$CC -Ae";; |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 206 | esac;; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 207 | Monterey*) |
| 208 | case $CC in |
| 209 | cc) CC="$CC -Wl,-Bexport";; |
| 210 | esac;; |
Martin v. Löwis | e8964d4 | 2001-03-06 12:09:07 +0000 | [diff] [blame] | 211 | SunOS*) |
| 212 | # Some functions have a prototype only with that define, e.g. confstr |
| 213 | AC_DEFINE(__EXTENSIONS__) |
| 214 | ;; |
Guido van Rossum | 8456161 | 1997-08-21 00:08:11 +0000 | [diff] [blame] | 215 | esac |
| 216 | |
Martin v. Löwis | e8964d4 | 2001-03-06 12:09:07 +0000 | [diff] [blame] | 217 | |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 218 | AC_SUBST(LIBRARY) |
| 219 | AC_MSG_CHECKING(LIBRARY) |
| 220 | if test -z "$LIBRARY" |
| 221 | then |
| 222 | LIBRARY='libpython$(VERSION).a' |
| 223 | fi |
| 224 | AC_MSG_RESULT($LIBRARY) |
| 225 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 226 | # LDLIBRARY is the name of the library to link against (as opposed to the |
| 227 | # name of the library into which to insert object files). On systems |
| 228 | # without shared libraries, LDLIBRARY is the same as LIBRARY (defined in |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 229 | # the Makefiles). On Cygwin LDLIBRARY is the import library, DLLLIBRARY is the |
| 230 | # shared (i.e., DLL) library. |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 231 | AC_SUBST(LDLIBRARY) |
Guido van Rossum | 2755290 | 2001-01-23 01:52:26 +0000 | [diff] [blame] | 232 | AC_SUBST(DLLLIBRARY) |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 233 | LDLIBRARY="$LIBRARY" |
Guido van Rossum | 2755290 | 2001-01-23 01:52:26 +0000 | [diff] [blame] | 234 | DLLLIBRARY='' |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 235 | |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 236 | # LINKCC is the command that links the python executable -- default is $(CC). |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 237 | # 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] | 238 | # linking. |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 239 | AC_SUBST(LINKCC) |
| 240 | AC_MSG_CHECKING(LINKCC) |
| 241 | if test -z "$LINKCC" |
| 242 | then |
| 243 | case $ac_sys_system in |
| 244 | AIX*) |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 245 | LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp \"\" \$(LIBRARY); \$(PURIFY) \$(CC)";; |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 246 | dgux*) |
| 247 | LINKCC="LD_RUN_PATH=$libdir \$(PURIFY) \$(CC)";; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 248 | Monterey64*) |
| 249 | LINKCC="\$(PURIFY) \$(CC) -L/usr/lib/ia64l64";; |
Guido van Rossum | 25f9303 | 1997-08-18 16:00:04 +0000 | [diff] [blame] | 250 | *) LINKCC="\$(PURIFY) \$(CC)";; |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 251 | esac |
| 252 | fi |
| 253 | AC_MSG_RESULT($LINKCC) |
| 254 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 255 | AC_MSG_CHECKING(LDLIBRARY) |
| 256 | |
| 257 | # NeXT framework builds require that the 'ar' library be converted into |
| 258 | # a bundle using libtool. |
| 259 | if test "$with_next_framework" |
| 260 | then |
| 261 | LDLIBRARY='libpython$(VERSION).dylib' |
Jack Jansen | ca06bc6 | 2001-08-03 15:32:23 +0000 | [diff] [blame] | 262 | DLLLIBRARY=$LDLIBRARY |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 263 | fi |
| 264 | |
| 265 | # 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] | 266 | case $MACHDEP in |
| 267 | dguxR4) |
| 268 | LDLIBRARY='libpython$(VERSION).so' |
| 269 | OPT="$OPT -pic" |
| 270 | ;; |
| 271 | beos*) |
| 272 | LDLIBRARY='libpython$(VERSION).so' |
| 273 | ;; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 274 | cygwin*) |
| 275 | LDLIBRARY='libpython$(VERSION).dll.a' |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 276 | DLLLIBRARY='libpython$(VERSION).dll' |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 277 | ;; |
Fred Drake | 5790be1 | 2000-10-09 17:06:13 +0000 | [diff] [blame] | 278 | esac |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 279 | AC_MSG_RESULT($LDLIBRARY) |
| 280 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 281 | AC_PROG_RANLIB |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 282 | AC_SUBST(AR) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 283 | AC_CHECK_PROGS(AR, ar aal, ar) |
Neil Schemenauer | a42c827 | 2001-03-31 00:01:55 +0000 | [diff] [blame] | 284 | |
| 285 | case $MACHDEP in |
| 286 | bsdos*) |
| 287 | # install -d does not work on BSDI |
| 288 | if test -z "$INSTALL" |
| 289 | then |
| 290 | INSTALL="${srcdir}/install-sh -c" |
| 291 | fi |
| 292 | esac |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 293 | AC_PROG_INSTALL |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 294 | |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 295 | # Not every filesystem supports hard links |
| 296 | AC_SUBST(LN) |
| 297 | if test -z "$LN" ; then |
| 298 | case $ac_sys_system in |
| 299 | BeOS*) LN="ln -s";; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 300 | CYGWIN*) LN="ln -s";; |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 301 | *) LN=ln;; |
| 302 | esac |
| 303 | fi |
| 304 | |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 305 | # Check for --with-pydebug |
| 306 | AC_MSG_CHECKING(for --with-pydebug) |
| 307 | AC_ARG_WITH(pydebug, |
| 308 | [ --with-pydebug build with Py_DEBUG defined], [ |
| 309 | if test "$withval" != no |
| 310 | then AC_DEFINE(Py_DEBUG) AC_MSG_RESULT(yes); Py_DEBUG='true' |
| 311 | else AC_MSG_RESULT(no); Py_DEBUG='false' |
| 312 | fi], |
| 313 | [AC_MSG_RESULT(no)]) |
| 314 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 315 | # Optimizer/debugger flags |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 316 | AC_SUBST(OPT) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 317 | if test -z "$OPT" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 318 | then |
Guido van Rossum | b5875b6 | 1997-07-18 23:29:09 +0000 | [diff] [blame] | 319 | case $GCC in |
| 320 | yes) |
| 321 | case $ac_cv_prog_cc_g in |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 322 | yes) |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 323 | if test "$Py_DEBUG" = 'true' ; then |
| 324 | # Optimization messes up debuggers, so turn it off for |
| 325 | # debug builds. |
| 326 | OPT="-g -Wall -Wstrict-prototypes" |
| 327 | else |
| 328 | OPT="-g -O3 -Wall -Wstrict-prototypes" |
| 329 | fi;; |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 330 | *) |
Fred Drake | 9f71582 | 2001-07-11 06:27:00 +0000 | [diff] [blame] | 331 | OPT="-O3 -Wall -Wstrict-prototypes";; |
| 332 | esac |
| 333 | ;; |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 334 | *) |
| 335 | case $ac_sys_system in |
| 336 | UnixWare*) |
| 337 | OPT="-O -K pentium,host,inline,loop_unroll,alloca ";; |
| 338 | *) |
| 339 | OPT="-O";; |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 340 | esac |
Guido van Rossum | 2242f2f | 2001-04-11 20:58:20 +0000 | [diff] [blame] | 341 | esac |
Jack Jansen | ca06bc6 | 2001-08-03 15:32:23 +0000 | [diff] [blame] | 342 | case $ac_sys_system in |
| 343 | Darwin*) |
| 344 | OPT="$OPT -no-cpp-precomp";; |
| 345 | esac |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 346 | fi |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 347 | |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 348 | # The current (beta) Monterey compiler dies with optimizations |
| 349 | case $ac_sys_system in |
| 350 | Monterey*) OPT="";; |
| 351 | esac |
| 352 | |
Guido van Rossum | 6f2260e | 1996-09-09 16:21:03 +0000 | [diff] [blame] | 353 | if test "$ac_arch_flags" |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 354 | then |
| 355 | OPT="$OPT $ac_arch_flags" |
| 356 | fi |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 357 | |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 358 | AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0) |
| 359 | AC_CACHE_VAL(ac_cv_opt_olimit_ok, |
| 360 | [ac_save_cc="$CC" |
| 361 | CC="$CC -OPT:Olimit=0" |
| 362 | AC_TRY_RUN([int main() { return 0; }], |
| 363 | ac_cv_opt_olimit_ok=yes, |
| 364 | ac_cv_opt_olimit_ok=no) |
| 365 | CC="$ac_save_cc"]) |
| 366 | AC_MSG_RESULT($ac_cv_opt_olimit_ok) |
Guido van Rossum | 2efa34b | 1997-10-23 17:43:11 +0000 | [diff] [blame] | 367 | if test $ac_cv_opt_olimit_ok = yes; then |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 368 | case $ac_sys_system in |
| 369 | Darwin*) OPT="$OPT" ;; |
| 370 | *) OPT="$OPT -OPT:Olimit=0";; |
| 371 | esac |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 372 | else |
| 373 | AC_MSG_CHECKING(whether $CC accepts -Olimit 1500) |
| 374 | AC_CACHE_VAL(ac_cv_olimit_ok, |
| 375 | [ac_save_cc="$CC" |
| 376 | CC="$CC -Olimit 1500" |
| 377 | AC_TRY_RUN([int main() { return 0; }], |
| 378 | ac_cv_olimit_ok=yes, |
| 379 | ac_cv_olimit_ok=no) |
| 380 | CC="$ac_save_cc"]) |
| 381 | AC_MSG_RESULT($ac_cv_olimit_ok) |
| 382 | if test $ac_cv_olimit_ok = yes; then |
| 383 | OPT="$OPT -Olimit 1500" |
| 384 | fi |
Guido van Rossum | 201afe5 | 1997-05-14 21:14:44 +0000 | [diff] [blame] | 385 | fi |
Guido van Rossum | f867812 | 1998-07-07 21:05:09 +0000 | [diff] [blame] | 386 | |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 387 | # -Kpthread, if available, provides the right #defines |
| 388 | # and linker options to make pthread_create available |
| 389 | AC_MSG_CHECKING(whether $CC accepts -Kpthread) |
| 390 | AC_CACHE_VAL(ac_cv_kpthread, |
| 391 | [ac_save_cc="$CC" |
| 392 | CC="$CC -Kpthread" |
| 393 | AC_TRY_LINK([#include <pthread.h>],[pthread_create(0,0,0,0)], |
| 394 | ac_cv_kpthread=yes, |
| 395 | ac_cv_kpthread=no) |
| 396 | CC="$ac_save_cc"]) |
| 397 | |
| 398 | # GCC does not reject -Kpthread as an illegal option, it merely complains that |
| 399 | # it is unrecognized |
| 400 | if test "$GCC" = "yes" |
| 401 | then ac_cv_kpthread="no, we have gcc" |
| 402 | fi |
| 403 | AC_MSG_RESULT($ac_cv_kpthread) |
| 404 | |
Fred Drake | ce81d59 | 2000-07-09 14:39:29 +0000 | [diff] [blame] | 405 | dnl # check for ANSI or K&R ("traditional") preprocessor |
| 406 | dnl AC_MSG_CHECKING(for C preprocessor type) |
| 407 | dnl AC_TRY_COMPILE([ |
| 408 | dnl #define spam(name, doc) {#name, &name, #name "() -- " doc} |
| 409 | dnl int foo; |
| 410 | dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something"); |
| 411 | dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional) |
| 412 | dnl AC_MSG_RESULT($cpp_type) |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 413 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 414 | # checks for header files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 415 | AC_HEADER_STDC |
Martin v. Löwis | 9b75dca | 2001-08-10 13:58:50 +0000 | [diff] [blame^] | 416 | AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h langinfo.h locale.h \ |
| 417 | ncurses.h poll.h pthread.h \ |
Eric S. Raymond | 1360359 | 2001-01-16 15:01:26 +0000 | [diff] [blame] | 418 | signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \ |
Fred Drake | 2ca5f3b | 2001-05-11 16:10:56 +0000 | [diff] [blame] | 419 | sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \ |
Andrew M. Kuchling | 881fd90 | 2001-07-14 20:55:52 +0000 | [diff] [blame] | 420 | sys/param.h sys/poll.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] | 421 | sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ |
Thomas Wouters | e38b2f1 | 2001-07-11 22:35:31 +0000 | [diff] [blame] | 422 | ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 423 | AC_HEADER_DIRENT |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 424 | |
| 425 | # checks for typedefs |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 426 | was_it_defined=no |
| 427 | AC_MSG_CHECKING(for clock_t in time.h) |
| 428 | AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, AC_DEFINE(clock_t, long)) |
| 429 | AC_MSG_RESULT($was_it_defined) |
| 430 | |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 431 | # Add some code to confdefs.h so that the test for off_t works on SCO |
| 432 | cat >> confdefs.h <<\EOF |
| 433 | #if defined(SCO_DS) |
| 434 | #undef _OFF_T |
| 435 | #endif |
| 436 | EOF |
| 437 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 438 | # Type availability checks |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 439 | AC_TYPE_MODE_T |
| 440 | AC_TYPE_OFF_T |
| 441 | AC_TYPE_PID_T |
| 442 | AC_TYPE_SIGNAL |
| 443 | AC_TYPE_SIZE_T |
| 444 | AC_TYPE_UID_T |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 445 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 446 | # Sizes of various common basic types |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 447 | AC_CHECK_SIZEOF(int) |
| 448 | AC_CHECK_SIZEOF(long) |
Guido van Rossum | fb4533c | 1998-10-02 14:39:42 +0000 | [diff] [blame] | 449 | AC_CHECK_SIZEOF(void *) |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 450 | AC_CHECK_SIZEOF(char) |
| 451 | AC_CHECK_SIZEOF(short) |
| 452 | AC_CHECK_SIZEOF(float) |
| 453 | AC_CHECK_SIZEOF(double) |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 454 | AC_CHECK_SIZEOF(fpos_t) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 455 | |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 456 | AC_MSG_CHECKING(for long long support) |
| 457 | have_long_long=no |
| 458 | AC_TRY_COMPILE([], [long long x; x = (long long)0;], AC_DEFINE(HAVE_LONG_LONG) have_long_long=yes) |
| 459 | AC_MSG_RESULT($have_long_long) |
Guido van Rossum | 8bc1dfd | 1999-04-10 16:01:48 +0000 | [diff] [blame] | 460 | if test "$have_long_long" = yes ; then |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 461 | AC_CHECK_SIZEOF(long long) |
| 462 | fi |
| 463 | |
Barry Warsaw | bc7c7f9 | 2000-08-18 04:53:33 +0000 | [diff] [blame] | 464 | AC_MSG_CHECKING(for uintptr_t support) |
| 465 | have_uintptr_t=no |
| 466 | AC_TRY_COMPILE([], [uintptr_t x; x = (uintptr_t)0;], AC_DEFINE(HAVE_UINTPTR_T) have_uintptr_t=yes) |
| 467 | AC_MSG_RESULT($have_uintptr_t) |
| 468 | if test "$have_uintptr_t" = yes ; then |
| 469 | AC_CHECK_SIZEOF(uintptr_t) |
| 470 | fi |
| 471 | |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 472 | # Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>. |
| 473 | AC_MSG_CHECKING(size of off_t) |
| 474 | AC_CACHE_VAL(ac_cv_sizeof_off_t, |
| 475 | [AC_TRY_RUN([#include <stdio.h> |
| 476 | #include <sys/types.h> |
| 477 | main() |
| 478 | { |
| 479 | FILE *f=fopen("conftestval", "w"); |
| 480 | if (!f) exit(1); |
| 481 | fprintf(f, "%d\n", sizeof(off_t)); |
| 482 | exit(0); |
| 483 | }], ac_cv_sizeof_off_t=`cat conftestval`, ac_cv_sizeof_off_t=0) |
| 484 | ]) |
| 485 | AC_MSG_RESULT($ac_cv_sizeof_off_t) |
| 486 | AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t) |
| 487 | |
| 488 | AC_MSG_CHECKING(whether to enable large file support) |
Guido van Rossum | 8bc1dfd | 1999-04-10 16:01:48 +0000 | [diff] [blame] | 489 | if test "$have_long_long" = yes -a \ |
| 490 | "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ |
| 491 | "$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] | 492 | AC_DEFINE(HAVE_LARGEFILE_SUPPORT) |
| 493 | AC_MSG_RESULT(yes) |
| 494 | else |
| 495 | AC_MSG_RESULT(no) |
| 496 | fi |
| 497 | |
Fred Drake | a3f6e91 | 2000-06-29 20:44:47 +0000 | [diff] [blame] | 498 | # AC_CHECK_SIZEOF() doesn't include <time.h>. |
| 499 | AC_MSG_CHECKING(size of time_t) |
| 500 | AC_CACHE_VAL(ac_cv_sizeof_time_t, |
| 501 | [AC_TRY_RUN([#include <stdio.h> |
| 502 | #include <time.h> |
| 503 | main() |
| 504 | { |
| 505 | FILE *f=fopen("conftestval", "w"); |
| 506 | if (!f) exit(1); |
| 507 | fprintf(f, "%d\n", sizeof(time_t)); |
| 508 | exit(0); |
| 509 | }], ac_cv_sizeof_time_t=`cat conftestval`, ac_cv_sizeof_time_t=0) |
| 510 | ]) |
| 511 | AC_MSG_RESULT($ac_cv_sizeof_time_t) |
| 512 | AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t) |
| 513 | |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 514 | |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 515 | # if have pthread_t then define SIZEOF_PTHREAD_T |
Martin v. Löwis | 123cbd2 | 2001-07-19 14:21:10 +0000 | [diff] [blame] | 516 | ac_save_cc="$CC" |
| 517 | if test "$ac_cv_kpthread" = "yes" |
| 518 | then CC="$CC -Kpthread" |
| 519 | fi |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 520 | AC_MSG_CHECKING(for pthread_t) |
| 521 | have_pthread_t=no |
Guido van Rossum | 1258049 | 2000-09-24 16:47:19 +0000 | [diff] [blame] | 522 | 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] | 523 | AC_MSG_RESULT($have_pthread_t) |
| 524 | if test "$have_pthread_t" = yes ; then |
| 525 | # AC_CHECK_SIZEOF() doesn't include <pthread.h>. |
| 526 | AC_MSG_CHECKING(size of pthread_t) |
| 527 | AC_CACHE_VAL(ac_cv_sizeof_pthread_t, |
| 528 | [AC_TRY_RUN([#include <stdio.h> |
| 529 | #include <pthread.h> |
| 530 | main() |
| 531 | { |
| 532 | FILE *f=fopen("conftestval", "w"); |
| 533 | if (!f) exit(1); |
| 534 | fprintf(f, "%d\n", sizeof(pthread_t)); |
| 535 | exit(0); |
| 536 | }], ac_cv_sizeof_pthread_t=`cat conftestval`, ac_cv_sizeof_pthread_t=0) |
| 537 | ]) |
| 538 | AC_MSG_RESULT($ac_cv_sizeof_pthread_t) |
| 539 | AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t) |
| 540 | fi |
Martin v. Löwis | 123cbd2 | 2001-07-19 14:21:10 +0000 | [diff] [blame] | 541 | CC="$ac_save_cc" |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 542 | |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 543 | # Minor variations in building a framework between NextStep versions 4 and 5 |
| 544 | AC_SUBST(LIBTOOL_CRUFT) |
| 545 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 546 | Darwin/*) |
| 547 | ns_undef_sym='_environ' |
Jack Jansen | ca06bc6 | 2001-08-03 15:32:23 +0000 | [diff] [blame] | 548 | LIBTOOL_CRUFT="-framework Foundation -framework Carbon -lcc_dynamic -arch_only ppc -U $ns_undef_sym" ;; |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 549 | next/4*) |
| 550 | ns_undef_sym='__environ' |
| 551 | LIBTOOL_CRUFT="-U $ns_undef_sym" ;; |
| 552 | next/5*) |
| 553 | ns_undef_sym='_environ' |
| 554 | LIBTOOL_CRUFT="-lcc_dynamic -U $ns_undef_sym" ;; |
| 555 | esac |
| 556 | |
| 557 | AC_MSG_CHECKING(for --with-next-framework) |
| 558 | if test "$with_next_framework" |
| 559 | then |
Jack Jansen | ca06bc6 | 2001-08-03 15:32:23 +0000 | [diff] [blame] | 560 | OPT="$OPT -fno-common -dynamic" |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 561 | # -U __environ is needed since bundles don't have access |
| 562 | # to crt0 when built but will always be linked against it |
| 563 | LDFLAGS="$LDFLAGS -Wl,-U,$ns_undef_sym" |
| 564 | AC_DEFINE(WITH_NEXT_FRAMEWORK) |
| 565 | AC_MSG_RESULT(yes) |
| 566 | else |
| 567 | AC_MSG_RESULT(no) |
| 568 | fi |
| 569 | |
| 570 | AC_MSG_CHECKING(for --with-dyld) |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 571 | case $ac_sys_system/$ac_sys_release in |
| 572 | Darwin/*) |
| 573 | AC_DEFINE(WITH_DYLD) |
| 574 | AC_MSG_RESULT(always on for Darwin) |
| 575 | ;; |
| 576 | *) |
| 577 | if test "$with_next_framework" -o "$with_dyld" |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 578 | then |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 579 | if test "$with_dyld" |
| 580 | then |
| 581 | AC_MSG_RESULT(yes) |
| 582 | else |
| 583 | AC_MSG_RESULT(required for framework build) |
| 584 | fi |
| 585 | AC_DEFINE(WITH_DYLD) |
| 586 | ns_dyld='set' |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 587 | else |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 588 | AC_MSG_RESULT(no) |
| 589 | fi ;; |
| 590 | esac |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 591 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 592 | # Set info about shared libraries. |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 593 | AC_SUBST(SO) |
| 594 | AC_SUBST(LDSHARED) |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 595 | AC_SUBST(BLDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 596 | AC_SUBST(CCSHARED) |
| 597 | AC_SUBST(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 598 | # SO is the extension of shared libraries `(including the dot!) |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 599 | # -- usually .so, .sl on HP-UX, .dll on Cygwin |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 600 | AC_MSG_CHECKING(SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 601 | if test -z "$SO" |
| 602 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 603 | case $ac_sys_system in |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 604 | hp*|HP*) SO=.sl;; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 605 | CYGWIN*) SO=.dll;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 606 | *) SO=.so;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 607 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 608 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 609 | AC_MSG_RESULT($SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 610 | # LDSHARED is the ld *command* used to create shared library |
| 611 | # -- "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] | 612 | # (Shared libraries in this instance are shared modules to be loaded into |
| 613 | # Python, as opposed to building Python itself as a shared library.) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 614 | AC_MSG_CHECKING(LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 615 | if test -z "$LDSHARED" |
| 616 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 617 | case $ac_sys_system/$ac_sys_release in |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 618 | AIX*) |
| 619 | BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp" |
| 620 | LDSHARED="\$(BINLIBDEST)/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/python.exp" |
| 621 | ;; |
| 622 | BeOS*) |
| 623 | BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY" |
| 624 | LDSHARED="\$(BINLIBDEST)/ld_so_beos \$(LIBDIR)/$LDLIBRARY" |
| 625 | ;; |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 626 | IRIX/5*) LDSHARED="ld -shared";; |
Guido van Rossum | 9192267 | 1997-10-09 20:24:13 +0000 | [diff] [blame] | 627 | IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 628 | SunOS/4*) LDSHARED="ld";; |
Greg Ward | 57c9a66 | 2000-05-26 12:22:54 +0000 | [diff] [blame] | 629 | SunOS/5*) |
| 630 | if test "$GCC" = "yes" |
Neil Schemenauer | 9505272 | 2001-02-19 18:17:33 +0000 | [diff] [blame] | 631 | then LDSHARED='$(CC) -shared' |
Greg Ward | 57c9a66 | 2000-05-26 12:22:54 +0000 | [diff] [blame] | 632 | else LDSHARED="ld -G"; |
| 633 | fi ;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 634 | hp*|HP*) LDSHARED="ld -b";; |
Guido van Rossum | 71001e4 | 1995-01-26 00:44:03 +0000 | [diff] [blame] | 635 | OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 636 | DYNIX/ptx*) LDSHARED="ld -G";; |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 637 | Darwin/*) |
| 638 | LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' |
| 639 | if test "$with_next_framework" ; then |
| 640 | LDSHARED="$LDSHARED \$(LDLIBRARY)" |
| 641 | fi ;; |
| 642 | next/*) |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 643 | if test "$ns_dyld" |
Guido van Rossum | acb14c7 | 2001-01-10 21:41:16 +0000 | [diff] [blame] | 644 | then LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined suppress' |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 645 | else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r'; |
| 646 | fi |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 647 | if test "$with_next_framework" ; then |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 648 | LDSHARED="$LDSHARED \$(LDLIBRARY)" |
| 649 | fi ;; |
Guido van Rossum | 81652ab | 1996-07-21 02:53:27 +0000 | [diff] [blame] | 650 | Linux*) LDSHARED="gcc -shared";; |
Guido van Rossum | 3c4bb80 | 1997-12-18 23:55:32 +0000 | [diff] [blame] | 651 | dgux*) LDSHARED="ld -G";; |
Guido van Rossum | 458e7fa | 1999-09-17 15:40:40 +0000 | [diff] [blame] | 652 | BSD/OS*/4*) LDSHARED="gcc -shared";; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 653 | OpenBSD*) LDSHARED="ld -Bshareable";; |
Guido van Rossum | df69365 | 1999-01-07 21:50:41 +0000 | [diff] [blame] | 654 | NetBSD*) |
| 655 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
| 656 | then |
| 657 | LDSHARED="cc -shared" |
| 658 | else |
| 659 | LDSHARED="ld -Bshareable" |
| 660 | fi;; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 661 | FreeBSD*) |
Jeremy Hylton | 4bcc7c5 | 2000-08-31 17:45:35 +0000 | [diff] [blame] | 662 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 663 | then |
| 664 | LDSHARED="cc -shared ${LDFLAGS}" |
| 665 | else |
| 666 | LDSHARED="ld -Bshareable ${LDFLAGS}" |
| 667 | fi;; |
Martin v. Löwis | bec1958 | 2001-03-21 15:57:54 +0000 | [diff] [blame] | 668 | UnixWare*) |
| 669 | if test "$GCC" = "yes" |
| 670 | then LDSHARED="$(CC) -shared" |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 671 | else LDSHARED="$(CC) -G" |
Martin v. Löwis | bec1958 | 2001-03-21 15:57:54 +0000 | [diff] [blame] | 672 | fi;; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 673 | SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 674 | Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 675 | CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 676 | *) LDSHARED="ld";; |
| 677 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 678 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 679 | AC_MSG_RESULT($LDSHARED) |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 680 | BLDSHARED=${BLDSHARED-$LDSHARED} |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 681 | # 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] | 682 | # library (module) -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 683 | AC_MSG_CHECKING(CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 684 | if test -z "$CCSHARED" |
| 685 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 686 | case $ac_sys_system/$ac_sys_release in |
Neil Schemenauer | 6625216 | 2001-02-19 04:47:42 +0000 | [diff] [blame] | 687 | SunOS*) if test "$GCC" = yes; |
| 688 | then CCSHARED="-fPIC"; |
| 689 | fi;; |
Guido van Rossum | af07a44 | 1995-02-13 19:45:27 +0000 | [diff] [blame] | 690 | hp*|HP*) if test "$GCC" = yes; |
| 691 | then CCSHARED="-fpic"; |
| 692 | else CCSHARED="+z"; |
| 693 | fi;; |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 694 | Linux*) CCSHARED="-fPIC";; |
Guido van Rossum | f5957ea | 1999-10-05 21:59:33 +0000 | [diff] [blame] | 695 | BSD/OS*/4*) CCSHARED="-fpic";; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 696 | OpenBSD*) CCSHARED="-fpic";; |
| 697 | FreeBSD*|NetBSD*) CCSHARED="-fPIC";; |
Martin v. Löwis | bec1958 | 2001-03-21 15:57:54 +0000 | [diff] [blame] | 698 | UnixWare*) |
| 699 | if test "$GCC" = "yes" |
| 700 | then CCSHARED="-fPIC" |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 701 | else CCSHARED="-KPIC" |
Martin v. Löwis | bec1958 | 2001-03-21 15:57:54 +0000 | [diff] [blame] | 702 | fi;; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 703 | SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";; |
Trent Mick | 635f6fb | 2000-08-23 21:33:05 +0000 | [diff] [blame] | 704 | Monterey*) CCSHARED="-G";; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 705 | IRIX*/6*) case $CC in |
| 706 | *gcc*) CCSHARED="-shared";; |
Guido van Rossum | ee21f41 | 1998-04-20 18:51:54 +0000 | [diff] [blame] | 707 | *) CCSHARED="";; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 708 | esac;; |
Guido van Rossum | aef734b | 2001-01-10 21:09:12 +0000 | [diff] [blame] | 709 | CYGWIN*) CCSHARED="-DUSE_DL_IMPORT";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 710 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 711 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 712 | AC_MSG_RESULT($CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 713 | # LINKFORSHARED are the flags passed to the $(CC) command that links |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 714 | # the python executable -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 715 | AC_MSG_CHECKING(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 716 | if test -z "$LINKFORSHARED" |
| 717 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 718 | case $ac_sys_system/$ac_sys_release in |
Neil Schemenauer | b3531b8 | 2001-02-16 04:09:05 +0000 | [diff] [blame] | 719 | AIX*) LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';; |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 720 | hp*|HP*) |
Guido van Rossum | 304dd2d | 1997-10-20 23:10:56 +0000 | [diff] [blame] | 721 | LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; |
Guido van Rossum | f5957ea | 1999-10-05 21:59:33 +0000 | [diff] [blame] | 722 | BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; |
Guido van Rossum | 2d9feed | 1997-11-24 17:36:21 +0000 | [diff] [blame] | 723 | Linux*) LINKFORSHARED="-Xlinker -export-dynamic";; |
Guido van Rossum | 54ecc3d | 1999-01-27 17:53:11 +0000 | [diff] [blame] | 724 | # -u libsys_s pulls in all symbols in libsys |
| 725 | next/2*|next/3*) LINKFORSHARED="-u libsys_s";; |
| 726 | # -u __dummy makes the linker aware of the objc runtime |
| 727 | # in System.framework; otherwise, __objcInit (referenced in |
| 728 | # crt1.o) gets erroneously defined as common, which breaks dynamic |
| 729 | # loading of any modules which reference it in System.framework |
| 730 | next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;; |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 731 | Darwin/*) LINKFORSHARED="-u __dummy -u _PyMac_Error -framework System -framework Foundation -framework Carbon" ;; |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 732 | UnixWare*) LINKFORSHARED="-Wl,-Bexport";; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 733 | SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; |
Fred Drake | 02706f5 | 2000-09-25 15:08:46 +0000 | [diff] [blame] | 734 | ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";; |
Guido van Rossum | 0286ae8 | 2000-08-29 15:06:49 +0000 | [diff] [blame] | 735 | FreeBSD*|NetBSD*) |
Guido van Rossum | df69365 | 1999-01-07 21:50:41 +0000 | [diff] [blame] | 736 | if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] |
| 737 | then |
| 738 | LINKFORSHARED="-Wl,--export-dynamic" |
| 739 | fi;; |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 740 | SunOS/5*) case $CC in |
| 741 | *gcc*) |
Guido van Rossum | 9c6ba9b | 2000-02-03 13:42:50 +0000 | [diff] [blame] | 742 | if $CC -Xlinker -V 2>&1 | grep BFD >/dev/null |
Guido van Rossum | 8f4ceb1 | 1997-12-18 23:42:19 +0000 | [diff] [blame] | 743 | then |
| 744 | LINKFORSHARED="-Xlinker --export-dynamic" |
Guido van Rossum | 2b5ca00 | 1998-03-05 15:41:09 +0000 | [diff] [blame] | 745 | fi;; |
| 746 | esac;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 747 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 748 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 749 | AC_MSG_RESULT($LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 750 | |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 751 | AC_SUBST(CFLAGSFORSHARED) |
| 752 | AC_MSG_CHECKING(CFLAGSFORSHARED) |
| 753 | if test ! "$LIBRARY" = "$LDLIBRARY" |
| 754 | then |
Neil Schemenauer | d9cf41c | 2001-01-27 21:39:17 +0000 | [diff] [blame] | 755 | case $ac_sys_system in |
| 756 | CYGWIN*) |
| 757 | # Cygwin needs CCSHARED when building extension DLLs |
| 758 | # but not when building the interpreter DLL. |
| 759 | CFLAGSFORSHARED='';; |
| 760 | *) |
| 761 | CFLAGSFORSHARED='$(CCSHARED)' |
| 762 | esac |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 763 | fi |
| 764 | AC_MSG_RESULT($CFLAGSFORSHARED) |
| 765 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 766 | # checks for libraries |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 767 | AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV |
| 768 | AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX |
Guido van Rossum | 0eefa3f | 1999-11-16 15:57:37 +0000 | [diff] [blame] | 769 | |
| 770 | # checks for system dependent C++ extensions support |
| 771 | case "$ac_sys_system" in |
| 772 | AIX*) AC_MSG_CHECKING(for genuine AIX C++ extensions support) |
| 773 | AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"], |
| 774 | [loadAndInit("", 0, "")], |
| 775 | [AC_DEFINE(AIX_GENUINE_CPLUSPLUS) |
| 776 | AC_MSG_RESULT(yes)], |
| 777 | [AC_MSG_RESULT(no)]);; |
| 778 | *) ;; |
| 779 | esac |
| 780 | |
Guido van Rossum | 70c7f48 | 1998-03-26 18:44:10 +0000 | [diff] [blame] | 781 | # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. |
| 782 | # However on SGI IRIX, these exist but are broken. |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 783 | # BeOS' sockets are stashed in libnet. |
| 784 | case "$ac_sys_system" in |
| 785 | IRIX*) ;; |
Guido van Rossum | 2cb5660 | 1998-05-07 13:25:56 +0000 | [diff] [blame] | 786 | *) |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 787 | AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 788 | AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets |
Jeremy Hylton | cb25d5e | 2000-07-27 21:23:28 +0000 | [diff] [blame] | 789 | ;; |
| 790 | esac |
| 791 | case "$ac_sys_system" in |
| 792 | BeOS*) |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 793 | AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS |
| 794 | ;; |
| 795 | esac |
Guido van Rossum | 70c7f48 | 1998-03-26 18:44:10 +0000 | [diff] [blame] | 796 | |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 797 | AC_MSG_CHECKING(for --with-libs) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 798 | AC_ARG_WITH(libs, |
| 799 | [ --with-libs='lib1 ...' link against additional libs], [ |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 800 | AC_MSG_RESULT($withval) |
| 801 | LIBS="$withval $LIBS" |
| 802 | ], AC_MSG_RESULT(no)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 803 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 804 | # Determine if signalmodule should be used. |
| 805 | AC_SUBST(USE_SIGNAL_MODULE) |
| 806 | AC_SUBST(SIGNAL_OBJS) |
| 807 | AC_MSG_CHECKING(for --with-signal-module) |
| 808 | AC_ARG_WITH(signal-module, |
| 809 | [ --with-signal-module disable/enable signal module]) |
| 810 | |
| 811 | if test -z "$with_signal_module" |
| 812 | then with_signal_module="yes" |
| 813 | fi |
| 814 | AC_MSG_RESULT($with_signal_module) |
| 815 | |
| 816 | if test "${with_signal_module}" = "yes"; then |
| 817 | USE_SIGNAL_MODULE="" |
| 818 | SIGNAL_OBJS="" |
| 819 | else |
| 820 | USE_SIGNAL_MODULE="#" |
| 821 | SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o" |
| 822 | fi |
| 823 | |
Guido van Rossum | 3d15bd8 | 2001-01-10 18:53:48 +0000 | [diff] [blame] | 824 | # This is used to generate Setup.config |
Guido van Rossum | 009f787 | 1997-12-04 00:51:42 +0000 | [diff] [blame] | 825 | AC_SUBST(USE_THREAD_MODULE) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 826 | USE_THREAD_MODULE="" |
Guido van Rossum | 009f787 | 1997-12-04 00:51:42 +0000 | [diff] [blame] | 827 | |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 828 | AC_MSG_CHECKING(for --with-dec-threads) |
| 829 | AC_SUBST(LDLAST) |
| 830 | AC_ARG_WITH(dec-threads, |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 831 | [ --with-dec-threads use DEC Alpha/OSF1 thread-safe libraries], [ |
| 832 | AC_MSG_RESULT($withval) |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 833 | LDLAST=-threads |
Guido van Rossum | f78abae | 1997-01-21 22:02:36 +0000 | [diff] [blame] | 834 | if test "${with_thread+set}" != set; then |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 835 | with_thread="$withval"; |
| 836 | fi], |
| 837 | AC_MSG_RESULT(no)) |
| 838 | |
| 839 | AC_MSG_CHECKING(for --with-threads) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 840 | AC_ARG_WITH(threads, |
| 841 | [ --with(out)-threads[=DIRECTORY] disable/enable thread support]) |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 842 | |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 843 | # --with-thread is deprecated, but check for it anyway |
Barry Warsaw | a0f3c5c | 2000-06-30 16:39:35 +0000 | [diff] [blame] | 844 | AC_ARG_WITH(thread, |
| 845 | [ --with(out)-thread[=DIRECTORY] deprecated; use --with(out)-threads],[ |
| 846 | with_threads=$with_thread]) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 847 | |
| 848 | if test -z "$with_threads" |
| 849 | then with_threads="yes" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 850 | fi |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 851 | AC_MSG_RESULT($with_threads) |
Guido van Rossum | 6400c26 | 1997-05-22 20:34:27 +0000 | [diff] [blame] | 852 | |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 853 | if test "$with_threads" = "no" |
| 854 | then |
| 855 | USE_THREAD_MODULE="#" |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 856 | elif test "$ac_cv_kpthread" = "yes" |
| 857 | then |
| 858 | CC="$CC -Kpthread" |
| 859 | AC_DEFINE(WITH_THREAD) |
| 860 | AC_DEFINE(_POSIX_THREADS) |
| 861 | LIBOBJS="$LIBOBJS thread.o" |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 862 | else |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 863 | if test ! -z "$with_threads" -a -d "$with_threads" |
| 864 | then LDFLAGS="$LDFLAGS -L$with_threads" |
| 865 | fi |
| 866 | if test ! -z "$withval" -a -d "$withval" |
| 867 | then LDFLAGS="$LDFLAGS -L$withval" |
| 868 | fi |
| 869 | AC_DEFINE(_REENTRANT) |
| 870 | AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD) |
| 871 | AC_DEFINE(C_THREADS) |
| 872 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 873 | AC_MSG_CHECKING(for --with-pth) |
| 874 | AC_ARG_WITH(pth, |
| 875 | [ --with-pth use GNU pth threading libraries], [ |
| 876 | AC_MSG_RESULT($withval) |
| 877 | AC_DEFINE(WITH_THREAD) |
| 878 | AC_DEFINE(HAVE_PTH) |
| 879 | LIBS="-lpth $LIBS" |
| 880 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 881 | AC_MSG_RESULT(no) |
| 882 | AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 883 | case $ac_sys_system in |
| 884 | Darwin*) ;; |
| 885 | *) AC_DEFINE(_POSIX_THREADS);; |
| 886 | esac |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 887 | LIBS="-lpthread $LIBS" |
| 888 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 889 | AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD) |
| 890 | case $ac_sys_system in |
| 891 | Darwin*) ;; |
| 892 | *) AC_DEFINE(_POSIX_THREADS);; |
| 893 | esac |
| 894 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 895 | AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD) |
| 896 | AC_DEFINE(BEOS_THREADS) |
| 897 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 898 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 899 | AC_DEFINE(_POSIX_THREADS) |
| 900 | LIBS="$LIBS -lpthreads" |
| 901 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 902 | AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 903 | AC_DEFINE(_POSIX_THREADS) |
| 904 | LIBS="$LIBS -lc_r" |
| 905 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 906 | AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD) |
| 907 | AC_DEFINE(_POSIX_THREADS) |
| 908 | LIBS="$LIBS -lthread" |
| 909 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 910 | AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD) |
| 911 | AC_DEFINE(_POSIX_THREADS) |
| 912 | LIBS="$LIBS -lpthread" |
| 913 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 914 | AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 915 | AC_DEFINE(_POSIX_THREADS) |
| 916 | LIBS="$LIBS -lcma" |
| 917 | LIBOBJS="$LIBOBJS thread.o"],[ |
| 918 | USE_THREAD_MODULE="#"]) |
| 919 | ])])])])])])])])]) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 920 | |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 921 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) |
| 922 | LIBS="$LIBS -lmpc" |
| 923 | LIBOBJS="$LIBOBJS thread.o" |
| 924 | USE_THREAD_MODULE=""]) |
| 925 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) |
| 926 | LIBS="$LIBS -lthread" |
| 927 | LIBOBJS="$LIBOBJS thread.o" |
| 928 | USE_THREAD_MODULE=""]) |
Jeremy Hylton | 1a2ca86 | 2000-10-16 16:59:12 +0000 | [diff] [blame] | 929 | |
Martin v. Löwis | 130fb17 | 2001-07-19 11:00:41 +0000 | [diff] [blame] | 930 | if test "$USE_THREAD_MODULE" != "#" |
| 931 | then |
| 932 | # If the above checks didn't disable threads, (at least) OSF1 |
| 933 | # needs this '-threads' argument during linking. |
| 934 | case $ac_sys_system in |
| 935 | OSF1) LDLAST=-threads;; |
| 936 | esac |
Jeremy Hylton | 1a2ca86 | 2000-10-16 16:59:12 +0000 | [diff] [blame] | 937 | fi |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 938 | fi |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 939 | |
Martin v. Löwis | a2ac602 | 2001-08-09 11:40:14 +0000 | [diff] [blame] | 940 | # Check for enable-ipv6 |
| 941 | AC_MSG_CHECKING([whether to enable ipv6]) |
| 942 | AC_ARG_ENABLE(ipv6, |
| 943 | [ --enable-ipv6 Enable ipv6 (with ipv4) support |
| 944 | --disable-ipv6 Disable ipv6 support], |
| 945 | [ case "$enableval" in |
| 946 | no) |
| 947 | AC_MSG_RESULT(no) |
| 948 | ipv6=no |
| 949 | ;; |
| 950 | *) AC_MSG_RESULT(yes) |
| 951 | AC_DEFINE(ENABLE_IPV6) |
| 952 | ipv6=yes |
| 953 | ;; |
| 954 | esac ], |
| 955 | |
| 956 | AC_TRY_RUN([ /* AF_INET6 available check */ |
| 957 | #include <sys/types.h> |
| 958 | #include <sys/socket.h> |
| 959 | main() |
| 960 | { |
| 961 | if (socket(AF_INET6, SOCK_STREAM, 0) < 0) |
| 962 | exit(1); |
| 963 | else |
| 964 | exit(0); |
| 965 | } |
| 966 | ], |
| 967 | AC_MSG_RESULT(yes) |
| 968 | AC_DEFINE(ENABLE_IPV6) |
| 969 | ipv6=yes, |
| 970 | AC_MSG_RESULT(no) |
| 971 | ipv6=no, |
| 972 | AC_MSG_RESULT(no) |
| 973 | ipv6=no |
| 974 | )) |
| 975 | |
| 976 | ipv6type=unknown |
| 977 | ipv6lib=none |
| 978 | ipv6trylibc=no |
| 979 | |
| 980 | if test "$ipv6" = "yes"; then |
| 981 | AC_MSG_CHECKING([ipv6 stack type]) |
| 982 | for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do |
| 983 | case $i in |
| 984 | inria) |
| 985 | dnl http://www.kame.net/ |
| 986 | AC_EGREP_CPP(yes, [dnl |
| 987 | #include <netinet/in.h> |
| 988 | #ifdef IPV6_INRIA_VERSION |
| 989 | yes |
| 990 | #endif], |
| 991 | [ipv6type=$i; |
| 992 | OPT="-DINET6 $OPT"]) |
| 993 | ;; |
| 994 | kame) |
| 995 | dnl http://www.kame.net/ |
| 996 | AC_EGREP_CPP(yes, [dnl |
| 997 | #include <netinet/in.h> |
| 998 | #ifdef __KAME__ |
| 999 | yes |
| 1000 | #endif], |
| 1001 | [ipv6type=$i; |
| 1002 | ipv6lib=inet6 |
| 1003 | ipv6libdir=/usr/local/v6/lib |
| 1004 | ipv6trylibc=yes |
| 1005 | OPT="-DINET6 $OPT"]) |
| 1006 | ;; |
| 1007 | linux-glibc) |
| 1008 | dnl http://www.v6.linux.or.jp/ |
| 1009 | AC_EGREP_CPP(yes, [dnl |
| 1010 | #include <features.h> |
| 1011 | #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)) |
| 1012 | yes |
| 1013 | #endif], |
| 1014 | [ipv6type=$i; |
| 1015 | ipv6trylibc=yes |
| 1016 | OPT="-DINET6 $OPT"]) |
| 1017 | ;; |
| 1018 | linux-inet6) |
| 1019 | dnl http://www.v6.linux.or.jp/ |
| 1020 | if test -d /usr/inet6; then |
| 1021 | ipv6type=$i |
| 1022 | ipv6lib=inet6 |
| 1023 | ipv6libdir=/usr/inet6/lib |
| 1024 | OPT="-DINET6 -I/usr/inet6/include $OPT" |
| 1025 | fi |
| 1026 | ;; |
| 1027 | solaris) |
| 1028 | if test -f /etc/netconfig; then |
| 1029 | if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then |
| 1030 | ipv6type=$i |
| 1031 | ipv6trylibc=yes |
| 1032 | OPT="-DINET6 $OPT" |
| 1033 | fi |
| 1034 | fi |
| 1035 | ;; |
| 1036 | toshiba) |
| 1037 | AC_EGREP_CPP(yes, [dnl |
| 1038 | #include <sys/param.h> |
| 1039 | #ifdef _TOSHIBA_INET6 |
| 1040 | yes |
| 1041 | #endif], |
| 1042 | [ipv6type=$i; |
| 1043 | ipv6lib=inet6; |
| 1044 | ipv6libdir=/usr/local/v6/lib; |
| 1045 | OPT="-DINET6 $OPT"]) |
| 1046 | ;; |
| 1047 | v6d) |
| 1048 | AC_EGREP_CPP(yes, [dnl |
| 1049 | #include </usr/local/v6/include/sys/v6config.h> |
| 1050 | #ifdef __V6D__ |
| 1051 | yes |
| 1052 | #endif], |
| 1053 | [ipv6type=$i; |
| 1054 | ipv6lib=v6; |
| 1055 | ipv6libdir=/usr/local/v6/lib; |
| 1056 | OPT="-I/usr/local/v6/include $OPT"]) |
| 1057 | ;; |
| 1058 | zeta) |
| 1059 | AC_EGREP_CPP(yes, [dnl |
| 1060 | #include <sys/param.h> |
| 1061 | #ifdef _ZETA_MINAMI_INET6 |
| 1062 | yes |
| 1063 | #endif], |
| 1064 | [ipv6type=$i; |
| 1065 | ipv6lib=inet6; |
| 1066 | ipv6libdir=/usr/local/v6/lib; |
| 1067 | OPT="-DINET6 $OPT"]) |
| 1068 | ;; |
| 1069 | esac |
| 1070 | if test "$ipv6type" != "unknown"; then |
| 1071 | break |
| 1072 | fi |
| 1073 | done |
| 1074 | AC_MSG_RESULT($ipv6type) |
| 1075 | fi |
| 1076 | |
| 1077 | if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then |
| 1078 | if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then |
| 1079 | LIBS="-L$ipv6libdir -l$ipv6lib $LIBS" |
| 1080 | echo "using lib$ipv6lib" |
| 1081 | else |
| 1082 | if test $ipv6trylibc = "yes"; then |
| 1083 | echo "using libc" |
| 1084 | else |
| 1085 | echo 'Fatal: no $ipv6lib library found. cannot continue.' |
| 1086 | echo "You need to fetch lib$ipv6lib.a from appropriate" |
| 1087 | echo 'ipv6 kit and compile beforehand.' |
| 1088 | exit 1 |
| 1089 | fi |
| 1090 | fi |
| 1091 | fi |
| 1092 | |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 1093 | # Check for GC support |
| 1094 | AC_SUBST(USE_GC_MODULE) |
| 1095 | USE_GC_MODULE="" |
| 1096 | AC_MSG_CHECKING(for --with-cycle-gc) |
| 1097 | AC_ARG_WITH(cycle-gc, |
| 1098 | [ --with(out)-cycle-gc disable/enable garbage collection]) |
| 1099 | |
| 1100 | if test -z "$with_cycle_gc" |
| 1101 | then with_cycle_gc="yes" |
| 1102 | fi |
| 1103 | if test "$with_cycle_gc" = "no" |
| 1104 | then |
| 1105 | USE_GC_MODULE="#" |
| 1106 | else |
| 1107 | AC_DEFINE(WITH_CYCLE_GC) |
| 1108 | fi |
| 1109 | AC_MSG_RESULT($with_cycle_gc) |
| 1110 | |
Neil Schemenauer | a35c688 | 2001-02-27 04:45:05 +0000 | [diff] [blame] | 1111 | # Check for Python-specific malloc support |
| 1112 | AC_MSG_CHECKING(for --with-pymalloc) |
| 1113 | AC_ARG_WITH(pymalloc, |
| 1114 | [ --with(out)-pymalloc disable/enable specialized mallocs], [ |
| 1115 | if test "$withval" != no |
| 1116 | then AC_DEFINE(WITH_PYMALLOC) AC_MSG_RESULT(yes) |
| 1117 | else AC_MSG_RESULT(no) |
| 1118 | fi], |
| 1119 | [AC_MSG_RESULT(no)]) |
| 1120 | |
Barry Warsaw | ef82cd7 | 2000-06-30 16:21:01 +0000 | [diff] [blame] | 1121 | # Check for --with-wctype-functions |
| 1122 | AC_MSG_CHECKING(for --with-wctype-functions) |
| 1123 | AC_ARG_WITH(wctype-functions, |
| 1124 | [ --with-wctype-functions use wctype.h functions], [ |
| 1125 | if test "$withval" != no |
| 1126 | then AC_DEFINE(WANT_WCTYPE_FUNCTIONS) AC_MSG_RESULT(yes) |
| 1127 | else AC_MSG_RESULT(no) |
| 1128 | fi], |
| 1129 | [AC_MSG_RESULT(no)]) |
| 1130 | |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 1131 | # -I${DLINCLDIR} is added to the compile rule for importdl.o |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1132 | AC_SUBST(DLINCLDIR) |
| 1133 | DLINCLDIR=/ |
| 1134 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1135 | AC_MSG_CHECKING(for --with-sgi-dl) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1136 | AC_ARG_WITH(sgi-dl, |
| 1137 | [ --with-sgi-dl=DIRECTORY IRIX 4 dynamic linking], [ |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1138 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1139 | AC_DEFINE(WITH_SGI_DL) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 1140 | DYNLOADFILE="dynload_dl.o" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1141 | dldir=$withval |
Guido van Rossum | 4095101 | 2000-10-07 16:21:27 +0000 | [diff] [blame] | 1142 | if test ! -z "$dldir" -a -d "$dldir" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 1143 | then LDFLAGS="$LDFLAGS -L$dldir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1144 | else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY) |
| 1145 | fi |
| 1146 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1147 | LIBS="$LIBS -ldl -lmld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1148 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1149 | AC_MSG_CHECKING(for --with-dl-dld) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1150 | 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] | 1151 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1152 | AC_DEFINE(WITH_DL_DLD) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 1153 | DYNLOADFILE="dynload_dl.o" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1154 | dldir=`echo "$withval" | sed 's/,.*//'` |
| 1155 | dlddir=`echo "$withval" | sed 's/.*,//'` |
Barry Warsaw | 7d1219d | 2000-10-05 18:45:53 +0000 | [diff] [blame] | 1156 | 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] | 1157 | then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1158 | else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY) |
| 1159 | fi |
| 1160 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1161 | LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1162 | |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 1163 | # the dlopen() function means we might want to use dynload_shlib.o. some |
| 1164 | # 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] | 1165 | AC_CHECK_FUNCS(dlopen) |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 1166 | |
| 1167 | # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic |
| 1168 | # loading of modules. |
| 1169 | AC_SUBST(DYNLOADFILE) |
| 1170 | AC_MSG_CHECKING(DYNLOADFILE) |
| 1171 | if test -z "$DYNLOADFILE" |
| 1172 | then |
| 1173 | case $ac_sys_system/$ac_sys_release in |
| 1174 | AIX*) DYNLOADFILE="dynload_aix.o";; |
| 1175 | BeOS*) DYNLOADFILE="dynload_beos.o";; |
| 1176 | hp*|HP*) DYNLOADFILE="dynload_hpux.o";; |
Guido van Rossum | 5839e58 | 2000-10-09 19:52:35 +0000 | [diff] [blame] | 1177 | Darwin/*|next/*) DYNLOADFILE="dynload_next.o";; |
Guido van Rossum | e97ee18 | 1999-12-20 21:27:22 +0000 | [diff] [blame] | 1178 | *) |
| 1179 | # use dynload_shlib.c and dlopen() if we have it; otherwise stub |
| 1180 | # out any dynamic loading |
| 1181 | if test "$ac_cv_func_dlopen" = yes |
| 1182 | then DYNLOADFILE="dynload_shlib.o" |
| 1183 | else DYNLOADFILE="dynload_stub.o" |
| 1184 | fi |
| 1185 | ;; |
| 1186 | esac |
| 1187 | fi |
| 1188 | AC_MSG_RESULT($DYNLOADFILE) |
| 1189 | if test "$DYNLOADFILE" != "dynload_stub.o" |
| 1190 | then |
| 1191 | AC_DEFINE(HAVE_DYNAMIC_LOADING) |
| 1192 | fi |
| 1193 | |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 1194 | # MACHDEP_OBJS can be set to platform-specific object files needed by Python |
| 1195 | |
| 1196 | AC_SUBST(MACHDEP_OBJS) |
| 1197 | AC_MSG_CHECKING(MACHDEP_OBJS) |
| 1198 | if test -z "$MACHDEP_OBJS" |
| 1199 | then |
| 1200 | case $ac_sys_system/$ac_sys_release in |
| 1201 | Darwin/*) |
Jack Jansen | 9a66b6d | 2001-08-08 13:56:14 +0000 | [diff] [blame] | 1202 | MACHDEP_OBJS="Python/mactoolboxglue.o" |
Jack Jansen | c49e5b7 | 2001-06-19 15:00:23 +0000 | [diff] [blame] | 1203 | AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE) |
| 1204 | ;; |
| 1205 | *) MACHDEP_OBJS="";; |
| 1206 | esac |
| 1207 | fi |
| 1208 | AC_MSG_RESULT($DYNLOADFILE) |
| 1209 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1210 | # checks for library functions |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 1211 | AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \ |
Fred Drake | 35a092f | 1999-12-13 16:23:35 +0000 | [diff] [blame] | 1212 | flock fork fsync fdatasync fpathconf ftime ftruncate \ |
Andrew M. Kuchling | a9586c7 | 2001-01-08 17:58:56 +0000 | [diff] [blame] | 1213 | getgroups getlogin getpeername getpid getpwent getwd \ |
Martin v. Löwis | 864e9ff | 2001-08-04 22:32:03 +0000 | [diff] [blame] | 1214 | hstrerror inet_pton kill link lstat mkfifo mktime mremap \ |
Andrew M. Kuchling | 5821b77 | 2000-08-25 01:14:08 +0000 | [diff] [blame] | 1215 | nice pathconf pause plock poll pthread_init \ |
Fred Drake | 35a092f | 1999-12-13 16:23:35 +0000 | [diff] [blame] | 1216 | putenv readlink \ |
Andrew M. Kuchling | 8d2f2b2 | 2000-07-13 01:26:58 +0000 | [diff] [blame] | 1217 | select setegid seteuid setgid \ |
Martin v. Löwis | 791bfda | 2001-07-24 06:33:08 +0000 | [diff] [blame] | 1218 | setlocale setregid setreuid setsid setpgid setuid setvbuf snprintf \ |
Fred Drake | 35a092f | 1999-12-13 16:23:35 +0000 | [diff] [blame] | 1219 | sigaction siginterrupt sigrelse strftime strptime symlink sysconf \ |
Fred Drake | 89143df | 1999-12-09 22:03:25 +0000 | [diff] [blame] | 1220 | tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ |
Thomas Wouters | c2c12dc | 2001-07-11 14:45:34 +0000 | [diff] [blame] | 1221 | truncate uname waitpid _getpty getpriority) |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1222 | |
Fred Drake | 8cef4cf | 2000-06-28 16:40:38 +0000 | [diff] [blame] | 1223 | # check for openpty and forkpty |
| 1224 | |
| 1225 | AC_CHECK_FUNCS(openpty,, AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])) |
| 1226 | AC_CHECK_FUNCS(forkpty,, AC_CHECK_LIB(util,forkpty, [AC_DEFINE(HAVE_FORKPTY)] [LIBS="$LIBS -lutil"])) |
| 1227 | |
Guido van Rossum | 00f0f6e | 1999-01-06 18:52:29 +0000 | [diff] [blame] | 1228 | # check for long file support functions |
| 1229 | AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs) |
| 1230 | |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 1231 | AC_REPLACE_FUNCS(dup2 getcwd strdup strerror memmove) |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 1232 | AC_CHECK_FUNCS(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG))) |
| 1233 | AC_CHECK_FUNCS(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG))) |
| 1234 | 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] | 1235 | |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 1236 | AC_CHECK_FUNCS(getaddrinfo, [dnl |
| 1237 | AC_MSG_CHECKING(getaddrinfo bug) |
| 1238 | AC_TRY_RUN([ |
| 1239 | #include <sys/types.h> |
| 1240 | #include <netdb.h> |
| 1241 | #include <string.h> |
| 1242 | #include <sys/socket.h> |
| 1243 | #include <netinet/in.h> |
| 1244 | |
| 1245 | main() |
| 1246 | { |
| 1247 | int passive, gaierr, inet4 = 0, inet6 = 0; |
| 1248 | struct addrinfo hints, *ai, *aitop; |
| 1249 | char straddr[INET6_ADDRSTRLEN], strport[16]; |
| 1250 | |
| 1251 | for (passive = 0; passive <= 1; passive++) { |
| 1252 | memset(&hints, 0, sizeof(hints)); |
| 1253 | hints.ai_family = AF_UNSPEC; |
| 1254 | hints.ai_flags = passive ? AI_PASSIVE : 0; |
| 1255 | hints.ai_socktype = SOCK_STREAM; |
| 1256 | if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { |
| 1257 | (void)gai_strerror(gaierr); |
| 1258 | goto bad; |
| 1259 | } |
| 1260 | for (ai = aitop; ai; ai = ai->ai_next) { |
| 1261 | if (ai->ai_addr == NULL || |
| 1262 | ai->ai_addrlen == 0 || |
| 1263 | getnameinfo(ai->ai_addr, ai->ai_addrlen, |
| 1264 | straddr, sizeof(straddr), strport, sizeof(strport), |
| 1265 | NI_NUMERICHOST|NI_NUMERICSERV) != 0) { |
| 1266 | goto bad; |
| 1267 | } |
| 1268 | switch (ai->ai_family) { |
| 1269 | case AF_INET: |
| 1270 | if (strcmp(strport, "54321") != 0) { |
| 1271 | goto bad; |
| 1272 | } |
| 1273 | if (passive) { |
| 1274 | if (strcmp(straddr, "0.0.0.0") != 0) { |
| 1275 | goto bad; |
| 1276 | } |
| 1277 | } else { |
| 1278 | if (strcmp(straddr, "127.0.0.1") != 0) { |
| 1279 | goto bad; |
| 1280 | } |
| 1281 | } |
| 1282 | inet4++; |
| 1283 | break; |
| 1284 | case AF_INET6: |
| 1285 | if (strcmp(strport, "54321") != 0) { |
| 1286 | goto bad; |
| 1287 | } |
| 1288 | if (passive) { |
| 1289 | if (strcmp(straddr, "::") != 0) { |
| 1290 | goto bad; |
| 1291 | } |
| 1292 | } else { |
| 1293 | if (strcmp(straddr, "::1") != 0) { |
| 1294 | goto bad; |
| 1295 | } |
| 1296 | } |
| 1297 | inet6++; |
| 1298 | break; |
| 1299 | case AF_UNSPEC: |
| 1300 | goto bad; |
| 1301 | break; |
| 1302 | default: |
| 1303 | /* another family support? */ |
| 1304 | break; |
| 1305 | } |
| 1306 | } |
| 1307 | } |
| 1308 | |
| 1309 | if (!(inet4 == 0 || inet4 == 2)) |
| 1310 | goto bad; |
| 1311 | if (!(inet6 == 0 || inet6 == 2)) |
| 1312 | goto bad; |
| 1313 | |
| 1314 | if (aitop) |
| 1315 | freeaddrinfo(aitop); |
| 1316 | exit(0); |
| 1317 | |
| 1318 | bad: |
| 1319 | if (aitop) |
| 1320 | freeaddrinfo(aitop); |
| 1321 | exit(1); |
| 1322 | } |
| 1323 | ], |
| 1324 | AC_MSG_RESULT(good) |
| 1325 | buggygetaddrinfo=no, |
| 1326 | AC_MSG_RESULT(buggy) |
| 1327 | buggygetaddrinfo=yes, |
| 1328 | AC_MSG_RESULT(buggy) |
| 1329 | buggygetaddrinfo=yes)], [buggygetaddrinfo=yes]) |
| 1330 | |
| 1331 | if test "$buggygetaddrinfo" = "yes"; then |
| 1332 | if test "$ipv6" = "yes"; then |
| 1333 | echo 'Fatal: You must get working getaddrinfo() function.' |
| 1334 | echo ' or you can specify "--disable-ipv6"'. |
| 1335 | exit 1 |
| 1336 | fi |
| 1337 | fi |
Thomas Wouters | b0db85a | 2001-08-08 10:39:03 +0000 | [diff] [blame] | 1338 | AC_CHECK_FUNCS(getnameinfo) |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 1339 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1340 | # checks for structures |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1341 | AC_HEADER_TIME |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1342 | AC_STRUCT_TM |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1343 | AC_STRUCT_TIMEZONE |
| 1344 | |
| 1345 | AC_MSG_CHECKING(for time.h that defines altzone) |
| 1346 | AC_CACHE_VAL(ac_cv_header_time_altzone, |
| 1347 | [AC_TRY_COMPILE([#include <time.h>], [return altzone;], |
| 1348 | ac_cv_header_time_altzone=yes, |
| 1349 | ac_cv_header_time_altzone=no)]) |
| 1350 | AC_MSG_RESULT($ac_cv_header_time_altzone) |
| 1351 | if test $ac_cv_header_time_altzone = yes; then |
| 1352 | AC_DEFINE(HAVE_ALTZONE) |
| 1353 | fi |
| 1354 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1355 | was_it_defined=no |
| 1356 | 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] | 1357 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1358 | #include <sys/types.h> |
| 1359 | #include <sys/select.h> |
| 1360 | #include <sys/time.h> |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1361 | ], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME) was_it_defined=yes]) |
| 1362 | AC_MSG_RESULT($was_it_defined) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1363 | |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 1364 | AC_MSG_CHECKING(for addrinfo) |
| 1365 | AC_CACHE_VAL(ac_cv_struct_addrinfo, |
| 1366 | AC_TRY_COMPILE([ |
| 1367 | # include <netdb.h>], |
| 1368 | [struct addrinfo a], |
| 1369 | ac_cv_struct_addrinfo=yes, |
| 1370 | ac_cv_struct_addrinfo=no)) |
| 1371 | AC_MSG_RESULT($ac_cv_struct_addrinfo) |
| 1372 | if test $ac_cv_struct_addrinfo = yes; then |
| 1373 | AC_DEFINE(HAVE_ADDRINFO) |
| 1374 | fi |
| 1375 | |
| 1376 | AC_MSG_CHECKING(for sockaddr_storage) |
| 1377 | AC_CACHE_VAL(ac_cv_struct_sockaddr_storage, |
| 1378 | AC_TRY_COMPILE([ |
| 1379 | # include <sys/types.h> |
| 1380 | # include <sys/socket.h>], |
| 1381 | [struct sockaddr_storage s], |
| 1382 | ac_cv_struct_sockaddr_storage=yes, |
| 1383 | ac_cv_struct_sockaddr_storage=no)) |
| 1384 | AC_MSG_RESULT($ac_cv_struct_sockaddr_storage) |
| 1385 | if test $ac_cv_struct_sockaddr_storage = yes; then |
| 1386 | AC_DEFINE(HAVE_SOCKADDR_STORAGE) |
| 1387 | fi |
| 1388 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1389 | # checks for compiler characteristics |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1390 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1391 | AC_C_CHAR_UNSIGNED |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1392 | AC_C_CONST |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1393 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1394 | works=no |
| 1395 | AC_MSG_CHECKING(for working volatile) |
| 1396 | AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes, AC_DEFINE(volatile, [])) |
| 1397 | AC_MSG_RESULT($works) |
Guido van Rossum | dabb11b | 1994-10-11 15:04:27 +0000 | [diff] [blame] | 1398 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1399 | works=no |
| 1400 | AC_MSG_CHECKING(for working signed char) |
| 1401 | AC_TRY_COMPILE([], [signed char c;], works=yes, AC_DEFINE(signed, [])) |
| 1402 | AC_MSG_RESULT($works) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1403 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1404 | have_prototypes=no |
| 1405 | AC_MSG_CHECKING(for prototypes) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1406 | AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], |
| 1407 | AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=yes) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1408 | AC_MSG_RESULT($have_prototypes) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1409 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1410 | works=no |
| 1411 | AC_MSG_CHECKING(for variable length prototypes and stdarg.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1412 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1413 | #include <stdarg.h> |
Guido van Rossum | 3f13e48 | 1996-08-30 20:58:11 +0000 | [diff] [blame] | 1414 | int foo(int x, ...) { |
| 1415 | va_list va; |
| 1416 | va_start(va, x); |
| 1417 | va_arg(va, int); |
| 1418 | va_arg(va, char *); |
| 1419 | va_arg(va, double); |
| 1420 | return 0; |
| 1421 | } |
| 1422 | ], [return foo(10, "", 3.14);], |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1423 | AC_DEFINE(HAVE_STDARG_PROTOTYPES) works=yes) |
| 1424 | AC_MSG_RESULT($works) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1425 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1426 | if test "$have_prototypes" = yes; then |
| 1427 | bad_prototypes=no |
| 1428 | AC_MSG_CHECKING(for bad exec* prototypes) |
| 1429 | AC_TRY_COMPILE([#include <unistd.h>], [char **t;execve("@",t,t);], , |
| 1430 | AC_DEFINE(BAD_EXEC_PROTOTYPES) bad_prototypes=yes) |
| 1431 | AC_MSG_RESULT($bad_prototypes) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1432 | fi |
| 1433 | |
Martin v. Löwis | 01dfdb3 | 2001-06-23 16:30:13 +0000 | [diff] [blame] | 1434 | # check if sockaddr has sa_len member |
| 1435 | AC_MSG_CHECKING(if sockaddr has sa_len member) |
| 1436 | AC_TRY_COMPILE([#include <sys/types.h> |
| 1437 | #include <sys/socket.h>], |
| 1438 | [struct sockaddr x; |
| 1439 | x.sa_len = 0;], |
| 1440 | AC_MSG_RESULT(yes) |
| 1441 | AC_DEFINE(HAVE_SOCKADDR_SA_LEN), |
| 1442 | AC_MSG_RESULT(no)) |
| 1443 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1444 | AC_MSG_CHECKING(for bad static forward) |
Martin v. Löwis | 1d5ecb7 | 2001-08-09 10:29:44 +0000 | [diff] [blame] | 1445 | AC_CACHE_VAL(ac_cv_bad_static_forward, |
| 1446 | [AC_TRY_RUN([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1447 | struct s { int a; int b; }; |
| 1448 | static struct s foo; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 1449 | int foobar() { |
| 1450 | static int random; |
| 1451 | random = (int) &foo; |
| 1452 | return random; |
| 1453 | } |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1454 | static struct s foo = { 1, 2 }; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 1455 | main() { |
| 1456 | exit(!((int)&foo == foobar())); |
Martin v. Löwis | 1d5ecb7 | 2001-08-09 10:29:44 +0000 | [diff] [blame] | 1457 | }], ac_cv_bad_static_forward=no, ac_cv_bad_static_forward=yes)]) |
| 1458 | AC_MSG_RESULT($ac_cv_bad_static_forward) |
| 1459 | if test "$ac_cv_bad_static_forward" = yes |
| 1460 | then |
| 1461 | AC_DEFINE(BAD_STATIC_FORWARD) |
| 1462 | fi |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1463 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1464 | va_list_is_array=no |
| 1465 | AC_MSG_CHECKING(whether va_list is an array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1466 | AC_TRY_COMPILE([ |
| 1467 | #ifdef HAVE_STDARG_PROTOTYPES |
| 1468 | #include <stdarg.h> |
| 1469 | #else |
| 1470 | #include <varargs.h> |
| 1471 | #endif |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 1472 | ], [va_list list1, list2; list1 = list2;], , |
| 1473 | AC_DEFINE(VA_LIST_IS_ARRAY) va_list_is_array=yes) |
| 1474 | AC_MSG_RESULT($va_list_is_array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1475 | |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1476 | # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( |
| 1477 | AC_CHECK_FUNC(gethostbyname_r, [ |
| 1478 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
| 1479 | AC_MSG_CHECKING([gethostbyname_r with 6 args]) |
| 1480 | OLD_CFLAGS=$CFLAGS |
| 1481 | CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" |
| 1482 | AC_TRY_COMPILE([ |
| 1483 | # include <netdb.h> |
| 1484 | ], [ |
| 1485 | char *name; |
| 1486 | struct hostent *he, *res; |
| 1487 | char buffer[2048]; |
| 1488 | int buflen = 2048; |
| 1489 | int h_errnop; |
| 1490 | |
| 1491 | (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop) |
| 1492 | ], [ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1493 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1494 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG) |
| 1495 | AC_MSG_RESULT(yes) |
| 1496 | ], [ |
| 1497 | AC_MSG_RESULT(no) |
| 1498 | AC_MSG_CHECKING([gethostbyname_r with 5 args]) |
| 1499 | AC_TRY_COMPILE([ |
| 1500 | # include <netdb.h> |
| 1501 | ], [ |
| 1502 | char *name; |
| 1503 | struct hostent *he; |
| 1504 | char buffer[2048]; |
| 1505 | int buflen = 2048; |
| 1506 | int h_errnop; |
| 1507 | |
| 1508 | (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop) |
| 1509 | ], [ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1510 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1511 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG) |
| 1512 | AC_MSG_RESULT(yes) |
| 1513 | ], [ |
| 1514 | AC_MSG_RESULT(no) |
| 1515 | AC_MSG_CHECKING([gethostbyname_r with 3 args]) |
| 1516 | AC_TRY_COMPILE([ |
| 1517 | # include <netdb.h> |
| 1518 | ], [ |
| 1519 | char *name; |
| 1520 | struct hostent *he; |
| 1521 | struct hostent_data data; |
| 1522 | |
| 1523 | (void) gethostbyname_r(name, he, &data); |
| 1524 | ], [ |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1525 | AC_DEFINE(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1526 | AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG) |
| 1527 | AC_MSG_RESULT(yes) |
| 1528 | ], [ |
| 1529 | AC_MSG_RESULT(no) |
| 1530 | ]) |
| 1531 | ]) |
| 1532 | ]) |
| 1533 | CFLAGS=$OLD_CFLAGS |
| 1534 | ], [ |
Thomas Wouters | 3a58420 | 2000-08-05 23:28:51 +0000 | [diff] [blame] | 1535 | AC_CHECK_FUNCS(gethostbyname) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1536 | ]) |
| 1537 | AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG) |
| 1538 | AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG) |
| 1539 | AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG) |
Guido van Rossum | 8db7d8b | 1999-03-23 16:40:33 +0000 | [diff] [blame] | 1540 | AC_SUBST(HAVE_GETHOSTBYNAME_R) |
Guido van Rossum | a96f0ba | 1999-03-22 21:49:51 +0000 | [diff] [blame] | 1541 | AC_SUBST(HAVE_GETHOSTBYNAME) |
| 1542 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1543 | # checks for system services |
| 1544 | # (none yet) |
| 1545 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 1546 | # Linux requires this for correct f.p. operations |
Jeremy Hylton | be28f5b | 2000-07-27 21:03:04 +0000 | [diff] [blame] | 1547 | AC_CHECK_FUNC(__fpu_control, |
| 1548 | [], |
| 1549 | [AC_CHECK_LIB(ieee, __fpu_control) |
| 1550 | ]) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1551 | |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1552 | # Check for --with-fpectl |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1553 | AC_MSG_CHECKING(for --with-fpectl) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1554 | AC_ARG_WITH(fpectl, |
| 1555 | [ --with-fpectl enable SIGFPE catching], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1556 | if test "$withval" != no |
| 1557 | then AC_DEFINE(WANT_SIGFPE_HANDLER) AC_MSG_RESULT(yes) |
| 1558 | else AC_MSG_RESULT(no) |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 1559 | fi], |
| 1560 | [AC_MSG_RESULT(no)]) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1561 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1562 | # check for --with-libm=... |
| 1563 | AC_SUBST(LIBM) |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 1564 | case $ac_sys_system in |
Guido van Rossum | 3dc0a51 | 2000-10-05 18:00:06 +0000 | [diff] [blame] | 1565 | Darwin) ;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 1566 | next) ;; |
Guido van Rossum | ec95c7b | 1998-08-04 17:59:56 +0000 | [diff] [blame] | 1567 | BeOS) ;; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 1568 | *) LIBM=-lm |
| 1569 | esac |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1570 | AC_MSG_CHECKING(for --with-libm=STRING) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1571 | AC_ARG_WITH(libm, [ --with-libm=STRING math library], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1572 | if test "$withval" = no |
| 1573 | then LIBM= |
| 1574 | AC_MSG_RESULT(force LIBM empty) |
| 1575 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1576 | then LIBM=$withval |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1577 | AC_MSG_RESULT(set LIBM=\"$withval\") |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1578 | else AC_ERROR(proper usage is --with-libm=STRING) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1579 | fi], |
| 1580 | [AC_MSG_RESULT(default LIBM=\"$LIBM\")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1581 | |
| 1582 | # check for --with-libc=... |
| 1583 | AC_SUBST(LIBC) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1584 | AC_MSG_CHECKING(for --with-libc=STRING) |
Barry Warsaw | c0d24d8 | 2000-06-29 16:12:00 +0000 | [diff] [blame] | 1585 | AC_ARG_WITH(libc, [ --with-libc=STRING C library], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1586 | if test "$withval" = no |
| 1587 | then LIBC= |
| 1588 | AC_MSG_RESULT(force LIBC empty) |
| 1589 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1590 | then LIBC=$withval |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1591 | AC_MSG_RESULT(set LIBC=\"$withval\") |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1592 | else AC_ERROR(proper usage is --with-libc=STRING) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 1593 | fi], |
| 1594 | [AC_MSG_RESULT(default LIBC=\"$LIBC\")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 1595 | |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 1596 | # check for hypot() in math library |
| 1597 | LIBS_SAVE=$LIBS |
| 1598 | LIBS="$LIBS $LIBM" |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 1599 | AC_REPLACE_FUNCS(hypot) |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 1600 | LIBS=$LIBS_SAVE |
| 1601 | |
Guido van Rossum | ad71370 | 1997-07-10 22:42:38 +0000 | [diff] [blame] | 1602 | # check whether malloc(0) returns NULL or not |
Guido van Rossum | ad71370 | 1997-07-10 22:42:38 +0000 | [diff] [blame] | 1603 | AC_MSG_CHECKING(what malloc(0) returns) |
| 1604 | AC_CACHE_VAL(ac_cv_malloc_zero, |
| 1605 | [AC_TRY_RUN([#include <stdio.h> |
| 1606 | #ifdef HAVE_STDLIB |
| 1607 | #include <stdlib.h> |
| 1608 | #else |
| 1609 | char *malloc(), *realloc(); |
| 1610 | int *free(); |
| 1611 | #endif |
| 1612 | main() { |
| 1613 | char *p; |
| 1614 | p = malloc(0); |
| 1615 | if (p == NULL) exit(1); |
| 1616 | p = realloc(p, 0); |
| 1617 | if (p == NULL) exit(1); |
| 1618 | free(p); |
| 1619 | exit(0); |
| 1620 | }], ac_cv_malloc_zero=nonnull, ac_cv_malloc_zero=null)]) |
| 1621 | AC_MSG_RESULT($ac_cv_malloc_zero) |
| 1622 | if test "$ac_cv_malloc_zero" = null |
| 1623 | then |
| 1624 | AC_DEFINE(MALLOC_ZERO_RETURNS_NULL) |
| 1625 | fi |
| 1626 | |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 1627 | # check for wchar.h |
| 1628 | AC_CHECK_HEADER(wchar.h, |
| 1629 | AC_DEFINE(HAVE_WCHAR_H) wchar_h="yes", |
| 1630 | wchar_h="no" |
| 1631 | ) |
| 1632 | |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 1633 | # determine wchar_t size |
| 1634 | if test "$wchar_h" = yes |
| 1635 | then |
| 1636 | AC_CHECK_SIZEOF(wchar_t) |
| 1637 | fi |
| 1638 | |
| 1639 | AC_MSG_CHECKING(what type to use for unicode) |
| 1640 | AC_ARG_ENABLE(unicode, |
| 1641 | [ --enable-unicode[=ucs2,ucs4] Enable Unicode strings (default is yes)],,enable_unicode=yes) |
| 1642 | |
| 1643 | if test $enable_unicode = yes |
| 1644 | then |
Martin v. Löwis | fd91779 | 2001-06-27 20:22:04 +0000 | [diff] [blame] | 1645 | # Without any arguments, Py_UNICODE defaults to two-byte mode |
| 1646 | enable_unicode="ucs2" |
Martin v. Löwis | 0ba70cc | 2001-06-26 22:22:37 +0000 | [diff] [blame] | 1647 | fi |
| 1648 | |
| 1649 | case "$enable_unicode" in |
| 1650 | ucs2) unicode_size="2" |
| 1651 | AC_DEFINE(Py_UNICODE_SIZE,2) |
| 1652 | ;; |
| 1653 | ucs4) unicode_size="4" |
| 1654 | AC_DEFINE(Py_UNICODE_SIZE,4) |
| 1655 | ;; |
| 1656 | esac |
| 1657 | |
| 1658 | if test "$enable_unicode" = "no" |
| 1659 | then |
| 1660 | AC_MSG_RESULT(not used) |
| 1661 | else |
| 1662 | AC_DEFINE(Py_USING_UNICODE) |
| 1663 | if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" |
| 1664 | then |
| 1665 | PY_UNICODE_TYPE="wchar_t" |
| 1666 | AC_DEFINE(HAVE_USABLE_WCHAR_T) |
| 1667 | AC_DEFINE(PY_UNICODE_TYPE,wchar_t) |
| 1668 | elif test "$ac_cv_sizeof_short" = "$unicode_size" |
| 1669 | then |
| 1670 | PY_UNICODE_TYPE="unsigned short" |
| 1671 | AC_DEFINE(PY_UNICODE_TYPE,unsigned short) |
| 1672 | elif test "$ac_cv_sizeof_long" = "$unicode_size" |
| 1673 | then |
| 1674 | PY_UNICODE_TYPE="unsigned long" |
| 1675 | AC_DEFINE(PY_UNICODE_TYPE,unsigned long) |
| 1676 | else |
| 1677 | PY_UNICODE_TYPE="no type found" |
| 1678 | fi |
| 1679 | AC_MSG_RESULT($PY_UNICODE_TYPE) |
| 1680 | fi |
Guido van Rossum | ef2255b | 2000-03-10 22:30:29 +0000 | [diff] [blame] | 1681 | |
| 1682 | # check for endianness |
| 1683 | AC_C_BIGENDIAN |
| 1684 | |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1685 | # Check whether right shifting a negative integer extends the sign bit |
| 1686 | # or fills with zeros (like the Cray J90, according to Tim Peters). |
| 1687 | AC_MSG_CHECKING(whether right shift extends the sign bit) |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 1688 | AC_CACHE_VAL(ac_cv_rshift_extends_sign, [ |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1689 | AC_TRY_RUN([ |
| 1690 | int main() |
| 1691 | { |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 1692 | exit(((-1)>>3 == -1) ? 0 : 1); |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1693 | } |
Vladimir Marangozov | a618028 | 2000-07-12 05:05:06 +0000 | [diff] [blame] | 1694 | ], ac_cv_rshift_extends_sign=yes, ac_cv_rshift_extends_sign=no)]) |
| 1695 | AC_MSG_RESULT($ac_cv_rshift_extends_sign) |
| 1696 | if test "$ac_cv_rshift_extends_sign" = no |
| 1697 | then |
| 1698 | AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS) |
| 1699 | fi |
| 1700 | |
Guido van Rossum | cadfaec | 2001-01-05 14:45:49 +0000 | [diff] [blame] | 1701 | # check for getc_unlocked and related locking functions |
| 1702 | AC_MSG_CHECKING(for getc_unlocked() and friends) |
| 1703 | AC_CACHE_VAL(ac_cv_have_getc_unlocked, [ |
| 1704 | AC_TRY_LINK([#include <stdio.h>],[ |
| 1705 | FILE *f = fopen("/dev/null", "r"); |
| 1706 | flockfile(f); |
| 1707 | getc_unlocked(f); |
| 1708 | funlockfile(f); |
| 1709 | ], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)]) |
| 1710 | AC_MSG_RESULT($ac_cv_have_getc_unlocked) |
| 1711 | if test "$ac_cv_have_getc_unlocked" = yes |
| 1712 | then |
| 1713 | AC_DEFINE(HAVE_GETC_UNLOCKED) |
| 1714 | fi |
Vladimir Marangozov | 9a5a5d1 | 2000-07-12 03:02:16 +0000 | [diff] [blame] | 1715 | |
Guido van Rossum | 353ae58 | 2001-07-10 16:45:32 +0000 | [diff] [blame] | 1716 | # check for readline 4.2 |
| 1717 | AC_CHECK_LIB(readline, rl_completion_matches, |
| 1718 | AC_DEFINE(HAVE_RL_COMPLETION_MATCHES), , -ltermcap) |
| 1719 | |
Thomas Wouters | e38b2f1 | 2001-07-11 22:35:31 +0000 | [diff] [blame] | 1720 | AC_MSG_CHECKING(for broken nice()) |
| 1721 | AC_CACHE_VAL(ac_cv_broken_nice, [ |
| 1722 | AC_TRY_RUN([ |
| 1723 | int main() |
| 1724 | { |
| 1725 | int val1 = nice(1); |
| 1726 | if (val1 != -1 && val1 == nice(2)) |
| 1727 | exit(0); |
| 1728 | exit(1); |
| 1729 | } |
| 1730 | ],ac_cv_broken_nice=yes, ac_cv_broken_nice=no)]) |
| 1731 | AC_MSG_RESULT($ac_cv_broken_nice) |
| 1732 | if test "$ac_cv_broken_nice" = yes |
| 1733 | then |
| 1734 | AC_DEFINE(HAVE_BROKEN_NICE) |
| 1735 | fi |
| 1736 | |
Guido van Rossum | 95713eb | 2000-05-18 20:53:31 +0000 | [diff] [blame] | 1737 | # THIS MUST BE LAST, IT CAN BREAK OTHER TESTS! |
| 1738 | # Add sys/socket.h to confdefs.h |
| 1739 | cat >> confdefs.h <<\EOF |
| 1740 | #ifdef HAVE_SYS_SOCKET_H |
| 1741 | #include <sys/socket.h> |
| 1742 | #endif |
| 1743 | EOF |
| 1744 | AC_CHECK_TYPE(socklen_t, int) |
| 1745 | |
Neil Schemenauer | f25cf6c | 2001-03-04 06:39:33 +0000 | [diff] [blame] | 1746 | # Add Python/ prefix to LIBOBJS |
| 1747 | libobjs=$LIBOBJS |
| 1748 | LIBOBJS= |
| 1749 | for obj in $libobjs; do |
| 1750 | LIBOBJS="$LIBOBJS Python/$obj" |
| 1751 | done |
| 1752 | |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 1753 | #AC_MSG_CHECKING(for Modules/Setup) |
| 1754 | #if test ! -f Modules/Setup ; then |
| 1755 | # if test ! -d Modules ; then |
| 1756 | # mkdir Modules |
| 1757 | # fi |
| 1758 | # cp "$srcdir/Modules/Setup.dist" Modules/Setup |
| 1759 | # AC_MSG_RESULT(creating) |
| 1760 | #else |
| 1761 | # AC_MSG_RESULT(already exists) |
| 1762 | #fi |
| 1763 | |
| 1764 | AC_SUBST(SRCDIRS) |
Neil Schemenauer | acbf9ef | 2001-02-27 02:15:14 +0000 | [diff] [blame] | 1765 | SRCDIRS="Parser Grammar Objects Python Modules" |
Andrew M. Kuchling | 8abedde | 2001-01-26 22:55:24 +0000 | [diff] [blame] | 1766 | AC_MSG_CHECKING(for build directories) |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 1767 | for dir in $SRCDIRS; do |
| 1768 | if test ! -d $dir; then |
| 1769 | mkdir $dir |
Fred Drake | 884d3ba | 2000-11-02 17:52:56 +0000 | [diff] [blame] | 1770 | fi |
Neil Schemenauer | 55f0cf3 | 2001-01-24 17:24:33 +0000 | [diff] [blame] | 1771 | done |
| 1772 | AC_MSG_RESULT(done) |
Fred Drake | 036144d | 2000-10-26 17:09:35 +0000 | [diff] [blame] | 1773 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 1774 | # generate output files |
Andrew M. Kuchling | 8abedde | 2001-01-26 22:55:24 +0000 | [diff] [blame] | 1775 | AC_OUTPUT(Makefile.pre Modules/Setup.config) |
Neil Schemenauer | 61c5115 | 2001-01-26 16:18:16 +0000 | [diff] [blame] | 1776 | |
| 1777 | echo "creating Setup" |
| 1778 | if test ! -f Modules/Setup |
| 1779 | then |
| 1780 | cp $srcdir/Modules/Setup.dist Modules/Setup |
| 1781 | fi |
| 1782 | |
| 1783 | echo "creating Setup.local" |
| 1784 | if test ! -f Modules/Setup.local |
| 1785 | then |
| 1786 | echo "# Edit this file for local setup changes" >Modules/Setup.local |
| 1787 | fi |
| 1788 | |
| 1789 | echo "creating Makefile" |
| 1790 | $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ |
| 1791 | -s Modules Modules/Setup.config \ |
Neil Schemenauer | f8b71c5 | 2001-04-21 17:41:16 +0000 | [diff] [blame] | 1792 | Modules/Setup.local Modules/Setup |
Neil Schemenauer | 6625216 | 2001-02-19 04:47:42 +0000 | [diff] [blame] | 1793 | mv config.c Modules |