home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / fileutils-3.9-src.lha / src / amiga / fileutils-3.9 / configure < prev    next >
Encoding:
Text File  |  1994-02-22  |  55.7 KB  |  2,296 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. > confdefs.h
  93. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  94.  
  95. # A filename unique to this package, relative to the directory that
  96. # configure is in, which we can look for to find out if srcdir is correct.
  97. unique_file=src/ls.c
  98.  
  99. # Find the source files, if location was not specified.
  100. if test -z "$srcdir"; then
  101.   srcdirdefaulted=yes
  102.   # Try the directory containing this script, then `..'.
  103.   prog=$0
  104.   confdir=`echo $prog| sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  105.   test "X$confdir" = "X$prog" && confdir=.
  106.   srcdir=$confdir
  107.   if test ! -r $srcdir/$unique_file; then
  108.     srcdir=..
  109.   fi
  110. fi
  111. if test ! -r $srcdir/$unique_file; then
  112.   if test x$srcdirdefaulted = xyes; then
  113.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  114.   else
  115.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  116.   fi
  117.   exit 1
  118. fi
  119. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  120. # But we can't avoid them for `..', to make subdirectories work.
  121. case $srcdir in
  122.   .|/*|~*) ;;
  123.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  124. esac
  125.  
  126.  
  127. # Save the original args to write them into config.status later.
  128. configure_args="$*"
  129.  
  130.  
  131.  
  132. # We want these before the checks, so the checks can modify their values.
  133. CFLAGS="-O2"    #HACK (fnf)
  134. LDFLAGS=""    #HACK (fnf)
  135. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
  136. test -z "$LDFLAGS" && LDFLAGS=-g
  137.  
  138. if test -z "$CC"; then
  139.   # Extract the first word of `gcc', so it can be a program name with args.
  140.   set dummy gcc; word=$2
  141.   echo checking for $word
  142.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  143.   for dir in $PATH; do
  144.     test -z "$dir" && dir=.
  145.     if test -f $dir/$word; then
  146.       CC="gcc"
  147.       break
  148.     fi
  149.   done
  150.   IFS="$saveifs"
  151. fi
  152. test -z "$CC" && CC="cc"
  153. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  154.  
  155. # Find out if we are using GNU C, under whatever name.
  156. cat > conftest.c <<EOF
  157. #ifdef __GNUC__
  158.   yes
  159. #endif
  160. EOF
  161. ${CC-cc} -E conftest.c > conftest.out 2>&1
  162. if egrep yes conftest.out >/dev/null 2>&1; then
  163.   GCC=1 # For later tests.
  164. fi
  165. rm -f conftest*
  166.  
  167.  
  168. # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  169. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
  170.  
  171.  
  172. echo checking how to run the C preprocessor
  173. if test -z "$CPP"; then
  174.   # This must be in double quotes, not single quotes, because CPP may get
  175.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  176.   # make.  It must be expanded now.
  177.   CPP="${CC-cc} -E"
  178.   cat > conftest.c <<EOF
  179. #include "confdefs.h"
  180. #include <stdio.h>
  181. Syntax Error
  182. EOF
  183. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  184. if test -z "$err"; then
  185.   :
  186. else
  187.   rm -rf conftest*
  188.   CPP=/lib/cpp
  189. fi
  190. rm -f conftest*
  191. fi
  192. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  193.  
  194. if test -n "$GCC"; then
  195.   echo checking whether -traditional is needed
  196.   pattern="Autoconf.*'x'"
  197.   prog='#include <sgtty.h>
  198. Autoconf TIOCGETP'
  199.   cat > conftest.c <<EOF
  200. #include "confdefs.h"
  201. $prog
  202. EOF
  203. eval "$CPP conftest.c > conftest.out 2>&1"
  204. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  205.   rm -rf conftest*
  206.   need_trad=1
  207.  
  208. fi
  209. rm -f conftest*
  210.  
  211.  
  212.   if test -z "$need_trad"; then
  213.     prog='#include <termio.h>
  214. Autoconf TCGETA'
  215.     cat > conftest.c <<EOF
  216. #include "confdefs.h"
  217. $prog
  218. EOF
  219. eval "$CPP conftest.c > conftest.out 2>&1"
  220. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  221.   rm -rf conftest*
  222.   need_trad=1
  223.  
  224. fi
  225. rm -f conftest*
  226.  
  227.   fi
  228.   test -n "$need_trad" && CC="$CC -traditional"
  229. fi
  230.  
  231. if test -z "$RANLIB"; then
  232.   # Extract the first word of `ranlib', so it can be a program name with args.
  233.   set dummy ranlib; word=$2
  234.   echo checking for $word
  235.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  236.   for dir in $PATH; do
  237.     test -z "$dir" && dir=.
  238.     if test -f $dir/$word; then
  239.       RANLIB="ranlib"
  240.       break
  241.     fi
  242.   done
  243.   IFS="$saveifs"
  244. fi
  245. test -z "$RANLIB" && RANLIB=":"
  246. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  247.  
  248. for p in 'bison -y' byacc
  249. do
  250. if test -z "$YACC"; then
  251.   # Extract the first word of `$p', so it can be a program name with args.
  252.   set dummy $p; word=$2
  253.   echo checking for $word
  254.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  255.   for dir in $PATH; do
  256.     test -z "$dir" && dir=.
  257.     if test -f $dir/$word; then
  258.       YACC="$p"
  259.       break
  260.     fi
  261.   done
  262.   IFS="$saveifs"
  263. fi
  264.  
  265. test -n "$YACC" && test -n "$verbose" && echo "    setting YACC to $YACC"
  266.  
  267. test -n "$YACC" && break
  268. done
  269. test -n "$YACC" || YACC="yacc"
  270.  
  271. echo checking for AIX
  272. cat > conftest.c <<EOF
  273. #include "confdefs.h"
  274. #ifdef _AIX
  275.   yes
  276. #endif
  277.  
  278. EOF
  279. eval "$CPP conftest.c > conftest.out 2>&1"
  280. if egrep "yes" conftest.out >/dev/null 2>&1; then
  281.   rm -rf conftest*
  282.   
  283. {
  284. test -n "$verbose" && \
  285. echo "    defining _ALL_SOURCE"
  286. echo "#define" _ALL_SOURCE 1 >> confdefs.h
  287. DEFS="$DEFS -D_ALL_SOURCE=1"
  288. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  289. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  290. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  291. "
  292. }
  293.  
  294.  
  295. fi
  296. rm -f conftest*
  297.  
  298.  
  299. echo checking for minix/config.h
  300. cat > conftest.c <<EOF
  301. #include "confdefs.h"
  302. #include <minix/config.h>
  303. EOF
  304. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  305. if test -z "$err"; then
  306.   rm -rf conftest*
  307.   MINIX=1
  308.  
  309. fi
  310. rm -f conftest*
  311.  
  312. # The Minix shell can't assign to the same variable on the same line!
  313. if test -n "$MINIX"; then
  314.   
  315. {
  316. test -n "$verbose" && \
  317. echo "    defining _POSIX_SOURCE"
  318. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  319. DEFS="$DEFS -D_POSIX_SOURCE=1"
  320. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  321. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  322. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  323. "
  324. }
  325.  
  326.   
  327. {
  328. test -n "$verbose" && \
  329. echo "    defining" _POSIX_1_SOURCE to be 2
  330. echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
  331. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  332. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  333. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  334. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  335. "
  336. }
  337.  
  338.   
  339. {
  340. test -n "$verbose" && \
  341. echo "    defining _MINIX"
  342. echo "#define" _MINIX 1 >> confdefs.h
  343. DEFS="$DEFS -D_MINIX=1"
  344. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  345. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  346. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  347. "
  348. }
  349.  
  350. fi
  351.  
  352. echo checking for POSIXized ISC
  353. if test -d /etc/conf/kconfig.d &&
  354.   grep _POSIX_VERSION /gnu/include/sys/unistd.h >/dev/null 2>&1
  355. then
  356.   ISC=1 # If later tests want to check for ISC.
  357.   
  358. {
  359. test -n "$verbose" && \
  360. echo "    defining _POSIX_SOURCE"
  361. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  362. DEFS="$DEFS -D_POSIX_SOURCE=1"
  363. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  364. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  365. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  366. "
  367. }
  368.  
  369.   if test -n "$GCC"; then
  370.     CC="$CC -posix"
  371.   else
  372.     CC="$CC -Xp"
  373.   fi
  374. fi
  375.  
  376. echo checking for major, minor and makedev header
  377. cat > conftest.c <<EOF
  378. #include "confdefs.h"
  379. #include <sys/types.h>
  380. int main() { exit(0); }
  381. int t() { return makedev(0, 0); }
  382. EOF
  383. if eval $compile; then
  384.   rm -rf conftest*
  385.   makedev=1
  386.  
  387. fi
  388. rm -f conftest*
  389.  
  390. if test -z "$makedev"; then
  391. echo checking for sys/mkdev.h
  392. cat > conftest.c <<EOF
  393. #include "confdefs.h"
  394. #include <sys/mkdev.h>
  395. EOF
  396. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  397. if test -z "$err"; then
  398.   rm -rf conftest*
  399.   
  400. {
  401. test -n "$verbose" && \
  402. echo "    defining MAJOR_IN_MKDEV"
  403. echo "#define" MAJOR_IN_MKDEV 1 >> confdefs.h
  404. DEFS="$DEFS -DMAJOR_IN_MKDEV=1"
  405. SEDDEFS="${SEDDEFS}\${SEDdA}MAJOR_IN_MKDEV\${SEDdB}MAJOR_IN_MKDEV\${SEDdC}1\${SEDdD}
  406. \${SEDuA}MAJOR_IN_MKDEV\${SEDuB}MAJOR_IN_MKDEV\${SEDuC}1\${SEDuD}
  407. \${SEDeA}MAJOR_IN_MKDEV\${SEDeB}MAJOR_IN_MKDEV\${SEDeC}1\${SEDeD}
  408. "
  409. }
  410.  makedev=1
  411.  
  412. fi
  413. rm -f conftest*
  414.  
  415. fi
  416. if test -z "$makedev"; then
  417. echo checking for sys/sysmacros.h
  418. cat > conftest.c <<EOF
  419. #include "confdefs.h"
  420. #include <sys/sysmacros.h>
  421. EOF
  422. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  423. if test -z "$err"; then
  424.   rm -rf conftest*
  425.   
  426. {
  427. test -n "$verbose" && \
  428. echo "    defining MAJOR_IN_SYSMACROS"
  429. echo "#define" MAJOR_IN_SYSMACROS 1 >> confdefs.h
  430. DEFS="$DEFS -DMAJOR_IN_SYSMACROS=1"
  431. SEDDEFS="${SEDDEFS}\${SEDdA}MAJOR_IN_SYSMACROS\${SEDdB}MAJOR_IN_SYSMACROS\${SEDdC}1\${SEDdD}
  432. \${SEDuA}MAJOR_IN_SYSMACROS\${SEDuB}MAJOR_IN_SYSMACROS\${SEDuC}1\${SEDuD}
  433. \${SEDeA}MAJOR_IN_SYSMACROS\${SEDeB}MAJOR_IN_SYSMACROS\${SEDeC}1\${SEDeD}
  434. "
  435. }
  436.  
  437.  
  438. fi
  439. rm -f conftest*
  440.  
  441. fi
  442.  
  443. echo checking for directory library header
  444. dirheader=
  445. if test -z "$dirheader"; then
  446.   echo checking for dirent.h
  447. cat > conftest.c <<EOF
  448. #include "confdefs.h"
  449. #include <sys/types.h>
  450. #include <dirent.h>
  451. int main() { exit(0); }
  452. int t() { DIR *dirp = 0; }
  453. EOF
  454. if eval $compile; then
  455.   rm -rf conftest*
  456.   
  457. {
  458. test -n "$verbose" && \
  459. echo "    defining DIRENT"
  460. echo "#define" DIRENT 1 >> confdefs.h
  461. DEFS="$DEFS -DDIRENT=1"
  462. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  463. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  464. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  465. "
  466. }
  467.  dirheader=dirent.h
  468.  
  469. fi
  470. rm -f conftest*
  471. fi
  472. if test -z "$dirheader"; then
  473.   echo checking for sys/ndir.h
  474. cat > conftest.c <<EOF
  475. #include "confdefs.h"
  476. #include <sys/types.h>
  477. #include <sys/ndir.h>
  478. int main() { exit(0); }
  479. int t() { DIR *dirp = 0; }
  480. EOF
  481. if eval $compile; then
  482.   rm -rf conftest*
  483.   
  484. {
  485. test -n "$verbose" && \
  486. echo "    defining SYSNDIR"
  487. echo "#define" SYSNDIR 1 >> confdefs.h
  488. DEFS="$DEFS -DSYSNDIR=1"
  489. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  490. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  491. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  492. "
  493. }
  494.  dirheader=sys/ndir.h
  495.  
  496. fi
  497. rm -f conftest*
  498. fi
  499. if test -z "$dirheader"; then
  500.   echo checking for sys/dir.h
  501. cat > conftest.c <<EOF
  502. #include "confdefs.h"
  503. #include <sys/types.h>
  504. #include <sys/dir.h>
  505. int main() { exit(0); }
  506. int t() { DIR *dirp = 0; }
  507. EOF
  508. if eval $compile; then
  509.   rm -rf conftest*
  510.   
  511. {
  512. test -n "$verbose" && \
  513. echo "    defining SYSDIR"
  514. echo "#define" SYSDIR 1 >> confdefs.h
  515. DEFS="$DEFS -DSYSDIR=1"
  516. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  517. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  518. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  519. "
  520. }
  521.  dirheader=sys/dir.h
  522.  
  523. fi
  524. rm -f conftest*
  525. fi
  526. if test -z "$dirheader"; then
  527.   echo checking for ndir.h
  528. cat > conftest.c <<EOF
  529. #include "confdefs.h"
  530. #include <sys/types.h>
  531. #include <ndir.h>
  532. int main() { exit(0); }
  533. int t() { DIR *dirp = 0; }
  534. EOF
  535. if eval $compile; then
  536.   rm -rf conftest*
  537.   
  538. {
  539. test -n "$verbose" && \
  540. echo "    defining NDIR"
  541. echo "#define" NDIR 1 >> confdefs.h
  542. DEFS="$DEFS -DNDIR=1"
  543. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  544. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  545. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  546. "
  547. }
  548.  dirheader=ndir.h
  549.  
  550. fi
  551. rm -f conftest*
  552. fi
  553.  
  554. echo checking for closedir return value
  555. cat > conftest.c <<EOF
  556. #include "confdefs.h"
  557. #include <sys/types.h>
  558. #include <$dirheader>
  559. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  560. EOF
  561. eval $compile
  562. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  563.   :
  564. else
  565.   rm -rf conftest*
  566.   
  567. {
  568. test -n "$verbose" && \
  569. echo "    defining VOID_CLOSEDIR"
  570. echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
  571. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  572. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  573. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  574. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  575. "
  576. }
  577.  
  578. fi
  579. rm -f conftest*
  580.  
  581. echo checking for return type of signal handlers
  582. cat > conftest.c <<EOF
  583. #include "confdefs.h"
  584. #include <sys/types.h>
  585. #include <signal.h>
  586. #ifdef signal
  587. #undef signal
  588. #endif
  589. extern void (*signal ()) ();
  590. int main() { exit(0); }
  591. int t() { int i; }
  592. EOF
  593. if eval $compile; then
  594.   rm -rf conftest*
  595.   
  596. {
  597. test -n "$verbose" && \
  598. echo "    defining" RETSIGTYPE to be void
  599. echo "#define" RETSIGTYPE void >> confdefs.h
  600. DEFS="$DEFS -DRETSIGTYPE=void"
  601. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  602. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  603. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  604. "
  605. }
  606.  
  607.  
  608. else
  609.   rm -rf conftest*
  610.   
  611. {
  612. test -n "$verbose" && \
  613. echo "    defining" RETSIGTYPE to be int
  614. echo "#define" RETSIGTYPE int >> confdefs.h
  615. DEFS="$DEFS -DRETSIGTYPE=int"
  616. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  617. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  618. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  619. "
  620. }
  621.  
  622. fi
  623. rm -f conftest*
  624.  
  625.  
  626.  
  627. echo checking how to get list of mounted filesystems
  628. mounted=
  629.  
  630. # DEC Alpha running OSF/1.
  631. cat > conftest.c <<EOF
  632. #include "confdefs.h"
  633.  
  634. #include <sys/types.h>
  635. #include <sys/mount.h>
  636. #include <sys/fs_types.h>
  637. int main() { exit(0); }
  638. int t() { struct statfs *stats;
  639. numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);  }
  640. EOF
  641. if eval $compile; then
  642.   rm -rf conftest*
  643.   
  644. {
  645. test -n "$verbose" && \
  646. echo "    defining MOUNTED_GETFSSTAT"
  647. echo "#define" MOUNTED_GETFSSTAT 1 >> confdefs.h
  648. DEFS="$DEFS -DMOUNTED_GETFSSTAT=1"
  649. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETFSSTAT\${SEDdB}MOUNTED_GETFSSTAT\${SEDdC}1\${SEDdD}
  650. \${SEDuA}MOUNTED_GETFSSTAT\${SEDuB}MOUNTED_GETFSSTAT\${SEDuC}1\${SEDuD}
  651. \${SEDeA}MOUNTED_GETFSSTAT\${SEDeB}MOUNTED_GETFSSTAT\${SEDeC}1\${SEDeD}
  652. "
  653. }
  654.  mounted=1
  655.  
  656. fi
  657. rm -f conftest*
  658.  
  659. if test -z "$mounted"; then
  660. # SVR4
  661. echo '#include "confdefs.h"
  662. #include <sys/mnttab.h>' > conftest.c
  663. eval "$CPP conftest.c > conftest.out 2>&1"
  664. if egrep "getmntent" conftest.out >/dev/null 2>&1; then
  665.   rm -rf conftest*
  666.   
  667. {
  668. test -n "$verbose" && \
  669. echo "    defining MOUNTED_GETMNTENT2"
  670. echo "#define" MOUNTED_GETMNTENT2 1 >> confdefs.h
  671. DEFS="$DEFS -DMOUNTED_GETMNTENT2=1"
  672. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNTENT2\${SEDdB}MOUNTED_GETMNTENT2\${SEDdC}1\${SEDdD}
  673. \${SEDuA}MOUNTED_GETMNTENT2\${SEDuB}MOUNTED_GETMNTENT2\${SEDuC}1\${SEDuD}
  674. \${SEDeA}MOUNTED_GETMNTENT2\${SEDeB}MOUNTED_GETMNTENT2\${SEDeC}1\${SEDeD}
  675. "
  676. }
  677.  mounted=1
  678.  
  679. fi
  680. rm -f conftest*
  681.  
  682. fi
  683. if test -z "$mounted"; then
  684. # AIX.
  685. cat > conftest.c <<EOF
  686. #include "confdefs.h"
  687. #include <fshelp.h>
  688. EOF
  689. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  690. if test -z "$err"; then
  691.   rm -rf conftest*
  692.   
  693. {
  694. test -n "$verbose" && \
  695. echo "    defining MOUNTED_VMOUNT"
  696. echo "#define" MOUNTED_VMOUNT 1 >> confdefs.h
  697. DEFS="$DEFS -DMOUNTED_VMOUNT=1"
  698. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_VMOUNT\${SEDdB}MOUNTED_VMOUNT\${SEDdC}1\${SEDdD}
  699. \${SEDuA}MOUNTED_VMOUNT\${SEDuB}MOUNTED_VMOUNT\${SEDuC}1\${SEDuD}
  700. \${SEDeA}MOUNTED_VMOUNT\${SEDeB}MOUNTED_VMOUNT\${SEDeC}1\${SEDeD}
  701. "
  702. }
  703.  mounted=1
  704.  
  705. fi
  706. rm -f conftest*
  707. fi
  708. if test -z "$mounted"; then
  709. # SVR3
  710. cat > conftest.c <<EOF
  711. #include "confdefs.h"
  712. #include <sys/statfs.h>
  713. #include <sys/fstyp.h>
  714. #include <mnttab.h>
  715. EOF
  716. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  717. if test -z "$err"; then
  718.   rm -rf conftest*
  719.   
  720. {
  721. test -n "$verbose" && \
  722. echo "    defining MOUNTED_FREAD_FSTYP"
  723. echo "#define" MOUNTED_FREAD_FSTYP 1 >> confdefs.h
  724. DEFS="$DEFS -DMOUNTED_FREAD_FSTYP=1"
  725. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_FREAD_FSTYP\${SEDdB}MOUNTED_FREAD_FSTYP\${SEDdC}1\${SEDdD}
  726. \${SEDuA}MOUNTED_FREAD_FSTYP\${SEDuB}MOUNTED_FREAD_FSTYP\${SEDuC}1\${SEDuD}
  727. \${SEDeA}MOUNTED_FREAD_FSTYP\${SEDeB}MOUNTED_FREAD_FSTYP\${SEDeC}1\${SEDeD}
  728. "
  729. }
  730.  mounted=1
  731.  
  732. fi
  733. rm -f conftest*
  734. fi
  735. if test -z "$mounted"; then
  736. # 4.3BSD
  737. cat > conftest.c <<EOF
  738. #include "confdefs.h"
  739. #include <mntent.h>
  740. EOF
  741. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  742. if test -z "$err"; then
  743.   rm -rf conftest*
  744.   
  745. {
  746. test -n "$verbose" && \
  747. echo "    defining MOUNTED_GETMNTENT1"
  748. echo "#define" MOUNTED_GETMNTENT1 1 >> confdefs.h
  749. DEFS="$DEFS -DMOUNTED_GETMNTENT1=1"
  750. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNTENT1\${SEDdB}MOUNTED_GETMNTENT1\${SEDdC}1\${SEDdD}
  751. \${SEDuA}MOUNTED_GETMNTENT1\${SEDuB}MOUNTED_GETMNTENT1\${SEDuC}1\${SEDuD}
  752. \${SEDeA}MOUNTED_GETMNTENT1\${SEDeB}MOUNTED_GETMNTENT1\${SEDeC}1\${SEDeD}
  753. "
  754. }
  755.  mounted=1
  756.  
  757. fi
  758. rm -f conftest*
  759. fi
  760. if test -z "$mounted"; then
  761. # 4.4BSD and DEC OSF/1.
  762. echo '#include "confdefs.h"
  763. #include <sys/mount.h>' > conftest.c
  764. eval "$CPP conftest.c > conftest.out 2>&1"
  765. if egrep "f_type;" conftest.out >/dev/null 2>&1; then
  766.   rm -rf conftest*
  767.   
  768. {
  769. test -n "$verbose" && \
  770. echo "    defining MOUNTED_GETMNTINFO"
  771. echo "#define" MOUNTED_GETMNTINFO 1 >> confdefs.h
  772. DEFS="$DEFS -DMOUNTED_GETMNTINFO=1"
  773. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNTINFO\${SEDdB}MOUNTED_GETMNTINFO\${SEDdC}1\${SEDdD}
  774. \${SEDuA}MOUNTED_GETMNTINFO\${SEDuB}MOUNTED_GETMNTINFO\${SEDuC}1\${SEDuD}
  775. \${SEDeA}MOUNTED_GETMNTINFO\${SEDeB}MOUNTED_GETMNTINFO\${SEDeC}1\${SEDeD}
  776. "
  777. }
  778.  mounted=1
  779.  
  780. fi
  781. rm -f conftest*
  782.  
  783. fi
  784. if test -z "$mounted"; then
  785. # Ultrix
  786. cat > conftest.c <<EOF
  787. #include "confdefs.h"
  788. #include <sys/fs_types.h>
  789. #include <sys/mount.h>
  790. EOF
  791. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  792. if test -z "$err"; then
  793.   rm -rf conftest*
  794.   
  795. {
  796. test -n "$verbose" && \
  797. echo "    defining MOUNTED_GETMNT"
  798. echo "#define" MOUNTED_GETMNT 1 >> confdefs.h
  799. DEFS="$DEFS -DMOUNTED_GETMNT=1"
  800. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_GETMNT\${SEDdB}MOUNTED_GETMNT\${SEDdC}1\${SEDdD}
  801. \${SEDuA}MOUNTED_GETMNT\${SEDuB}MOUNTED_GETMNT\${SEDuC}1\${SEDuD}
  802. \${SEDeA}MOUNTED_GETMNT\${SEDeB}MOUNTED_GETMNT\${SEDeC}1\${SEDeD}
  803. "
  804. }
  805.  mounted=1
  806.  
  807. fi
  808. rm -f conftest*
  809. fi
  810. if test -z "$mounted"; then
  811. # SVR2
  812. cat > conftest.c <<EOF
  813. #include "confdefs.h"
  814. #include <mnttab.h>
  815. EOF
  816. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  817. if test -z "$err"; then
  818.   rm -rf conftest*
  819.   
  820. {
  821. test -n "$verbose" && \
  822. echo "    defining MOUNTED_FREAD"
  823. echo "#define" MOUNTED_FREAD 1 >> confdefs.h
  824. DEFS="$DEFS -DMOUNTED_FREAD=1"
  825. SEDDEFS="${SEDDEFS}\${SEDdA}MOUNTED_FREAD\${SEDdB}MOUNTED_FREAD\${SEDdC}1\${SEDdD}
  826. \${SEDuA}MOUNTED_FREAD\${SEDuB}MOUNTED_FREAD\${SEDuC}1\${SEDuD}
  827. \${SEDeA}MOUNTED_FREAD\${SEDeB}MOUNTED_FREAD\${SEDeC}1\${SEDeD}
  828. "
  829. }
  830.  mounted=1
  831.  
  832. fi
  833. rm -f conftest*
  834. fi
  835.  
  836. echo checking how to get filesystem space usage
  837. space=
  838.  
  839. # DEC Alpha running OSF/1
  840. cat > conftest.c <<EOF
  841. #include "confdefs.h"
  842.  
  843. #include <sys/types.h>
  844. #include <sys/mount.h>
  845. main ()
  846. {
  847. struct statfs fsd;
  848. fsd.f_fsize = 0;
  849. exit (statfs (".", &fsd, sizeof (struct statfs)));
  850. }
  851. EOF
  852. eval $compile
  853. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  854.   rm -rf conftest*
  855.   
  856. {
  857. test -n "$verbose" && \
  858. echo "    defining STAT_STATFS3_OSF1"
  859. echo "#define" STAT_STATFS3_OSF1 1 >> confdefs.h
  860. DEFS="$DEFS -DSTAT_STATFS3_OSF1=1"
  861. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS3_OSF1\${SEDdB}STAT_STATFS3_OSF1\${SEDdC}1\${SEDdD}
  862. \${SEDuA}STAT_STATFS3_OSF1\${SEDuB}STAT_STATFS3_OSF1\${SEDuC}1\${SEDuD}
  863. \${SEDeA}STAT_STATFS3_OSF1\${SEDeB}STAT_STATFS3_OSF1\${SEDeC}1\${SEDeD}
  864. "
  865. }
  866.  space=1
  867.  
  868. fi
  869. rm -f conftest*
  870. if test -z "$space"; then
  871. # SVR4
  872. cat > conftest.c <<EOF
  873. #include "confdefs.h"
  874. #include <sys/statvfs.h>
  875. #include <sys/fstyp.h>
  876. EOF
  877. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  878. if test -z "$err"; then
  879.   rm -rf conftest*
  880.   
  881. {
  882. test -n "$verbose" && \
  883. echo "    defining STAT_STATVFS"
  884. echo "#define" STAT_STATVFS 1 >> confdefs.h
  885. DEFS="$DEFS -DSTAT_STATVFS=1"
  886. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATVFS\${SEDdB}STAT_STATVFS\${SEDdC}1\${SEDdD}
  887. \${SEDuA}STAT_STATVFS\${SEDuB}STAT_STATVFS\${SEDuC}1\${SEDuD}
  888. \${SEDeA}STAT_STATVFS\${SEDeB}STAT_STATVFS\${SEDeC}1\${SEDeD}
  889. "
  890. }
  891.  space=1
  892.  
  893. fi
  894. rm -f conftest*
  895. fi
  896. if test -z "$space"; then
  897. # AIX
  898. echo '#include "confdefs.h"
  899. #include <sys/statfs.h>' > conftest.c
  900. eval "$CPP conftest.c > conftest.out 2>&1"
  901. if egrep "f_nlsdirtype" conftest.out >/dev/null 2>&1; then
  902.   rm -rf conftest*
  903.   
  904. {
  905. test -n "$verbose" && \
  906. echo "    defining STAT_STATFS2_BSIZE"
  907. echo "#define" STAT_STATFS2_BSIZE 1 >> confdefs.h
  908. DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
  909. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_BSIZE\${SEDdB}STAT_STATFS2_BSIZE\${SEDdC}1\${SEDdD}
  910. \${SEDuA}STAT_STATFS2_BSIZE\${SEDuB}STAT_STATFS2_BSIZE\${SEDuC}1\${SEDuD}
  911. \${SEDeA}STAT_STATFS2_BSIZE\${SEDeB}STAT_STATFS2_BSIZE\${SEDeC}1\${SEDeD}
  912. "
  913. }
  914.  space=1
  915.  
  916. fi
  917. rm -f conftest*
  918.  
  919. fi
  920. if test -z "$space"; then
  921. # SVR3
  922. cat > conftest.c <<EOF
  923. #include "confdefs.h"
  924. #include <sys/statfs.h>
  925. EOF
  926. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  927. if test -z "$err"; then
  928.   rm -rf conftest*
  929.   
  930. {
  931. test -n "$verbose" && \
  932. echo "    defining STAT_STATFS4"
  933. echo "#define" STAT_STATFS4 1 >> confdefs.h
  934. DEFS="$DEFS -DSTAT_STATFS4=1"
  935. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS4\${SEDdB}STAT_STATFS4\${SEDdC}1\${SEDdD}
  936. \${SEDuA}STAT_STATFS4\${SEDuB}STAT_STATFS4\${SEDuC}1\${SEDuD}
  937. \${SEDeA}STAT_STATFS4\${SEDeB}STAT_STATFS4\${SEDeC}1\${SEDeD}
  938. "
  939. }
  940.  space=1
  941.  
  942. fi
  943. rm -f conftest*
  944. fi
  945. if test -z "$space"; then
  946. # 4.3BSD
  947. cat > conftest.c <<EOF
  948. #include "confdefs.h"
  949. #include <sys/vfs.h>
  950. EOF
  951. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  952. if test -z "$err"; then
  953.   rm -rf conftest*
  954.   
  955. {
  956. test -n "$verbose" && \
  957. echo "    defining STAT_STATFS2_BSIZE"
  958. echo "#define" STAT_STATFS2_BSIZE 1 >> confdefs.h
  959. DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
  960. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_BSIZE\${SEDdB}STAT_STATFS2_BSIZE\${SEDdC}1\${SEDdD}
  961. \${SEDuA}STAT_STATFS2_BSIZE\${SEDuB}STAT_STATFS2_BSIZE\${SEDuC}1\${SEDuD}
  962. \${SEDeA}STAT_STATFS2_BSIZE\${SEDeB}STAT_STATFS2_BSIZE\${SEDeC}1\${SEDeD}
  963. "
  964. }
  965.  space=1
  966.  
  967. fi
  968. rm -f conftest*
  969. fi
  970. if test -z "$space"; then
  971. # 4.4BSD
  972. echo '#include "confdefs.h"
  973. #include <sys/mount.h>' > conftest.c
  974. eval "$CPP conftest.c > conftest.out 2>&1"
  975. if true; then
  976.   rm -rf conftest*
  977.   
  978. {
  979. test -n "$verbose" && \
  980. echo "    defining STAT_STATFS2_FSIZE"
  981. echo "#define" STAT_STATFS2_FSIZE 1 >> confdefs.h
  982. DEFS="$DEFS -DSTAT_STATFS2_FSIZE=1"
  983. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_FSIZE\${SEDdB}STAT_STATFS2_FSIZE\${SEDdC}1\${SEDdD}
  984. \${SEDuA}STAT_STATFS2_FSIZE\${SEDuB}STAT_STATFS2_FSIZE\${SEDuC}1\${SEDuD}
  985. \${SEDeA}STAT_STATFS2_FSIZE\${SEDeB}STAT_STATFS2_FSIZE\${SEDeC}1\${SEDeD}
  986. "
  987. }
  988.  space=1
  989.  
  990. fi
  991. rm -f conftest*
  992.  
  993. fi
  994. if test -z "$space"; then
  995. # SVR2
  996. cat > conftest.c <<EOF
  997. #include "confdefs.h"
  998. #include <sys/filsys.h>
  999. EOF
  1000. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1001. if test -z "$err"; then
  1002.   rm -rf conftest*
  1003.   
  1004. {
  1005. test -n "$verbose" && \
  1006. echo "    defining STAT_READ"
  1007. echo "#define" STAT_READ 1 >> confdefs.h
  1008. DEFS="$DEFS -DSTAT_READ=1"
  1009. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_READ\${SEDdB}STAT_READ\${SEDdC}1\${SEDdD}
  1010. \${SEDuA}STAT_READ\${SEDuB}STAT_READ\${SEDuC}1\${SEDuD}
  1011. \${SEDeA}STAT_READ\${SEDeB}STAT_READ\${SEDeC}1\${SEDeD}
  1012. "
  1013. }
  1014.  space=1
  1015.  
  1016. fi
  1017. rm -f conftest*
  1018. fi
  1019. if test -z "$space"; then
  1020. # Ultrix
  1021. cat > conftest.c <<EOF
  1022. #include "confdefs.h"
  1023. #include <sys/mount.h>
  1024. EOF
  1025. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1026. if test -z "$err"; then
  1027.   rm -rf conftest*
  1028.   
  1029. {
  1030. test -n "$verbose" && \
  1031. echo "    defining STAT_STATFS2_FS_DATA"
  1032. echo "#define" STAT_STATFS2_FS_DATA 1 >> confdefs.h
  1033. DEFS="$DEFS -DSTAT_STATFS2_FS_DATA=1"
  1034. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_STATFS2_FS_DATA\${SEDdB}STAT_STATFS2_FS_DATA\${SEDdC}1\${SEDdD}
  1035. \${SEDuA}STAT_STATFS2_FS_DATA\${SEDuB}STAT_STATFS2_FS_DATA\${SEDuC}1\${SEDuD}
  1036. \${SEDeA}STAT_STATFS2_FS_DATA\${SEDeB}STAT_STATFS2_FS_DATA\${SEDeC}1\${SEDeD}
  1037. "
  1038. }
  1039.  space=1
  1040.  
  1041. fi
  1042. rm -f conftest*
  1043. fi
  1044. if test -n "$mounted" && test -n "$space"; then
  1045.   PROGS="$PROGS df" LIBOBJS="$LIBOBJS fsusage.o mountlist.o"
  1046. fi
  1047.  
  1048. echo checking for uid_t in sys/types.h
  1049. echo '#include "confdefs.h"
  1050. #include <sys/types.h>' > conftest.c
  1051. eval "$CPP conftest.c > conftest.out 2>&1"
  1052. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  1053.   :
  1054. else
  1055.   rm -rf conftest*
  1056.   
  1057. {
  1058. test -n "$verbose" && \
  1059. echo "    defining" uid_t to be int
  1060. echo "#define" uid_t int >> confdefs.h
  1061. DEFS="$DEFS -Duid_t=int"
  1062. SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
  1063. \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
  1064. \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
  1065. "
  1066. }
  1067.  
  1068. {
  1069. test -n "$verbose" && \
  1070. echo "    defining" gid_t to be int
  1071. echo "#define" gid_t int >> confdefs.h
  1072. DEFS="$DEFS -Dgid_t=int"
  1073. SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
  1074. \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
  1075. \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
  1076. "
  1077. }
  1078.  
  1079. fi
  1080. rm -f conftest*
  1081.  
  1082. echo checking for type of array argument to getgroups
  1083. prog='/* Thanks to Mike Rendell for this test.  */
  1084. #include <sys/types.h>
  1085. #define NGID 256
  1086. #undef MAX
  1087. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  1088. main()
  1089. {
  1090.   gid_t gidset[NGID];
  1091.   int i, n;
  1092.   union { gid_t gval; long lval; }  val;
  1093.  
  1094.   val.lval = -1;
  1095.   for (i = 0; i < NGID; i++)
  1096.     gidset[i] = val.gval;
  1097.   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
  1098.                  gidset);
  1099.   /* Exit non-zero if getgroups seems to require an array of ints.  This
  1100.      happens when gid_t is short but getgroups modifies an array of ints.  */
  1101.   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
  1102. }'
  1103. cat > conftest.c <<EOF
  1104. #include "confdefs.h"
  1105. $prog
  1106. EOF
  1107. eval $compile
  1108. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1109.   rm -rf conftest*
  1110.   
  1111. {
  1112. test -n "$verbose" && \
  1113. echo "    defining" GETGROUPS_T to be gid_t
  1114. echo "#define" GETGROUPS_T gid_t >> confdefs.h
  1115. DEFS="$DEFS -DGETGROUPS_T=gid_t"
  1116. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}gid_t\${SEDdD}
  1117. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}gid_t\${SEDuD}
  1118. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}gid_t\${SEDeD}
  1119. "
  1120. }
  1121.  
  1122.  
  1123. else
  1124.   rm -rf conftest*
  1125.   
  1126. {
  1127. test -n "$verbose" && \
  1128. echo "    defining" GETGROUPS_T to be int
  1129. echo "#define" GETGROUPS_T int >> confdefs.h
  1130. DEFS="$DEFS -DGETGROUPS_T=int"
  1131. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}int\${SEDdD}
  1132. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}int\${SEDuD}
  1133. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}int\${SEDeD}
  1134. "
  1135. }
  1136.  
  1137. fi
  1138. rm -f conftest*
  1139.  
  1140. echo checking integer size
  1141. cat > conftest.c <<EOF
  1142. #include "confdefs.h"
  1143. main() { exit(sizeof(int) != 2); }
  1144. EOF
  1145. eval $compile
  1146. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1147.   rm -rf conftest*
  1148.   
  1149. {
  1150. test -n "$verbose" && \
  1151. echo "    defining INT_16_BITS"
  1152. echo "#define" INT_16_BITS 1 >> confdefs.h
  1153. DEFS="$DEFS -DINT_16_BITS=1"
  1154. SEDDEFS="${SEDDEFS}\${SEDdA}INT_16_BITS\${SEDdB}INT_16_BITS\${SEDdC}1\${SEDdD}
  1155. \${SEDuA}INT_16_BITS\${SEDuB}INT_16_BITS\${SEDuC}1\${SEDuD}
  1156. \${SEDeA}INT_16_BITS\${SEDeB}INT_16_BITS\${SEDeC}1\${SEDeD}
  1157. "
  1158. }
  1159.  
  1160.  
  1161. fi
  1162. rm -f conftest*
  1163.  
  1164. prog='/* Ultrix mips cc rejects this.  */
  1165. typedef int charset[2]; const charset x;
  1166. /* SunOS 4.1.1 cc rejects this.  */
  1167. char const *const *ccp;
  1168. char **p;
  1169. /* AIX XL C 1.02.0.0 rejects this.
  1170.    It does not let you subtract one const X* pointer from another in an arm
  1171.    of an if-expression whose if-part is not a constant expression */
  1172. const char *g = "string";
  1173. ccp = &g + (g ? g-g : 0);
  1174. /* HPUX 7.0 cc rejects these. */
  1175. ++ccp;
  1176. p = (char**) ccp;
  1177. ccp = (char const *const *) p;
  1178. { /* SCO 3.2v4 cc rejects this.  */
  1179.   char *t;
  1180.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  1181.  
  1182.   *t++ = 0;
  1183. }
  1184. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  1185.   int x[] = {25,17};
  1186.   const int *foo = &x[0];
  1187.   ++foo;
  1188. }
  1189. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  1190.   typedef const int *iptr;
  1191.   iptr p = 0;
  1192.   ++p;
  1193. }
  1194. { /* AIX XL C 1.02.0.0 rejects this saying
  1195.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  1196.   struct s { int j; const int *ap[3]; };
  1197.   struct s *b; b->j = 5;
  1198. }'
  1199. echo checking for lack of working const
  1200. cat > conftest.c <<EOF
  1201. #include "confdefs.h"
  1202.  
  1203. int main() { exit(0); }
  1204. int t() { $prog }
  1205. EOF
  1206. if eval $compile; then
  1207.   :
  1208. else
  1209.   rm -rf conftest*
  1210.   
  1211. {
  1212. test -n "$verbose" && \
  1213. echo "    defining" const to be empty
  1214. echo "#define" const  >> confdefs.h
  1215. DEFS="$DEFS -Dconst="
  1216. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  1217. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  1218. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  1219. "
  1220. }
  1221.  
  1222. fi
  1223. rm -f conftest*
  1224.  
  1225. echo checking for ANSI C header files
  1226. cat > conftest.c <<EOF
  1227. #include "confdefs.h"
  1228. #include <stdlib.h>
  1229. #include <stdarg.h>
  1230. #include <string.h>
  1231. #include <float.h>
  1232. EOF
  1233. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1234. if test -z "$err"; then
  1235.   rm -rf conftest*
  1236.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  1237. echo '#include "confdefs.h"
  1238. #include <string.h>' > conftest.c
  1239. eval "$CPP conftest.c > conftest.out 2>&1"
  1240. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  1241.   rm -rf conftest*
  1242.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  1243. cat > conftest.c <<EOF
  1244. #include "confdefs.h"
  1245. #include <ctype.h>
  1246. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  1247. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  1248. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  1249. int main () { int i; for (i = 0; i < 256; i++)
  1250. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  1251. exit (0); }
  1252.  
  1253. EOF
  1254. eval $compile
  1255. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1256.   rm -rf conftest*
  1257.   
  1258. {
  1259. test -n "$verbose" && \
  1260. echo "    defining STDC_HEADERS"
  1261. echo "#define" STDC_HEADERS 1 >> confdefs.h
  1262. DEFS="$DEFS -DSTDC_HEADERS=1"
  1263. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  1264. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  1265. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  1266. "
  1267. }
  1268.  
  1269.  
  1270. fi
  1271. rm -f conftest*
  1272.  
  1273. fi
  1274. rm -f conftest*
  1275.  
  1276.  
  1277. fi
  1278. rm -f conftest*
  1279.  
  1280. echo checking for struct tm in time.h
  1281. cat > conftest.c <<EOF
  1282. #include "confdefs.h"
  1283. #include <sys/types.h>
  1284. #include <time.h>
  1285. int main() { exit(0); }
  1286. int t() { struct tm *tp; tp->tm_sec; }
  1287. EOF
  1288. if eval $compile; then
  1289.   :
  1290. else
  1291.   rm -rf conftest*
  1292.   
  1293. {
  1294. test -n "$verbose" && \
  1295. echo "    defining TM_IN_SYS_TIME"
  1296. echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h
  1297. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  1298. SEDDEFS="${SEDDEFS}\${SEDdA}TM_IN_SYS_TIME\${SEDdB}TM_IN_SYS_TIME\${SEDdC}1\${SEDdD}
  1299. \${SEDuA}TM_IN_SYS_TIME\${SEDuB}TM_IN_SYS_TIME\${SEDuC}1\${SEDuD}
  1300. \${SEDeA}TM_IN_SYS_TIME\${SEDeB}TM_IN_SYS_TIME\${SEDeC}1\${SEDeD}
  1301. "
  1302. }
  1303.  
  1304. fi
  1305. rm -f conftest*
  1306.  
  1307. echo checking for whether time.h and sys/time.h may both be included
  1308. cat > conftest.c <<EOF
  1309. #include "confdefs.h"
  1310. #include <sys/types.h>
  1311. #include <sys/time.h>
  1312. #include <time.h>
  1313. int main() { exit(0); }
  1314. int t() { struct tm *tp; }
  1315. EOF
  1316. if eval $compile; then
  1317.   rm -rf conftest*
  1318.   
  1319. {
  1320. test -n "$verbose" && \
  1321. echo "    defining TIME_WITH_SYS_TIME"
  1322. echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
  1323. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  1324. SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
  1325. \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
  1326. \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
  1327. "
  1328. }
  1329.  
  1330.  
  1331. fi
  1332. rm -f conftest*
  1333.  
  1334. echo checking for broken stat file mode macros
  1335. cat > conftest.c <<EOF
  1336. #include "confdefs.h"
  1337. #include <sys/types.h>
  1338. #include <sys/stat.h>
  1339. #ifdef S_ISBLK
  1340. #if S_ISBLK (S_IFDIR)
  1341. You lose.
  1342. #endif
  1343. #ifdef S_IFCHR
  1344. #if S_ISBLK (S_IFCHR)
  1345. You lose.
  1346. #endif
  1347. #endif /* S_IFCHR */
  1348. #endif /* S_ISBLK */
  1349. #ifdef S_ISLNK
  1350. #if S_ISLNK (S_IFREG)
  1351. You lose.
  1352. #endif
  1353. #endif /* S_ISLNK */
  1354. #ifdef S_ISSOCK
  1355. #if S_ISSOCK (S_IFREG)
  1356. You lose.
  1357. #endif
  1358. #endif /* S_ISSOCK */
  1359.  
  1360. EOF
  1361. eval "$CPP conftest.c > conftest.out 2>&1"
  1362. if egrep "You lose" conftest.out >/dev/null 2>&1; then
  1363.   rm -rf conftest*
  1364.   
  1365. {
  1366. test -n "$verbose" && \
  1367. echo "    defining STAT_MACROS_BROKEN"
  1368. echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h
  1369. DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
  1370. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD}
  1371. \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD}
  1372. \${SEDeA}STAT_MACROS_BROKEN\${SEDeB}STAT_MACROS_BROKEN\${SEDeC}1\${SEDeD}
  1373. "
  1374. }
  1375.  
  1376.  
  1377. fi
  1378. rm -f conftest*
  1379.  
  1380. for hdr in string.h fcntl.h limits.h sys/time.h errno.h unistd.h
  1381. do
  1382. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1383. echo checking for ${hdr}
  1384. cat > conftest.c <<EOF
  1385. #include "confdefs.h"
  1386. #include <${hdr}>
  1387. EOF
  1388. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1389. if test -z "$err"; then
  1390.   rm -rf conftest*
  1391.   
  1392. {
  1393. test -n "$verbose" && \
  1394. echo "    defining ${trhdr}"
  1395. echo "#define" ${trhdr} 1 >> confdefs.h
  1396. DEFS="$DEFS -D${trhdr}=1"
  1397. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1398. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1399. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1400. "
  1401. }
  1402.  
  1403.  
  1404. fi
  1405. rm -f conftest*
  1406. done
  1407.  
  1408. for func in fnmatch mkdir mktime stpcpy strdup strstr rename
  1409. do
  1410. echo checking for ${func}
  1411. cat > conftest.c <<EOF
  1412. #include "confdefs.h"
  1413. #include <ctype.h>
  1414. int main() { exit(0); }
  1415. int t() { 
  1416. /* The GNU C library defines this for functions which it implements
  1417.     to always fail with ENOSYS.  Some functions are actually named
  1418.     something starting with __ and the normal name is an alias.  */
  1419. #if defined (__stub_${func}) || defined (__stub___${func})
  1420. choke me
  1421. #else
  1422. /* Override any gcc2 internal prototype to avoid an error.  */
  1423. extern char ${func}(); ${func}();
  1424. #endif
  1425.  }
  1426. EOF
  1427. if eval $compile; then
  1428.   :
  1429. else
  1430.   rm -rf conftest*
  1431.   LIBOBJS="$LIBOBJS ${func}.o"
  1432. test -n "$verbose" && echo "    using ${func}.o instead"
  1433. fi
  1434. rm -f conftest*
  1435.  
  1436. done
  1437.  
  1438. for func in strerror ftime getcwd mkfifo memcpy bcopy gettimeofday
  1439. do
  1440. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1441. echo checking for ${func}
  1442. cat > conftest.c <<EOF
  1443. #include "confdefs.h"
  1444. #include <ctype.h>
  1445. int main() { exit(0); }
  1446. int t() { 
  1447. /* The GNU C library defines this for functions which it implements
  1448.     to always fail with ENOSYS.  Some functions are actually named
  1449.     something starting with __ and the normal name is an alias.  */
  1450. #if defined (__stub_${func}) || defined (__stub___${func})
  1451. choke me
  1452. #else
  1453. /* Override any gcc2 internal prototype to avoid an error.  */
  1454. extern char ${func}(); ${func}();
  1455. #endif
  1456.  }
  1457. EOF
  1458. if eval $compile; then
  1459.   rm -rf conftest*
  1460.   {
  1461. test -n "$verbose" && \
  1462. echo "    defining ${trfunc}"
  1463. echo "#define" ${trfunc} 1 >> confdefs.h
  1464. DEFS="$DEFS -D${trfunc}=1"
  1465. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1466. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1467. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1468. "
  1469. }
  1470.  
  1471.  
  1472. fi
  1473. rm -f conftest*
  1474. done
  1475.  
  1476. echo checking for ftruncate
  1477. cat > conftest.c <<EOF
  1478. #include "confdefs.h"
  1479.  
  1480. int main() { exit(0); }
  1481. int t() { ftruncate(); }
  1482. EOF
  1483. if eval $compile; then
  1484.   rm -rf conftest*
  1485.   
  1486. {
  1487. test -n "$verbose" && \
  1488. echo "    defining HAVE_FTRUNCATE"
  1489. echo "#define" HAVE_FTRUNCATE 1 >> confdefs.h
  1490. DEFS="$DEFS -DHAVE_FTRUNCATE=1"
  1491. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_FTRUNCATE\${SEDdB}HAVE_FTRUNCATE\${SEDdC}1\${SEDdD}
  1492. \${SEDuA}HAVE_FTRUNCATE\${SEDuB}HAVE_FTRUNCATE\${SEDuC}1\${SEDuD}
  1493. \${SEDeA}HAVE_FTRUNCATE\${SEDeB}HAVE_FTRUNCATE\${SEDeC}1\${SEDeD}
  1494. "
  1495. }
  1496.  
  1497.  
  1498. else
  1499.   rm -rf conftest*
  1500.   ftruncate_missing=1
  1501. fi
  1502. rm -f conftest*
  1503.  
  1504. if test -n "$ftruncate_missing"; then
  1505. echo checking for fcntl emulation of ftruncate
  1506. cat > conftest.c <<EOF
  1507. #include "confdefs.h"
  1508. #include <sys/types.h>
  1509. #include <fcntl.h>
  1510. int main() { exit(0); }
  1511. int t() { 
  1512. #if !defined(F_CHSIZE) && !defined(F_FREESP)
  1513. chsize();
  1514. #endif
  1515.  }
  1516. EOF
  1517. if eval $compile; then
  1518.   rm -rf conftest*
  1519.   
  1520. {
  1521. test -n "$verbose" && \
  1522. echo "    defining HAVE_FTRUNCATE"
  1523. echo "#define" HAVE_FTRUNCATE 1 >> confdefs.h
  1524. DEFS="$DEFS -DHAVE_FTRUNCATE=1"
  1525. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_FTRUNCATE\${SEDdB}HAVE_FTRUNCATE\${SEDdC}1\${SEDdD}
  1526. \${SEDuA}HAVE_FTRUNCATE\${SEDuB}HAVE_FTRUNCATE\${SEDuC}1\${SEDuD}
  1527. \${SEDeA}HAVE_FTRUNCATE\${SEDeB}HAVE_FTRUNCATE\${SEDeC}1\${SEDeD}
  1528. "
  1529. }
  1530.  LIBOBJS="$LIBOBJS ftruncate.o"
  1531.  
  1532. fi
  1533. rm -f conftest*
  1534.  
  1535. fi
  1536.  
  1537. case "$LIBOBJS" in
  1538. *rename.o*)
  1539.   LIBPROGS="$LIBPROGS mvdir"
  1540.   ;;
  1541. esac
  1542.  
  1543. echo checking for vprintf
  1544. cat > conftest.c <<EOF
  1545. #include "confdefs.h"
  1546.  
  1547. int main() { exit(0); }
  1548. int t() { vprintf(); }
  1549. EOF
  1550. if eval $compile; then
  1551.   rm -rf conftest*
  1552.   
  1553. {
  1554. test -n "$verbose" && \
  1555. echo "    defining HAVE_VPRINTF"
  1556. echo "#define" HAVE_VPRINTF 1 >> confdefs.h
  1557. DEFS="$DEFS -DHAVE_VPRINTF=1"
  1558. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
  1559. \${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
  1560. \${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
  1561. "
  1562. }
  1563.  
  1564.  
  1565. else
  1566.   rm -rf conftest*
  1567.   vprintf_missing=1
  1568. fi
  1569. rm -f conftest*
  1570.  
  1571. if test -n "$vprintf_missing"; then
  1572. echo checking for _doprnt
  1573. cat > conftest.c <<EOF
  1574. #include "confdefs.h"
  1575.  
  1576. int main() { exit(0); }
  1577. int t() { _doprnt(); }
  1578. EOF
  1579. if eval $compile; then
  1580.   rm -rf conftest*
  1581.   
  1582. {
  1583. test -n "$verbose" && \
  1584. echo "    defining HAVE_DOPRNT"
  1585. echo "#define" HAVE_DOPRNT 1 >> confdefs.h
  1586. DEFS="$DEFS -DHAVE_DOPRNT=1"
  1587. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
  1588. \${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
  1589. \${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
  1590. "
  1591. }
  1592.  
  1593.  
  1594. fi
  1595. rm -f conftest*
  1596.  
  1597. fi
  1598.  
  1599. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  1600. # for constant arguments.  Useless!
  1601. echo checking for working alloca.h
  1602. cat > conftest.c <<EOF
  1603. #include "confdefs.h"
  1604. #include <alloca.h>
  1605. int main() { exit(0); }
  1606. int t() { char *p = alloca(2 * sizeof(int)); }
  1607. EOF
  1608. if eval $compile; then
  1609.   rm -rf conftest*
  1610.   
  1611. {
  1612. test -n "$verbose" && \
  1613. echo "    defining HAVE_ALLOCA_H"
  1614. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  1615. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  1616. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  1617. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  1618. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  1619. "
  1620. }
  1621.  
  1622.  
  1623. fi
  1624. rm -f conftest*
  1625.  
  1626. decl="#ifdef __GNUC__
  1627. #define alloca __builtin_alloca
  1628. #else
  1629. #if HAVE_ALLOCA_H
  1630. #include <alloca.h>
  1631. #else
  1632. #ifdef _AIX
  1633.  #pragma alloca
  1634. #else
  1635. char *alloca ();
  1636. #endif
  1637. #endif
  1638. #endif
  1639. "
  1640. echo checking for alloca
  1641. cat > conftest.c <<EOF
  1642. #include "confdefs.h"
  1643. $decl
  1644. int main() { exit(0); }
  1645. int t() { char *p = (char *) alloca(1); }
  1646. EOF
  1647. if eval $compile; then
  1648.   :
  1649. else
  1650.   rm -rf conftest*
  1651.   alloca_missing=1
  1652. cat > conftest.c <<EOF
  1653. #include "confdefs.h"
  1654.  
  1655. #if defined(CRAY) && ! defined(CRAY2)
  1656. winnitude
  1657. #else
  1658. lossage
  1659. #endif
  1660.  
  1661. EOF
  1662. eval "$CPP conftest.c > conftest.out 2>&1"
  1663. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  1664.   rm -rf conftest*
  1665.   echo checking for _getb67
  1666. cat > conftest.c <<EOF
  1667. #include "confdefs.h"
  1668. #include <ctype.h>
  1669. int main() { exit(0); }
  1670. int t() { 
  1671. /* The GNU C library defines this for functions which it implements
  1672.     to always fail with ENOSYS.  Some functions are actually named
  1673.     something starting with __ and the normal name is an alias.  */
  1674. #if defined (__stub__getb67) || defined (__stub____getb67)
  1675. choke me
  1676. #else
  1677. /* Override any gcc2 internal prototype to avoid an error.  */
  1678. extern char _getb67(); _getb67();
  1679. #endif
  1680.  }
  1681. EOF
  1682. if eval $compile; then
  1683.   rm -rf conftest*
  1684.   {
  1685. test -n "$verbose" && \
  1686. echo "    defining" CRAY_STACKSEG_END to be _getb67
  1687. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  1688. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1689. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  1690. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1691. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1692. "
  1693. }
  1694.  
  1695.  
  1696. else
  1697.   rm -rf conftest*
  1698.   echo checking for GETB67
  1699. cat > conftest.c <<EOF
  1700. #include "confdefs.h"
  1701. #include <ctype.h>
  1702. int main() { exit(0); }
  1703. int t() { 
  1704. /* The GNU C library defines this for functions which it implements
  1705.     to always fail with ENOSYS.  Some functions are actually named
  1706.     something starting with __ and the normal name is an alias.  */
  1707. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1708. choke me
  1709. #else
  1710. /* Override any gcc2 internal prototype to avoid an error.  */
  1711. extern char GETB67(); GETB67();
  1712. #endif
  1713.  }
  1714. EOF
  1715. if eval $compile; then
  1716.   rm -rf conftest*
  1717.   {
  1718. test -n "$verbose" && \
  1719. echo "    defining" CRAY_STACKSEG_END to be GETB67
  1720. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  1721. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1722. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1723. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1724. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1725. "
  1726. }
  1727.  
  1728.  
  1729. else
  1730.   rm -rf conftest*
  1731.   echo checking for getb67
  1732. cat > conftest.c <<EOF
  1733. #include "confdefs.h"
  1734. #include <ctype.h>
  1735. int main() { exit(0); }
  1736. int t() { 
  1737. /* The GNU C library defines this for functions which it implements
  1738.     to always fail with ENOSYS.  Some functions are actually named
  1739.     something starting with __ and the normal name is an alias.  */
  1740. #if defined (__stub_getb67) || defined (__stub___getb67)
  1741. choke me
  1742. #else
  1743. /* Override any gcc2 internal prototype to avoid an error.  */
  1744. extern char getb67(); getb67();
  1745. #endif
  1746.  }
  1747. EOF
  1748. if eval $compile; then
  1749.   rm -rf conftest*
  1750.   {
  1751. test -n "$verbose" && \
  1752. echo "    defining" CRAY_STACKSEG_END to be getb67
  1753. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  1754. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1755. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1756. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1757. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1758. "
  1759. }
  1760.  
  1761.  
  1762. fi
  1763. rm -f conftest*
  1764.  
  1765. fi
  1766. rm -f conftest*
  1767.  
  1768. fi
  1769. rm -f conftest*
  1770.  
  1771.  
  1772. fi
  1773. rm -f conftest*
  1774.  
  1775.  
  1776. fi
  1777. rm -f conftest*
  1778.  
  1779. if test -n "$alloca_missing"; then
  1780.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1781.   # that cause trouble.  Some versions do not even contain alloca or
  1782.   # contain a buggy version.  If you still want to use their alloca,
  1783.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1784.   ALLOCA=alloca.o
  1785.   
  1786. {
  1787. test -n "$verbose" && \
  1788. echo "    defining C_ALLOCA"
  1789. echo "#define" C_ALLOCA 1 >> confdefs.h
  1790. DEFS="$DEFS -DC_ALLOCA=1"
  1791. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  1792. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  1793. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  1794. "
  1795. }
  1796.  
  1797.  
  1798.   echo 'checking stack direction for C alloca'
  1799.   echo checking whether cross-compiling
  1800. # If we cannot run a trivial program, we must be cross compiling.
  1801. cat > conftest.c <<EOF
  1802. #include "confdefs.h"
  1803. main(){exit(0);}
  1804. EOF
  1805. eval $compile
  1806. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1807.   :
  1808. else
  1809.   rm -rf conftest*
  1810.   cross_compiling=1
  1811. fi
  1812. rm -f conftest*
  1813.  
  1814. if test -n "$cross_compiling"
  1815. then
  1816.   
  1817. {
  1818. test -n "$verbose" && \
  1819. echo "    defining" STACK_DIRECTION to be 0
  1820. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  1821. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1822. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1823. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1824. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1825. "
  1826. }
  1827.  
  1828. else
  1829. cat > conftest.c <<EOF
  1830. #include "confdefs.h"
  1831. find_stack_direction ()
  1832. {
  1833.   static char *addr = 0;
  1834.   auto char dummy;
  1835.   if (addr == 0)
  1836.     {
  1837.       addr = &dummy;
  1838.       return find_stack_direction ();
  1839.     }
  1840.   else
  1841.     return (&dummy > addr) ? 1 : -1;
  1842. }
  1843. main ()
  1844. {
  1845.   exit (find_stack_direction() < 0);
  1846. }
  1847. EOF
  1848. eval $compile
  1849. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1850.   rm -rf conftest*
  1851.   
  1852. {
  1853. test -n "$verbose" && \
  1854. echo "    defining" STACK_DIRECTION to be 1
  1855. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  1856. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1857. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1858. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1859. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1860. "
  1861. }
  1862.  
  1863.  
  1864. else
  1865.   rm -rf conftest*
  1866.   
  1867. {
  1868. test -n "$verbose" && \
  1869. echo "    defining" STACK_DIRECTION to be -1
  1870. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  1871. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1872. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1873. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1874. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1875. "
  1876. }
  1877.  
  1878. fi
  1879. fi
  1880. rm -f conftest*
  1881. fi
  1882.  
  1883. echo checking for st_blocks in struct stat
  1884. cat > conftest.c <<EOF
  1885. #include "confdefs.h"
  1886. #include <sys/types.h>
  1887. #include <sys/stat.h>
  1888. int main() { exit(0); }
  1889. int t() { struct stat s; s.st_blocks; }
  1890. EOF
  1891. if eval $compile; then
  1892.   rm -rf conftest*
  1893.   
  1894. {
  1895. test -n "$verbose" && \
  1896. echo "    defining HAVE_ST_BLOCKS"
  1897. echo "#define" HAVE_ST_BLOCKS 1 >> confdefs.h
  1898. DEFS="$DEFS -DHAVE_ST_BLOCKS=1"
  1899. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ST_BLOCKS\${SEDdB}HAVE_ST_BLOCKS\${SEDdC}1\${SEDdD}
  1900. \${SEDuA}HAVE_ST_BLOCKS\${SEDuB}HAVE_ST_BLOCKS\${SEDuC}1\${SEDuD}
  1901. \${SEDeA}HAVE_ST_BLOCKS\${SEDeB}HAVE_ST_BLOCKS\${SEDeC}1\${SEDeD}
  1902. "
  1903. }
  1904.  
  1905.  
  1906. else
  1907.   rm -rf conftest*
  1908.   LIBOBJS="$LIBOBJS fileblocks.o"
  1909. fi
  1910. rm -f conftest*
  1911.  
  1912. echo checking utime with null argument
  1913. rm -f conftestdata; > conftestdata
  1914. # Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
  1915. cat > conftest.c <<EOF
  1916. #include "confdefs.h"
  1917. #include <sys/types.h>
  1918. #include <sys/stat.h>
  1919. main() {
  1920. struct stat s, t;
  1921. exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
  1922. && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
  1923. && t.st_mtime - s.st_mtime < 120));
  1924. }
  1925. EOF
  1926. eval $compile
  1927. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1928.   rm -rf conftest*
  1929.   
  1930. {
  1931. test -n "$verbose" && \
  1932. echo "    defining HAVE_UTIME_NULL"
  1933. echo "#define" HAVE_UTIME_NULL 1 >> confdefs.h
  1934. DEFS="$DEFS -DHAVE_UTIME_NULL=1"
  1935. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UTIME_NULL\${SEDdB}HAVE_UTIME_NULL\${SEDdC}1\${SEDdD}
  1936. \${SEDuA}HAVE_UTIME_NULL\${SEDuB}HAVE_UTIME_NULL\${SEDuC}1\${SEDuD}
  1937. \${SEDeA}HAVE_UTIME_NULL\${SEDeB}HAVE_UTIME_NULL\${SEDeC}1\${SEDeD}
  1938. "
  1939. }
  1940.  
  1941.  
  1942. fi
  1943. rm -f conftest*
  1944. rm -f core
  1945.  
  1946. echo checking for Xenix
  1947. cat > conftest.c <<EOF
  1948. #include "confdefs.h"
  1949. #if defined(M_XENIX) && !defined(M_UNIX)
  1950.   yes
  1951. #endif
  1952.  
  1953. EOF
  1954. eval "$CPP conftest.c > conftest.out 2>&1"
  1955. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1956.   rm -rf conftest*
  1957.   XENIX=1
  1958.  
  1959. fi
  1960. rm -f conftest*
  1961.  
  1962. if test -n "$XENIX"; then
  1963.   LIBS="$LIBS -lx"
  1964.   case "$DEFS" in
  1965.   *SYSNDIR*) ;;
  1966.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  1967.   esac
  1968. fi
  1969.  
  1970. LIBS_save="${LIBS}"
  1971. LIBS="${LIBS} -lsun"
  1972. have_lib=""
  1973. echo checking for -lsun
  1974. cat > conftest.c <<EOF
  1975. #include "confdefs.h"
  1976.  
  1977. int main() { exit(0); }
  1978. int t() { main(); }
  1979. EOF
  1980. if eval $compile; then
  1981.   rm -rf conftest*
  1982.   have_lib="1"
  1983.  
  1984. fi
  1985. rm -f conftest*
  1986. LIBS="${LIBS_save}"
  1987. if test -n "${have_lib}"; then
  1988.    :; LIBS="$LIBS -lsun"
  1989. else
  1990.    :; 
  1991. fi
  1992.  
  1993.  
  1994. LIBS_save="${LIBS}"
  1995. LIBS="${LIBS} -lseq"
  1996. have_lib=""
  1997. echo checking for -lseq
  1998. cat > conftest.c <<EOF
  1999. #include "confdefs.h"
  2000.  
  2001. int main() { exit(0); }
  2002. int t() { main(); }
  2003. EOF
  2004. if eval $compile; then
  2005.   rm -rf conftest*
  2006.   have_lib="1"
  2007.  
  2008. fi
  2009. rm -f conftest*
  2010. LIBS="${LIBS_save}"
  2011. if test -n "${have_lib}"; then
  2012.    :; LIBS="$LIBS -lseq"
  2013. else
  2014.    :; 
  2015. fi
  2016.  
  2017.  
  2018. # Check for libypsec.a on Dolphin M88K machines.
  2019. LIBS_save="${LIBS}"
  2020. LIBS="${LIBS} -lypsec"
  2021. have_lib=""
  2022. echo checking for -lypsec
  2023. cat > conftest.c <<EOF
  2024. #include "confdefs.h"
  2025.  
  2026. int main() { exit(0); }
  2027. int t() { main(); }
  2028. EOF
  2029. if eval $compile; then
  2030.   rm -rf conftest*
  2031.   have_lib="1"
  2032.  
  2033. fi
  2034. rm -f conftest*
  2035. LIBS="${LIBS_save}"
  2036. if test -n "${have_lib}"; then
  2037.    
  2038. {
  2039. test -n "$verbose" && \
  2040. echo "    defining HAVE_LIBYPSEC"
  2041. echo "#define" HAVE_LIBYPSEC 1 >> confdefs.h
  2042. DEFS="$DEFS -DHAVE_LIBYPSEC=1"
  2043. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBYPSEC\${SEDdB}HAVE_LIBYPSEC\${SEDdC}1\${SEDdD}
  2044. \${SEDuA}HAVE_LIBYPSEC\${SEDuB}HAVE_LIBYPSEC\${SEDuC}1\${SEDuD}
  2045. \${SEDeA}HAVE_LIBYPSEC\${SEDeB}HAVE_LIBYPSEC\${SEDeC}1\${SEDeD}
  2046. "
  2047. }
  2048.  
  2049.    LIBS="${LIBS} -lypsec"
  2050. fi
  2051.  
  2052.  
  2053. # m88k running dgux 5.4 needs this
  2054. LIBS_save="${LIBS}"
  2055. LIBS="${LIBS} -ldgc"
  2056. have_lib=""
  2057. echo checking for -ldgc
  2058. cat > conftest.c <<EOF
  2059. #include "confdefs.h"
  2060.  
  2061. int main() { exit(0); }
  2062. int t() { main(); }
  2063. EOF
  2064. if eval $compile; then
  2065.   rm -rf conftest*
  2066.   have_lib="1"
  2067.  
  2068. fi
  2069. rm -f conftest*
  2070. LIBS="${LIBS_save}"
  2071. if test -n "${have_lib}"; then
  2072.    
  2073. {
  2074. test -n "$verbose" && \
  2075. echo "    defining HAVE_LIBDGC"
  2076. echo "#define" HAVE_LIBDGC 1 >> confdefs.h
  2077. DEFS="$DEFS -DHAVE_LIBDGC=1"
  2078. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDGC\${SEDdB}HAVE_LIBDGC\${SEDdC}1\${SEDdD}
  2079. \${SEDuA}HAVE_LIBDGC\${SEDuB}HAVE_LIBDGC\${SEDuC}1\${SEDuD}
  2080. \${SEDeA}HAVE_LIBDGC\${SEDeB}HAVE_LIBDGC\${SEDeC}1\${SEDeD}
  2081. "
  2082. }
  2083.  
  2084.    LIBS="${LIBS} -ldgc"
  2085. fi
  2086.  
  2087.  
  2088. echo checking for AFS
  2089. false && 
  2090. {
  2091. test -n "$verbose" && \
  2092. echo "    defining AFS"
  2093. echo "#define" AFS 1 >> confdefs.h
  2094. DEFS="$DEFS -DAFS=1"
  2095. SEDDEFS="${SEDDEFS}\${SEDdA}AFS\${SEDdB}AFS\${SEDdC}1\${SEDdD}
  2096. \${SEDuA}AFS\${SEDuB}AFS\${SEDuC}1\${SEDuD}
  2097. \${SEDeA}AFS\${SEDeB}AFS\${SEDeC}1\${SEDeD}
  2098. "
  2099. }
  2100.  
  2101.  
  2102. # Set default prefixes.
  2103. if test -n "$prefix"; then
  2104.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  2105.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  2106. fi
  2107. if test -n "$exec_prefix"; then
  2108.   prsub="$prsub
  2109. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  2110. fi
  2111. # Quote sed substitution magic chars in DEFS.
  2112. cat >conftest.def <<EOF
  2113. $DEFS
  2114. EOF
  2115. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  2116. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  2117. rm -f conftest.def
  2118. # Substitute for predefined variables.
  2119.  
  2120. trap 'rm -f config.status; exit 1' 1 3 15
  2121. echo creating config.status
  2122. rm -f config.status
  2123. cat > config.status <<EOF
  2124. #!/bin/sh
  2125. # Generated automatically by configure.
  2126. # Run this file to recreate the current configuration.
  2127. # This directory was configured as follows,
  2128. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2129. #
  2130. # $0 $configure_args
  2131.  
  2132. for arg
  2133. do
  2134.   case "\$arg" in
  2135.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  2136.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  2137.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  2138.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  2139.   esac
  2140. done
  2141.  
  2142. trap 'rm -fr Makefile lib/Makefile src/Makefile man/Makefile config.h conftest*; exit 1' 1 3 15
  2143. PROGS='$PROGS'
  2144. LIBPROGS='$LIBPROGS'
  2145. CC='$CC'
  2146. CFLAGS='$CFLAGS'
  2147. LDFLAGS='$LDFLAGS'
  2148. CPP='$CPP'
  2149. RANLIB='$RANLIB'
  2150. YACC='$YACC'
  2151. LIBOBJS='$LIBOBJS'
  2152. ALLOCA='$ALLOCA'
  2153. LIBS='$LIBS'
  2154. srcdir='$srcdir'
  2155. prefix='$prefix'
  2156. exec_prefix='$exec_prefix'
  2157. prsub='$prsub'
  2158. extrasub='$extrasub'
  2159. EOF
  2160. cat >> config.status <<\EOF
  2161.  
  2162. top_srcdir=$srcdir
  2163.  
  2164. CONFIG_FILES=${CONFIG_FILES-"Makefile lib/Makefile src/Makefile man/Makefile"}
  2165. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  2166.   srcdir=$top_srcdir
  2167.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2168.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  2169.   if test "$dir" != "$file"; then
  2170.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  2171.     test ! -d $dir && mkdir $dir
  2172.   fi
  2173.   echo creating $file
  2174.   rm -f $file
  2175.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  2176.   sed -e "
  2177. $prsub
  2178. $extrasub
  2179. s%@PROGS@%$PROGS%g
  2180. s%@LIBPROGS@%$LIBPROGS%g
  2181. s%@CC@%$CC%g
  2182. s%@CFLAGS@%$CFLAGS%g
  2183. s%@LDFLAGS@%$LDFLAGS%g
  2184. s%@CPP@%$CPP%g
  2185. s%@RANLIB@%$RANLIB%g
  2186. s%@YACC@%$YACC%g
  2187. s%@LIBOBJS@%$LIBOBJS%g
  2188. s%@ALLOCA@%$ALLOCA%g
  2189. s%@LIBS@%$LIBS%g
  2190. s%@srcdir@%$srcdir%g
  2191. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  2192. fi; done
  2193.  
  2194. CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
  2195. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  2196. echo creating $file
  2197.  
  2198. # These sed commands are put into SEDDEFS when defining a macro.
  2199. # They are broken into pieces to make the sed script easier to manage.
  2200. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  2201. # is the cpp macro being defined and VALUE is the value it is being given.
  2202. # Each defining turns into a single global substitution command.
  2203. #
  2204. # SEDd sets the value in "#define NAME VALUE" lines.
  2205. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2206. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  2207. SEDdC='\3'
  2208. SEDdD='@g'
  2209. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2210. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2211. SEDuB='\([     ]\)@\1#\2define\3'
  2212. SEDuC=' '
  2213. SEDuD='\4@g'
  2214. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2215. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2216. SEDeB='$@\1#\2define\3'
  2217. SEDeC=' '
  2218. SEDeD='@g'
  2219. rm -f conftest.sed
  2220. EOF
  2221. # Turn off quoting long enough to insert the sed commands.
  2222. rm -f conftest.sh
  2223. cat > conftest.sh <<EOF
  2224. $SEDDEFS
  2225. EOF
  2226.  
  2227. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  2228. # on the size of here documents.
  2229.  
  2230. # Maximum number of lines to put in a single here document.
  2231. maxshlines=9
  2232.  
  2233. while :
  2234. do
  2235.   # wc gives bogus results for an empty file on some systems.
  2236.   lines=`grep -c . conftest.sh`
  2237.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2238.   rm -f conftest.s1 conftest.s2
  2239.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  2240.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  2241.   # Write a limited-size here document to append to conftest.sed.
  2242.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  2243.   cat conftest.s1 >> config.status
  2244.   echo 'CONFEOF' >> config.status
  2245.   rm -f conftest.s1 conftest.sh
  2246.   mv conftest.s2 conftest.sh
  2247. done
  2248. rm -f conftest.sh
  2249.  
  2250. # Now back to your regularly scheduled config.status.
  2251. cat >> config.status <<\EOF
  2252. # This sed command replaces #undef's with comments.  This is necessary, for
  2253. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2254. # on some systems where configure will not decide to define it in
  2255. # config.h.
  2256. cat >> conftest.sed <<\CONFEOF
  2257. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  2258. CONFEOF
  2259. rm -f conftest.h
  2260. # Break up the sed commands because old seds have small limits.
  2261. maxsedlines=20
  2262. cp $top_srcdir/$file.in conftest.h1
  2263. while :
  2264. do
  2265.   lines=`grep -c . conftest.sed`
  2266.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2267.   rm -f conftest.s1 conftest.s2 conftest.h2
  2268.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  2269.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  2270.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  2271.   rm -f conftest.s1 conftest.h1 conftest.sed
  2272.   mv conftest.h2 conftest.h1
  2273.   mv conftest.s2 conftest.sed
  2274. done
  2275. rm -f conftest.sed conftest.h
  2276. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  2277. cat conftest.h1 >> conftest.h
  2278. rm -f conftest.h1
  2279. if cmp -s $file conftest.h 2>/dev/null; then
  2280.   # The file exists and we would not be changing it.
  2281.   echo "$file is unchanged"
  2282.   rm -f conftest.h
  2283. else
  2284.   rm -f $file
  2285.   mv conftest.h $file
  2286. fi
  2287. fi; done
  2288.  
  2289.  
  2290.  
  2291. exit 0
  2292. EOF
  2293. chmod +x config.status
  2294. ${CONFIG_SHELL-/bin/sh} config.status
  2295.  
  2296.