home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / fileutils-3.6 / configure < prev    next >
Encoding:
Text File  |  1993-05-22  |  33.7 KB  |  1,596 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] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  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, also recognize exact --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.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86. fi
  87.  
  88. rm -f conftest*
  89. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  90.  
  91. # A filename unique to this package, relative to the directory that
  92. # configure is in, which we can look for to find out if srcdir is correct.
  93. unique_file=src/ls.c
  94.  
  95. # Find the source files, if location was not specified.
  96. if test -z "$srcdir"; then
  97.   srcdirdefaulted=yes
  98.   # Try the directory containing this script, then `..'.
  99.   prog=$0
  100.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  101.   test "X$confdir" = "X$prog" && confdir=.
  102.   srcdir=$confdir
  103.   if test ! -r $srcdir/$unique_file; then
  104.     srcdir=..
  105.   fi
  106. fi
  107. if test ! -r $srcdir/$unique_file; then
  108.   if test x$srcdirdefaulted = xyes; then
  109.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  110.   else
  111.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  112.   fi
  113.   exit 1
  114. fi
  115. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  116. # But we can't avoid them for `..', to make subdirectories work.
  117. case $srcdir in
  118.   .|/*|~*) ;;
  119.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  120. esac
  121.  
  122.  
  123. # We want these before the checks, so the checks can modify their values.
  124. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
  125. test -z "$LDFLAGS" && LDFLAGS=-g
  126.  
  127. if test -z "$CC"; then
  128.   # Extract the first word of `gcc', so it can be a program name with args.
  129.   set dummy gcc; word=$2
  130.   echo checking for $word
  131.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  132.   for dir in $PATH; do
  133.     test -z "$dir" && dir=.
  134.     if test -f $dir/$word; then
  135.       CC="gcc"
  136.       break
  137.     fi
  138.   done
  139.   IFS="$saveifs"
  140. fi
  141. test -z "$CC" && CC="cc"
  142. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  143.  
  144. # Find out if we are using GNU C, under whatever name.
  145. cat > conftest.c <<EOF
  146. #ifdef __GNUC__
  147.   yes
  148. #endif
  149. EOF
  150. ${CC-cc} -E conftest.c > conftest.out 2>&1
  151. if egrep yes conftest.out >/dev/null 2>&1; then
  152.   GCC=1 # For later tests.
  153. fi
  154. rm -f conftest*
  155.  
  156.  
  157. # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  158. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
  159.  
  160.  
  161. echo checking how to run the C preprocessor
  162. if test -z "$CPP"; then
  163.   CPP='${CC-cc} -E'
  164.   cat > conftest.c <<EOF
  165. #include <stdio.h>
  166. EOF
  167. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  168. if test -z "$err"; then
  169.   :
  170. else
  171.   CPP=/lib/cpp
  172. fi
  173. rm -f conftest*
  174. fi
  175.  
  176. if test -n "$GCC"; then
  177.   echo checking whether -traditional is needed
  178.   pattern="Autoconf.*'x'"
  179.   prog='#include <sgtty.h>
  180. Autoconf TIOCGETP'
  181.   cat > conftest.c <<EOF
  182. $prog
  183. EOF
  184. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  185. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  186.   need_trad=1
  187. fi
  188. rm -f conftest*
  189.  
  190.  
  191.   if test -z "$need_trad"; then
  192.     prog='#include <termio.h>
  193. Autoconf TCGETA'
  194.     cat > conftest.c <<EOF
  195. $prog
  196. EOF
  197. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  198. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  199.   need_trad=1
  200. fi
  201. rm -f conftest*
  202.  
  203.   fi
  204.   test -n "$need_trad" && CC="$CC -traditional"
  205. fi
  206.  
  207. if test -z "$RANLIB"; then
  208.   # Extract the first word of `ranlib', so it can be a program name with args.
  209.   set dummy ranlib; word=$2
  210.   echo checking for $word
  211.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  212.   for dir in $PATH; do
  213.     test -z "$dir" && dir=.
  214.     if test -f $dir/$word; then
  215.       RANLIB="ranlib"
  216.       break
  217.     fi
  218.   done
  219.   IFS="$saveifs"
  220. fi
  221. test -z "$RANLIB" && RANLIB=":"
  222. test -n "$RANLIB" -a -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  223.  
  224. for p in 'bison -y' byacc
  225. do
  226. if test -z "$YACC"; then
  227.   # Extract the first word of `$p', so it can be a program name with args.
  228.   set dummy $p; word=$2
  229.   echo checking for $word
  230.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  231.   for dir in $PATH; do
  232.     test -z "$dir" && dir=.
  233.     if test -f $dir/$word; then
  234.       YACC="$p"
  235.       break
  236.     fi
  237.   done
  238.   IFS="$saveifs"
  239. fi
  240.  
  241. test -n "$YACC" -a -n "$verbose" && echo "    setting YACC to $YACC"
  242.  
  243. test -n "$YACC" && break
  244. done
  245. test -n "$YACC" || YACC="yacc"
  246.  
  247. echo checking for AIX
  248. cat > conftest.c <<EOF
  249. #ifdef _AIX
  250.   yes
  251. #endif
  252.  
  253. EOF
  254. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  255. if egrep "yes" conftest.out >/dev/null 2>&1; then
  256.   {
  257. test -n "$verbose" && \
  258. echo '    defining' _ALL_SOURCE
  259. DEFS="$DEFS -D_ALL_SOURCE=1"
  260. }
  261.  
  262. fi
  263. rm -f conftest*
  264.  
  265.  
  266. echo checking for minix/config.h
  267. cat > conftest.c <<EOF
  268. #include <minix/config.h>
  269. EOF
  270. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  271. if test -z "$err"; then
  272.   MINIX=1
  273. fi
  274. rm -f conftest*
  275.  
  276. # The Minix shell can't assign to the same variable on the same line!
  277. if test -n "$MINIX"; then
  278.   {
  279. test -n "$verbose" && \
  280. echo '    defining' _POSIX_SOURCE
  281. DEFS="$DEFS -D_POSIX_SOURCE=1"
  282. }
  283.  
  284.   {
  285. test -n "$verbose" && \
  286. echo '    defining' _POSIX_1_SOURCE to be '2'
  287. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  288. }
  289.  
  290.   {
  291. test -n "$verbose" && \
  292. echo '    defining' _MINIX
  293. DEFS="$DEFS -D_MINIX=1"
  294. }
  295.  
  296. fi
  297.  
  298. echo checking for POSIXized ISC
  299. if test -d /etc/conf/kconfig.d &&
  300.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  301. then
  302.   ISC=1 # If later tests want to check for ISC.
  303.   {
  304. test -n "$verbose" && \
  305. echo '    defining' _POSIX_SOURCE
  306. DEFS="$DEFS -D_POSIX_SOURCE=1"
  307. }
  308.  
  309.   if test -n "$GCC"; then
  310.     CC="$CC -posix"
  311.   else
  312.     CC="$CC -Xp"
  313.   fi
  314. fi
  315.  
  316. echo checking for major, minor and makedev header
  317. cat > conftest.c <<EOF
  318. #include <sys/types.h>
  319. int main() { exit(0); }
  320. int t() { return makedev(0, 0); }
  321. EOF
  322. if eval $compile; then
  323.   makedev=1
  324. fi
  325. rm -f conftest*
  326.  
  327. if test -z "$makedev"; then
  328. echo checking for sys/mkdev.h
  329. cat > conftest.c <<EOF
  330. #include <sys/mkdev.h>
  331. EOF
  332. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  333. if test -z "$err"; then
  334.   {
  335. test -n "$verbose" && \
  336. echo '    defining' MAJOR_IN_MKDEV
  337. DEFS="$DEFS -DMAJOR_IN_MKDEV=1"
  338. }
  339.  makedev=1
  340. fi
  341. rm -f conftest*
  342.  
  343. fi
  344. if test -z "$makedev"; then
  345. echo checking for sys/sysmacros.h
  346. cat > conftest.c <<EOF
  347. #include <sys/sysmacros.h>
  348. EOF
  349. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  350. if test -z "$err"; then
  351.   {
  352. test -n "$verbose" && \
  353. echo '    defining' MAJOR_IN_SYSMACROS
  354. DEFS="$DEFS -DMAJOR_IN_SYSMACROS=1"
  355. }
  356.  
  357. fi
  358. rm -f conftest*
  359.  
  360. fi
  361.  
  362. echo checking for directory library header
  363. dirheader=
  364. if test -z "$dirheader"; then
  365.   echo checking for dirent.h
  366. cat > conftest.c <<EOF
  367. #include <sys/types.h>
  368. #include <dirent.h>
  369. int main() { exit(0); }
  370. int t() { DIR *dirp = opendir ("/"); }
  371. EOF
  372. if eval $compile; then
  373.   {
  374. test -n "$verbose" && \
  375. echo '    defining' DIRENT
  376. DEFS="$DEFS -DDIRENT=1"
  377. }
  378.  dirheader=dirent.h
  379. fi
  380. rm -f conftest*
  381. fi
  382. if test -z "$dirheader"; then
  383.   echo checking for sys/ndir.h
  384. cat > conftest.c <<EOF
  385. #include <sys/types.h>
  386. #include <sys/ndir.h>
  387. int main() { exit(0); }
  388. int t() { DIR *dirp = opendir ("/"); }
  389. EOF
  390. if eval $compile; then
  391.   {
  392. test -n "$verbose" && \
  393. echo '    defining' SYSNDIR
  394. DEFS="$DEFS -DSYSNDIR=1"
  395. }
  396.  dirheader=sys/ndir.h
  397. fi
  398. rm -f conftest*
  399. fi
  400. if test -z "$dirheader"; then
  401.   echo checking for sys/dir.h
  402. cat > conftest.c <<EOF
  403. #include <sys/types.h>
  404. #include <sys/dir.h>
  405. int main() { exit(0); }
  406. int t() { DIR *dirp = opendir ("/"); }
  407. EOF
  408. if eval $compile; then
  409.   {
  410. test -n "$verbose" && \
  411. echo '    defining' SYSDIR
  412. DEFS="$DEFS -DSYSDIR=1"
  413. }
  414.  dirheader=sys/dir.h
  415. fi
  416. rm -f conftest*
  417. fi
  418. if test -z "$dirheader"; then
  419.   echo checking for ndir.h
  420. cat > conftest.c <<EOF
  421. #include <sys/types.h>
  422. #include <ndir.h>
  423. int main() { exit(0); }
  424. int t() { DIR *dirp = opendir ("/"); }
  425. EOF
  426. if eval $compile; then
  427.   {
  428. test -n "$verbose" && \
  429. echo '    defining' NDIR
  430. DEFS="$DEFS -DNDIR=1"
  431. }
  432.  dirheader=ndir.h
  433. fi
  434. rm -f conftest*
  435. fi
  436.  
  437. echo checking for closedir return value
  438. cat > conftest.c <<EOF
  439. #include <sys/types.h>
  440. #include <$dirheader>
  441. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  442. EOF
  443. eval $compile
  444. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  445.   :
  446. else
  447.   {
  448. test -n "$verbose" && \
  449. echo '    defining' VOID_CLOSEDIR
  450. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  451. }
  452.  
  453. fi
  454. rm -f conftest*
  455.  
  456. echo checking for return type of signal handlers
  457. cat > conftest.c <<EOF
  458. #include <sys/types.h>
  459. #include <signal.h>
  460. #ifdef signal
  461. #undef signal
  462. #endif
  463. extern void (*signal ()) ();
  464. int main() { exit(0); }
  465. int t() { int i; }
  466. EOF
  467. if eval $compile; then
  468.   {
  469. test -n "$verbose" && \
  470. echo '    defining' RETSIGTYPE to be 'void'
  471. DEFS="$DEFS -DRETSIGTYPE=void"
  472. }
  473.  
  474. else
  475.   {
  476. test -n "$verbose" && \
  477. echo '    defining' RETSIGTYPE to be 'int'
  478. DEFS="$DEFS -DRETSIGTYPE=int"
  479. }
  480.  
  481. fi
  482. rm -f conftest*
  483.  
  484.  
  485.  
  486. echo checking how to get list of mounted filesystems
  487. mounted=
  488.  
  489. # DEC Alpha running OSF/1.
  490. cat > conftest.c <<EOF
  491.  
  492. #include <sys/types.h>
  493. #include <sys/mount.h>
  494. #include <sys/fs_types.h>
  495. int main() { exit(0); }
  496. int t() { struct statfs *stats;
  497. numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);  }
  498. EOF
  499. if eval $compile; then
  500.   {
  501. test -n "$verbose" && \
  502. echo '    defining' MOUNTED_GETFSSTAT
  503. DEFS="$DEFS -DMOUNTED_GETFSSTAT=1"
  504. }
  505.  mounted=1
  506. fi
  507. rm -f conftest*
  508.  
  509. if test -z "$mounted"; then
  510. # SVR4
  511. echo '#include <sys/mnttab.h>' > conftest.c
  512. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  513. if egrep "getmntent" conftest.out >/dev/null 2>&1; then
  514.   {
  515. test -n "$verbose" && \
  516. echo '    defining' MOUNTED_GETMNTENT2
  517. DEFS="$DEFS -DMOUNTED_GETMNTENT2=1"
  518. }
  519.  mounted=1
  520. fi
  521. rm -f conftest*
  522.  
  523. fi
  524. if test -z "$mounted"; then
  525. # AIX.
  526. cat > conftest.c <<EOF
  527. #include <fshelp.h>
  528. EOF
  529. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  530. if test -z "$err"; then
  531.   {
  532. test -n "$verbose" && \
  533. echo '    defining' MOUNTED_VMOUNT
  534. DEFS="$DEFS -DMOUNTED_VMOUNT=1"
  535. }
  536.  mounted=1
  537. fi
  538. rm -f conftest*
  539. fi
  540. if test -z "$mounted"; then
  541. # SVR3
  542. cat > conftest.c <<EOF
  543. #include <sys/statfs.h>
  544. #include <sys/fstyp.h>
  545. #include <mnttab.h>
  546. EOF
  547. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  548. if test -z "$err"; then
  549.   {
  550. test -n "$verbose" && \
  551. echo '    defining' MOUNTED_FREAD_FSTYP
  552. DEFS="$DEFS -DMOUNTED_FREAD_FSTYP=1"
  553. }
  554.  mounted=1
  555. fi
  556. rm -f conftest*
  557. fi
  558. if test -z "$mounted"; then
  559. # 4.3BSD
  560. cat > conftest.c <<EOF
  561. #include <mntent.h>
  562. EOF
  563. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  564. if test -z "$err"; then
  565.   {
  566. test -n "$verbose" && \
  567. echo '    defining' MOUNTED_GETMNTENT1
  568. DEFS="$DEFS -DMOUNTED_GETMNTENT1=1"
  569. }
  570.  mounted=1
  571. fi
  572. rm -f conftest*
  573. fi
  574. if test -z "$mounted"; then
  575. # 4.4BSD and DEC OSF/1.
  576. echo '#include <sys/mount.h>' > conftest.c
  577. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  578. if egrep "f_type;" conftest.out >/dev/null 2>&1; then
  579.   {
  580. test -n "$verbose" && \
  581. echo '    defining' MOUNTED_GETMNTINFO
  582. DEFS="$DEFS -DMOUNTED_GETMNTINFO=1"
  583. }
  584.  mounted=1
  585. fi
  586. rm -f conftest*
  587.  
  588. fi
  589. if test -z "$mounted"; then
  590. # Ultrix
  591. cat > conftest.c <<EOF
  592. #include <sys/fs_types.h>
  593. #include <sys/mount.h>
  594. EOF
  595. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  596. if test -z "$err"; then
  597.   {
  598. test -n "$verbose" && \
  599. echo '    defining' MOUNTED_GETMNT
  600. DEFS="$DEFS -DMOUNTED_GETMNT=1"
  601. }
  602.  mounted=1
  603. fi
  604. rm -f conftest*
  605. fi
  606. if test -z "$mounted"; then
  607. # SVR2
  608. cat > conftest.c <<EOF
  609. #include <mnttab.h>
  610. EOF
  611. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  612. if test -z "$err"; then
  613.   {
  614. test -n "$verbose" && \
  615. echo '    defining' MOUNTED_FREAD
  616. DEFS="$DEFS -DMOUNTED_FREAD=1"
  617. }
  618.  mounted=1
  619. fi
  620. rm -f conftest*
  621. fi
  622.  
  623. echo checking how to get filesystem space usage
  624. space= 
  625.  
  626. # DEC Alpha running OSF/1
  627. cat > conftest.c <<EOF
  628.  
  629. #include <sys/types.h>
  630. #include <sys/mount.h>
  631. main ()
  632. {
  633. struct statfs fsd;
  634. exit (statfs (".", &fsd, sizeof (struct statfs)));
  635. }
  636. EOF
  637. eval $compile
  638. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  639.   {
  640. test -n "$verbose" && \
  641. echo '    defining' STATFS_OSF1
  642. DEFS="$DEFS -DSTATFS_OSF1=1"
  643. }
  644.  space=1
  645. fi
  646. rm -f conftest*
  647. if test -z "$space"; then
  648. # SVR4
  649. cat > conftest.c <<EOF
  650. #include <sys/statvfs.h>
  651. #include <sys/fstyp.h>
  652. EOF
  653. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  654. if test -z "$err"; then
  655.   {
  656. test -n "$verbose" && \
  657. echo '    defining' STAT_STATVFS
  658. DEFS="$DEFS -DSTAT_STATVFS=1"
  659. }
  660.  space=1
  661. fi
  662. rm -f conftest*
  663. fi
  664. if test -z "$space"; then
  665. # AIX
  666. echo '#include <sys/statfs.h>' > conftest.c
  667. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  668. if egrep "f_nlsdirtype" conftest.out >/dev/null 2>&1; then
  669.   {
  670. test -n "$verbose" && \
  671. echo '    defining' STAT_STATFS2_BSIZE
  672. DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
  673. }
  674.  space=1
  675. fi
  676. rm -f conftest*
  677.  
  678. fi
  679. if test -z "$space"; then
  680. # SVR3
  681. cat > conftest.c <<EOF
  682. #include <sys/statfs.h>
  683. EOF
  684. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  685. if test -z "$err"; then
  686.   {
  687. test -n "$verbose" && \
  688. echo '    defining' STAT_STATFS4
  689. DEFS="$DEFS -DSTAT_STATFS4=1"
  690. }
  691.  space=1
  692. fi
  693. rm -f conftest*
  694. fi
  695. if test -z "$space"; then
  696. # 4.3BSD
  697. cat > conftest.c <<EOF
  698. #include <sys/vfs.h>
  699. EOF
  700. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  701. if test -z "$err"; then
  702.   {
  703. test -n "$verbose" && \
  704. echo '    defining' STAT_STATFS2_BSIZE
  705. DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
  706. }
  707.  space=1
  708. fi
  709. rm -f conftest*
  710. fi
  711. if test -z "$space"; then
  712. # 4.4BSD
  713. echo '#include <sys/mount.h>' > conftest.c
  714. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  715. if egrep "MOUNT_UFS" conftest.out >/dev/null 2>&1; then
  716.   {
  717. test -n "$verbose" && \
  718. echo '    defining' STAT_STATFS2_FSIZE
  719. DEFS="$DEFS -DSTAT_STATFS2_FSIZE=1"
  720. }
  721.  space=1
  722. fi
  723. rm -f conftest*
  724.  
  725. fi
  726. if test -z "$space"; then
  727. # SVR2
  728. cat > conftest.c <<EOF
  729. #include <sys/filsys.h>
  730. EOF
  731. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  732. if test -z "$err"; then
  733.   {
  734. test -n "$verbose" && \
  735. echo '    defining' STAT_READ
  736. DEFS="$DEFS -DSTAT_READ=1"
  737. }
  738.  space=1
  739. fi
  740. rm -f conftest*
  741. fi
  742. if test -z "$space"; then
  743. # Ultrix
  744. cat > conftest.c <<EOF
  745. #include <sys/mount.h>
  746. EOF
  747. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  748. if test -z "$err"; then
  749.   {
  750. test -n "$verbose" && \
  751. echo '    defining' STAT_STATFS2_FS_DATA
  752. DEFS="$DEFS -DSTAT_STATFS2_FS_DATA=1"
  753. }
  754.  space=1
  755. fi
  756. rm -f conftest*
  757. fi
  758. if test -n "$mounted" && test -n "$space"; then
  759.   PROGS="$PROGS df" LIBOBJS="$LIBOBJS fsusage.o mountlist.o"
  760. fi
  761.  
  762. echo checking for uid_t in sys/types.h
  763. echo '#include <sys/types.h>' > conftest.c
  764. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  765. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  766.   :
  767. else
  768.   {
  769. test -n "$verbose" && \
  770. echo '    defining' uid_t to be 'int'
  771. DEFS="$DEFS -Duid_t=int"
  772. }
  773.  {
  774. test -n "$verbose" && \
  775. echo '    defining' gid_t to be 'int'
  776. DEFS="$DEFS -Dgid_t=int"
  777. }
  778.  
  779. fi
  780. rm -f conftest*
  781.  
  782. echo checking for type of array argument to getgroups
  783. prog='/* Thanks to Mike Rendell for this test.  */
  784. #include <sys/types.h>
  785. #define NGID 256
  786. #undef MAX
  787. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  788. main()
  789. {
  790.   gid_t gidset[NGID];
  791.   int i, n;
  792.   union { gid_t gval; long lval; }  val;
  793.  
  794.   val.lval = -1;
  795.   for (i = 0; i < NGID; i++)
  796.     gidset[i] = val.gval;
  797.   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
  798.                  gidset);
  799.   /* Exit non-zero if getgroups seems to require an array of ints.  This
  800.      happens when gid_t is short but getgroups modifies an array of ints.  */
  801.   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
  802. }'
  803. cat > conftest.c <<EOF
  804. $prog
  805. EOF
  806. eval $compile
  807. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  808.   {
  809. test -n "$verbose" && \
  810. echo '    defining' GETGROUPS_T to be 'gid_t'
  811. DEFS="$DEFS -DGETGROUPS_T=gid_t"
  812. }
  813.  
  814. else
  815.   {
  816. test -n "$verbose" && \
  817. echo '    defining' GETGROUPS_T to be 'int'
  818. DEFS="$DEFS -DGETGROUPS_T=int"
  819. }
  820.  
  821. fi
  822. rm -f conftest*
  823.  
  824. echo checking integer size
  825. cat > conftest.c <<EOF
  826. main() { exit(!(sizeof(long) > sizeof(int))); }
  827. EOF
  828. eval $compile
  829. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  830.   {
  831. test -n "$verbose" && \
  832. echo '    defining' INT_16_BITS
  833. DEFS="$DEFS -DINT_16_BITS=1"
  834. }
  835.  
  836. fi
  837. rm -f conftest*
  838.  
  839. prog='/* Ultrix mips cc rejects this.  */
  840. typedef int charset[2]; const charset x;
  841. /* SunOS 4.1.1 cc rejects this.  */
  842. char const *const *ccp;
  843. char **p;
  844. /* AIX XL C 1.02.0.0 rejects this.
  845.    It does not let you subtract one const X* pointer from another in an arm
  846.    of an if-expression whose if-part is not a constant expression */
  847. const char *g = "string";
  848. p = &g + (g ? g-g : 0);
  849. /* HPUX 7.0 cc rejects these. */
  850. ++ccp;
  851. p = (char**) ccp;
  852. ccp = (char const *const *) p;
  853. { /* SCO 3.2v4 cc rejects this.  */
  854.   char *t;
  855.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  856.  
  857.   *t++ = 0;
  858. }
  859. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  860.   int x[] = {25,17};
  861.   const int *foo = &x[0];
  862.   ++foo;
  863. }
  864. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  865.   typedef const int *iptr;
  866.   iptr p = 0;
  867.   ++p;
  868. }
  869. { /* AIX XL C 1.02.0.0 rejects this saying
  870.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  871.   struct s { int j; const int *ap[3]; };
  872.   struct s *b; b->j = 5;
  873. }'
  874. echo checking for working const
  875. cat > conftest.c <<EOF
  876.  
  877. int main() { exit(0); }
  878. int t() { $prog }
  879. EOF
  880. if eval $compile; then
  881.   :
  882. else
  883.   {
  884. test -n "$verbose" && \
  885. echo '    defining' const to be 'empty'
  886. DEFS="$DEFS -Dconst="
  887. }
  888.  
  889. fi
  890. rm -f conftest*
  891.  
  892. echo checking for ANSI C header files
  893. cat > conftest.c <<EOF
  894. #include <stdlib.h>
  895. #include <stdarg.h>
  896. #include <string.h>
  897. #include <float.h>
  898. EOF
  899. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  900. if test -z "$err"; then
  901.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  902. echo '#include <string.h>' > conftest.c
  903. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  904. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  905.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  906. cat > conftest.c <<EOF
  907. #include <ctype.h>
  908. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  909. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  910. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  911. int main () { int i; for (i = 0; i < 256; i++)
  912. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  913. exit (0); }
  914.  
  915. EOF
  916. eval $compile
  917. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  918.   {
  919. test -n "$verbose" && \
  920. echo '    defining' STDC_HEADERS
  921. DEFS="$DEFS -DSTDC_HEADERS=1"
  922. }
  923.  
  924. fi
  925. rm -f conftest*
  926. fi
  927. rm -f conftest*
  928.  
  929. fi
  930. rm -f conftest*
  931.  
  932. echo checking for unistd.h
  933. cat > conftest.c <<EOF
  934. #include <unistd.h>
  935. EOF
  936. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  937. if test -z "$err"; then
  938.   {
  939. test -n "$verbose" && \
  940. echo '    defining' HAVE_UNISTD_H
  941. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  942. }
  943.  
  944. fi
  945. rm -f conftest*
  946.  
  947. echo checking for struct tm in time.h
  948. cat > conftest.c <<EOF
  949. #include <sys/types.h>
  950. #include <time.h>
  951. int main() { exit(0); }
  952. int t() { struct tm *tp; }
  953. EOF
  954. if eval $compile; then
  955.   :
  956. else
  957.   {
  958. test -n "$verbose" && \
  959. echo '    defining' TM_IN_SYS_TIME
  960. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  961. }
  962.  
  963. fi
  964. rm -f conftest*
  965.  
  966. echo checking for whether time.h and sys/time.h may both be included
  967. cat > conftest.c <<EOF
  968. #include <sys/types.h>
  969. #include <sys/time.h>
  970. #include <time.h>
  971. int main() { exit(0); }
  972. int t() { struct tm *tp; }
  973. EOF
  974. if eval $compile; then
  975.   {
  976. test -n "$verbose" && \
  977. echo '    defining' TIME_WITH_SYS_TIME
  978. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  979. }
  980.  
  981. fi
  982. rm -f conftest*
  983.  
  984. for hdr in string.h fcntl.h limits.h sys/time.h errno.h
  985. do
  986. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  987. echo checking for ${hdr}
  988. cat > conftest.c <<EOF
  989. #include <${hdr}>
  990. EOF
  991. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  992. if test -z "$err"; then
  993.   {
  994. test -n "$verbose" && \
  995. echo '    defining' ${trhdr}
  996. DEFS="$DEFS -D${trhdr}=1"
  997. }
  998.  
  999. fi
  1000. rm -f conftest*
  1001. done
  1002.  
  1003. for func in fnmatch mkdir mktime stpcpy strdup strstr rename
  1004. do
  1005. echo checking for ${func}
  1006. cat > conftest.c <<EOF
  1007.  
  1008. int main() { exit(0); }
  1009. int t() { /* The GNU C library defines this for functions which it implements
  1010.     to always fail with ENOSYS.  Some functions are actually named
  1011.     something starting with __ and the normal name is an alias.  */
  1012. #if defined (__stub_${func}) || defined (__stub___${func})
  1013. choke me
  1014. #else
  1015. /* Override any gcc2 internal prototype to avoid an error.  */
  1016. extern char ${func}(); ${func}();
  1017. #endif
  1018.  }
  1019. EOF
  1020. if eval $compile; then
  1021.   :
  1022. else
  1023.   LIBOBJS="$LIBOBJS ${func}.o"
  1024. test -n "$verbose" && echo "    using ${func}.o instead"
  1025. fi
  1026. rm -f conftest*
  1027.  
  1028. done
  1029.  
  1030. for func in strerror ftime getcwd mkfifo memcpy bcopy gettimeofday
  1031. do
  1032. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1033. echo checking for ${func}
  1034. cat > conftest.c <<EOF
  1035. #include <ctype.h>
  1036. int main() { exit(0); }
  1037. int t() { 
  1038. /* The GNU C library defines this for functions which it implements
  1039.     to always fail with ENOSYS.  Some functions are actually named
  1040.     something starting with __ and the normal name is an alias.  */
  1041. #if defined (__stub_${func}) || defined (__stub___${func})
  1042. choke me
  1043. #else
  1044. /* Override any gcc2 internal prototype to avoid an error.  */
  1045. extern char ${func}(); ${func}();
  1046. #endif
  1047.  }
  1048. EOF
  1049. if eval $compile; then
  1050.   {
  1051. test -n "$verbose" && \
  1052. echo '    defining' ${trfunc}
  1053. DEFS="$DEFS -D${trfunc}=1"
  1054. }
  1055.  
  1056. fi
  1057. rm -f conftest*
  1058. done
  1059.  
  1060. echo checking for ftruncate
  1061. cat > conftest.c <<EOF
  1062.  
  1063. int main() { exit(0); }
  1064. int t() { ftruncate(); }
  1065. EOF
  1066. if eval $compile; then
  1067.   {
  1068. test -n "$verbose" && \
  1069. echo '    defining' HAVE_FTRUNCATE
  1070. DEFS="$DEFS -DHAVE_FTRUNCATE=1"
  1071. }
  1072.  
  1073. else
  1074.   ftruncate_missing=1
  1075. fi
  1076. rm -f conftest*
  1077.  
  1078. if test -n "$ftruncate_missing"; then
  1079. echo checking for fcntl emulation of ftruncate
  1080. cat > conftest.c <<EOF
  1081. #include <sys/types.h>
  1082. #include <fcntl.h>
  1083. int main() { exit(0); }
  1084. int t() { 
  1085. #if !defined(F_CHSIZE) && !defined(F_FREESP)
  1086. chsize();
  1087. #endif
  1088.  }
  1089. EOF
  1090. if eval $compile; then
  1091.   {
  1092. test -n "$verbose" && \
  1093. echo '    defining' HAVE_FTRUNCATE
  1094. DEFS="$DEFS -DHAVE_FTRUNCATE=1"
  1095. }
  1096.  LIBOBJS="$LIBOBJS ftruncate.o"
  1097. fi
  1098. rm -f conftest*
  1099.  
  1100. fi
  1101.  
  1102. case "$LIBOBJS" in
  1103. *rename.o*)
  1104.   LIBPROGS="$LIBPROGS mvdir"
  1105.   {
  1106. test -n "$verbose" && \
  1107. echo '    defining' MVDIR to be '"\"$(libdir)/mvdir\""'
  1108. DEFS="$DEFS -DMVDIR=\"\\\"\$(libdir)/mvdir\\\"\""
  1109. }
  1110.  
  1111.   ;;
  1112. esac
  1113.  
  1114. echo checking for vprintf
  1115. cat > conftest.c <<EOF
  1116.  
  1117. int main() { exit(0); }
  1118. int t() { vprintf(); }
  1119. EOF
  1120. if eval $compile; then
  1121.   {
  1122. test -n "$verbose" && \
  1123. echo '    defining' HAVE_VPRINTF
  1124. DEFS="$DEFS -DHAVE_VPRINTF=1"
  1125. }
  1126.  
  1127. else
  1128.   vprintf_missing=1
  1129. fi
  1130. rm -f conftest*
  1131.  
  1132. if test -n "$vprintf_missing"; then
  1133. echo checking for _doprnt
  1134. cat > conftest.c <<EOF
  1135.  
  1136. int main() { exit(0); }
  1137. int t() { _doprnt(); }
  1138. EOF
  1139. if eval $compile; then
  1140.   {
  1141. test -n "$verbose" && \
  1142. echo '    defining' HAVE_DOPRNT
  1143. DEFS="$DEFS -DHAVE_DOPRNT=1"
  1144. }
  1145.  
  1146. fi
  1147. rm -f conftest*
  1148.  
  1149. fi
  1150.  
  1151. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  1152. # for constant arguments.  Useless!
  1153. echo checking for working alloca.h
  1154. cat > conftest.c <<EOF
  1155. #include <alloca.h>
  1156. int main() { exit(0); }
  1157. int t() { char *p = alloca(2 * sizeof(int)); }
  1158. EOF
  1159. if eval $compile; then
  1160.   {
  1161. test -n "$verbose" && \
  1162. echo '    defining' HAVE_ALLOCA_H
  1163. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  1164. }
  1165.  
  1166. fi
  1167. rm -f conftest*
  1168.  
  1169. decl="#ifdef __GNUC__
  1170. #define alloca __builtin_alloca
  1171. #else
  1172. #if HAVE_ALLOCA_H
  1173. #include <alloca.h>
  1174. #else
  1175. #ifdef _AIX
  1176.  #pragma alloca
  1177. #else
  1178. char *alloca ();
  1179. #endif
  1180. #endif
  1181. #endif
  1182. "
  1183. echo checking for alloca
  1184. cat > conftest.c <<EOF
  1185. $decl
  1186. int main() { exit(0); }
  1187. int t() { char *p = (char *) alloca(1); }
  1188. EOF
  1189. if eval $compile; then
  1190.   :
  1191. else
  1192.   alloca_missing=1
  1193. cat > conftest.c <<EOF
  1194.  
  1195. #if defined(CRAY) && ! defined(CRAY2)
  1196. winnitude
  1197. #else
  1198. lossage
  1199. #endif
  1200.  
  1201. EOF
  1202. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1203. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  1204.   echo checking for _getb67
  1205. cat > conftest.c <<EOF
  1206. #include <ctype.h>
  1207. int main() { exit(0); }
  1208. int t() { 
  1209. /* The GNU C library defines this for functions which it implements
  1210.     to always fail with ENOSYS.  Some functions are actually named
  1211.     something starting with __ and the normal name is an alias.  */
  1212. #if defined (__stub__getb67) || defined (__stub____getb67)
  1213. choke me
  1214. #else
  1215. /* Override any gcc2 internal prototype to avoid an error.  */
  1216. extern char _getb67(); _getb67();
  1217. #endif
  1218.  }
  1219. EOF
  1220. if eval $compile; then
  1221.   {
  1222. test -n "$verbose" && \
  1223. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  1224. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1225. }
  1226.  
  1227. else
  1228.   echo checking for GETB67
  1229. cat > conftest.c <<EOF
  1230. #include <ctype.h>
  1231. int main() { exit(0); }
  1232. int t() { 
  1233. /* The GNU C library defines this for functions which it implements
  1234.     to always fail with ENOSYS.  Some functions are actually named
  1235.     something starting with __ and the normal name is an alias.  */
  1236. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1237. choke me
  1238. #else
  1239. /* Override any gcc2 internal prototype to avoid an error.  */
  1240. extern char GETB67(); GETB67();
  1241. #endif
  1242.  }
  1243. EOF
  1244. if eval $compile; then
  1245.   {
  1246. test -n "$verbose" && \
  1247. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  1248. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1249. }
  1250.  
  1251. else
  1252.   echo checking for getb67
  1253. cat > conftest.c <<EOF
  1254. #include <ctype.h>
  1255. int main() { exit(0); }
  1256. int t() { 
  1257. /* The GNU C library defines this for functions which it implements
  1258.     to always fail with ENOSYS.  Some functions are actually named
  1259.     something starting with __ and the normal name is an alias.  */
  1260. #if defined (__stub_getb67) || defined (__stub___getb67)
  1261. choke me
  1262. #else
  1263. /* Override any gcc2 internal prototype to avoid an error.  */
  1264. extern char getb67(); getb67();
  1265. #endif
  1266.  }
  1267. EOF
  1268. if eval $compile; then
  1269.   {
  1270. test -n "$verbose" && \
  1271. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  1272. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1273. }
  1274.  
  1275. fi
  1276. rm -f conftest*
  1277.  
  1278. fi
  1279. rm -f conftest*
  1280.  
  1281. fi
  1282. rm -f conftest*
  1283.  
  1284. fi
  1285. rm -f conftest*
  1286.  
  1287.  
  1288. fi
  1289. rm -f conftest*
  1290.  
  1291. if test -n "$alloca_missing"; then
  1292.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1293.   # that cause trouble.  Some versions do not even contain alloca or
  1294.   # contain a buggy version.  If you still want to use their alloca,
  1295.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1296.   ALLOCA=alloca.o
  1297.  
  1298.   echo 'checking stack direction for C alloca'
  1299.   echo checking whether cross-compiling
  1300. # If we cannot run a trivial program, we must be cross compiling.
  1301. cat > conftest.c <<EOF
  1302. main(){exit(0);}
  1303. EOF
  1304. eval $compile
  1305. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1306.   :
  1307. else
  1308.   cross_compiling=1
  1309. fi
  1310. rm -f conftest*
  1311.  
  1312. if test -n "$cross_compiling"
  1313. then
  1314.   {
  1315. test -n "$verbose" && \
  1316. echo '    defining' STACK_DIRECTION to be '0'
  1317. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1318. }
  1319.  
  1320. else
  1321. cat > conftest.c <<EOF
  1322. find_stack_direction ()
  1323. {
  1324.   static char *addr = 0;
  1325.   auto char dummy;
  1326.   if (addr == 0)
  1327.     {
  1328.       addr = &dummy;
  1329.       return find_stack_direction ();
  1330.     }
  1331.   else
  1332.     return (&dummy > addr) ? 1 : -1;
  1333. }
  1334. main ()
  1335. {
  1336.   exit (find_stack_direction() < 0);
  1337. }
  1338. EOF
  1339. eval $compile
  1340. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1341.   {
  1342. test -n "$verbose" && \
  1343. echo '    defining' STACK_DIRECTION to be '1'
  1344. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1345. }
  1346.  
  1347. else
  1348.   {
  1349. test -n "$verbose" && \
  1350. echo '    defining' STACK_DIRECTION to be '-1'
  1351. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1352. }
  1353.  
  1354. fi
  1355. fi
  1356. rm -f conftest*
  1357. fi
  1358.  
  1359. echo checking for st_blocks in struct stat
  1360. cat > conftest.c <<EOF
  1361. #include <sys/types.h>
  1362. #include <sys/stat.h>
  1363. int main() { exit(0); }
  1364. int t() { struct stat s; s.st_blocks; }
  1365. EOF
  1366. if eval $compile; then
  1367.   {
  1368. test -n "$verbose" && \
  1369. echo '    defining' HAVE_ST_BLOCKS
  1370. DEFS="$DEFS -DHAVE_ST_BLOCKS=1"
  1371. }
  1372.  
  1373. else
  1374.   LIBOBJS="$LIBOBJS fileblocks.o"
  1375. fi
  1376. rm -f conftest*
  1377.  
  1378. echo checking utime with null argument
  1379. rm -f conftestdata; > conftestdata
  1380. # Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
  1381. cat > conftest.c <<EOF
  1382. #include <sys/types.h>
  1383. #include <sys/stat.h>
  1384. main() {
  1385. struct stat s, t;
  1386. exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
  1387. && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
  1388. && t.st_mtime - s.st_mtime < 120));
  1389. }
  1390. EOF
  1391. eval $compile
  1392. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1393.   {
  1394. test -n "$verbose" && \
  1395. echo '    defining' HAVE_UTIME_NULL
  1396. DEFS="$DEFS -DHAVE_UTIME_NULL=1"
  1397. }
  1398.  
  1399. fi
  1400. rm -f conftest*
  1401. rm -f core
  1402.  
  1403. echo checking for Xenix
  1404. cat > conftest.c <<EOF
  1405. #if defined(M_XENIX) && !defined(M_UNIX)
  1406.   yes
  1407. #endif
  1408.  
  1409. EOF
  1410. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1411. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1412.   XENIX=1
  1413. fi
  1414. rm -f conftest*
  1415.  
  1416. if test -n "$XENIX"; then
  1417.   LIBS="$LIBS -lx"
  1418.   case "$DEFS" in
  1419.   *SYSNDIR*) ;;
  1420.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  1421.   esac
  1422. fi
  1423.  
  1424. echo checking for IRIX libsun
  1425. if test -f /usr/lib/libsun.a; then
  1426.   LIBS="$LIBS -lsun"
  1427. fi
  1428.  
  1429. echo checking for DYNIX/ptx libseq
  1430. cat > conftest.c <<EOF
  1431. #if defined(_SEQUENT_)
  1432.   yes
  1433. #endif
  1434.  
  1435. EOF
  1436. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1437. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1438.   SEQUENT=1
  1439. fi
  1440. rm -f conftest*
  1441.  
  1442. test -n "$SEQUENT" && test -f /usr/lib/libseq.a &&
  1443.   LIBS="$LIBS -lseq"
  1444.  
  1445. # Check for libypsec.a on Dolphin M88K machines.
  1446. LIBS_save="${LIBS}"
  1447. LIBS="${LIBS} -lypsec"
  1448. have_lib=""
  1449. echo checking for -lypsec
  1450. cat > conftest.c <<EOF
  1451.  
  1452. int main() { exit(0); }
  1453. int t() { main(); }
  1454. EOF
  1455. if eval $compile; then
  1456.   have_lib="1"
  1457. fi
  1458. rm -f conftest*
  1459. LIBS="${LIBS_save}"
  1460. if test -n "${have_lib}"; then
  1461.    {
  1462. test -n "$verbose" && \
  1463. echo '    defining' HAVE_LIBYPSEC
  1464. DEFS="$DEFS -DHAVE_LIBYPSEC=1"
  1465. }
  1466.  
  1467.    LIBS="${LIBS} -lypsec"
  1468. fi
  1469.  
  1470.  
  1471. # m88k running dgux 5.4 needs this
  1472. LIBS_save="${LIBS}"
  1473. LIBS="${LIBS} -ldgc"
  1474. have_lib=""
  1475. echo checking for -ldgc
  1476. cat > conftest.c <<EOF
  1477.  
  1478. int main() { exit(0); }
  1479. int t() { main(); }
  1480. EOF
  1481. if eval $compile; then
  1482.   have_lib="1"
  1483. fi
  1484. rm -f conftest*
  1485. LIBS="${LIBS_save}"
  1486. if test -n "${have_lib}"; then
  1487.    {
  1488. test -n "$verbose" && \
  1489. echo '    defining' HAVE_LIBDGC
  1490. DEFS="$DEFS -DHAVE_LIBDGC=1"
  1491. }
  1492.  
  1493.    LIBS="${LIBS} -ldgc"
  1494. fi
  1495.  
  1496.  
  1497. echo checking for AFS
  1498. test -d /afs && {
  1499. test -n "$verbose" && \
  1500. echo '    defining' AFS
  1501. DEFS="$DEFS -DAFS=1"
  1502. }
  1503.  
  1504.  
  1505. if test -n "$prefix"; then
  1506.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1507.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1508. fi
  1509. if test -n "$exec_prefix"; then
  1510.   prsub="$prsub
  1511. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  1512. exec_prefix\\1=\\2$exec_prefix%"
  1513. fi
  1514. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  1515.  
  1516. trap 'rm -f config.status; exit 1' 1 3 15
  1517. echo creating config.status
  1518. rm -f config.status
  1519. cat > config.status <<EOF
  1520. #!/bin/sh
  1521. # Generated automatically by configure.
  1522. # Run this file to recreate the current configuration.
  1523. # This directory was configured as follows,
  1524. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1525. #
  1526. # $0 $*
  1527.  
  1528. for arg
  1529. do
  1530.   case "\$arg" in
  1531.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1532.     exec /bin/sh $0 $* ;;
  1533.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1534.   esac
  1535. done
  1536.  
  1537. trap 'rm -f Makefile lib/Makefile src/Makefile man/Makefile; exit 1' 1 3 15
  1538. PROGS='$PROGS'
  1539. LIBPROGS='$LIBPROGS'
  1540. CC='$CC'
  1541. CFLAGS='$CFLAGS'
  1542. LDFLAGS='$LDFLAGS'
  1543. CPP='$CPP'
  1544. RANLIB='$RANLIB'
  1545. YACC='$YACC'
  1546. LIBOBJS='$LIBOBJS'
  1547. ALLOCA='$ALLOCA'
  1548. LIBS='$LIBS'
  1549. srcdir='$srcdir'
  1550. DEFS='$DEFS'
  1551. prefix='$prefix'
  1552. exec_prefix='$exec_prefix'
  1553. prsub='$prsub'
  1554. EOF
  1555. cat >> config.status <<\EOF
  1556.  
  1557. top_srcdir=$srcdir
  1558.  
  1559. # Allow make-time overrides of the generated file list.
  1560. test -n "$gen_files" || gen_files="Makefile lib/Makefile src/Makefile man/Makefile"
  1561.  
  1562. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  1563.   srcdir=$top_srcdir
  1564.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1565.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1566.   if test "$dir" != "$file"; then
  1567.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1568.     test ! -d $dir && mkdir $dir
  1569.   fi
  1570.   echo creating $file
  1571.   rm -f $file
  1572.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1573.   sed -e "
  1574. $prsub
  1575. s%@PROGS@%$PROGS%g
  1576. s%@LIBPROGS@%$LIBPROGS%g
  1577. s%@CC@%$CC%g
  1578. s%@CFLAGS@%$CFLAGS%g
  1579. s%@LDFLAGS@%$LDFLAGS%g
  1580. s%@CPP@%$CPP%g
  1581. s%@RANLIB@%$RANLIB%g
  1582. s%@YACC@%$YACC%g
  1583. s%@LIBOBJS@%$LIBOBJS%g
  1584. s%@ALLOCA@%$ALLOCA%g
  1585. s%@LIBS@%$LIBS%g
  1586. s%@srcdir@%$srcdir%g
  1587. s%@DEFS@%$DEFS%
  1588. " $top_srcdir/${file}.in >> $file
  1589. fi; done
  1590.  
  1591. exit 0
  1592. EOF
  1593. chmod +x config.status
  1594. test -n "$no_create" || ./config.status
  1595.  
  1596.