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