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) |
| 9 | VERSION=1.5 |
| 10 | |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 11 | # NEXTSTEP stuff |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 12 | if test -f /usr/lib/NextStep/software_version; then |
| 13 | |
| 14 | AC_MSG_CHECKING(for --with-next-archs) |
| 15 | AC_ARG_WITH(next-archs, |
| 16 | [--with-next-archs='arch1 arch2 ..' build MAB binary], [ |
| 17 | if test -n "$withval"; then |
Guido van Rossum | 2bb4f55 | 1996-09-10 18:19:59 +0000 | [diff] [blame] | 18 | ac_arch_flags=`/usr/lib/arch_tool -archify_list $withval` |
| 19 | # GCC does not currently support multi archs on the NeXT |
| 20 | with_gcc=no |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 21 | fi |
| 22 | AC_MSG_RESULT($with_next_archs) |
| 23 | ], [AC_MSG_RESULT(none: using `arch`)]) |
| 24 | |
| 25 | if test -z "$MACHDEP" |
| 26 | then |
| 27 | set X `hostinfo | grep 'NeXT Mach.*:' | \ |
| 28 | sed -e 's/://' -e 's/\./_/'` && \ |
| 29 | ac_sys_system=next && ac_sys_release=$4 |
| 30 | |
| 31 | MACHDEP="$ac_sys_system$ac_sys_release" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 32 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 33 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 34 | |
| 35 | # Set name for machine-dependent library files |
| 36 | AC_SUBST(MACHDEP) |
| 37 | AC_MSG_CHECKING(MACHDEP) |
| 38 | if test -z "$MACHDEP" |
| 39 | then |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 40 | ac_sys_system=`uname -s` |
| 41 | if test "$ac_sys_system" = "AIX" ; then |
| 42 | ac_sys_release=`uname -v` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 43 | else |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 44 | ac_sys_release=`uname -r` |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 45 | fi |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 46 | ac_md_system=`echo $ac_sys_system | |
| 47 | tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'` |
| 48 | ac_md_release=`echo $ac_sys_release | |
| 49 | tr -d '[/ ]' | sed 's/\..*//'` |
| 50 | MACHDEP="$ac_md_system$ac_md_release" |
| 51 | |
Guido van Rossum | bcd91e0 | 1997-03-20 20:46:29 +0000 | [diff] [blame] | 52 | case $MACHDEP in |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 53 | '') MACHDEP=unknown;; |
| 54 | esac |
| 55 | fi |
| 56 | AC_MSG_RESULT($MACHDEP) |
| 57 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 58 | # checks for alternative programs |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 59 | AC_MSG_CHECKING(for --without-gcc) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 60 | AC_ARG_WITH(gcc, [--without-gcc never use gcc], [ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 61 | case $withval in |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 62 | no) CC=cc |
| 63 | without_gcc=yes;; |
| 64 | yes) CC=gcc |
| 65 | without_gcc=no;; |
| 66 | *) CC=$withval |
| 67 | without_gcc=$withval;; |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 68 | esac], [ |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 69 | case $ac_sys_system in |
Guido van Rossum | 55a214e | 1995-09-13 17:48:09 +0000 | [diff] [blame] | 70 | OSF1) CC=cc |
| 71 | without_gcc=;; |
| 72 | *) without_gcc=no;; |
| 73 | esac]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 74 | AC_MSG_RESULT($without_gcc) |
| 75 | |
Guido van Rossum | 03ad99f | 1995-03-09 14:09:54 +0000 | [diff] [blame] | 76 | # If the user switches compilers, we can't believe the cache |
| 77 | if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" |
| 78 | then |
| 79 | AC_ERROR(cached CC is different -- throw away $cache_file |
| 80 | (it is also a good idea to do 'make clean' before compiling)) |
| 81 | fi |
| 82 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 83 | AC_PROG_CC |
Guido van Rossum | fb84255 | 1997-08-06 23:42:07 +0000 | [diff] [blame] | 84 | |
| 85 | # LINKCC is the command that links the python executable -- default is $(CC). |
| 86 | # This is altered for AIX in order to build the export list before linking. |
| 87 | AC_SUBST(LINKCC) |
| 88 | AC_MSG_CHECKING(LINKCC) |
| 89 | if test -z "$LINKCC" |
| 90 | then |
| 91 | case $ac_sys_system in |
| 92 | AIX*) |
| 93 | LINKCC="makexp_aix python.exp \"\" \$(MYLIBS) \$(ADDOBJS); \$(CC)";; |
| 94 | *) LINKCC="\$(CC)";; |
| 95 | esac |
| 96 | fi |
| 97 | AC_MSG_RESULT($LINKCC) |
| 98 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 99 | AC_PROG_RANLIB |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 100 | AC_SUBST(AR) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 101 | AC_CHECK_PROGS(AR, ar aal, ar) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 102 | AC_SUBST(INSTALL) |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 103 | AC_SUBST(INSTALL_PROGRAM) |
| 104 | AC_SUBST(INSTALL_DATA) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 105 | # Install just never works :-( |
| 106 | if test -z "$INSTALL" |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 107 | then |
| 108 | INSTALL=cp |
| 109 | INSTALL_PROGRAM=cp |
| 110 | INSTALL_DATA=cp |
| 111 | else |
| 112 | INSTALL_PROGRAM="$INSTALL" |
| 113 | INSTALL_DATA="$INSTALL -m 644" |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 114 | fi |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 115 | |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 116 | # Optimizer/debugger flags passed between Makefiles |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 117 | AC_SUBST(OPT) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 118 | if test -z "$OPT" |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 119 | then |
Guido van Rossum | b5875b6 | 1997-07-18 23:29:09 +0000 | [diff] [blame] | 120 | case $GCC in |
| 121 | yes) |
| 122 | case $ac_cv_prog_cc_g in |
| 123 | yes) OPT="-g -O2";; |
| 124 | *) OPT="-O2";; |
| 125 | esac |
| 126 | ;; |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 127 | *) OPT="-O";; |
| 128 | esac |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 129 | fi |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 130 | |
Guido van Rossum | 6f2260e | 1996-09-09 16:21:03 +0000 | [diff] [blame] | 131 | if test "$ac_arch_flags" |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 132 | then |
| 133 | OPT="$OPT $ac_arch_flags" |
| 134 | fi |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 135 | # checks for UNIX variants that set C preprocessor variables |
| 136 | AC_AIX |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 137 | AC_MINIX |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 138 | |
Guido van Rossum | 201afe5 | 1997-05-14 21:14:44 +0000 | [diff] [blame] | 139 | AC_MSG_CHECKING(whether $CC accepts -Olimit 1500) |
| 140 | AC_CACHE_VAL(ac_cv_olimit_ok, |
| 141 | [ac_save_cc="$CC" |
| 142 | CC="$CC -Olimit 1500" |
Guido van Rossum | 7f059ad | 1997-05-30 14:22:30 +0000 | [diff] [blame] | 143 | AC_TRY_RUN([int main() { return 0; }], |
Guido van Rossum | 201afe5 | 1997-05-14 21:14:44 +0000 | [diff] [blame] | 144 | ac_cv_olimit_ok=yes, |
| 145 | ac_cv_olimit_ok=no) |
| 146 | CC="$ac_save_cc"]) |
| 147 | AC_MSG_RESULT($ac_cv_olimit_ok) |
| 148 | if test $ac_cv_olimit_ok = yes; then |
| 149 | OPT="$OPT -Olimit 1500" |
| 150 | fi |
| 151 | |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 152 | # check for ANSI or K&R ("traditional") preprocessor |
| 153 | AC_MSG_CHECKING(for C preprocessor type) |
| 154 | AC_TRY_COMPILE([ |
| 155 | #define spam(name, doc) {#name, &name, #name "() -- " doc} |
| 156 | int foo; |
| 157 | struct {char *name; int *addr; char *doc;} desc = spam(foo, "something"); |
| 158 | ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional) |
| 159 | AC_MSG_RESULT($cpp_type) |
| 160 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 161 | # checks for header files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 162 | AC_HEADER_STDC |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 163 | AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h ncurses.h pthread.h \ |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 164 | signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h \ |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 165 | sys/audioio.h sys/file.h sys/lock.h \ |
| 166 | sys/param.h sys/select.h sys/time.h sys/times.h \ |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 167 | sys/un.h sys/utsname.h sys/wait.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 168 | AC_HEADER_DIRENT |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 169 | |
| 170 | # checks for typedefs |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 171 | was_it_defined=no |
| 172 | AC_MSG_CHECKING(for clock_t in time.h) |
| 173 | AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, AC_DEFINE(clock_t, long)) |
| 174 | AC_MSG_RESULT($was_it_defined) |
| 175 | |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 176 | # Add some code to confdefs.h so that the test for off_t works on SCO |
| 177 | cat >> confdefs.h <<\EOF |
| 178 | #if defined(SCO_DS) |
| 179 | #undef _OFF_T |
| 180 | #endif |
| 181 | EOF |
| 182 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 183 | AC_TYPE_MODE_T |
| 184 | AC_TYPE_OFF_T |
| 185 | AC_TYPE_PID_T |
| 186 | AC_TYPE_SIGNAL |
| 187 | AC_TYPE_SIZE_T |
| 188 | AC_TYPE_UID_T |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 189 | |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 190 | AC_CHECK_SIZEOF(int) |
| 191 | AC_CHECK_SIZEOF(long) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 192 | |
| 193 | # Set info about shared libraries. |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 194 | AC_SUBST(SO) |
| 195 | AC_SUBST(LDSHARED) |
| 196 | AC_SUBST(CCSHARED) |
| 197 | AC_SUBST(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 198 | # SO is the extension of shared libraries `(including the dot!) |
| 199 | # -- usually .so, .sl on HP-UX |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 200 | AC_MSG_CHECKING(SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 201 | if test -z "$SO" |
| 202 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 203 | case $ac_sys_system in |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 204 | hp*|HP*) SO=.sl;; |
| 205 | *) SO=.so;; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 206 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 207 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 208 | AC_MSG_RESULT($SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 209 | # LDSHARED is the ld *command* used to create shared library |
| 210 | # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 211 | AC_MSG_CHECKING(LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 212 | if test -z "$LDSHARED" |
| 213 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 214 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 215 | AIX*) LDSHARED="ld_so_aix \$(CC)";; |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 216 | IRIX/5*) LDSHARED="ld -shared";; |
Guido van Rossum | 7f059ad | 1997-05-30 14:22:30 +0000 | [diff] [blame] | 217 | IRIX*/6*) LDSHARED="ld $SGI_ABI -shared -all"; OPT="$OPT $SGI_ABI";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 218 | SunOS/4*) LDSHARED="ld";; |
| 219 | SunOS/5*) LDSHARED="ld -G";; |
| 220 | hp*|HP*) LDSHARED="ld -b";; |
Guido van Rossum | 71001e4 | 1995-01-26 00:44:03 +0000 | [diff] [blame] | 221 | OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 222 | DYNIX/ptx*) LDSHARED="ld -G";; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 223 | next/*) LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';; |
Guido van Rossum | 81652ab | 1996-07-21 02:53:27 +0000 | [diff] [blame] | 224 | Linux*) LDSHARED="gcc -shared";; |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 225 | FreeBSD*) LDSHARED="ld -Bshareable";; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 226 | SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 227 | *) LDSHARED="ld";; |
| 228 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 229 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 230 | AC_MSG_RESULT($LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 231 | # CCSHARED are the C *flags* used to create objects to go into a shared |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 232 | # library -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 233 | AC_MSG_CHECKING(CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 234 | if test -z "$CCSHARED" |
| 235 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 236 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | af07a44 | 1995-02-13 19:45:27 +0000 | [diff] [blame] | 237 | hp*|HP*) if test "$GCC" = yes; |
| 238 | then CCSHARED="-fpic"; |
| 239 | else CCSHARED="+z"; |
| 240 | fi;; |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 241 | Linux*) CCSHARED="-fpic";; |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 242 | FreeBSD*) CCSHARED="-fpic";; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 243 | SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";; |
Guido van Rossum | 7f059ad | 1997-05-30 14:22:30 +0000 | [diff] [blame] | 244 | IRIX*/6*) CCSHARED="$SGI_ABI -all";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 245 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 246 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 247 | AC_MSG_RESULT($CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 248 | # LINKFORSHARED are the flags passed to the $(CC) command that links |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 249 | # the python executable -- this is only needed for a few systems |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 250 | AC_MSG_CHECKING(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 251 | if test -z "$LINKFORSHARED" |
| 252 | then |
Guido van Rossum | 6100aaf | 1997-04-29 21:48:51 +0000 | [diff] [blame] | 253 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | c5d14a6 | 1997-05-13 17:59:29 +0000 | [diff] [blame] | 254 | AIX*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';; |
Guido van Rossum | 5dab3d8 | 1996-12-06 21:18:18 +0000 | [diff] [blame] | 255 | hp*|HP*) |
| 256 | LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/sharedmodules";; |
Guido van Rossum | b65a48e | 1995-06-14 18:21:23 +0000 | [diff] [blame] | 257 | Linux*) LINKFORSHARED="-rdynamic";; |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 258 | next) LINKFORSHARED="-u libsys_s";; |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 259 | SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; |
Guido van Rossum | 7f059ad | 1997-05-30 14:22:30 +0000 | [diff] [blame] | 260 | IRIX*/6*) LINKFORSHARED="$SGI_ABI -all";; |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 261 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 262 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 263 | AC_MSG_RESULT($LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 264 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 265 | # checks for libraries |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 266 | AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV |
| 267 | AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX |
| 268 | AC_CHECK_LIB(sun, getpwnam) # NIS (== YP) interface for IRIX 4 |
Guido van Rossum | 71001e4 | 1995-01-26 00:44:03 +0000 | [diff] [blame] | 269 | # The following three (nsl,inet,socket) are needed on Sequent; |
| 270 | # the order of checking must be this. Most SVR4 platforms will |
| 271 | # need -lsocket and -lnsl. However on SGI IRIX 5, these exist but |
| 272 | # broken. I see no elegant solution (probably CHECK_LIB should be |
| 273 | # fixed to only add the library if the given entry point is not |
| 274 | # satisfied without it). |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 275 | if test "$ac_sys_system" != IRIX |
Guido van Rossum | 71001e4 | 1995-01-26 00:44:03 +0000 | [diff] [blame] | 276 | then |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 277 | AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 |
| 278 | AC_CHECK_LIB(inet, gethostbyname, [LIBS="-linet $LIBS"], [], -lnsl) # Sequent |
| 279 | AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets |
Guido van Rossum | 71001e4 | 1995-01-26 00:44:03 +0000 | [diff] [blame] | 280 | fi |
Guido van Rossum | c5a3903 | 1996-07-31 17:35:03 +0000 | [diff] [blame] | 281 | AC_MSG_CHECKING(for --with-libs) |
| 282 | AC_ARG_WITH(libs, [--with-libs='lib1 ...' link against additional libs], [ |
| 283 | AC_MSG_RESULT($withval) |
| 284 | LIBS="$withval $LIBS" |
| 285 | ], AC_MSG_RESULT(no)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 286 | |
Guido van Rossum | 8c4ed9a | 1996-12-31 22:34:17 +0000 | [diff] [blame] | 287 | AC_MSG_CHECKING(for --with(out)-readline) |
Guido van Rossum | 8c4ed9a | 1996-12-31 22:34:17 +0000 | [diff] [blame] | 288 | AC_ARG_WITH(readline, |
Guido van Rossum | 3c7c678 | 1997-08-05 21:47:42 +0000 | [diff] [blame] | 289 | [--with(out)-readline obsolete, edit Modules/Setup instead], |
| 290 | [AC_MSG_RESULT($withval) |
| 291 | AC_ERROR(--with(out)-readline is obsolete, edit Modules/Setup instead)], |
| 292 | [AC_MSG_RESULT(not specified.)]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 293 | |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 294 | AC_MSG_CHECKING(for --with-dec-threads) |
| 295 | AC_SUBST(LDLAST) |
| 296 | AC_ARG_WITH(dec-threads, |
| 297 | [--with-dec-threads use DEC Alpha/OSF1 thread-safe libraries], |
| 298 | [AC_MSG_RESULT($withval) |
| 299 | LDLAST=-threads |
Guido van Rossum | f78abae | 1997-01-21 22:02:36 +0000 | [diff] [blame] | 300 | if test "${with_thread+set}" != set; then |
Guido van Rossum | 54d93d4 | 1997-01-22 20:51:58 +0000 | [diff] [blame] | 301 | with_thread="$withval"; |
| 302 | fi], |
| 303 | AC_MSG_RESULT(no)) |
| 304 | |
| 305 | AC_MSG_CHECKING(for --with-threads) |
| 306 | AC_ARG_WITH(threads, [--with-threads alias for --with-thread], |
| 307 | [AC_MSG_RESULT($withval) |
| 308 | if test "${with_thread+set}" != set; then |
| 309 | with_thread="$withval"; |
| 310 | fi], |
| 311 | AC_MSG_RESULT(no)) |
| 312 | |
| 313 | AC_MSG_CHECKING(for --with-thread) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 314 | AC_ARG_WITH(thread, [--with-thread[=DIRECTORY] make interpreter thread-safe], [ |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 315 | AC_MSG_RESULT($withval) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 316 | if test -d "$withval" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 317 | then LDFLAGS="$LDFLAGS -L$withval" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 318 | fi |
Guido van Rossum | 9caf77a | 1996-08-01 00:52:26 +0000 | [diff] [blame] | 319 | AC_DEFINE(_REENTRANT) |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 320 | AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD) |
| 321 | AC_DEFINE(C_THREADS) |
| 322 | LIBOBJS="$LIBOBJS thread.o"],[ |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 323 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 324 | AC_DEFINE(_POSIX_THREADS) |
| 325 | LIBS="$LIBS -lpthreads" |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 326 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 327 | AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 328 | AC_DEFINE(_POSIX_THREADS) |
| 329 | LIBS="$LIBS -lpthread" |
Guido van Rossum | 6400c26 | 1997-05-22 20:34:27 +0000 | [diff] [blame] | 330 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 331 | AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD) |
| 332 | AC_DEFINE(_POSIX_THREADS) |
| 333 | LIBS="$LIBS -lthread" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 334 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | 6400c26 | 1997-05-22 20:34:27 +0000 | [diff] [blame] | 335 | ])])]) |
| 336 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 337 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 338 | LIBS="$LIBS -lmpc" |
| 339 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 340 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 341 | LIBS="$LIBS -lthread" |
| 342 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 343 | ], AC_MSG_RESULT(no)) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 344 | |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 345 | # -I${DLINCLDIR} is added to the compile rule for importdl.o |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 346 | AC_SUBST(DLINCLDIR) |
| 347 | DLINCLDIR=/ |
| 348 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 349 | AC_MSG_CHECKING(for --with-sgi-dl) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 350 | AC_ARG_WITH(sgi-dl, [--with-sgi-dl=DIRECTORY IRIX 4 dynamic linking], [ |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 351 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 352 | AC_DEFINE(WITH_SGI_DL) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 353 | dldir=$withval |
| 354 | if test -d "$dldir" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 355 | then LDFLAGS="$LDFLAGS -L$dldir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 356 | else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY) |
| 357 | fi |
| 358 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 359 | LIBS="$LIBS -ldl -lmld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 360 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 361 | AC_MSG_CHECKING(for --with-dl-dld) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 362 | 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] | 363 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 364 | AC_DEFINE(WITH_DL_DLD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 365 | dldir=`echo "$withval" | sed 's/,.*//'` |
| 366 | dlddir=`echo "$withval" | sed 's/.*,//'` |
| 367 | if test -d "$dldir" -a -d "$dlddir" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 368 | then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 369 | else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY) |
| 370 | fi |
| 371 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 372 | LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 373 | |
| 374 | # checks for library functions |
Guido van Rossum | 93cfa95 | 1997-05-22 20:12:34 +0000 | [diff] [blame] | 375 | AC_CHECK_FUNCS(chown clock dlopen execv flock fork ftime ftruncate \ |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 376 | gethostname_r getpeername getpgrp getpid gettimeofday getwd \ |
Guido van Rossum | 93cfa95 | 1997-05-22 20:12:34 +0000 | [diff] [blame] | 377 | kill link lstat mkfifo nice plock putenv readlink \ |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 378 | select setgid setuid setsid setpgid setpgrp setvbuf \ |
| 379 | sigaction siginterrupt sigrelse strftime symlink \ |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 380 | tcgetpgrp tcsetpgrp times truncate uname waitpid) |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 381 | AC_REPLACE_FUNCS(dup2 getcwd strdup strerror memmove) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 382 | AC_CHECK_FUNC(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG))) |
| 383 | AC_CHECK_FUNC(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG))) |
| 384 | AC_CHECK_FUNC(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] | 385 | |
| 386 | # checks for structures |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 387 | AC_HEADER_TIME |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 388 | AC_STRUCT_TM |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 389 | AC_STRUCT_TIMEZONE |
| 390 | |
| 391 | AC_MSG_CHECKING(for time.h that defines altzone) |
| 392 | AC_CACHE_VAL(ac_cv_header_time_altzone, |
| 393 | [AC_TRY_COMPILE([#include <time.h>], [return altzone;], |
| 394 | ac_cv_header_time_altzone=yes, |
| 395 | ac_cv_header_time_altzone=no)]) |
| 396 | AC_MSG_RESULT($ac_cv_header_time_altzone) |
| 397 | if test $ac_cv_header_time_altzone = yes; then |
| 398 | AC_DEFINE(HAVE_ALTZONE) |
| 399 | fi |
| 400 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 401 | was_it_defined=no |
| 402 | 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] | 403 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 404 | #include <sys/types.h> |
| 405 | #include <sys/select.h> |
| 406 | #include <sys/time.h> |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 407 | ], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME) was_it_defined=yes]) |
| 408 | AC_MSG_RESULT($was_it_defined) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 409 | |
| 410 | # checks for compiler characteristics |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 411 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 412 | AC_C_CHAR_UNSIGNED |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 413 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 414 | AC_C_CONST |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 415 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 416 | works=no |
| 417 | AC_MSG_CHECKING(for working volatile) |
| 418 | AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes, AC_DEFINE(volatile, [])) |
| 419 | AC_MSG_RESULT($works) |
Guido van Rossum | dabb11b | 1994-10-11 15:04:27 +0000 | [diff] [blame] | 420 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 421 | works=no |
| 422 | AC_MSG_CHECKING(for working signed char) |
| 423 | AC_TRY_COMPILE([], [signed char c;], works=yes, AC_DEFINE(signed, [])) |
| 424 | AC_MSG_RESULT($works) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 425 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 426 | have_prototypes=no |
| 427 | AC_MSG_CHECKING(for prototypes) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 428 | AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], |
| 429 | AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=yes) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 430 | AC_MSG_RESULT($have_prototypes) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 431 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 432 | works=no |
| 433 | AC_MSG_CHECKING(for variable length prototypes and stdarg.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 434 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 435 | #include <stdarg.h> |
Guido van Rossum | 3f13e48 | 1996-08-30 20:58:11 +0000 | [diff] [blame] | 436 | int foo(int x, ...) { |
| 437 | va_list va; |
| 438 | va_start(va, x); |
| 439 | va_arg(va, int); |
| 440 | va_arg(va, char *); |
| 441 | va_arg(va, double); |
| 442 | return 0; |
| 443 | } |
| 444 | ], [return foo(10, "", 3.14);], |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 445 | AC_DEFINE(HAVE_STDARG_PROTOTYPES) works=yes) |
| 446 | AC_MSG_RESULT($works) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 447 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 448 | if test "$have_prototypes" = yes; then |
| 449 | bad_prototypes=no |
| 450 | AC_MSG_CHECKING(for bad exec* prototypes) |
| 451 | AC_TRY_COMPILE([#include <unistd.h>], [char **t;execve("@",t,t);], , |
| 452 | AC_DEFINE(BAD_EXEC_PROTOTYPES) bad_prototypes=yes) |
| 453 | AC_MSG_RESULT($bad_prototypes) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 454 | fi |
| 455 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 456 | bad_forward=no |
| 457 | AC_MSG_CHECKING(for bad static forward) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 458 | AC_TRY_RUN([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 459 | struct s { int a; int b; }; |
| 460 | static struct s foo; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 461 | int foobar() { |
| 462 | static int random; |
| 463 | random = (int) &foo; |
| 464 | return random; |
| 465 | } |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 466 | static struct s foo = { 1, 2 }; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 467 | main() { |
| 468 | exit(!((int)&foo == foobar())); |
| 469 | } |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 470 | ], , AC_DEFINE(BAD_STATIC_FORWARD) bad_forward=yes) |
| 471 | AC_MSG_RESULT($bad_forward) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 472 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 473 | va_list_is_array=no |
| 474 | AC_MSG_CHECKING(whether va_list is an array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 475 | AC_TRY_COMPILE([ |
| 476 | #ifdef HAVE_STDARG_PROTOTYPES |
| 477 | #include <stdarg.h> |
| 478 | #else |
| 479 | #include <varargs.h> |
| 480 | #endif |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 481 | ], [va_list list1, list2; list1 = list2;], , |
| 482 | AC_DEFINE(VA_LIST_IS_ARRAY) va_list_is_array=yes) |
| 483 | AC_MSG_RESULT($va_list_is_array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 484 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 485 | # checks for system services |
| 486 | # (none yet) |
| 487 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 488 | # Linux requires this for correct f.p. operations |
| 489 | AC_CHECK_LIB(ieee, __fpu_control) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 490 | |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 491 | # Check for --with-fpectl |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 492 | AC_MSG_CHECKING(for --with-fpectl) |
| 493 | AC_ARG_WITH(fpectl, [--with-fpectl enable SIGFPE catching], [ |
| 494 | if test "$withval" != no |
| 495 | then AC_DEFINE(WANT_SIGFPE_HANDLER) AC_MSG_RESULT(yes) |
| 496 | else AC_MSG_RESULT(no) |
| 497 | fi]) |
| 498 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 499 | # check for --with-libm=... |
| 500 | AC_SUBST(LIBM) |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 501 | case $ac_sys_system in |
| 502 | next) ;; |
| 503 | *) LIBM=-lm |
| 504 | esac |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 505 | AC_MSG_CHECKING(for --with-libm=STRING) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 506 | AC_ARG_WITH(libm, [--with-libm=STRING math library], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 507 | if test "$withval" = no |
| 508 | then LIBM= |
| 509 | AC_MSG_RESULT(force LIBM empty) |
| 510 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 511 | then LIBM=$withval |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 512 | AC_MSG_RESULT(set LIBM=\"$withval\") |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 513 | else AC_ERROR(proper usage is --with-libm=STRING) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 514 | fi], |
| 515 | [AC_MSG_RESULT(default LIBM=\"$LIBM\")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 516 | |
| 517 | # check for --with-libc=... |
| 518 | AC_SUBST(LIBC) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 519 | AC_MSG_CHECKING(for --with-libc=STRING) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 520 | AC_ARG_WITH(libc, [--with-libc=STRING C library], [ |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 521 | if test "$withval" = no |
| 522 | then LIBC= |
| 523 | AC_MSG_RESULT(force LIBC empty) |
| 524 | elif test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 525 | then LIBC=$withval |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 526 | AC_MSG_RESULT(set LIBC=\"$withval\") |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 527 | else AC_ERROR(proper usage is --with-libc=STRING) |
Guido van Rossum | 9327422 | 1997-05-09 02:42:00 +0000 | [diff] [blame] | 528 | fi], |
| 529 | [AC_MSG_RESULT(default LIBC=\"$LIBC\")]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 530 | |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 531 | # check for hypot() in math library |
| 532 | LIBS_SAVE=$LIBS |
| 533 | LIBS="$LIBS $LIBM" |
| 534 | AC_CHECK_FUNCS(hypot) |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 535 | AC_REPLACE_FUNCS(hypot) |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 536 | LIBS=$LIBS_SAVE |
| 537 | |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 538 | # check for getopt |
| 539 | AC_MSG_CHECKING(for genuine getopt) |
| 540 | AC_CACHE_VAL(ac_cv_func_getopt, |
| 541 | [AC_TRY_RUN([#include <stdio.h> |
| 542 | extern int optind, opterr, getopt(); |
| 543 | extern char* optarg; |
| 544 | int main() { |
| 545 | char* av[] = { "testprog", "parameter", "-fFlag", NULL }; |
| 546 | opterr = 0; |
| 547 | if (getopt(3, av, "f:") == 'f') { exit(1); } |
| 548 | exit(0); |
| 549 | }], ac_cv_func_getopt=yes, ac_cv_func_getopt=no, ac_cv_func_getopt=no)])dnl |
| 550 | AC_MSG_RESULT($ac_cv_func_getopt) |
| 551 | test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o" |
| 552 | AC_SUBST(LIBOBJS)dnl |
| 553 | |
Guido van Rossum | ad71370 | 1997-07-10 22:42:38 +0000 | [diff] [blame] | 554 | # check whether malloc(0) returns NULL or not |
Guido van Rossum | ad71370 | 1997-07-10 22:42:38 +0000 | [diff] [blame] | 555 | AC_MSG_CHECKING(what malloc(0) returns) |
| 556 | AC_CACHE_VAL(ac_cv_malloc_zero, |
| 557 | [AC_TRY_RUN([#include <stdio.h> |
| 558 | #ifdef HAVE_STDLIB |
| 559 | #include <stdlib.h> |
| 560 | #else |
| 561 | char *malloc(), *realloc(); |
| 562 | int *free(); |
| 563 | #endif |
| 564 | main() { |
| 565 | char *p; |
| 566 | p = malloc(0); |
| 567 | if (p == NULL) exit(1); |
| 568 | p = realloc(p, 0); |
| 569 | if (p == NULL) exit(1); |
| 570 | free(p); |
| 571 | exit(0); |
| 572 | }], ac_cv_malloc_zero=nonnull, ac_cv_malloc_zero=null)]) |
| 573 | AC_MSG_RESULT($ac_cv_malloc_zero) |
| 574 | if test "$ac_cv_malloc_zero" = null |
| 575 | then |
| 576 | AC_DEFINE(MALLOC_ZERO_RETURNS_NULL) |
| 577 | fi |
| 578 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 579 | # generate output files |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 580 | AC_OUTPUT(Makefile \ |
| 581 | Objects/Makefile \ |
| 582 | Parser/Makefile \ |
| 583 | Python/Makefile \ |
| 584 | Modules/Makefile.pre) |