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