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 | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 48 | case MACHDEP in |
| 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 | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 246 | AC_MSG_CHECKING(for --with-readline) |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 247 | AC_ARG_WITH(readline, [--with-readline[=DIRECTORY] use GNU readline library], [ |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 248 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 249 | AC_DEFINE(WITH_READLINE) |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 250 | if test -d "$withval" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 251 | then LDFLAGS="$LDFLAGS -L$withval" |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 252 | fi |
Guido van Rossum | 6f2260e | 1996-09-09 16:21:03 +0000 | [diff] [blame] | 253 | # first check if we can compile without lib termcap |
| 254 | AC_MSG_CHECKING(for -lreadline without -ltermcap) |
| 255 | # check if a libreadline exists |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 256 | LIBS="$LIBS -lreadline" |
Guido van Rossum | 6f2260e | 1996-09-09 16:21:03 +0000 | [diff] [blame] | 257 | AC_TRY_LINK(extern char *readline();,char *line=readline();,[ |
| 258 | AC_MSG_RESULT(yes)],[ |
| 259 | AC_MSG_RESULT(no) |
| 260 | AC_CHECKING(for -lreadline that needs -ltermcap) |
| 261 | termcap= |
| 262 | AC_CHECK_LIB(termcap, tgetent, [termcap=termcap], [ |
| 263 | AC_CHECK_LIB(termlib, tgetent, [termcap=termlib], [ |
| 264 | AC_ERROR(no working -ltermcap/termlib found -- do not use --with-readline)])]) |
| 265 | # Avoid possible conflict between shared libraries termcap and gl |
| 266 | # on IRIX 5: both contain a routine called clear. |
| 267 | if test -f /usr/lib/lib$termcap.a |
| 268 | then LIBS="$LIBS /usr/lib/lib$termcap.a" |
| 269 | else LIBS="$LIBS -l$termcap" |
| 270 | fi |
| 271 | AC_MSG_CHECKING(for -lreadline) |
| 272 | AC_TRY_LINK(extern char *readline();, char *line=readline();,[ |
| 273 | AC_MSG_RESULT(yes)],[ |
| 274 | AC_ERROR(no working GNU readline library found -- do not use --with-readline)]) |
| 275 | ]) |
| 276 | ], |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 277 | AC_MSG_RESULT(no)) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 278 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 279 | AC_MSG_CHECKING(for --with-thread) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 280 | AC_ARG_WITH(thread, [--with-thread[=DIRECTORY] make interpreter thread-safe], [ |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 281 | AC_MSG_RESULT($withval) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 282 | if test -d "$withval" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 283 | then LDFLAGS="$LDFLAGS -L$withval" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 284 | fi |
Guido van Rossum | 9caf77a | 1996-08-01 00:52:26 +0000 | [diff] [blame] | 285 | AC_DEFINE(_REENTRANT) |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 286 | AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD) |
| 287 | AC_DEFINE(C_THREADS) |
| 288 | LIBOBJS="$LIBOBJS thread.o"],[ |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 289 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 290 | AC_DEFINE(_POSIX_THREADS) |
| 291 | LIBS="$LIBS -lpthreads" |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 292 | LIBOBJS="$LIBOBJS thread.o"], [ |
| 293 | AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD) |
| 294 | AC_DEFINE(_POSIX_THREADS) |
| 295 | LIBS="$LIBS -lpthread" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 296 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 297 | ])]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 298 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 299 | LIBS="$LIBS -lmpc" |
| 300 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 301 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 302 | LIBS="$LIBS -lthread" |
| 303 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 304 | ], AC_MSG_RESULT(no)) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 305 | |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 306 | # -I${DLINCLDIR} is added to the compile rule for importdl.o |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 307 | AC_SUBST(DLINCLDIR) |
| 308 | DLINCLDIR=/ |
| 309 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 310 | AC_MSG_CHECKING(for --with-sgi-dl) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 311 | 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] | 312 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 313 | AC_DEFINE(WITH_SGI_DL) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 314 | dldir=$withval |
| 315 | if test -d "$dldir" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 316 | then LDFLAGS="$LDFLAGS -L$dldir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 317 | else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY) |
| 318 | fi |
| 319 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 320 | LIBS="$LIBS -ldl -lmld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 321 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 322 | AC_MSG_CHECKING(for --with-dl-dld) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 323 | 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] | 324 | AC_MSG_RESULT($withval) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 325 | AC_DEFINE(WITH_DL_DLD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 326 | dldir=`echo "$withval" | sed 's/,.*//'` |
| 327 | dlddir=`echo "$withval" | sed 's/.*,//'` |
| 328 | if test -d "$dldir" -a -d "$dlddir" |
Guido van Rossum | 300fda7 | 1996-08-19 21:58:16 +0000 | [diff] [blame] | 329 | then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 330 | else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY) |
| 331 | fi |
| 332 | DLINCLDIR=${dldir} |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 333 | LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 334 | |
| 335 | # checks for library functions |
Guido van Rossum | a2ef383 | 1996-06-26 19:45:23 +0000 | [diff] [blame] | 336 | AC_CHECK_FUNCS(chown clock dlopen flock ftime ftruncate \ |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 337 | gethostname_r getpeername getpgrp getpid gettimeofday getwd \ |
Guido van Rossum | dde4317 | 1996-07-24 02:41:31 +0000 | [diff] [blame] | 338 | link lstat mkfifo nice plock putenv readlink \ |
Guido van Rossum | 68242b5 | 1996-05-28 22:53:03 +0000 | [diff] [blame] | 339 | select setgid setuid setsid setpgid setpgrp setvbuf \ |
| 340 | sigaction siginterrupt sigrelse strftime symlink \ |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 341 | tcgetpgrp tcsetpgrp times truncate uname waitpid) |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 342 | AC_REPLACE_FUNCS(dup2 getcwd strdup strerror memmove) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 343 | AC_CHECK_FUNC(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG))) |
| 344 | AC_CHECK_FUNC(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG))) |
| 345 | 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] | 346 | |
| 347 | # checks for structures |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 348 | AC_HEADER_TIME |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 349 | AC_STRUCT_TM |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 350 | AC_STRUCT_TIMEZONE |
| 351 | |
| 352 | AC_MSG_CHECKING(for time.h that defines altzone) |
| 353 | AC_CACHE_VAL(ac_cv_header_time_altzone, |
| 354 | [AC_TRY_COMPILE([#include <time.h>], [return altzone;], |
| 355 | ac_cv_header_time_altzone=yes, |
| 356 | ac_cv_header_time_altzone=no)]) |
| 357 | AC_MSG_RESULT($ac_cv_header_time_altzone) |
| 358 | if test $ac_cv_header_time_altzone = yes; then |
| 359 | AC_DEFINE(HAVE_ALTZONE) |
| 360 | fi |
| 361 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 362 | was_it_defined=no |
| 363 | 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] | 364 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 365 | #include <sys/types.h> |
| 366 | #include <sys/select.h> |
| 367 | #include <sys/time.h> |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 368 | ], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME) was_it_defined=yes]) |
| 369 | AC_MSG_RESULT($was_it_defined) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 370 | |
| 371 | # checks for compiler characteristics |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 372 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 373 | AC_C_CHAR_UNSIGNED |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 374 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 375 | AC_C_CONST |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 376 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 377 | works=no |
| 378 | AC_MSG_CHECKING(for working volatile) |
| 379 | AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes, AC_DEFINE(volatile, [])) |
| 380 | AC_MSG_RESULT($works) |
Guido van Rossum | dabb11b | 1994-10-11 15:04:27 +0000 | [diff] [blame] | 381 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 382 | works=no |
| 383 | AC_MSG_CHECKING(for working signed char) |
| 384 | AC_TRY_COMPILE([], [signed char c;], works=yes, AC_DEFINE(signed, [])) |
| 385 | AC_MSG_RESULT($works) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 386 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 387 | have_prototypes=no |
| 388 | AC_MSG_CHECKING(for prototypes) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 389 | AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], |
| 390 | AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=yes) |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 391 | AC_MSG_RESULT($have_prototypes) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 392 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 393 | works=no |
| 394 | AC_MSG_CHECKING(for variable length prototypes and stdarg.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 395 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 396 | #include <stdarg.h> |
Guido van Rossum | 3f13e48 | 1996-08-30 20:58:11 +0000 | [diff] [blame] | 397 | int foo(int x, ...) { |
| 398 | va_list va; |
| 399 | va_start(va, x); |
| 400 | va_arg(va, int); |
| 401 | va_arg(va, char *); |
| 402 | va_arg(va, double); |
| 403 | return 0; |
| 404 | } |
| 405 | ], [return foo(10, "", 3.14);], |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 406 | AC_DEFINE(HAVE_STDARG_PROTOTYPES) works=yes) |
| 407 | AC_MSG_RESULT($works) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 408 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 409 | if test "$have_prototypes" = yes; then |
| 410 | bad_prototypes=no |
| 411 | AC_MSG_CHECKING(for bad exec* prototypes) |
| 412 | AC_TRY_COMPILE([#include <unistd.h>], [char **t;execve("@",t,t);], , |
| 413 | AC_DEFINE(BAD_EXEC_PROTOTYPES) bad_prototypes=yes) |
| 414 | AC_MSG_RESULT($bad_prototypes) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 415 | fi |
| 416 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 417 | bad_forward=no |
| 418 | AC_MSG_CHECKING(for bad static forward) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 419 | AC_TRY_RUN([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 420 | struct s { int a; int b; }; |
| 421 | static struct s foo; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 422 | int foobar() { |
| 423 | static int random; |
| 424 | random = (int) &foo; |
| 425 | return random; |
| 426 | } |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 427 | static struct s foo = { 1, 2 }; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 428 | main() { |
| 429 | exit(!((int)&foo == foobar())); |
| 430 | } |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 431 | ], , AC_DEFINE(BAD_STATIC_FORWARD) bad_forward=yes) |
| 432 | AC_MSG_RESULT($bad_forward) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 433 | |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 434 | va_list_is_array=no |
| 435 | AC_MSG_CHECKING(whether va_list is an array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 436 | AC_TRY_COMPILE([ |
| 437 | #ifdef HAVE_STDARG_PROTOTYPES |
| 438 | #include <stdarg.h> |
| 439 | #else |
| 440 | #include <varargs.h> |
| 441 | #endif |
Guido van Rossum | 5739e7e | 1995-01-20 16:50:53 +0000 | [diff] [blame] | 442 | ], [va_list list1, list2; list1 = list2;], , |
| 443 | AC_DEFINE(VA_LIST_IS_ARRAY) va_list_is_array=yes) |
| 444 | AC_MSG_RESULT($va_list_is_array) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 445 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 446 | # checks for system services |
| 447 | # (none yet) |
| 448 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 449 | # Linux requires this for correct f.p. operations |
| 450 | AC_CHECK_LIB(ieee, __fpu_control) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 451 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 452 | # check for --with-libm=... |
| 453 | AC_SUBST(LIBM) |
Guido van Rossum | 4b6b579 | 1996-09-09 20:09:34 +0000 | [diff] [blame] | 454 | case $ac_sys_system in |
| 455 | next) ;; |
| 456 | *) LIBM=-lm |
| 457 | esac |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 458 | AC_ARG_WITH(libm, [--with-libm=STRING math library], [ |
| 459 | if test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 460 | then LIBM=$withval |
| 461 | else AC_ERROR(proper usage is --with-libm=STRING) |
| 462 | fi]) |
| 463 | |
| 464 | # check for --with-libc=... |
| 465 | AC_SUBST(LIBC) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 466 | AC_ARG_WITH(libc, [--with-libc=STRING C library], [ |
| 467 | if test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 468 | then LIBC=$withval |
| 469 | else AC_ERROR(proper usage is --with-libc=STRING) |
| 470 | fi]) |
| 471 | |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 472 | # check for hypot() in math library |
| 473 | LIBS_SAVE=$LIBS |
| 474 | LIBS="$LIBS $LIBM" |
| 475 | AC_CHECK_FUNCS(hypot) |
Guido van Rossum | f2f7eb3 | 1996-08-30 15:18:00 +0000 | [diff] [blame] | 476 | AC_REPLACE_FUNCS(hypot) |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 477 | LIBS=$LIBS_SAVE |
| 478 | |
Guido van Rossum | 7d47329 | 1995-01-20 14:12:16 +0000 | [diff] [blame] | 479 | # check for getopt |
| 480 | AC_MSG_CHECKING(for genuine getopt) |
| 481 | AC_CACHE_VAL(ac_cv_func_getopt, |
| 482 | [AC_TRY_RUN([#include <stdio.h> |
| 483 | extern int optind, opterr, getopt(); |
| 484 | extern char* optarg; |
| 485 | int main() { |
| 486 | char* av[] = { "testprog", "parameter", "-fFlag", NULL }; |
| 487 | opterr = 0; |
| 488 | if (getopt(3, av, "f:") == 'f') { exit(1); } |
| 489 | exit(0); |
| 490 | }], ac_cv_func_getopt=yes, ac_cv_func_getopt=no, ac_cv_func_getopt=no)])dnl |
| 491 | AC_MSG_RESULT($ac_cv_func_getopt) |
| 492 | test $ac_cv_func_getopt = no && LIBOBJS="$LIBOBJS getopt.o" |
| 493 | AC_SUBST(LIBOBJS)dnl |
| 494 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 495 | # generate output files |
Guido van Rossum | b418f89 | 1996-07-30 18:06:02 +0000 | [diff] [blame] | 496 | AC_OUTPUT(Makefile \ |
| 497 | Objects/Makefile \ |
| 498 | Parser/Makefile \ |
| 499 | Python/Makefile \ |
| 500 | Modules/Makefile.pre) |