| Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame^] | 1 |  | 
 | 2 | #!/bin/sh | 
 | 3 | # Guess values for system-dependent variables and create Makefiles. | 
 | 4 | # Generated automatically using autoconf. | 
 | 5 | # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. | 
 | 6 |  | 
 | 7 | # This program is free software; you can redistribute it and/or modify | 
 | 8 | # it under the terms of the GNU General Public License as published by | 
 | 9 | # the Free Software Foundation; either version 2, or (at your option) | 
 | 10 | # any later version. | 
 | 11 |  | 
 | 12 | # This program is distributed in the hope that it will be useful, | 
 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
 | 15 | # GNU General Public License for more details. | 
 | 16 |  | 
 | 17 | # You should have received a copy of the GNU General Public License | 
 | 18 | # along with this program; if not, write to the Free Software | 
 | 19 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 
 | 20 |  | 
 | 21 | # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] | 
 | 22 | #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]] | 
 | 23 | # Ignores all args except --srcdir, --prefix, --exec-prefix, and | 
 | 24 | # --with-PACKAGE[=VALUE] unless this script has special code to handle it. | 
 | 25 |  | 
 | 26 | for arg | 
 | 27 | do | 
 | 28 |   # Handle --exec-prefix with a space before the argument. | 
 | 29 |   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix= | 
 | 30 |   # Handle --host with a space before the argument. | 
 | 31 |   elif test x$next_host = xyes; then next_host= | 
 | 32 |   # Handle --prefix with a space before the argument. | 
 | 33 |   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix= | 
 | 34 |   # Handle --srcdir with a space before the argument. | 
 | 35 |   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir= | 
 | 36 |   else | 
 | 37 |     case $arg in | 
 | 38 |      # For backward compatibility, recognize -exec-prefix and --exec_prefix. | 
 | 39 |      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*) | 
 | 40 | 	exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; | 
 | 41 |      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e) | 
 | 42 | 	next_exec_prefix=yes ;; | 
 | 43 |  | 
 | 44 |      -gas | --gas | --ga | --g) ;; | 
 | 45 |  | 
 | 46 |      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;; | 
 | 47 |      -host | --host | --hos | --ho | --h) | 
 | 48 | 	next_host=yes ;; | 
 | 49 |  | 
 | 50 |      -nfp | --nfp | --nf) ;; | 
 | 51 |  | 
 | 52 |      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | 
 | 53 | 	prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; | 
 | 54 |      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | 
 | 55 | 	next_prefix=yes ;; | 
 | 56 |  | 
 | 57 |      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*) | 
 | 58 | 	srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;; | 
 | 59 |      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s) | 
 | 60 | 	next_srcdir=yes ;; | 
 | 61 |  | 
 | 62 |      -with-* | --with-*) | 
 | 63 |        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'` | 
 | 64 |        # Reject names that aren't valid shell variable names. | 
 | 65 |        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then | 
 | 66 |          echo "configure: $package: invalid package name" >&2; exit 1 | 
 | 67 |        fi | 
 | 68 |        package=`echo $package| sed 's/-/_/g'` | 
 | 69 |        case "$arg" in | 
 | 70 |          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;; | 
 | 71 |          *) val=1 ;; | 
 | 72 |        esac | 
 | 73 |        eval "with_$package='$val'" ;; | 
 | 74 |  | 
 | 75 |      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v) | 
 | 76 |        verbose=yes ;; | 
 | 77 |  | 
 | 78 |      *) ;; | 
 | 79 |     esac | 
 | 80 |   fi | 
 | 81 | done | 
 | 82 |  | 
 | 83 | trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15 | 
 | 84 | trap 'rm -f confdefs*' 0 | 
 | 85 |  | 
 | 86 | # NLS nuisances. | 
 | 87 | # These must not be set unconditionally because not all systems understand | 
 | 88 | # e.g. LANG=C (notably SCO). | 
 | 89 | if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi | 
 | 90 | if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi | 
 | 91 |  | 
 | 92 | rm -f conftest* confdefs.h | 
 | 93 | # AIX cpp loses on an empty file, so make sure it contains at least a newline. | 
 | 94 | echo > confdefs.h | 
 | 95 | compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1' | 
 | 96 |  | 
 | 97 | # A filename unique to this package, relative to the directory that | 
 | 98 | # configure is in, which we can look for to find out if srcdir is correct. | 
 | 99 | unique_file=Py/object.h | 
 | 100 |  | 
 | 101 | # Find the source files, if location was not specified. | 
 | 102 | if test -z "$srcdir"; then | 
 | 103 |   srcdirdefaulted=yes | 
 | 104 |   # Try the directory containing this script, then `..'. | 
 | 105 |   prog=$0 | 
 | 106 |   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'` | 
 | 107 |   test "X$confdir" = "X$prog" && confdir=. | 
 | 108 |   srcdir=$confdir | 
 | 109 |   if test ! -r $srcdir/$unique_file; then | 
 | 110 |     srcdir=.. | 
 | 111 |   fi | 
 | 112 | fi | 
 | 113 | if test ! -r $srcdir/$unique_file; then | 
 | 114 |   if test x$srcdirdefaulted = xyes; then | 
 | 115 |     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2 | 
 | 116 |   else | 
 | 117 |     echo "configure: Can not find sources in \`${srcdir}'." 1>&2 | 
 | 118 |   fi | 
 | 119 |   exit 1 | 
 | 120 | fi | 
 | 121 | # Preserve a srcdir of `.' to avoid automounter screwups with pwd. | 
 | 122 | # But we can't avoid them for `..', to make subdirectories work. | 
 | 123 | case $srcdir in | 
 | 124 |   .|/*|~*) ;; | 
 | 125 |   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute. | 
 | 126 | esac | 
 | 127 |  | 
 | 128 |  | 
 | 129 | # Save the original args to write them into config.status later. | 
 | 130 | configure_args="$*" | 
 | 131 |  | 
 | 132 |  | 
 | 133 | # checks for alternative programs | 
 | 134 | if test -z "$CC"; then | 
 | 135 |   # Extract the first word of `gcc', so it can be a program name with args. | 
 | 136 |   set dummy gcc; word=$2 | 
 | 137 |   echo checking for $word | 
 | 138 |   IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:" | 
 | 139 |   for dir in $PATH; do | 
 | 140 |     test -z "$dir" && dir=. | 
 | 141 |     if test -f $dir/$word; then | 
 | 142 |       CC="gcc" | 
 | 143 |       break | 
 | 144 |     fi | 
 | 145 |   done | 
 | 146 |   IFS="$saveifs" | 
 | 147 | fi | 
 | 148 | test -z "$CC" && CC="cc" | 
 | 149 | test -n "$CC" && test -n "$verbose" && echo "	setting CC to $CC" | 
 | 150 |  | 
 | 151 | # Find out if we are using GNU C, under whatever name. | 
 | 152 | cat > conftest.c <<EOF | 
 | 153 | #ifdef __GNUC__ | 
 | 154 |   yes | 
 | 155 | #endif | 
 | 156 | EOF | 
 | 157 | ${CC-cc} -E conftest.c > conftest.out 2>&1 | 
 | 158 | if egrep yes conftest.out >/dev/null 2>&1; then | 
 | 159 |   GCC=1 # For later tests. | 
 | 160 | fi | 
 | 161 | rm -f conftest* | 
 | 162 |  | 
 | 163 | if test -z "$RANLIB"; then | 
 | 164 |   # Extract the first word of `ranlib', so it can be a program name with args. | 
 | 165 |   set dummy ranlib; word=$2 | 
 | 166 |   echo checking for $word | 
 | 167 |   IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:" | 
 | 168 |   for dir in $PATH; do | 
 | 169 |     test -z "$dir" && dir=. | 
 | 170 |     if test -f $dir/$word; then | 
 | 171 |       RANLIB="ranlib" | 
 | 172 |       break | 
 | 173 |     fi | 
 | 174 |   done | 
 | 175 |   IFS="$saveifs" | 
 | 176 | fi | 
 | 177 | test -z "$RANLIB" && RANLIB=":" | 
 | 178 | test -n "$RANLIB" && test -n "$verbose" && echo "	setting RANLIB to $RANLIB" | 
 | 179 |  | 
 | 180 |  | 
 | 181 | # checks for UNIX variants that set C preprocessor variables | 
 | 182 | echo checking for AIX | 
 | 183 | echo checking how to run the C preprocessor | 
 | 184 | if test -z "$CPP"; then | 
 | 185 |   # This must be in double quotes, not single quotes, because CPP may get | 
 | 186 |   # substituted into the Makefile and ``${CC-cc}'' will simply confuse | 
 | 187 |   # make.  It must be expanded now. | 
 | 188 |   CPP="${CC-cc} -E" | 
 | 189 |   cat > conftest.c <<EOF | 
 | 190 | #include "confdefs.h" | 
 | 191 | #include <stdio.h> | 
 | 192 | Syntax Error | 
 | 193 | EOF | 
 | 194 | err=`eval "($CPP conftest.c >/dev/null) 2>&1"` | 
 | 195 | if test -z "$err"; then | 
 | 196 |   : | 
 | 197 | else | 
 | 198 |   rm -rf conftest* | 
 | 199 |   CPP=/lib/cpp | 
 | 200 | fi | 
 | 201 | rm -f conftest* | 
 | 202 | fi | 
 | 203 | test ".${verbose}" != "." && echo "	setting CPP to $CPP" | 
 | 204 |  | 
 | 205 | cat > conftest.c <<EOF | 
 | 206 | #include "confdefs.h" | 
 | 207 | #ifdef _AIX | 
 | 208 |   yes | 
 | 209 | #endif | 
 | 210 |  | 
 | 211 | EOF | 
 | 212 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 213 | if egrep "yes" conftest.out >/dev/null 2>&1; then | 
 | 214 |   rm -rf conftest* | 
 | 215 |    | 
 | 216 | { | 
 | 217 | test -n "$verbose" && \ | 
 | 218 | echo "	defining _ALL_SOURCE" | 
 | 219 | echo "#define" _ALL_SOURCE 1 >> confdefs.h | 
 | 220 | DEFS="$DEFS -D_ALL_SOURCE=1" | 
 | 221 | } | 
 | 222 |  | 
 | 223 |  | 
 | 224 | fi | 
 | 225 | rm -f conftest* | 
 | 226 |  | 
 | 227 |  | 
 | 228 | echo checking for POSIXized ISC | 
 | 229 | if test -d /etc/conf/kconfig.d && | 
 | 230 |   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 | 
 | 231 | then | 
 | 232 |   ISC=1 # If later tests want to check for ISC. | 
 | 233 |    | 
 | 234 | { | 
 | 235 | test -n "$verbose" && \ | 
 | 236 | echo "	defining _POSIX_SOURCE" | 
 | 237 | echo "#define" _POSIX_SOURCE 1 >> confdefs.h | 
 | 238 | DEFS="$DEFS -D_POSIX_SOURCE=1" | 
 | 239 | } | 
 | 240 |  | 
 | 241 |   if test -n "$GCC"; then | 
 | 242 |     CC="$CC -posix" | 
 | 243 |   else | 
 | 244 |     CC="$CC -Xp" | 
 | 245 |   fi | 
 | 246 | fi | 
 | 247 |  | 
 | 248 | echo checking for minix/config.h | 
 | 249 | cat > conftest.c <<EOF | 
 | 250 | #include "confdefs.h" | 
 | 251 | #include <minix/config.h> | 
 | 252 | EOF | 
 | 253 | err=`eval "($CPP conftest.c >/dev/null) 2>&1"` | 
 | 254 | if test -z "$err"; then | 
 | 255 |   rm -rf conftest* | 
 | 256 |   MINIX=1 | 
 | 257 |  | 
 | 258 | fi | 
 | 259 | rm -f conftest* | 
 | 260 |  | 
 | 261 | # The Minix shell can't assign to the same variable on the same line! | 
 | 262 | if test -n "$MINIX"; then | 
 | 263 |    | 
 | 264 | { | 
 | 265 | test -n "$verbose" && \ | 
 | 266 | echo "	defining _POSIX_SOURCE" | 
 | 267 | echo "#define" _POSIX_SOURCE 1 >> confdefs.h | 
 | 268 | DEFS="$DEFS -D_POSIX_SOURCE=1" | 
 | 269 | } | 
 | 270 |  | 
 | 271 |    | 
 | 272 | { | 
 | 273 | test -n "$verbose" && \ | 
 | 274 | echo "	defining" _POSIX_1_SOURCE to be 2 | 
 | 275 | echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h | 
 | 276 | DEFS="$DEFS -D_POSIX_1_SOURCE=2" | 
 | 277 | } | 
 | 278 |  | 
 | 279 |    | 
 | 280 | { | 
 | 281 | test -n "$verbose" && \ | 
 | 282 | echo "	defining _MINIX" | 
 | 283 | echo "#define" _MINIX 1 >> confdefs.h | 
 | 284 | DEFS="$DEFS -D_MINIX=1" | 
 | 285 | } | 
 | 286 |  | 
 | 287 | fi | 
 | 288 |  | 
 | 289 | LIBS_save="${LIBS}" | 
 | 290 | LIBS="${LIBS} -lseq" | 
 | 291 | have_lib="" | 
 | 292 | echo checking for -lseq | 
 | 293 | cat > conftest.c <<EOF | 
 | 294 | #include "confdefs.h" | 
 | 295 |  | 
 | 296 | int main() { exit(0); } | 
 | 297 | int t() { main(); } | 
 | 298 | EOF | 
 | 299 | if eval $compile; then | 
 | 300 |   rm -rf conftest* | 
 | 301 |   have_lib="1" | 
 | 302 |  | 
 | 303 | fi | 
 | 304 | rm -f conftest* | 
 | 305 | LIBS="${LIBS_save}" | 
 | 306 | if test -n "${have_lib}"; then | 
 | 307 |    :; LIBS="$LIBS -lseq" | 
 | 308 | else | 
 | 309 |    :;  | 
 | 310 | fi | 
 | 311 |  | 
 | 312 |  | 
 | 313 |  | 
 | 314 | # checks for header files | 
 | 315 | echo checking for ANSI C header files | 
 | 316 | cat > conftest.c <<EOF | 
 | 317 | #include "confdefs.h" | 
 | 318 | #include <stdlib.h> | 
 | 319 | #include <stdarg.h> | 
 | 320 | #include <string.h> | 
 | 321 | #include <float.h> | 
 | 322 | EOF | 
 | 323 | err=`eval "($CPP conftest.c >/dev/null) 2>&1"` | 
 | 324 | if test -z "$err"; then | 
 | 325 |   rm -rf conftest* | 
 | 326 |   # SunOS 4.x string.h does not declare mem*, contrary to ANSI. | 
 | 327 | echo '#include "confdefs.h" | 
 | 328 | #include <string.h>' > conftest.c | 
 | 329 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 330 | if egrep "memchr" conftest.out >/dev/null 2>&1; then | 
 | 331 |   rm -rf conftest* | 
 | 332 |   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. | 
 | 333 | cat > conftest.c <<EOF | 
 | 334 | #include "confdefs.h" | 
 | 335 | #include <ctype.h> | 
 | 336 | #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | 
 | 337 | #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) | 
 | 338 | #define XOR(e,f) (((e) && !(f)) || (!(e) && (f))) | 
 | 339 | int main () { int i; for (i = 0; i < 256; i++) | 
 | 340 | if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); | 
 | 341 | exit (0); } | 
 | 342 |  | 
 | 343 | EOF | 
 | 344 | eval $compile | 
 | 345 | if test -s conftest && (./conftest; exit) 2>/dev/null; then | 
 | 346 |    | 
 | 347 | { | 
 | 348 | test -n "$verbose" && \ | 
 | 349 | echo "	defining STDC_HEADERS" | 
 | 350 | echo "#define" STDC_HEADERS 1 >> confdefs.h | 
 | 351 | DEFS="$DEFS -DSTDC_HEADERS=1" | 
 | 352 | } | 
 | 353 |  | 
 | 354 |  | 
 | 355 | fi | 
 | 356 | rm -fr conftest* | 
 | 357 |  | 
 | 358 | fi | 
 | 359 | rm -f conftest* | 
 | 360 |  | 
 | 361 |  | 
 | 362 | fi | 
 | 363 | rm -f conftest* | 
 | 364 |  | 
 | 365 | for hdr in dlfcn.h signal.h stdarg.h unistd.h utime.h sys/param.h sys/select.h sys/times.h sys/utsname.h | 
 | 366 | do | 
 | 367 | trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'` | 
 | 368 | echo checking for ${hdr} | 
 | 369 | cat > conftest.c <<EOF | 
 | 370 | #include "confdefs.h" | 
 | 371 | #include <${hdr}> | 
 | 372 | EOF | 
 | 373 | err=`eval "($CPP conftest.c >/dev/null) 2>&1"` | 
 | 374 | if test -z "$err"; then | 
 | 375 |   rm -rf conftest* | 
 | 376 |    | 
 | 377 | { | 
 | 378 | test -n "$verbose" && \ | 
 | 379 | echo "	defining ${trhdr}" | 
 | 380 | echo "#define" ${trhdr} 1 >> confdefs.h | 
 | 381 | DEFS="$DEFS -D${trhdr}=1" | 
 | 382 | } | 
 | 383 |  | 
 | 384 |  | 
 | 385 | fi | 
 | 386 | rm -f conftest* | 
 | 387 | done | 
 | 388 |  | 
 | 389 | echo checking for directory library header | 
 | 390 | dirheader= | 
 | 391 | if test -z "$dirheader"; then | 
 | 392 |   echo checking for dirent.h | 
 | 393 | cat > conftest.c <<EOF | 
 | 394 | #include "confdefs.h" | 
 | 395 | #include <sys/types.h> | 
 | 396 | #include <dirent.h> | 
 | 397 | int main() { exit(0); } | 
 | 398 | int t() { DIR *dirp = 0; } | 
 | 399 | EOF | 
 | 400 | if eval $compile; then | 
 | 401 |   rm -rf conftest* | 
 | 402 |    | 
 | 403 | { | 
 | 404 | test -n "$verbose" && \ | 
 | 405 | echo "	defining DIRENT" | 
 | 406 | echo "#define" DIRENT 1 >> confdefs.h | 
 | 407 | DEFS="$DEFS -DDIRENT=1" | 
 | 408 | } | 
 | 409 |  dirheader=dirent.h | 
 | 410 |  | 
 | 411 | fi | 
 | 412 | rm -f conftest* | 
 | 413 | fi | 
 | 414 | if test -z "$dirheader"; then | 
 | 415 |   echo checking for sys/ndir.h | 
 | 416 | cat > conftest.c <<EOF | 
 | 417 | #include "confdefs.h" | 
 | 418 | #include <sys/types.h> | 
 | 419 | #include <sys/ndir.h> | 
 | 420 | int main() { exit(0); } | 
 | 421 | int t() { DIR *dirp = 0; } | 
 | 422 | EOF | 
 | 423 | if eval $compile; then | 
 | 424 |   rm -rf conftest* | 
 | 425 |    | 
 | 426 | { | 
 | 427 | test -n "$verbose" && \ | 
 | 428 | echo "	defining SYSNDIR" | 
 | 429 | echo "#define" SYSNDIR 1 >> confdefs.h | 
 | 430 | DEFS="$DEFS -DSYSNDIR=1" | 
 | 431 | } | 
 | 432 |  dirheader=sys/ndir.h | 
 | 433 |  | 
 | 434 | fi | 
 | 435 | rm -f conftest* | 
 | 436 | fi | 
 | 437 | if test -z "$dirheader"; then | 
 | 438 |   echo checking for sys/dir.h | 
 | 439 | cat > conftest.c <<EOF | 
 | 440 | #include "confdefs.h" | 
 | 441 | #include <sys/types.h> | 
 | 442 | #include <sys/dir.h> | 
 | 443 | int main() { exit(0); } | 
 | 444 | int t() { DIR *dirp = 0; } | 
 | 445 | EOF | 
 | 446 | if eval $compile; then | 
 | 447 |   rm -rf conftest* | 
 | 448 |    | 
 | 449 | { | 
 | 450 | test -n "$verbose" && \ | 
 | 451 | echo "	defining SYSDIR" | 
 | 452 | echo "#define" SYSDIR 1 >> confdefs.h | 
 | 453 | DEFS="$DEFS -DSYSDIR=1" | 
 | 454 | } | 
 | 455 |  dirheader=sys/dir.h | 
 | 456 |  | 
 | 457 | fi | 
 | 458 | rm -f conftest* | 
 | 459 | fi | 
 | 460 | if test -z "$dirheader"; then | 
 | 461 |   echo checking for ndir.h | 
 | 462 | cat > conftest.c <<EOF | 
 | 463 | #include "confdefs.h" | 
 | 464 | #include <sys/types.h> | 
 | 465 | #include <ndir.h> | 
 | 466 | int main() { exit(0); } | 
 | 467 | int t() { DIR *dirp = 0; } | 
 | 468 | EOF | 
 | 469 | if eval $compile; then | 
 | 470 |   rm -rf conftest* | 
 | 471 |    | 
 | 472 | { | 
 | 473 | test -n "$verbose" && \ | 
 | 474 | echo "	defining NDIR" | 
 | 475 | echo "#define" NDIR 1 >> confdefs.h | 
 | 476 | DEFS="$DEFS -DNDIR=1" | 
 | 477 | } | 
 | 478 |  dirheader=ndir.h | 
 | 479 |  | 
 | 480 | fi | 
 | 481 | rm -f conftest* | 
 | 482 | fi | 
 | 483 |  | 
 | 484 | echo checking for closedir return value | 
 | 485 | cat > conftest.c <<EOF | 
 | 486 | #include "confdefs.h" | 
 | 487 | #include <sys/types.h> | 
 | 488 | #include <$dirheader> | 
 | 489 | int closedir(); main() { exit(closedir(opendir(".")) != 0); } | 
 | 490 | EOF | 
 | 491 | eval $compile | 
 | 492 | if test -s conftest && (./conftest; exit) 2>/dev/null; then | 
 | 493 |   : | 
 | 494 | else | 
 | 495 |    | 
 | 496 | { | 
 | 497 | test -n "$verbose" && \ | 
 | 498 | echo "	defining VOID_CLOSEDIR" | 
 | 499 | echo "#define" VOID_CLOSEDIR 1 >> confdefs.h | 
 | 500 | DEFS="$DEFS -DVOID_CLOSEDIR=1" | 
 | 501 | } | 
 | 502 |  | 
 | 503 | fi | 
 | 504 | rm -fr conftest* | 
 | 505 |  | 
 | 506 |  | 
 | 507 | # checks for typedefs | 
 | 508 | echo checking for uid_t in sys/types.h | 
 | 509 | echo '#include "confdefs.h" | 
 | 510 | #include <sys/types.h>' > conftest.c | 
 | 511 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 512 | if egrep "uid_t" conftest.out >/dev/null 2>&1; then | 
 | 513 |   : | 
 | 514 | else | 
 | 515 |   rm -rf conftest* | 
 | 516 |    | 
 | 517 | { | 
 | 518 | test -n "$verbose" && \ | 
 | 519 | echo "	defining" uid_t to be int | 
 | 520 | echo "#define" uid_t int >> confdefs.h | 
 | 521 | DEFS="$DEFS -Duid_t=int" | 
 | 522 | } | 
 | 523 |   | 
 | 524 | { | 
 | 525 | test -n "$verbose" && \ | 
 | 526 | echo "	defining" gid_t to be int | 
 | 527 | echo "#define" gid_t int >> confdefs.h | 
 | 528 | DEFS="$DEFS -Dgid_t=int" | 
 | 529 | } | 
 | 530 |  | 
 | 531 | fi | 
 | 532 | rm -f conftest* | 
 | 533 |  | 
 | 534 | echo checking for type of array argument to getgroups | 
 | 535 | prog='/* Thanks to Mike Rendell for this test.  */ | 
 | 536 | #include <sys/types.h> | 
 | 537 | #define NGID 256 | 
 | 538 | #undef MAX | 
 | 539 | #define MAX(x,y) ((x) > (y) ? (x) : (y)) | 
 | 540 | main() | 
 | 541 | { | 
 | 542 |   gid_t gidset[NGID]; | 
 | 543 |   int i, n; | 
 | 544 |   union { gid_t gval; long lval; }  val; | 
 | 545 |  | 
 | 546 |   val.lval = -1; | 
 | 547 |   for (i = 0; i < NGID; i++) | 
 | 548 |     gidset[i] = val.gval; | 
 | 549 |   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, | 
 | 550 |                  gidset); | 
 | 551 |   /* Exit non-zero if getgroups seems to require an array of ints.  This | 
 | 552 |      happens when gid_t is short but getgroups modifies an array of ints.  */ | 
 | 553 |   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); | 
 | 554 | }' | 
 | 555 | cat > conftest.c <<EOF | 
 | 556 | #include "confdefs.h" | 
 | 557 | $prog | 
 | 558 | EOF | 
 | 559 | eval $compile | 
 | 560 | if test -s conftest && (./conftest; exit) 2>/dev/null; then | 
 | 561 |    | 
 | 562 | { | 
 | 563 | test -n "$verbose" && \ | 
 | 564 | echo "	defining" GETGROUPS_T to be gid_t | 
 | 565 | echo "#define" GETGROUPS_T gid_t >> confdefs.h | 
 | 566 | DEFS="$DEFS -DGETGROUPS_T=gid_t" | 
 | 567 | } | 
 | 568 |  | 
 | 569 |  | 
 | 570 | else | 
 | 571 |    | 
 | 572 | { | 
 | 573 | test -n "$verbose" && \ | 
 | 574 | echo "	defining" GETGROUPS_T to be int | 
 | 575 | echo "#define" GETGROUPS_T int >> confdefs.h | 
 | 576 | DEFS="$DEFS -DGETGROUPS_T=int" | 
 | 577 | } | 
 | 578 |  | 
 | 579 | fi | 
 | 580 | rm -fr conftest* | 
 | 581 |  | 
 | 582 | echo checking for mode_t in sys/types.h | 
 | 583 | echo '#include "confdefs.h" | 
 | 584 | #include <sys/types.h>' > conftest.c | 
 | 585 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 586 | if egrep "mode_t" conftest.out >/dev/null 2>&1; then | 
 | 587 |   : | 
 | 588 | else | 
 | 589 |   rm -rf conftest* | 
 | 590 |    | 
 | 591 | { | 
 | 592 | test -n "$verbose" && \ | 
 | 593 | echo "	defining" mode_t to be int | 
 | 594 | echo "#define" mode_t int >> confdefs.h | 
 | 595 | DEFS="$DEFS -Dmode_t=int" | 
 | 596 | } | 
 | 597 |  | 
 | 598 | fi | 
 | 599 | rm -f conftest* | 
 | 600 |  | 
 | 601 | echo checking for off_t in sys/types.h | 
 | 602 | echo '#include "confdefs.h" | 
 | 603 | #include <sys/types.h>' > conftest.c | 
 | 604 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 605 | if egrep "off_t" conftest.out >/dev/null 2>&1; then | 
 | 606 |   : | 
 | 607 | else | 
 | 608 |   rm -rf conftest* | 
 | 609 |    | 
 | 610 | { | 
 | 611 | test -n "$verbose" && \ | 
 | 612 | echo "	defining" off_t to be long | 
 | 613 | echo "#define" off_t long >> confdefs.h | 
 | 614 | DEFS="$DEFS -Doff_t=long" | 
 | 615 | } | 
 | 616 |  | 
 | 617 | fi | 
 | 618 | rm -f conftest* | 
 | 619 |  | 
 | 620 | echo checking for pid_t in sys/types.h | 
 | 621 | echo '#include "confdefs.h" | 
 | 622 | #include <sys/types.h>' > conftest.c | 
 | 623 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 624 | if egrep "pid_t" conftest.out >/dev/null 2>&1; then | 
 | 625 |   : | 
 | 626 | else | 
 | 627 |   rm -rf conftest* | 
 | 628 |    | 
 | 629 | { | 
 | 630 | test -n "$verbose" && \ | 
 | 631 | echo "	defining" pid_t to be int | 
 | 632 | echo "#define" pid_t int >> confdefs.h | 
 | 633 | DEFS="$DEFS -Dpid_t=int" | 
 | 634 | } | 
 | 635 |  | 
 | 636 | fi | 
 | 637 | rm -f conftest* | 
 | 638 |  | 
 | 639 | echo checking for return type of signal handlers | 
 | 640 | cat > conftest.c <<EOF | 
 | 641 | #include "confdefs.h" | 
 | 642 | #include <sys/types.h> | 
 | 643 | #include <signal.h> | 
 | 644 | #ifdef signal | 
 | 645 | #undef signal | 
 | 646 | #endif | 
 | 647 | extern void (*signal ()) (); | 
 | 648 | int main() { exit(0); } | 
 | 649 | int t() { int i; } | 
 | 650 | EOF | 
 | 651 | if eval $compile; then | 
 | 652 |   rm -rf conftest* | 
 | 653 |    | 
 | 654 | { | 
 | 655 | test -n "$verbose" && \ | 
 | 656 | echo "	defining" RETSIGTYPE to be void | 
 | 657 | echo "#define" RETSIGTYPE void >> confdefs.h | 
 | 658 | DEFS="$DEFS -DRETSIGTYPE=void" | 
 | 659 | } | 
 | 660 |  | 
 | 661 |  | 
 | 662 | else | 
 | 663 |   rm -rf conftest* | 
 | 664 |    | 
 | 665 | { | 
 | 666 | test -n "$verbose" && \ | 
 | 667 | echo "	defining" RETSIGTYPE to be int | 
 | 668 | echo "#define" RETSIGTYPE int >> confdefs.h | 
 | 669 | DEFS="$DEFS -DRETSIGTYPE=int" | 
 | 670 | } | 
 | 671 |  | 
 | 672 | fi | 
 | 673 | rm -f conftest* | 
 | 674 |  | 
 | 675 |  | 
 | 676 | echo checking for size_t in sys/types.h | 
 | 677 | echo '#include "confdefs.h" | 
 | 678 | #include <sys/types.h>' > conftest.c | 
 | 679 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 680 | if egrep "size_t" conftest.out >/dev/null 2>&1; then | 
 | 681 |   : | 
 | 682 | else | 
 | 683 |   rm -rf conftest* | 
 | 684 |    | 
 | 685 | { | 
 | 686 | test -n "$verbose" && \ | 
 | 687 | echo "	defining" size_t to be unsigned | 
 | 688 | echo "#define" size_t unsigned >> confdefs.h | 
 | 689 | DEFS="$DEFS -Dsize_t=unsigned" | 
 | 690 | } | 
 | 691 |  | 
 | 692 | fi | 
 | 693 | rm -f conftest* | 
 | 694 |  | 
 | 695 | echo checking for uid_t in sys/types.h | 
 | 696 | echo '#include "confdefs.h" | 
 | 697 | #include <sys/types.h>' > conftest.c | 
 | 698 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 699 | if egrep "uid_t" conftest.out >/dev/null 2>&1; then | 
 | 700 |   : | 
 | 701 | else | 
 | 702 |   rm -rf conftest* | 
 | 703 |    | 
 | 704 | { | 
 | 705 | test -n "$verbose" && \ | 
 | 706 | echo "	defining" uid_t to be int | 
 | 707 | echo "#define" uid_t int >> confdefs.h | 
 | 708 | DEFS="$DEFS -Duid_t=int" | 
 | 709 | } | 
 | 710 |   | 
 | 711 | { | 
 | 712 | test -n "$verbose" && \ | 
 | 713 | echo "	defining" gid_t to be int | 
 | 714 | echo "#define" gid_t int >> confdefs.h | 
 | 715 | DEFS="$DEFS -Dgid_t=int" | 
 | 716 | } | 
 | 717 |  | 
 | 718 | fi | 
 | 719 | rm -f conftest* | 
 | 720 |  | 
 | 721 |  | 
 | 722 | # checks for libraries | 
 | 723 | LIBS_save="${LIBS}" | 
 | 724 | LIBS="${LIBS} -ldl" | 
 | 725 | have_lib="" | 
 | 726 | echo checking for -ldl | 
 | 727 | cat > conftest.c <<EOF | 
 | 728 | #include "confdefs.h" | 
 | 729 |  | 
 | 730 | int main() { exit(0); } | 
 | 731 | int t() { main(); } | 
 | 732 | EOF | 
 | 733 | if eval $compile; then | 
 | 734 |   rm -rf conftest* | 
 | 735 |   have_lib="1" | 
 | 736 |  | 
 | 737 | fi | 
 | 738 | rm -f conftest* | 
 | 739 | LIBS="${LIBS_save}" | 
 | 740 | if test -n "${have_lib}"; then | 
 | 741 |     | 
 | 742 | { | 
 | 743 | test -n "$verbose" && \ | 
 | 744 | echo "	defining HAVE_LIBDL" | 
 | 745 | echo "#define" HAVE_LIBDL 1 >> confdefs.h | 
 | 746 | DEFS="$DEFS -DHAVE_LIBDL=1" | 
 | 747 | } | 
 | 748 |  | 
 | 749 |    LIBS="${LIBS} -ldl" | 
 | 750 | fi | 
 | 751 |  | 
 | 752 | LIBS="${LIBS} -L${READLINESRC-${PWD-${CWD-`pwd`}}/readline}" | 
 | 753 | LIBS_save="${LIBS}" | 
 | 754 | LIBS="${LIBS} -lreadline" | 
 | 755 | have_lib="" | 
 | 756 | echo checking for -lreadline | 
 | 757 | cat > conftest.c <<EOF | 
 | 758 | #include "confdefs.h" | 
 | 759 |  | 
 | 760 | int main() { exit(0); } | 
 | 761 | int t() { main(); } | 
 | 762 | EOF | 
 | 763 | if eval $compile; then | 
 | 764 |   rm -rf conftest* | 
 | 765 |   have_lib="1" | 
 | 766 |  | 
 | 767 | fi | 
 | 768 | rm -f conftest* | 
 | 769 | LIBS="${LIBS_save}" | 
 | 770 | if test -n "${have_lib}"; then | 
 | 771 |     | 
 | 772 | { | 
 | 773 | test -n "$verbose" && \ | 
 | 774 | echo "	defining HAVE_LIBREADLINE" | 
 | 775 | echo "#define" HAVE_LIBREADLINE 1 >> confdefs.h | 
 | 776 | DEFS="$DEFS -DHAVE_LIBREADLINE=1" | 
 | 777 | } | 
 | 778 |  | 
 | 779 |    LIBS="${LIBS} -lreadline" | 
 | 780 | fi | 
 | 781 |  | 
 | 782 | if test -n "${have_lib}"; then | 
 | 783 | LIBS_save="${LIBS}" | 
 | 784 | LIBS="${LIBS} -ltermcap" | 
 | 785 | have_lib="" | 
 | 786 | echo checking for -ltermcap | 
 | 787 | cat > conftest.c <<EOF | 
 | 788 | #include "confdefs.h" | 
 | 789 |  | 
 | 790 | int main() { exit(0); } | 
 | 791 | int t() { main(); } | 
 | 792 | EOF | 
 | 793 | if eval $compile; then | 
 | 794 |   rm -rf conftest* | 
 | 795 |   have_lib="1" | 
 | 796 |  | 
 | 797 | fi | 
 | 798 | rm -f conftest* | 
 | 799 | LIBS="${LIBS_save}" | 
 | 800 | if test -n "${have_lib}"; then | 
 | 801 |     | 
 | 802 | { | 
 | 803 | test -n "$verbose" && \ | 
 | 804 | echo "	defining HAVE_LIBTERMCAP" | 
 | 805 | echo "#define" HAVE_LIBTERMCAP 1 >> confdefs.h | 
 | 806 | DEFS="$DEFS -DHAVE_LIBTERMCAP=1" | 
 | 807 | } | 
 | 808 |  | 
 | 809 |    LIBS="${LIBS} -ltermcap" | 
 | 810 | fi | 
 | 811 |  | 
 | 812 | fi | 
 | 813 |  | 
 | 814 | # Check for IRIX or SOLARIS thread interface | 
 | 815 | LIBS_save="${LIBS}" | 
 | 816 | LIBS="${LIBS} -lmpc" | 
 | 817 | have_lib="" | 
 | 818 | echo checking for -lmpc | 
 | 819 | cat > conftest.c <<EOF | 
 | 820 | #include "confdefs.h" | 
 | 821 |  | 
 | 822 | int main() { exit(0); } | 
 | 823 | int t() { main(); } | 
 | 824 | EOF | 
 | 825 | if eval $compile; then | 
 | 826 |   rm -rf conftest* | 
 | 827 |   have_lib="1" | 
 | 828 |  | 
 | 829 | fi | 
 | 830 | rm -f conftest* | 
 | 831 | LIBS="${LIBS_save}" | 
 | 832 | if test -n "${have_lib}"; then | 
 | 833 |     | 
 | 834 | { | 
 | 835 | test -n "$verbose" && \ | 
 | 836 | echo "	defining HAVE_LIBMPC" | 
 | 837 | echo "#define" HAVE_LIBMPC 1 >> confdefs.h | 
 | 838 | DEFS="$DEFS -DHAVE_LIBMPC=1" | 
 | 839 | } | 
 | 840 |  | 
 | 841 |    LIBS="${LIBS} -lmpc" | 
 | 842 | fi | 
 | 843 |  | 
 | 844 | if test -n "${have_lib}"; then | 
 | 845 | DEFS="${DEFS} -DUSE_THREAD" | 
 | 846 | LIBOBJS="${LIBOBJS} thread.o" | 
 | 847 | fi | 
 | 848 |  | 
 | 849 | LIBS_save="${LIBS}" | 
 | 850 | LIBS="${LIBS} -lthread" | 
 | 851 | have_lib="" | 
 | 852 | echo checking for -lthread | 
 | 853 | cat > conftest.c <<EOF | 
 | 854 | #include "confdefs.h" | 
 | 855 |  | 
 | 856 | int main() { exit(0); } | 
 | 857 | int t() { main(); } | 
 | 858 | EOF | 
 | 859 | if eval $compile; then | 
 | 860 |   rm -rf conftest* | 
 | 861 |   have_lib="1" | 
 | 862 |  | 
 | 863 | fi | 
 | 864 | rm -f conftest* | 
 | 865 | LIBS="${LIBS_save}" | 
 | 866 | if test -n "${have_lib}"; then | 
 | 867 |     | 
 | 868 | { | 
 | 869 | test -n "$verbose" && \ | 
 | 870 | echo "	defining HAVE_LIBTHREAD" | 
 | 871 | echo "#define" HAVE_LIBTHREAD 1 >> confdefs.h | 
 | 872 | DEFS="$DEFS -DHAVE_LIBTHREAD=1" | 
 | 873 | } | 
 | 874 |  | 
 | 875 |    LIBS="${LIBS} -lthread" | 
 | 876 | fi | 
 | 877 |  | 
 | 878 | if test -n "${have_lib}"; then | 
 | 879 | DEFS="${DEFS} -DUSE_THREAD" | 
 | 880 | LIBOBJS="${LIBOBJS} thread.o" | 
 | 881 | fi | 
 | 882 |  | 
 | 883 | # checks for library functions | 
 | 884 | for func in clock ftime gettimeofday getpgrp getwd lstat readlink readline select setsid setpgid setpgrp siginterrupt symlink tcgetpgrp tcsetpgrp times uname waitpid | 
 | 885 | do | 
 | 886 | trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'` | 
 | 887 | echo checking for ${func} | 
 | 888 | cat > conftest.c <<EOF | 
 | 889 | #include "confdefs.h" | 
 | 890 | #include <ctype.h> | 
 | 891 | int main() { exit(0); } | 
 | 892 | int t() {  | 
 | 893 | /* The GNU C library defines this for functions which it implements | 
 | 894 |     to always fail with ENOSYS.  Some functions are actually named | 
 | 895 |     something starting with __ and the normal name is an alias.  */ | 
 | 896 | #if defined (__stub_${func}) || defined (__stub___${func}) | 
 | 897 | choke me | 
 | 898 | #else | 
 | 899 | /* Override any gcc2 internal prototype to avoid an error.  */ | 
 | 900 | extern char ${func}(); ${func}(); | 
 | 901 | #endif | 
 | 902 |  } | 
 | 903 | EOF | 
 | 904 | if eval $compile; then | 
 | 905 |   rm -rf conftest* | 
 | 906 |   { | 
 | 907 | test -n "$verbose" && \ | 
 | 908 | echo "	defining ${trfunc}" | 
 | 909 | echo "#define" ${trfunc} 1 >> confdefs.h | 
 | 910 | DEFS="$DEFS -D${trfunc}=1" | 
 | 911 | } | 
 | 912 |  | 
 | 913 |  | 
 | 914 | fi | 
 | 915 | rm -f conftest* | 
 | 916 | done | 
 | 917 |  | 
 | 918 | for func in dup2 getcwd strerror strtoul strtod memmove | 
 | 919 | do | 
 | 920 | echo checking for ${func} | 
 | 921 | cat > conftest.c <<EOF | 
 | 922 | #include "confdefs.h" | 
 | 923 | #include <ctype.h> | 
 | 924 | int main() { exit(0); } | 
 | 925 | int t() {  | 
 | 926 | /* The GNU C library defines this for functions which it implements | 
 | 927 |     to always fail with ENOSYS.  Some functions are actually named | 
 | 928 |     something starting with __ and the normal name is an alias.  */ | 
 | 929 | #if defined (__stub_${func}) || defined (__stub___${func}) | 
 | 930 | choke me | 
 | 931 | #else | 
 | 932 | /* Override any gcc2 internal prototype to avoid an error.  */ | 
 | 933 | extern char ${func}(); ${func}(); | 
 | 934 | #endif | 
 | 935 |  } | 
 | 936 | EOF | 
 | 937 | if eval $compile; then | 
 | 938 |   : | 
 | 939 | else | 
 | 940 |   rm -rf conftest* | 
 | 941 |   LIBOBJS="$LIBOBJS ${func}.o" | 
 | 942 | test -n "$verbose" && echo "	using ${func}.o instead" | 
 | 943 | fi | 
 | 944 | rm -f conftest* | 
 | 945 |  | 
 | 946 | done | 
 | 947 |  | 
 | 948 | echo checking for getpgrp | 
 | 949 | cat > conftest.c <<EOF | 
 | 950 | #include "confdefs.h" | 
 | 951 | #include <ctype.h> | 
 | 952 | int main() { exit(0); } | 
 | 953 | int t() {  | 
 | 954 | /* The GNU C library defines this for functions which it implements | 
 | 955 |     to always fail with ENOSYS.  Some functions are actually named | 
 | 956 |     something starting with __ and the normal name is an alias.  */ | 
 | 957 | #if defined (__stub_getpgrp) || defined (__stub___getpgrp) | 
 | 958 | choke me | 
 | 959 | #else | 
 | 960 | /* Override any gcc2 internal prototype to avoid an error.  */ | 
 | 961 | extern char getpgrp(); getpgrp(); | 
 | 962 | #endif | 
 | 963 |  } | 
 | 964 | EOF | 
 | 965 | if eval $compile; then | 
 | 966 |   rm -rf conftest* | 
 | 967 |   echo checking for argument to getpgrp | 
 | 968 | cat > conftest.c <<EOF | 
 | 969 | #include "confdefs.h" | 
 | 970 | #include <unistd.h> | 
 | 971 | int main() { exit(0); } | 
 | 972 | int t() { getpgrp(0); } | 
 | 973 | EOF | 
 | 974 | if eval $compile; then | 
 | 975 |   rm -rf conftest* | 
 | 976 |    | 
 | 977 | { | 
 | 978 | test -n "$verbose" && \ | 
 | 979 | echo "	defining GETPGRP_HAVE_ARG" | 
 | 980 | echo "#define" GETPGRP_HAVE_ARG 1 >> confdefs.h | 
 | 981 | DEFS="$DEFS -DGETPGRP_HAVE_ARG=1" | 
 | 982 | } | 
 | 983 |  | 
 | 984 |  | 
 | 985 | fi | 
 | 986 | rm -f conftest* | 
 | 987 |  | 
 | 988 |  | 
 | 989 | fi | 
 | 990 | rm -f conftest* | 
 | 991 |  | 
 | 992 |  | 
 | 993 | # checks for structures | 
 | 994 | echo checking for whether time.h and sys/time.h may both be included | 
 | 995 | cat > conftest.c <<EOF | 
 | 996 | #include "confdefs.h" | 
 | 997 | #include <sys/types.h> | 
 | 998 | #include <sys/time.h> | 
 | 999 | #include <time.h> | 
 | 1000 | int main() { exit(0); } | 
 | 1001 | int t() { struct tm *tp; } | 
 | 1002 | EOF | 
 | 1003 | if eval $compile; then | 
 | 1004 |   rm -rf conftest* | 
 | 1005 |    | 
 | 1006 | { | 
 | 1007 | test -n "$verbose" && \ | 
 | 1008 | echo "	defining TIME_WITH_SYS_TIME" | 
 | 1009 | echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h | 
 | 1010 | DEFS="$DEFS -DTIME_WITH_SYS_TIME=1" | 
 | 1011 | } | 
 | 1012 |  | 
 | 1013 |  | 
 | 1014 | fi | 
 | 1015 | rm -f conftest* | 
 | 1016 |  | 
 | 1017 | echo checking for struct tm in time.h | 
 | 1018 | cat > conftest.c <<EOF | 
 | 1019 | #include "confdefs.h" | 
 | 1020 | #include <sys/types.h> | 
 | 1021 | #include <time.h> | 
 | 1022 | int main() { exit(0); } | 
 | 1023 | int t() { struct tm *tp; tp->tm_sec; } | 
 | 1024 | EOF | 
 | 1025 | if eval $compile; then | 
 | 1026 |   : | 
 | 1027 | else | 
 | 1028 |   rm -rf conftest* | 
 | 1029 |    | 
 | 1030 | { | 
 | 1031 | test -n "$verbose" && \ | 
 | 1032 | echo "	defining TM_IN_SYS_TIME" | 
 | 1033 | echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h | 
 | 1034 | DEFS="$DEFS -DTM_IN_SYS_TIME=1" | 
 | 1035 | } | 
 | 1036 |  | 
 | 1037 | fi | 
 | 1038 | rm -f conftest* | 
 | 1039 |  | 
 | 1040 | decl='#include <sys/types.h> | 
 | 1041 | ' | 
 | 1042 | case "$DEFS" in | 
 | 1043 |   *TM_IN_SYS_TIME*) decl="$decl | 
 | 1044 | #include <sys/time.h> | 
 | 1045 | " ;; | 
 | 1046 |   *) decl="$decl | 
 | 1047 | #include <time.h> | 
 | 1048 | " ;; | 
 | 1049 | esac | 
 | 1050 | echo checking for tm_zone in struct tm | 
 | 1051 | cat > conftest.c <<EOF | 
 | 1052 | #include "confdefs.h" | 
 | 1053 | $decl | 
 | 1054 | int main() { exit(0); } | 
 | 1055 | int t() { struct tm tm; tm.tm_zone; } | 
 | 1056 | EOF | 
 | 1057 | if eval $compile; then | 
 | 1058 |   rm -rf conftest* | 
 | 1059 |    | 
 | 1060 | { | 
 | 1061 | test -n "$verbose" && \ | 
 | 1062 | echo "	defining HAVE_TM_ZONE" | 
 | 1063 | echo "#define" HAVE_TM_ZONE 1 >> confdefs.h | 
 | 1064 | DEFS="$DEFS -DHAVE_TM_ZONE=1" | 
 | 1065 | } | 
 | 1066 |  | 
 | 1067 |  | 
 | 1068 | else | 
 | 1069 |   rm -rf conftest* | 
 | 1070 |   no_tm_zone=1 | 
 | 1071 | fi | 
 | 1072 | rm -f conftest* | 
 | 1073 |  | 
 | 1074 | if test -n "$no_tm_zone"; then | 
 | 1075 | echo checking for tzname | 
 | 1076 | cat > conftest.c <<EOF | 
 | 1077 | #include "confdefs.h" | 
 | 1078 | #include <time.h> | 
 | 1079 | #ifndef tzname /* For SGI.  */ | 
 | 1080 | extern char *tzname[]; /* RS6000 and others want it this way.  */ | 
 | 1081 | #endif | 
 | 1082 | int main() { exit(0); } | 
 | 1083 | int t() { atoi(*tzname); } | 
 | 1084 | EOF | 
 | 1085 | if eval $compile; then | 
 | 1086 |   rm -rf conftest* | 
 | 1087 |    | 
 | 1088 | { | 
 | 1089 | test -n "$verbose" && \ | 
 | 1090 | echo "	defining HAVE_TZNAME" | 
 | 1091 | echo "#define" HAVE_TZNAME 1 >> confdefs.h | 
 | 1092 | DEFS="$DEFS -DHAVE_TZNAME=1" | 
 | 1093 | } | 
 | 1094 |  | 
 | 1095 |  | 
 | 1096 | fi | 
 | 1097 | rm -f conftest* | 
 | 1098 |  | 
 | 1099 | fi | 
 | 1100 |  | 
 | 1101 |  | 
 | 1102 | # checks for compiler characteristics | 
 | 1103 | prog='/* Ultrix mips cc rejects this.  */ | 
 | 1104 | typedef int charset[2]; const charset x; | 
 | 1105 | /* SunOS 4.1.1 cc rejects this.  */ | 
 | 1106 | char const *const *ccp; | 
 | 1107 | char **p; | 
 | 1108 | /* AIX XL C 1.02.0.0 rejects this. | 
 | 1109 |    It does not let you subtract one const X* pointer from another in an arm | 
 | 1110 |    of an if-expression whose if-part is not a constant expression */ | 
 | 1111 | const char *g = "string"; | 
 | 1112 | ccp = &g + (g ? g-g : 0); | 
 | 1113 | /* HPUX 7.0 cc rejects these. */ | 
 | 1114 | ++ccp; | 
 | 1115 | p = (char**) ccp; | 
 | 1116 | ccp = (char const *const *) p; | 
 | 1117 | { /* SCO 3.2v4 cc rejects this.  */ | 
 | 1118 |   char *t; | 
 | 1119 |   char const *s = 0 ? (char *) 0 : (char const *) 0; | 
 | 1120 |  | 
 | 1121 |   *t++ = 0; | 
 | 1122 | } | 
 | 1123 | { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */ | 
 | 1124 |   int x[] = {25,17}; | 
 | 1125 |   const int *foo = &x[0]; | 
 | 1126 |   ++foo; | 
 | 1127 | } | 
 | 1128 | { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ | 
 | 1129 |   typedef const int *iptr; | 
 | 1130 |   iptr p = 0; | 
 | 1131 |   ++p; | 
 | 1132 | } | 
 | 1133 | { /* AIX XL C 1.02.0.0 rejects this saying | 
 | 1134 |      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ | 
 | 1135 |   struct s { int j; const int *ap[3]; }; | 
 | 1136 |   struct s *b; b->j = 5; | 
 | 1137 | } | 
 | 1138 | { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ | 
 | 1139 |   const int foo = 10; | 
 | 1140 | }' | 
 | 1141 | echo checking for lack of working const | 
 | 1142 | cat > conftest.c <<EOF | 
 | 1143 | #include "confdefs.h" | 
 | 1144 |  | 
 | 1145 | int main() { exit(0); } | 
 | 1146 | int t() { $prog } | 
 | 1147 | EOF | 
 | 1148 | if eval $compile; then | 
 | 1149 |   : | 
 | 1150 | else | 
 | 1151 |   rm -rf conftest* | 
 | 1152 |    | 
 | 1153 | { | 
 | 1154 | test -n "$verbose" && \ | 
 | 1155 | echo "	defining" const to be empty | 
 | 1156 | echo "#define" const  >> confdefs.h | 
 | 1157 | DEFS="$DEFS -Dconst=" | 
 | 1158 | } | 
 | 1159 |  | 
 | 1160 | fi | 
 | 1161 | rm -f conftest* | 
 | 1162 |  | 
 | 1163 | echo checking for prototypes | 
 | 1164 | cat > conftest.c <<EOF | 
 | 1165 | #include "confdefs.h" | 
 | 1166 | int foo(int x){return 0;} int main(){return foo(10);} | 
 | 1167 | EOF | 
 | 1168 | eval $compile | 
 | 1169 | if test -s conftest && (./conftest; exit) 2>/dev/null; then | 
 | 1170 |    | 
 | 1171 | { | 
 | 1172 | test -n "$verbose" && \ | 
 | 1173 | echo "	defining HAVE_PROTOTYPES" | 
 | 1174 | echo "#define" HAVE_PROTOTYPES 1 >> confdefs.h | 
 | 1175 | DEFS="$DEFS -DHAVE_PROTOTYPES=1" | 
 | 1176 | } | 
 | 1177 |  have_prototypes=1 | 
 | 1178 |  | 
 | 1179 | fi | 
 | 1180 | rm -fr conftest* | 
 | 1181 | if test "$have_prototypes"; then | 
 | 1182 | echo checking for "bad exec* prototypes" | 
 | 1183 | cat > conftest.c <<EOF | 
 | 1184 | #include "confdefs.h" | 
 | 1185 | #include <unistd.h> | 
 | 1186 | int main() { exit(0); } | 
 | 1187 | int t() { char *const*t;execve("@",t,t); } | 
 | 1188 | EOF | 
 | 1189 | if eval $compile; then | 
 | 1190 |   : | 
 | 1191 | else | 
 | 1192 |   rm -rf conftest* | 
 | 1193 |    | 
 | 1194 | { | 
 | 1195 | test -n "$verbose" && \ | 
 | 1196 | echo "	defining BAD_EXEC_PROTOTYPES" | 
 | 1197 | echo "#define" BAD_EXEC_PROTOTYPES 1 >> confdefs.h | 
 | 1198 | DEFS="$DEFS -DBAD_EXEC_PROTOTYPES=1" | 
 | 1199 | } | 
 | 1200 |  | 
 | 1201 | fi | 
 | 1202 | rm -f conftest* | 
 | 1203 |  | 
 | 1204 | fi | 
 | 1205 |  | 
 | 1206 | # checks for system services | 
 | 1207 | # (none yet) | 
 | 1208 |  | 
 | 1209 | # other checks for UNIX variants | 
 | 1210 | LIBS_save="${LIBS}" | 
 | 1211 | LIBS="${LIBS} -lsun" | 
 | 1212 | have_lib="" | 
 | 1213 | echo checking for -lsun | 
 | 1214 | cat > conftest.c <<EOF | 
 | 1215 | #include "confdefs.h" | 
 | 1216 |  | 
 | 1217 | int main() { exit(0); } | 
 | 1218 | int t() { main(); } | 
 | 1219 | EOF | 
 | 1220 | if eval $compile; then | 
 | 1221 |   rm -rf conftest* | 
 | 1222 |   have_lib="1" | 
 | 1223 |  | 
 | 1224 | fi | 
 | 1225 | rm -f conftest* | 
 | 1226 | LIBS="${LIBS_save}" | 
 | 1227 | if test -n "${have_lib}"; then | 
 | 1228 |    :; LIBS="$LIBS -lsun" | 
 | 1229 | else | 
 | 1230 |    :;  | 
 | 1231 | fi | 
 | 1232 |  | 
 | 1233 |  | 
 | 1234 | echo checking for Xenix | 
 | 1235 | cat > conftest.c <<EOF | 
 | 1236 | #include "confdefs.h" | 
 | 1237 | #if defined(M_XENIX) && !defined(M_UNIX) | 
 | 1238 |   yes | 
 | 1239 | #endif | 
 | 1240 |  | 
 | 1241 | EOF | 
 | 1242 | eval "$CPP conftest.c > conftest.out 2>&1" | 
 | 1243 | if egrep "yes" conftest.out >/dev/null 2>&1; then | 
 | 1244 |   rm -rf conftest* | 
 | 1245 |   XENIX=1 | 
 | 1246 |  | 
 | 1247 | fi | 
 | 1248 | rm -f conftest* | 
 | 1249 |  | 
 | 1250 | if test -n "$XENIX"; then | 
 | 1251 |   LIBS="$LIBS -lx" | 
 | 1252 |   case "$DEFS" in | 
 | 1253 |   *SYSNDIR*) ;; | 
 | 1254 |   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx. | 
 | 1255 |   esac | 
 | 1256 | fi | 
 | 1257 |  | 
 | 1258 |  | 
 | 1259 | # generate output files | 
 | 1260 | # Set default prefixes. | 
 | 1261 | if test -n "$prefix"; then | 
 | 1262 |   test -z "$exec_prefix" && exec_prefix='${prefix}' | 
 | 1263 |   prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%" | 
 | 1264 | fi | 
 | 1265 | if test -n "$exec_prefix"; then | 
 | 1266 |   prsub="$prsub | 
 | 1267 | s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%" | 
 | 1268 | fi | 
 | 1269 | # Quote sed substitution magic chars in DEFS. | 
 | 1270 | cat >conftest.def <<EOF | 
 | 1271 | $DEFS | 
 | 1272 | EOF | 
 | 1273 | escape_ampersand_and_backslash='s%[&\\]%\\&%g' | 
 | 1274 | DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def` | 
 | 1275 | rm -f conftest.def | 
 | 1276 | # Substitute for predefined variables. | 
 | 1277 |  | 
 | 1278 | trap 'rm -f config.status; exit 1' 1 3 15 | 
 | 1279 | echo creating config.status | 
 | 1280 | rm -f config.status | 
 | 1281 | cat > config.status <<EOF | 
 | 1282 | #!/bin/sh | 
 | 1283 | # Generated automatically by configure. | 
 | 1284 | # Run this file to recreate the current configuration. | 
 | 1285 | # This directory was configured as follows, | 
 | 1286 | # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | 
 | 1287 | # | 
 | 1288 | # $0 $configure_args | 
 | 1289 |  | 
 | 1290 | for arg | 
 | 1291 | do | 
 | 1292 |   case "\$arg" in | 
 | 1293 |     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) | 
 | 1294 |     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args | 
 | 1295 |     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;; | 
 | 1296 |     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;; | 
 | 1297 |   esac | 
 | 1298 | done | 
 | 1299 |  | 
 | 1300 | trap 'rm -f Objects/Makefile Parser/Makefile Python/Makefile; exit 1' 1 3 15 | 
 | 1301 | CC='$CC' | 
 | 1302 | RANLIB='$RANLIB' | 
 | 1303 | CPP='$CPP' | 
 | 1304 | LIBOBJS='$LIBOBJS' | 
 | 1305 | LIBS='$LIBS' | 
 | 1306 | srcdir='$srcdir' | 
 | 1307 | DEFS='$DEFS' | 
 | 1308 | prefix='$prefix' | 
 | 1309 | exec_prefix='$exec_prefix' | 
 | 1310 | prsub='$prsub' | 
 | 1311 | extrasub='$extrasub' | 
 | 1312 | EOF | 
 | 1313 | cat >> config.status <<\EOF | 
 | 1314 |  | 
 | 1315 | top_srcdir=$srcdir | 
 | 1316 |  | 
 | 1317 | CONFIG_FILES=${CONFIG_FILES-"Objects/Makefile Parser/Makefile Python/Makefile"} | 
 | 1318 | for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then | 
 | 1319 |   srcdir=$top_srcdir | 
 | 1320 |   # Remove last slash and all that follows it.  Not all systems have dirname. | 
 | 1321 |   dir=`echo $file|sed 's%/[^/][^/]*$%%'` | 
 | 1322 |   if test "$dir" != "$file"; then | 
 | 1323 |     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir | 
 | 1324 |     test ! -d $dir && mkdir $dir | 
 | 1325 |   fi | 
 | 1326 |   echo creating $file | 
 | 1327 |   rm -f $file | 
 | 1328 |   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file | 
 | 1329 |   sed -e " | 
 | 1330 | $prsub | 
 | 1331 | $extrasub | 
 | 1332 | s%@CC@%$CC%g | 
 | 1333 | s%@RANLIB@%$RANLIB%g | 
 | 1334 | s%@CPP@%$CPP%g | 
 | 1335 | s%@LIBOBJS@%$LIBOBJS%g | 
 | 1336 | s%@LIBS@%$LIBS%g | 
 | 1337 | s%@srcdir@%$srcdir%g | 
 | 1338 | s%@DEFS@%$DEFS% | 
 | 1339 | " $top_srcdir/${file}.in >> $file | 
 | 1340 | fi; done | 
 | 1341 |  | 
 | 1342 |  | 
 | 1343 | exit 0 | 
 | 1344 | EOF | 
 | 1345 | chmod +x config.status | 
 | 1346 | ${CONFIG_SHELL-/bin/sh} config.status | 
 | 1347 |  |