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