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 | |
| 7 | # checks for alternative programs |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 8 | AC_CHECKING(for --with(out)-gcc) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 9 | AC_ARG_WITH(gcc, [--without-gcc never use gcc], [ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 10 | case $withval in |
| 11 | no) withval=cc;; |
| 12 | yes) withval=gcc;; |
| 13 | esac |
| 14 | CC=$withval]) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 15 | AC_PROG_CC |
| 16 | AC_PROG_RANLIB |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 17 | AC_SUBST(AR) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 18 | AC_CHECK_PROGS(AR, ar aal, ar) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 19 | AC_SUBST(INSTALL) |
| 20 | # Install just never works :-( |
| 21 | if test -z "$INSTALL" |
| 22 | then INSTALL=cp |
| 23 | fi |
| 24 | AC_SUBST(OPT) |
| 25 | # Optimizer/debugger flags passed between Makefiles |
| 26 | if test -z "$OPT" |
| 27 | then OPT=-O |
| 28 | fi |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 29 | |
| 30 | # checks for UNIX variants that set C preprocessor variables |
| 31 | AC_AIX |
| 32 | AC_ISC_POSIX |
| 33 | AC_MINIX |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 34 | AC_CHECKING(for NeXT) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 35 | AC_TRY_RUN([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 36 | #ifdef _NEXT_SOURCE |
| 37 | main() { exit(0); } |
| 38 | #endif |
| 39 | ], AC_DEFINE(_POSIX_SOURCE)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 40 | |
| 41 | # checks for header files |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 42 | AC_HEADER_STDC |
| 43 | AC_CHECK_HEADERS(dlfcn.h fcntl.h limits.h signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h sys/audioio.h sys/param.h sys/select.h sys/time.h sys/times.h sys/un.h sys/utsname.h) |
| 44 | AC_HEADER_DIRENT |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 45 | |
| 46 | # checks for typedefs |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 47 | AC_CHECKING(for clock_t in time.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 48 | AC_EGREP_HEADER(clock_t, time.h, , AC_DEFINE(clock_t, long)) |
| 49 | AC_TYPE_MODE_T |
| 50 | AC_TYPE_OFF_T |
| 51 | AC_TYPE_PID_T |
| 52 | AC_TYPE_SIGNAL |
| 53 | AC_TYPE_SIZE_T |
| 54 | AC_TYPE_UID_T |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 55 | |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 56 | # Set name for machine-dependent library files |
| 57 | AC_SUBST(MACHDEP) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 58 | AC_MSG_CHECKING(MACHDEP) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 59 | if test -z "$MACHDEP" |
| 60 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 61 | ac_sys_system=`uname -s | tr -d ' ' | tr '[[A-Z]]' '[[a-z]]'` |
| 62 | ac_sys_release=`uname -r | tr -d ' ' | sed 's/\..*//'` |
| 63 | MACHDEP="$ac_sys_system$ac_sys_release" |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 64 | case MACHDEP in |
| 65 | '') MACHDEP=unknown;; |
| 66 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 67 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 68 | AC_MSG_RESULT($MACHDEP) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 69 | |
| 70 | # Set info about shared libraries. |
| 71 | # XXX This should try things out instead of testing uname! |
| 72 | AC_SUBST(SO) |
| 73 | AC_SUBST(LDSHARED) |
| 74 | AC_SUBST(CCSHARED) |
| 75 | AC_SUBST(LINKFORSHARED) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 76 | ac_sys_system=`uname -s` |
| 77 | ac_sys_release=`uname -r` |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 78 | # SO is the extension of shared libraries `(including the dot!) |
| 79 | # -- usually .so, .sl on HP-UX |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 80 | AC_MSG_CHECKING(SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 81 | if test -z "$SO" |
| 82 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 83 | case $ac_sys_system in |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 84 | hp*|HP*) SO=.sl;; |
| 85 | *) SO=.so;; |
| 86 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 87 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 88 | AC_MSG_RESULT($SO) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 89 | # LDSHARED is the ld *command* used to create shared library |
| 90 | # -- "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] | 91 | AC_MSG_CHECKING(LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 92 | if test -z "$LDSHARED" |
| 93 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 94 | case $ac_sys_system/$ac_sys_release in |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 95 | IRIX*) LDSHARED="ld -shared";; |
| 96 | SunOS/4*) LDSHARED="ld";; |
| 97 | SunOS/5*) LDSHARED="ld -G";; |
| 98 | hp*|HP*) LDSHARED="ld -b";; |
| 99 | *) LDSHARED="ld";; |
| 100 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 101 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 102 | AC_MSG_RESULT($LDSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 103 | # CCSHARED are the C *flags* used to create objects to go into a shared |
| 104 | # library -- this is only needed for HP-UX |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 105 | AC_MSG_CHECKING(CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 106 | if test -z "$CCSHARED" |
| 107 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 108 | case $ac_sys_system in |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 109 | hp*|HP*) CCSHARED="+z";; |
| 110 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 111 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 112 | AC_MSG_RESULT($CCSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 113 | # LINKFORSHARED are the flags passed to the $(CC) command that links |
| 114 | # the python executable -- this is only needed for HP-UX |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 115 | AC_MSG_CHECKING(LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 116 | if test -z "$LINKFORSHARED" |
| 117 | then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 118 | case $ac_sys_system in |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 119 | hp*|HP*) LINKFORSHARED="-Wl,-E";; |
| 120 | esac |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 121 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 122 | AC_MSG_RESULT($LINKFORSHARED) |
Guido van Rossum | ac405f6 | 1994-09-12 10:56:06 +0000 | [diff] [blame] | 123 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 124 | # checks for libraries |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 125 | AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV |
| 126 | AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX |
| 127 | AC_CHECK_LIB(sun, getpwnam) # NIS (== YP) interface for IRIX 4 |
Guido van Rossum | f618d2c | 1995-01-17 16:36:13 +0000 | [diff] [blame] | 128 | AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 |
| 129 | AC_CHECK_LIB(inet, gethostbyname, [LIBS="-linet $LIBS"], [], -lnsl) # Sequent |
| 130 | AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 131 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 132 | AC_CHECKING(for --with-readline) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 133 | AC_ARG_WITH(readline, [--with-readline=DIRECTORY GNU readline], [ |
| 134 | AC_DEFINE(WITH_READLINE) |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 135 | if test ! -d "$withval" |
| 136 | then AC_ERROR(proper usage is --with-readline=DIRECTORY) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 137 | fi |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 138 | termcap= |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 139 | AC_CHECK_LIB(termcap, tgetent, [termcap=termcap], [ |
| 140 | AC_CHECK_LIB(termlib, tgetent, [termcap=termlib])]) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 141 | if test ! -z "$termcap" |
Guido van Rossum | 4e8af44 | 1994-08-19 15:33:54 +0000 | [diff] [blame] | 142 | then LIBS="$LIBS $withval/libreadline.a" |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 143 | # Avoid possible conflict between shared libraries termcap and gl |
| 144 | # on IRIX 5: both contain a routine called clear. |
| 145 | if test -f /usr/lib/lib$termcap.a |
| 146 | then LIBS="$LIBS /usr/lib/lib$termcap.a" |
| 147 | else LIBS="$LIBS -l$termcap" |
| 148 | fi |
| 149 | else AC_ERROR(no working termcap/termlib, do not use --with-readline) |
| 150 | fi]) |
| 151 | |
| 152 | AC_CHECKING(for --with-thread) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 153 | AC_ARG_WITH(thread, [--with-thread[=DIRECTORY] make interpreter thread-safe], [ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 154 | if test -d "$withval" |
| 155 | then LIBS="$LIBS -L$withval" |
| 156 | fi |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 157 | AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 158 | AC_DEFINE(_POSIX_THREADS) |
| 159 | LIBS="$LIBS -lpthreads" |
| 160 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 161 | AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 162 | LIBS="$LIBS -lmpc" |
| 163 | LIBOBJS="$LIBOBJS thread.o"]) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 164 | AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 165 | LIBS="$LIBS -lthread" |
| 166 | LIBOBJS="$LIBOBJS thread.o"]) |
| 167 | ]) |
| 168 | |
| 169 | # -I${DLINCLDIR} is added to the compile rule for import.o |
| 170 | AC_SUBST(DLINCLDIR) |
| 171 | DLINCLDIR=/ |
| 172 | |
| 173 | AC_CHECKING(for --with-sgi-dl) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 174 | AC_ARG_WITH(sgi-dl, [--with-sgi-dl=DIRECTORY IRIX 4 dynamic linking], [ |
| 175 | AC_DEFINE(WITH_SGI_DL) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 176 | dldir=$withval |
| 177 | if test -d "$dldir" |
| 178 | then LIBS="$LIBS -L$dldir" |
| 179 | else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY) |
| 180 | fi |
| 181 | DLINCLDIR=${dldir} |
| 182 | LIBS="$LIBS -ldl -lmld"]) |
| 183 | |
| 184 | AC_CHECKING(for --with-dl-dld) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 185 | AC_ARG_WITH(dl-dld, [--with-dl-dld=DL_DIR,DLD_DIR GNU dynamic linking], [ |
| 186 | AC_DEFINE(WITH_DL_DLD) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 187 | dldir=`echo "$withval" | sed 's/,.*//'` |
| 188 | dlddir=`echo "$withval" | sed 's/.*,//'` |
| 189 | if test -d "$dldir" -a -d "$dlddir" |
| 190 | then LIBS="$LIBS -L$dldir -L$dlddir" |
| 191 | else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY) |
| 192 | fi |
| 193 | DLINCLDIR=${dldir} |
| 194 | LIBS="$LIBS -ldl -ldld"]) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 195 | |
| 196 | # checks for library functions |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 197 | AC_CHECK_FUNCS(chown clock dlopen ftime ftruncate gethostname_r gettimeofday getpeername getpgrp getpid getwd link lstat nice readlink select setgid setuid setsid setpgid setpgrp setvbuf siginterrupt symlink tcgetpgrp tcsetpgrp times truncate uname waitpid) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 198 | AC_REPLACE_FUNCS(dup2 getcwd strerror memmove) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 199 | AC_CHECK_FUNC(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG))) |
| 200 | AC_CHECK_FUNC(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG))) |
| 201 | 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] | 202 | |
| 203 | # checks for structures |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 204 | AC_HEADER_TIME |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 205 | AC_STRUCT_TM |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 206 | AC_STRUCT_TIMEZONE |
| 207 | |
| 208 | AC_MSG_CHECKING(for time.h that defines altzone) |
| 209 | AC_CACHE_VAL(ac_cv_header_time_altzone, |
| 210 | [AC_TRY_COMPILE([#include <time.h>], [return altzone;], |
| 211 | ac_cv_header_time_altzone=yes, |
| 212 | ac_cv_header_time_altzone=no)]) |
| 213 | AC_MSG_RESULT($ac_cv_header_time_altzone) |
| 214 | if test $ac_cv_header_time_altzone = yes; then |
| 215 | AC_DEFINE(HAVE_ALTZONE) |
| 216 | fi |
| 217 | |
| 218 | AC_CHECKING(whether sys/select.h and sys/time.h may both be included) |
| 219 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 220 | #include <sys/types.h> |
| 221 | #include <sys/select.h> |
| 222 | #include <sys/time.h> |
| 223 | ], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME)]) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 224 | |
| 225 | # checks for compiler characteristics |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 226 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 227 | AC_C_CHAR_UNSIGNED |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 228 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 229 | AC_C_CONST |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 230 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 231 | AC_CHECKING(for working volatile) |
| 232 | AC_TRY_COMPILE([],[volatile int x; x = 0;],,AC_DEFINE(volatile, [])) |
Guido van Rossum | dabb11b | 1994-10-11 15:04:27 +0000 | [diff] [blame] | 233 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 234 | AC_CHECKING(for working signed char) |
| 235 | AC_TRY_COMPILE([], [signed char c;],,AC_DEFINE(signed, [])) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 236 | |
| 237 | AC_CHECKING(for prototypes) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 238 | AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], |
| 239 | AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=yes) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 240 | |
| 241 | AC_CHECKING(for variable length prototypes and stdarg.h) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 242 | AC_TRY_COMPILE([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 243 | #include <stdarg.h> |
| 244 | int foo(int x, ...) { return 0; } |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 245 | ], [return foo(10, 11, 12);], |
| 246 | AC_DEFINE(HAVE_STDARG_PROTOTYPES)) |
| 247 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 248 | if test "$have_prototypes"; then |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 249 | AC_CHECKING(for bad exec* prototypes) |
| 250 | AC_TRY_COMPILE([#include <unistd.h>], [char **t;execve("@",t,t);], , AC_DEFINE(BAD_EXEC_PROTOTYPES)) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 251 | fi |
| 252 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 253 | AC_CHECKING(for bad static forward) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 254 | AC_TRY_RUN([ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 255 | struct s { int a; int b; }; |
| 256 | static struct s foo; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 257 | int foobar() { |
| 258 | static int random; |
| 259 | random = (int) &foo; |
| 260 | return random; |
| 261 | } |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 262 | static struct s foo = { 1, 2 }; |
Guido van Rossum | 5dee5e7 | 1994-11-10 23:06:54 +0000 | [diff] [blame] | 263 | main() { |
| 264 | exit(!((int)&foo == foobar())); |
| 265 | } |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 266 | ], , AC_DEFINE(BAD_STATIC_FORWARD)) |
| 267 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 268 | AC_CHECKING(whether va_list is an array) |
| 269 | AC_TRY_COMPILE([ |
| 270 | #ifdef HAVE_STDARG_PROTOTYPES |
| 271 | #include <stdarg.h> |
| 272 | #else |
| 273 | #include <varargs.h> |
| 274 | #endif |
| 275 | ], [va_list list1, list2; list1 = list2;], , AC_DEFINE(VA_LIST_IS_ARRAY)) |
| 276 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 277 | # checks for system services |
| 278 | # (none yet) |
| 279 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 280 | # Linux requires this for correct f.p. operations |
| 281 | AC_CHECK_LIB(ieee, __fpu_control) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 282 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 283 | # check for --with-libm=... |
| 284 | AC_SUBST(LIBM) |
| 285 | LIBM=-lm |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 286 | AC_ARG_WITH(libm, [--with-libm=STRING math library], [ |
| 287 | if test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 288 | then LIBM=$withval |
| 289 | else AC_ERROR(proper usage is --with-libm=STRING) |
| 290 | fi]) |
| 291 | |
| 292 | # check for --with-libc=... |
| 293 | AC_SUBST(LIBC) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 294 | AC_ARG_WITH(libc, [--with-libc=STRING C library], [ |
| 295 | if test "$withval" != yes |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 296 | then LIBC=$withval |
| 297 | else AC_ERROR(proper usage is --with-libc=STRING) |
| 298 | fi]) |
| 299 | |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 300 | # check for hypot() in math library |
| 301 | LIBS_SAVE=$LIBS |
| 302 | LIBS="$LIBS $LIBM" |
| 303 | AC_CHECK_FUNCS(hypot) |
| 304 | LIBS=$LIBS_SAVE |
| 305 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 306 | # generate output files |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 307 | AC_OUTPUT(Makefile Objects/Makefile Parser/Makefile Python/Makefile Modules/Makefile.pre) |