home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / find-3.8-src.lha / src / amiga / find-3.8 / configure < prev    next >
Text File  |  1994-02-23  |  23KB  |  1,049 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. rm -f conftest*
  84. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  85.  
  86. # A filename unique to this package, relative to the directory that
  87. # configure is in, which we can look for to find out if srcdir is correct.
  88. unique_file=find/pred.c
  89.  
  90. # Find the source files, if location was not specified.
  91. if test -z "$srcdir"; then
  92.   srcdirdefaulted=yes
  93.   # Try the directory containing this script, then `..'.
  94.   prog=$0
  95.   confdir=`echo $prog| sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  96.   test "X$confdir" = "X$prog" && confdir=.
  97.   srcdir=$confdir
  98.   if test ! -r $srcdir/$unique_file; then
  99.     srcdir=..
  100.   fi
  101. fi
  102. if test ! -r $srcdir/$unique_file; then
  103.   if test x$srcdirdefaulted = xyes; then
  104.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  105.   else
  106.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  107.   fi
  108.   exit 1
  109. fi
  110. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  111. # But we can't avoid them for `..', to make subdirectories work.
  112. case $srcdir in
  113.   .|/*|~*) ;;
  114.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  115. esac
  116.  
  117. if test -z "$CC"; then
  118.   echo checking for gcc
  119.   saveifs="$IFS"; IFS="${IFS}:"
  120.   for dir in $PATH; do
  121.     test -z "$dir" && dir=.
  122.     if test -f $dir/gcc; then
  123.       CC="gcc"
  124.       break
  125.     fi
  126.   done
  127.   IFS="$saveifs"
  128. fi
  129. test -z "$CC" && CC="cc"
  130.  
  131. # Find out if we are using GNU C, under whatever name.
  132. cat > conftest.c <<EOF
  133. #ifdef __GNUC__
  134.   yes
  135. #endif
  136. EOF
  137. ${CC-cc} -E conftest.c > conftest.out 2>&1
  138. if egrep yes conftest.out >/dev/null 2>&1; then
  139.   GCC=1 # For later tests.
  140. fi
  141. rm -f conftest*
  142.  
  143. echo checking how to run the C preprocessor
  144. if test -z "$CPP"; then
  145.   CPP='${CC-cc} -E'
  146.   cat > conftest.c <<EOF
  147. #include <stdio.h>
  148. EOF
  149. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  150. if test -z "$err"; then
  151.   :
  152. else
  153.   CPP=/lib/cpp
  154. fi
  155. rm -f conftest*
  156. fi
  157.  
  158. # Make sure to not get the incompatible SysV /etc/install and
  159. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  160. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  161. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  162. if test -z "$INSTALL"; then
  163.   echo checking for install
  164.   saveifs="$IFS"; IFS="${IFS}:"
  165.   for dir in $PATH; do
  166.     test -z "$dir" && dir=.
  167.     case $dir in
  168.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  169.     *)
  170.       if test -f $dir/installbsd; then
  171.     INSTALL="$dir/installbsd -c"
  172.     INSTALL_PROGRAM='$(INSTALL)'
  173.     INSTALL_DATA='$(INSTALL) -m 644'
  174.     break
  175.       fi
  176.       if test -f $dir/install; then
  177.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  178.       : # AIX
  179.     else
  180.       INSTALL="$dir/install -c"
  181.       INSTALL_PROGRAM='$(INSTALL)'
  182.       INSTALL_DATA='$(INSTALL) -m 644'
  183.       break
  184.     fi
  185.       fi
  186.       ;;
  187.     esac
  188.   done
  189.   IFS="$saveifs"
  190. fi
  191. INSTALL=${INSTALL-cp}
  192. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  193. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  194.  
  195. if test -z "$RANLIB"; then
  196.   echo checking for ranlib
  197.   saveifs="$IFS"; IFS="${IFS}:"
  198.   for dir in $PATH; do
  199.     test -z "$dir" && dir=.
  200.     if test -f $dir/ranlib; then
  201.       RANLIB="ranlib"
  202.       break
  203.     fi
  204.   done
  205.   IFS="$saveifs"
  206. fi
  207. test -z "$RANLIB" && RANLIB="@:"
  208.  
  209. echo checking for AIX
  210. cat > conftest.c <<EOF
  211. #ifdef _AIX
  212.   yes
  213. #endif
  214.  
  215. EOF
  216. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  217. if egrep "yes" conftest.out >/dev/null 2>&1; then
  218.   {
  219. test -n "$verbose" && \
  220. echo '    defining' _ALL_SOURCE
  221. DEFS="$DEFS -D_ALL_SOURCE=1"
  222. }
  223.  
  224. fi
  225. rm -f conftest*
  226.  
  227.  
  228. echo checking for minix/config.h
  229. cat > conftest.c <<EOF
  230. #include <minix/config.h>
  231. EOF
  232. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  233. if test -z "$err"; then
  234.   MINIX=1
  235. fi
  236. rm -f conftest*
  237.  
  238. # The Minix shell can't assign to the same variable on the same line!
  239. if test -n "$MINIX"; then
  240.   {
  241. test -n "$verbose" && \
  242. echo '    defining' _POSIX_SOURCE
  243. DEFS="$DEFS -D_POSIX_SOURCE=1"
  244. }
  245.  
  246.   {
  247. test -n "$verbose" && \
  248. echo '    defining' _POSIX_1_SOURCE to be 2
  249. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  250. }
  251.  
  252.   {
  253. test -n "$verbose" && \
  254. echo '    defining' _MINIX
  255. DEFS="$DEFS -D_MINIX=1"
  256. }
  257.  
  258. fi
  259.  
  260. echo checking for POSIXized ISC
  261. if test -d /etc/conf/kconfig.d &&
  262.   grep _POSIX_VERSION /gnu/include/sys/unistd.h >/dev/null 2>&1
  263. then
  264.   ISC=1 # If later tests want to check for ISC.
  265.   {
  266. test -n "$verbose" && \
  267. echo '    defining' _POSIX_SOURCE
  268. DEFS="$DEFS -D_POSIX_SOURCE=1"
  269. }
  270.  
  271.   if test -n "$GCC"; then
  272.     CC="$CC -posix"
  273.   else
  274.     CC="$CC -Xp"
  275.   fi
  276. fi
  277.  
  278. echo checking for SCO UNIX libintl
  279. cat > conftest.c <<EOF
  280. #if defined(M_UNIX)
  281.   yes
  282. #endif
  283.  
  284. EOF
  285. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  286. if egrep "yes" conftest.out >/dev/null 2>&1; then
  287.   SCO_UNIX=1
  288. fi
  289. rm -f conftest*
  290.  
  291. test -n "$SCO_UNIX" && test -f /lib/libintl.a &&
  292.   LIBS="$LIBS -lintl" # For strftime.
  293.  
  294. echo checking for major, minor and makedev header
  295. cat > conftest.c <<EOF
  296. #include <sys/types.h>
  297. int main() { exit(0); } 
  298. int t() { return makedev(0, 0); }
  299. EOF
  300. if eval $compile; then
  301.   makedev=1
  302. fi
  303. rm -f conftest*
  304.  
  305. if test -z "$makedev"; then
  306. echo checking for sys/mkdev.h
  307. cat > conftest.c <<EOF
  308. #include <sys/mkdev.h>
  309. EOF
  310. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  311. if test -z "$err"; then
  312.   {
  313. test -n "$verbose" && \
  314. echo '    defining' MAJOR_IN_MKDEV
  315. DEFS="$DEFS -DMAJOR_IN_MKDEV=1"
  316. }
  317.  makedev=1
  318. fi
  319. rm -f conftest*
  320.  
  321. fi
  322. if test -z "$makedev"; then
  323. echo checking for sys/sysmacros.h
  324. cat > conftest.c <<EOF
  325. #include <sys/sysmacros.h>
  326. EOF
  327. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  328. if test -z "$err"; then
  329.   {
  330. test -n "$verbose" && \
  331. echo '    defining' MAJOR_IN_SYSMACROS
  332. DEFS="$DEFS -DMAJOR_IN_SYSMACROS=1"
  333. }
  334.  
  335. fi
  336. rm -f conftest*
  337.  
  338. fi
  339.  
  340. echo checking for directory library header
  341. dirheader=
  342. if test -z "$dirheader"; then
  343.   echo checking for dirent.h
  344. cat > conftest.c <<EOF
  345. #include <sys/types.h>
  346. #include <dirent.h>
  347. int main() { exit(0); } 
  348. int t() { DIR *dirp = opendir ("/"); }
  349. EOF
  350. if eval $compile; then
  351.   {
  352. test -n "$verbose" && \
  353. echo '    defining' DIRENT
  354. DEFS="$DEFS -DDIRENT=1"
  355. }
  356.  dirheader=dirent.h
  357. fi
  358. rm -f conftest*
  359. fi
  360. if test -z "$dirheader"; then
  361.   echo checking for sys/ndir.h
  362. cat > conftest.c <<EOF
  363. #include <sys/types.h>
  364. #include <sys/ndir.h>
  365. int main() { exit(0); } 
  366. int t() { DIR *dirp = opendir ("/"); }
  367. EOF
  368. if eval $compile; then
  369.   {
  370. test -n "$verbose" && \
  371. echo '    defining' SYSNDIR
  372. DEFS="$DEFS -DSYSNDIR=1"
  373. }
  374.  dirheader=sys/ndir.h
  375. fi
  376. rm -f conftest*
  377. fi
  378. if test -z "$dirheader"; then
  379.   echo checking for sys/dir.h
  380. cat > conftest.c <<EOF
  381. #include <sys/types.h>
  382. #include <sys/dir.h>
  383. int main() { exit(0); } 
  384. int t() { DIR *dirp = opendir ("/"); }
  385. EOF
  386. if eval $compile; then
  387.   {
  388. test -n "$verbose" && \
  389. echo '    defining' SYSDIR
  390. DEFS="$DEFS -DSYSDIR=1"
  391. }
  392.  dirheader=sys/dir.h
  393. fi
  394. rm -f conftest*
  395. fi
  396. if test -z "$dirheader"; then
  397.   echo checking for ndir.h
  398. cat > conftest.c <<EOF
  399. #include <sys/types.h>
  400. #include <ndir.h>
  401. int main() { exit(0); } 
  402. int t() { DIR *dirp = opendir ("/"); }
  403. EOF
  404. if eval $compile; then
  405.   {
  406. test -n "$verbose" && \
  407. echo '    defining' NDIR
  408. DEFS="$DEFS -DNDIR=1"
  409. }
  410.  dirheader=ndir.h
  411. fi
  412. rm -f conftest*
  413. fi
  414.  
  415. echo checking for closedir return value
  416. cat > conftest.c <<EOF
  417. #include <sys/types.h>
  418. #include <$dirheader>
  419. int closedir(); main() { exit(0); }
  420. EOF
  421. eval $compile
  422. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  423.   :
  424. else
  425.   {
  426. test -n "$verbose" && \
  427. echo '    defining' VOID_CLOSEDIR
  428. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  429. }
  430.  
  431. fi
  432. rm -f conftest*
  433.  
  434. echo checking how to get filesystem type
  435. # SVR4.
  436. cat > conftest.c <<EOF
  437. #include <sys/statvfs.h>
  438. #include <sys/fstyp.h>
  439. EOF
  440. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  441. if test -z "$err"; then
  442.   {
  443. test -n "$verbose" && \
  444. echo '    defining' FSTYPE_STATVFS
  445. DEFS="$DEFS -DFSTYPE_STATVFS=1"
  446. }
  447.  fstype=1
  448. fi
  449. rm -f conftest*
  450. if test -z "$fstype"; then
  451. # SVR3.
  452. cat > conftest.c <<EOF
  453. #include <sys/statfs.h>
  454. #include <sys/fstyp.h>
  455. EOF
  456. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  457. if test -z "$err"; then
  458.   {
  459. test -n "$verbose" && \
  460. echo '    defining' FSTYPE_USG_STATFS
  461. DEFS="$DEFS -DFSTYPE_USG_STATFS=1"
  462. }
  463.  fstype=1
  464. fi
  465. rm -f conftest*
  466. fi
  467. if test -z "$fstype"; then
  468. # AIX.
  469. cat > conftest.c <<EOF
  470. #include <sys/statfs.h>
  471. #include <sys/vmount.h>
  472. EOF
  473. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  474. if test -z "$err"; then
  475.   {
  476. test -n "$verbose" && \
  477. echo '    defining' FSTYPE_AIX_STATFS
  478. DEFS="$DEFS -DFSTYPE_AIX_STATFS=1"
  479. }
  480.  fstype=1
  481. fi
  482. rm -f conftest*
  483. fi
  484. if test -z "$fstype"; then  
  485. # 4.3BSD.
  486. cat > conftest.c <<EOF
  487. #include <mntent.h>
  488. EOF
  489. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  490. if test -z "$err"; then
  491.   {
  492. test -n "$verbose" && \
  493. echo '    defining' FSTYPE_MNTENT
  494. DEFS="$DEFS -DFSTYPE_MNTENT=1"
  495. }
  496.  fstype=1
  497. fi
  498. rm -f conftest*
  499. fi
  500. if test -z "$fstype"; then  
  501. # 4.4BSD.  Also DEC OSF/1.
  502. echo '#include <sys/mount.h>' > conftest.c
  503. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  504. if egrep "f_type;" conftest.out >/dev/null 2>&1; then
  505.   {
  506. test -n "$verbose" && \
  507. echo '    defining' FSTYPE_STATFS
  508. DEFS="$DEFS -DFSTYPE_STATFS=1"
  509. }
  510.  fstype=1
  511. fi
  512. rm -f conftest*
  513.  
  514. fi
  515. if test -z "$fstype"; then  
  516. # Ultrix.
  517. cat > conftest.c <<EOF
  518. #include <sys/mount.h>
  519. #include <sys/fs_types.h>
  520. EOF
  521. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  522. if test -z "$err"; then
  523.   {
  524. test -n "$verbose" && \
  525. echo '    defining' FSTYPE_GETMNT
  526. DEFS="$DEFS -DFSTYPE_GETMNT=1"
  527. }
  528.  fstype=1
  529. fi
  530. rm -f conftest*
  531. fi
  532.  
  533. echo checking for uid_t in sys/types.h
  534. echo '#include <sys/types.h>' > conftest.c
  535. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  536. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  537.   :
  538. else 
  539.   {
  540. test -n "$verbose" && \
  541. echo '    defining' uid_t to be int
  542. DEFS="$DEFS -Duid_t=int"
  543. }
  544.  {
  545. test -n "$verbose" && \
  546. echo '    defining' gid_t to be int
  547. DEFS="$DEFS -Dgid_t=int"
  548. }
  549.  
  550. fi
  551. rm -f conftest*
  552.  
  553. prog='/* Ultrix mips cc rejects this.  */
  554. typedef int charset[2]; const charset x;
  555. /* SunOS 4.1.1 cc rejects this.  */
  556. char const *const *ccp;
  557. char **p;
  558. /* AIX XL C 1.2.0.0 rejects this.  */
  559. p += p ? p-p : 0;
  560. /* HPUX 7.0 cc rejects these. */
  561. ++ccp;
  562. p = (char**) ccp;
  563. ccp = (char const *const *) p;
  564. { /* SCO 3.2v4 cc rejects this.  */
  565.   char *t;
  566.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  567.  
  568.   *t++ = 0;
  569. }
  570. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  571.   int x[] = {25,17};
  572.   const int *foo = &x[0];
  573.   ++foo;
  574. }
  575. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  576.   typedef const int *iptr;
  577.   iptr p = 0;
  578.   ++p;
  579. }
  580. { /* AIX XL C 1.02.0.0 rejects this saying
  581.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  582.   struct s { int j; const int *ap[3]; };
  583.   void a (struct s *b) { b->j = 5; }
  584. }'
  585. echo checking for working const
  586. cat > conftest.c <<EOF
  587.  
  588. int main() { exit(0); } 
  589. int t() { $prog }
  590. EOF
  591. if eval $compile; then
  592.   :
  593. else
  594.   {
  595. test -n "$verbose" && \
  596. echo '    defining' const to be empty
  597. DEFS="$DEFS -Dconst="
  598. }
  599.  
  600. fi
  601. rm -f conftest*
  602.  
  603. echo checking for ANSI C header files
  604. cat > conftest.c <<EOF
  605. #include <stdlib.h>
  606. #include <stdarg.h>
  607. #include <string.h>
  608. #include <float.h>
  609. EOF
  610. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  611. if test -z "$err"; then
  612.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  613. echo '#include <string.h>' > conftest.c
  614. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  615. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  616.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  617. cat > conftest.c <<EOF
  618. #include <ctype.h>
  619. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  620. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  621. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  622. int main () { int i; for (i = 0; i < 256; i++)
  623. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  624. exit (0); }
  625.  
  626. EOF
  627. eval $compile
  628. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  629.   {
  630. test -n "$verbose" && \
  631. echo '    defining' STDC_HEADERS
  632. DEFS="$DEFS -DSTDC_HEADERS=1"
  633. }
  634.  
  635. fi
  636. rm -f conftest*
  637. fi
  638. rm -f conftest*
  639.  
  640. fi
  641. rm -f conftest*
  642.  
  643. echo checking for unistd.h
  644. cat > conftest.c <<EOF
  645. #include <unistd.h>
  646. EOF
  647. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  648. if test -z "$err"; then
  649.   {
  650. test -n "$verbose" && \
  651. echo '    defining' HAVE_UNISTD_H
  652. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  653. }
  654.  
  655. fi
  656. rm -f conftest*
  657.  
  658. for hdr in string.h limits.h
  659. do
  660. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  661. echo checking for ${hdr}
  662. cat > conftest.c <<EOF
  663. #include <${hdr}>
  664. EOF
  665. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  666. if test -z "$err"; then
  667.   {
  668. test -n "$verbose" && \
  669. echo '    defining' ${trhdr}
  670. DEFS="$DEFS -D${trhdr}=1"
  671. }
  672.  
  673. fi
  674. rm -f conftest*
  675. done
  676.  
  677. for func in memset stpcpy strdup strftime strspn strstr strtol
  678. do
  679. echo checking for ${func}
  680. cat > conftest.c <<EOF
  681.  
  682. int main() { exit(0); } 
  683. int t() { 
  684. /* Override any gcc2 internal prototype to avoid an error.  */
  685. extern char ${func}(); ${func}(); }
  686. EOF
  687. if eval $compile; then
  688.   :
  689. else
  690.   LIBOBJS="$LIBOBJS ${func}.o"
  691. fi
  692. rm -f conftest*
  693.  
  694. done
  695.  
  696. for func in strerror
  697. do
  698. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  699. echo checking for ${func}
  700. cat > conftest.c <<EOF
  701. #include <stdio.h>
  702. int main() { exit(0); } 
  703. int t() { 
  704. #ifdef __stub_${func}
  705. choke me
  706. #else
  707. /* Override any gcc2 internal prototype to avoid an error.  */
  708. extern char ${func}(); ${func}();
  709. #endif
  710.  }
  711. EOF
  712. if eval $compile; then
  713.   {
  714. test -n "$verbose" && \
  715. echo '    defining' ${trfunc}
  716. DEFS="$DEFS -D${trfunc}=1"
  717. }
  718.  
  719. fi
  720. rm -f conftest*
  721. #endif
  722. done
  723.  
  724. echo checking for vprintf
  725. cat > conftest.c <<EOF
  726.  
  727. int main() { exit(0); } 
  728. int t() { vprintf(); }
  729. EOF
  730. if eval $compile; then
  731.   {
  732. test -n "$verbose" && \
  733. echo '    defining' HAVE_VPRINTF
  734. DEFS="$DEFS -DHAVE_VPRINTF=1"
  735. }
  736.  
  737. else
  738.   vprintf_missing=1
  739. fi
  740. rm -f conftest*
  741.  
  742. if test -n "$vprintf_missing"; then
  743. echo checking for _doprnt
  744. cat > conftest.c <<EOF
  745.  
  746. int main() { exit(0); } 
  747. int t() { _doprnt(); }
  748. EOF
  749. if eval $compile; then
  750.   {
  751. test -n "$verbose" && \
  752. echo '    defining' HAVE_DOPRNT
  753. DEFS="$DEFS -DHAVE_DOPRNT=1"
  754. }
  755.  
  756. fi
  757. rm -f conftest*
  758.  
  759. fi
  760.  
  761. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  762. # for constant arguments.  Useless!
  763. echo checking for working alloca.h
  764. cat > conftest.c <<EOF
  765. #include <alloca.h>
  766. int main() { exit(0); } 
  767. int t() { char *p = alloca(2 * sizeof(int)); }
  768. EOF
  769. if eval $compile; then
  770.   {
  771. test -n "$verbose" && \
  772. echo '    defining' HAVE_ALLOCA_H
  773. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  774. }
  775.  
  776. fi
  777. rm -f conftest*
  778.  
  779. decl="#ifdef __GNUC__
  780. #define alloca __builtin_alloca
  781. #else
  782. #if HAVE_ALLOCA_H
  783. #include <alloca.h>
  784. #else
  785. #ifdef _AIX
  786.  #pragma alloca
  787. #else
  788. char *alloca ();
  789. #endif
  790. #endif
  791. #endif
  792. "
  793. echo checking for alloca
  794. cat > conftest.c <<EOF
  795. $decl
  796. int main() { exit(0); } 
  797. int t() { char *p = (char *) alloca(1); }
  798. EOF
  799. if eval $compile; then
  800.   :
  801. else
  802.   alloca_missing=1
  803. fi
  804. rm -f conftest*
  805.  
  806. if test -n "$alloca_missing"; then
  807.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  808.   # that cause trouble.  Some versions do not even contain alloca or
  809.   # contain a buggy version.  If you still want to use their alloca,
  810.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  811.   ALLOCA=alloca.o
  812. fi
  813.  
  814. echo checking for st_blocks in struct stat
  815. cat > conftest.c <<EOF
  816. #include <sys/types.h>
  817. #include <sys/stat.h>
  818. int main() { exit(0); } 
  819. int t() { struct stat s; s.st_blocks; }
  820. EOF
  821. if eval $compile; then
  822.   {
  823. test -n "$verbose" && \
  824. echo '    defining' HAVE_ST_BLOCKS
  825. DEFS="$DEFS -DHAVE_ST_BLOCKS=1"
  826. }
  827.  
  828. else
  829.   LIBOBJS="$LIBOBJS fileblocks.o"
  830. fi
  831. rm -f conftest*
  832.  
  833. echo checking for st_rdev in struct stat
  834. cat > conftest.c <<EOF
  835. #include <sys/types.h>
  836. #include <sys/stat.h>
  837. int main() { exit(0); } 
  838. int t() { struct stat s; s.st_rdev; }
  839. EOF
  840. if eval $compile; then
  841.   {
  842. test -n "$verbose" && \
  843. echo '    defining' HAVE_ST_RDEV
  844. DEFS="$DEFS -DHAVE_ST_RDEV=1"
  845. }
  846.  
  847. fi
  848. rm -f conftest*
  849.  
  850. echo checking for struct tm in time.h
  851. cat > conftest.c <<EOF
  852. #include <sys/types.h>
  853. #include <time.h>
  854. int main() { exit(0); } 
  855. int t() { struct tm *tp; }
  856. EOF
  857. if eval $compile; then
  858.   :
  859. else
  860.   {
  861. test -n "$verbose" && \
  862. echo '    defining' TM_IN_SYS_TIME
  863. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  864. }
  865.  
  866. fi
  867. rm -f conftest*
  868.  
  869. decl='#include <sys/types.h>
  870. '
  871. case "$DEFS" in
  872.   *TM_IN_SYS_TIME*) decl="$decl
  873. #include <sys/time.h>
  874. " ;;
  875.   *) decl="$decl
  876. #include <time.h>
  877. " ;;
  878. esac
  879. echo checking for tm_zone in struct tm
  880. cat > conftest.c <<EOF
  881. $decl
  882. int main() { exit(0); } 
  883. int t() { struct tm tm; tm.tm_zone; }
  884. EOF
  885. if eval $compile; then
  886.   {
  887. test -n "$verbose" && \
  888. echo '    defining' HAVE_TM_ZONE
  889. DEFS="$DEFS -DHAVE_TM_ZONE=1"
  890. }
  891.  
  892. else
  893.   no_tm_zone=1
  894. fi
  895. rm -f conftest*
  896.  
  897. if test -n "$no_tm_zone"; then
  898. echo checking for tzname
  899. cat > conftest.c <<EOF
  900. #include <time.h>
  901. #ifndef tzname /* For SGI.  */
  902. extern char *tzname[]; /* RS6000 and others want it this way.  */
  903. #endif
  904. int main() { exit(0); } 
  905. int t() { atoi(*tzname); }
  906. EOF
  907. if eval $compile; then
  908.   {
  909. test -n "$verbose" && \
  910. echo '    defining' HAVE_TZNAME
  911. DEFS="$DEFS -DHAVE_TZNAME=1"
  912. }
  913.  
  914. fi
  915. rm -f conftest*
  916.  
  917. fi
  918.  
  919. echo checking for Xenix
  920. cat > conftest.c <<EOF
  921. #if defined(M_XENIX) && !defined(M_UNIX)
  922.   yes
  923. #endif
  924.  
  925. EOF
  926. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  927. if egrep "yes" conftest.out >/dev/null 2>&1; then
  928.   XENIX=1
  929. fi
  930. rm -f conftest*
  931.  
  932. if test -n "$XENIX"; then
  933.   {
  934. test -n "$verbose" && \
  935. echo '    defining' VOID_CLOSEDIR
  936. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  937. }
  938.  
  939.   LIBS="$LIBS -lx"
  940.   case "$DEFS" in
  941.   *SYSNDIR*) ;;
  942.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  943.   esac
  944. fi
  945.  
  946. echo checking for IRIX libsun
  947. if test -f /gnu/lib/libsun.a; then
  948.   LIBS="$LIBS -lsun"
  949. fi
  950.  
  951. echo checking for DYNIX/ptx libseq
  952. cat > conftest.c <<EOF
  953. #if defined(_SEQUENT_)
  954.   yes
  955. #endif
  956.  
  957. EOF
  958. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  959. if egrep "yes" conftest.out >/dev/null 2>&1; then
  960.   SEQUENT=1
  961. fi
  962. rm -f conftest*
  963.  
  964. test -n "$SEQUENT" && test -f /gnu/lib/libseq.a &&
  965.   LIBS="$LIBS -lseq"
  966.  
  967. if test -n "$prefix"; then
  968.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  969.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  970. fi
  971. if test -n "$exec_prefix"; then
  972.   prsub="$prsub
  973. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  974. exec_prefix\\1=\\2$exec_prefix%"
  975. fi
  976.  
  977. trap 'rm -f config.status; exit 1' 1 3 15
  978. echo creating config.status
  979. rm -f config.status
  980. cat > config.status <<EOF
  981. #!/bin/sh
  982. # Generated automatically by configure.
  983. # Run this file to recreate the current configuration.
  984. # This directory was configured as follows,
  985. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  986. #
  987. # $0 $*
  988.  
  989. for arg
  990. do
  991.   case "\$arg" in
  992.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  993.     exec /bin/sh $0 $* ;;
  994.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  995.   esac
  996. done
  997.  
  998. trap 'rm -f Makefile lib/Makefile find/Makefile xargs/Makefile locate/Makefile man/Makefile; exit 1' 1 3 15
  999. CC='$CC'
  1000. CPP='$CPP'
  1001. INSTALL='$INSTALL'
  1002. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1003. INSTALL_DATA='$INSTALL_DATA'
  1004. RANLIB='$RANLIB'
  1005. LIBOBJS='$LIBOBJS'
  1006. ALLOCA='$ALLOCA'
  1007. LIBS='$LIBS'
  1008. srcdir='$srcdir'
  1009. DEFS='$DEFS'
  1010. prefix='$prefix'
  1011. exec_prefix='$exec_prefix'
  1012. prsub='$prsub'
  1013. EOF
  1014. cat >> config.status <<\EOF
  1015.  
  1016. top_srcdir=$srcdir
  1017. for file in .. Makefile lib/Makefile find/Makefile xargs/Makefile locate/Makefile man/Makefile; do if [ "x$file" != "x.." ]; then
  1018.   srcdir=$top_srcdir
  1019.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1020.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1021.   if test "$dir" != "$file"; then
  1022.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1023.     test ! -d $dir && mkdir $dir
  1024.   fi
  1025.   echo creating $file
  1026.   rm -f $file
  1027.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1028.   sed -e "
  1029. $prsub
  1030. s%@CC@%$CC%g
  1031. s%@CPP@%$CPP%g
  1032. s%@INSTALL@%$INSTALL%g
  1033. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1034. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1035. s%@RANLIB@%$RANLIB%g
  1036. s%@LIBOBJS@%$LIBOBJS%g
  1037. s%@ALLOCA@%$ALLOCA%g
  1038. s%@LIBS@%$LIBS%g
  1039. s%@srcdir@%$srcdir%g
  1040. s%@DEFS@%$DEFS%
  1041. " $top_srcdir/${file}.in >> $file
  1042. fi; done
  1043.  
  1044. exit 0
  1045. EOF
  1046. chmod +x config.status
  1047. test -n "$no_create" || ./config.status
  1048.  
  1049.