home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / tar-1.11.2-src.lha / src / amiga / tar-1.11.2 / configure < prev    next >
Text File  |  1994-02-24  |  20KB  |  835 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.      *) ;;
  74.     esac
  75.   fi
  76. done
  77.  
  78. trap 'rm -f conftest* core; exit 1' 1 3 15
  79.  
  80. rm -f conftest*
  81. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  82.  
  83. # A filename unique to this package, relative to the directory that
  84. # configure is in, which we can look for to find out if srcdir is correct.
  85. unique_file=tar.h
  86.  
  87. # Find the source files, if location was not specified.
  88. if test -z "$srcdir"; then
  89.   srcdirdefaulted=yes
  90.   # Try the directory containing this script, then `..'.
  91.   prog=$0
  92.   confdir=`echo $prog| sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  93.   test "X$confdir" = "X$prog" && confdir=.
  94.   srcdir=$confdir
  95.   if test ! -r $srcdir/$unique_file; then
  96.     srcdir=..
  97.   fi
  98. fi
  99. if test ! -r $srcdir/$unique_file; then
  100.   if test x$srcdirdefaulted = xyes; then
  101.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  102.   else
  103.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  104.   fi
  105.   exit 1
  106. fi
  107. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  108. # But we can't avoid them for `..', to make subdirectories work.
  109. case $srcdir in
  110.   .|/*|~*) ;;
  111.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  112. esac
  113.  
  114. PROGS="tar"
  115. if test -z "$CC"; then
  116.   echo checking for gcc
  117.   saveifs="$IFS"; IFS="${IFS}:"
  118.   for dir in $PATH; do
  119.     test -z "$dir" && dir=.
  120.     if test -f $dir/gcc; then
  121.       CC="gcc"
  122.       break
  123.     fi
  124.   done
  125.   IFS="$saveifs"
  126. fi
  127. test -z "$CC" && CC="cc"
  128.  
  129. # Find out if we are using GNU C, under whatever name.
  130. cat > conftest.c <<EOF
  131. #ifdef __GNUC__
  132.   yes
  133. #endif
  134. EOF
  135. ${CC-cc} -E conftest.c > conftest.out 2>&1
  136. if egrep yes conftest.out >/dev/null 2>&1; then
  137.   GCC=1 # For later tests.
  138. fi
  139. rm -f conftest*
  140.  
  141. echo checking how to run the C preprocessor
  142. if test -z "$CPP"; then
  143.   CPP='${CC-cc} -E'
  144.   cat > conftest.c <<EOF
  145. #include <stdio.h>
  146. EOF
  147. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  148. if test -z "$err"; then
  149.   :
  150. else
  151.   CPP=/lib/cpp
  152. fi
  153. rm -f conftest*
  154. fi
  155.  
  156. if test -n "$GCC"; then
  157.   echo checking whether -traditional is needed
  158.   pattern="Autoconf.*'x'"
  159.   prog='#include <sgtty.h>
  160. Autoconf TIOCGETP'
  161.   cat > conftest.c <<EOF
  162. $prog
  163. EOF
  164. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  165. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  166.   need_trad=1
  167. fi
  168. rm -f conftest*
  169.  
  170.  
  171.   if test -z "$need_trad"; then
  172.     prog='#include <termio.h>
  173. Autoconf TCGETA'
  174.     cat > conftest.c <<EOF
  175. $prog
  176. EOF
  177. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  178. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  179.   need_trad=1
  180. fi
  181. rm -f conftest*
  182.  
  183.   fi
  184.   test -n "$need_trad" && CC="$CC -traditional"
  185. fi
  186.  
  187. # Make sure to not get the incompatible SysV /etc/install and
  188. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  189. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  190. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  191. if test -z "$INSTALL"; then
  192.   echo checking for install
  193.   saveifs="$IFS"; IFS="${IFS}:"
  194.   for dir in $PATH; do
  195.     test -z "$dir" && dir=.
  196.     case $dir in
  197.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  198.     *)
  199.       if test -f $dir/install; then
  200.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  201.       : # AIX
  202.     else
  203.       INSTALL="$dir/install -c"
  204.       INSTALL_PROGRAM='$(INSTALL)'
  205.       INSTALL_DATA='$(INSTALL) -m 644'
  206.       break
  207.     fi
  208.       fi
  209.       ;;
  210.     esac
  211.   done
  212.   IFS="$saveifs"
  213. fi
  214. INSTALL=${INSTALL-cp}
  215. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  216. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  217.  
  218. if test -z "$YACC"; then
  219.   echo checking for bison
  220.   saveifs="$IFS"; IFS="${IFS}:"
  221.   for dir in $PATH; do
  222.     test -z "$dir" && dir=.
  223.     if test -f $dir/bison; then
  224.       YACC="bison -y"
  225.       break
  226.     fi
  227.   done
  228.   IFS="$saveifs"
  229. fi
  230. test -z "$YACC" && YACC=""
  231.  
  232. if test -z "$YACC"; then
  233.   echo checking for byacc
  234.   saveifs="$IFS"; IFS="${IFS}:"
  235.   for dir in $PATH; do
  236.     test -z "$dir" && dir=.
  237.     if test -f $dir/byacc; then
  238.       YACC="byacc"
  239.       break
  240.     fi
  241.   done
  242.   IFS="$saveifs"
  243. fi
  244. test -z "$YACC" && YACC="yacc"
  245.  
  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.   DEFS="$DEFS -D_ALL_SOURCE=1"
  257. fi
  258. rm -f conftest*
  259.  
  260.  
  261. echo checking for minix/config.h
  262. cat > conftest.c <<EOF
  263. #include <minix/config.h>
  264. EOF
  265. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  266. if test -z "$err"; then
  267.   MINIX=1
  268. fi
  269. rm -f conftest*
  270.  
  271. # The Minix shell can't assign to the same variable on the same line!
  272. if test -n "$MINIX"; then
  273.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  274.   DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  275.   DEFS="$DEFS -D_MINIX=1"
  276. fi
  277.  
  278. echo checking for POSIXized ISC
  279. if test -d /etc/conf/kconfig.d &&
  280.   grep _POSIX_VERSION /gnu/include/sys/unistd.h >/dev/null 2>&1
  281. then
  282.   ISC=1 # If later tests want to check for ISC.
  283.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  284.   if test -n "$GCC"; then
  285.     CC="$CC -posix"
  286.   else
  287.     CC="$CC -Xp"
  288.   fi
  289. fi
  290.  
  291. echo checking for return type of signal handlers
  292. cat > conftest.c <<EOF
  293. #include <sys/types.h>
  294. #include <signal.h>
  295. #ifdef signal
  296. #undef signal
  297. #endif
  298. extern void (*signal ()) ();
  299. main() { exit(0); } 
  300. t() { int i; }
  301. EOF
  302. if eval $compile; then
  303.   DEFS="$DEFS -DRETSIGTYPE=void"
  304. else
  305.   DEFS="$DEFS -DRETSIGTYPE=int"
  306. fi
  307. rm -f conftest*
  308.  
  309.  
  310. echo checking for size_t in sys/types.h
  311. echo '#include <sys/types.h>' > conftest.c
  312. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  313. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  314.   :
  315. else 
  316.   DEFS="$DEFS -Dsize_t=unsigned"
  317. fi
  318. rm -f conftest*
  319.  
  320. echo checking for major, minor and makedev header
  321. cat > conftest.c <<EOF
  322. #include <sys/types.h>
  323. main() { exit(0); } 
  324. t() { return makedev(0, 0); }
  325. EOF
  326. if eval $compile; then
  327.   makedev=1
  328. fi
  329. rm -f conftest*
  330.  
  331. if test -z "$makedev"; then
  332. echo checking for sys/mkdev.h
  333. cat > conftest.c <<EOF
  334. #include <sys/mkdev.h>
  335. EOF
  336. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  337. if test -z "$err"; then
  338.   DEFS="$DEFS -DMAJOR_IN_MKDEV=1" makedev=1
  339. fi
  340. rm -f conftest*
  341.  
  342. fi
  343. if test -z "$makedev"; then
  344. echo checking for sys/sysmacros.h
  345. cat > conftest.c <<EOF
  346. #include <sys/sysmacros.h>
  347. EOF
  348. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  349. if test -z "$err"; then
  350.   DEFS="$DEFS -DMAJOR_IN_SYSMACROS=1"
  351. fi
  352. rm -f conftest*
  353.  
  354. fi
  355.  
  356. echo checking for directory library header
  357. echo checking for dirent.h
  358. cat > conftest.c <<EOF
  359. #include <dirent.h>
  360. EOF
  361. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  362. if test -z "$err"; then
  363.   DEFS="$DEFS -DDIRENT=1" dirheader=dirent.h
  364. fi
  365. rm -f conftest*
  366.  
  367. if test -z "$dirheader"; then
  368. echo checking for sys/ndir.h
  369. cat > conftest.c <<EOF
  370. #include <sys/ndir.h>
  371. EOF
  372. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  373. if test -z "$err"; then
  374.   DEFS="$DEFS -DSYSNDIR=1" dirheader=sys/ndir.h
  375. fi
  376. rm -f conftest*
  377.  
  378. fi
  379. if test -z "$dirheader"; then
  380. echo checking for sys/dir.h
  381. cat > conftest.c <<EOF
  382. #include <sys/dir.h>
  383. EOF
  384. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  385. if test -z "$err"; then
  386.   DEFS="$DEFS -DSYSDIR=1" dirheader=sys/dir.h
  387. fi
  388. rm -f conftest*
  389.  
  390. fi
  391. if test -z "$dirheader"; then
  392. echo checking for ndir.h
  393. cat > conftest.c <<EOF
  394. #include <ndir.h>
  395. EOF
  396. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  397. if test -z "$err"; then
  398.   DEFS="$DEFS -DNDIR=1" dirheader=ndir.h
  399. fi
  400. rm -f conftest*
  401.  
  402. fi
  403.  
  404. echo checking for closedir return value
  405. cat > conftest.c <<EOF
  406. #include <sys/types.h>
  407. #include <$dirheader>
  408. int closedir(); main() { exit(0); }
  409. EOF
  410. eval $compile
  411. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  412.   :
  413. else
  414.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  415. fi
  416. rm -f conftest*
  417.  
  418. # The 3-argument open happens to go along with the O_* defines,
  419. # which are easier to check for.
  420. echo checking for fcntl.h
  421. cat > conftest.c <<EOF
  422. #include <fcntl.h>
  423. EOF
  424. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  425. if test -z "$err"; then
  426.   open_header=fcntl.h
  427. else
  428.   open_header=sys/file.h
  429. fi
  430. rm -f conftest*
  431.  
  432. echo checking for 3-argument open
  433. cat > conftest.c <<EOF
  434. #include <$open_header>
  435. main() { exit(0); } 
  436. t() { int x = O_RDONLY; }
  437. EOF
  438. if eval $compile; then
  439.   :
  440. else
  441.   DEFS="$DEFS -DEMUL_OPEN3=1"
  442. fi
  443. rm -f conftest*
  444.  
  445. echo checking for remote tape and socket header files
  446. echo checking for sys/mtio.h
  447. cat > conftest.c <<EOF
  448. #include <sys/mtio.h>
  449. EOF
  450. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  451. if test -z "$err"; then
  452.   DEFS="$DEFS -DHAVE_SYS_MTIO_H=1" have_mtio=1
  453. fi
  454. rm -f conftest*
  455.  
  456. if test -n "$have_mtio"; then
  457. cat > conftest.c <<EOF
  458. #include <sgtty.h>
  459. #include <sys/socket.h>
  460. EOF
  461. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  462. # Suppress building rmt, even though the above succeeds on the Amiga, the
  463. # link fails due to an unresolved call to setsockopt().  -fnf
  464. if false && test -z "$err"; then
  465.   PROGS="$PROGS rmt"
  466. fi
  467. rm -f conftest*
  468. fi
  469.  
  470. echo checking for remote shell
  471. if test -f /gnu/bin/remsh || test -f /gnu/bin/rsh || test -f /gnu/bin/nsh; then
  472.   RTAPELIB=rtapelib.o
  473. else
  474.   echo checking for netdb.h
  475. cat > conftest.c <<EOF
  476. #include <netdb.h>
  477. EOF
  478. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  479. # Suppres use of rtapelib.o since it references getservbyname() and rexec(),
  480. # which are unresolved at link time.
  481. if false && test -z "$err"; then
  482.   DEFS="$DEFS -DHAVE_NETDB_H=1" RTAPELIB=rtapelib.o
  483. else
  484.   DEFS="$DEFS -DNO_REMOTE=1"
  485. fi
  486. rm -f conftest*
  487. fi
  488.  
  489. echo checking for ANSI C header files
  490. cat > conftest.c <<EOF
  491. #include <stdlib.h>
  492. #include <stdarg.h>
  493. #include <string.h>
  494. #include <float.h>
  495. EOF
  496. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  497. if test -z "$err"; then
  498.   # SunOS string.h does not declare mem*, contrary to ANSI.
  499. echo '#include <string.h>' > conftest.c
  500. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  501. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  502.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  503. cat > conftest.c <<EOF
  504. #include <ctype.h>
  505. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  506. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  507. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  508. int main () { int i; for (i = 0; i < 256; i++)
  509. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  510. exit (0); }
  511.  
  512. EOF
  513. eval $compile
  514. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  515.   DEFS="$DEFS -DSTDC_HEADERS=1"
  516. fi
  517. rm -f conftest*
  518. fi
  519. rm -f conftest*
  520.  
  521. fi
  522. rm -f conftest*
  523.  
  524. echo checking for unistd.h
  525. cat > conftest.c <<EOF
  526. #include <unistd.h>
  527. EOF
  528. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  529. if test -z "$err"; then
  530.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  531. fi
  532. rm -f conftest*
  533.  
  534. echo checking for getgrgid declaration
  535. echo '#include <grp.h>' > conftest.c
  536. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  537. if egrep "getgrgid" conftest.out >/dev/null 2>&1; then
  538.   DEFS="$DEFS -DHAVE_GETGRGID=1"
  539. fi
  540. rm -f conftest*
  541.  
  542. echo checking for getpwuid declaration
  543. echo '#include <pwd.h>' > conftest.c
  544. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  545. if egrep "getpwuid" conftest.out >/dev/null 2>&1; then
  546.   DEFS="$DEFS -DHAVE_GETPWUID=1"
  547. fi
  548. rm -f conftest*
  549.  
  550. for hdr in string.h limits.h
  551. do
  552. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  553. echo checking for ${hdr}
  554. cat > conftest.c <<EOF
  555. #include <${hdr}>
  556. EOF
  557. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  558. if test -z "$err"; then
  559.   DEFS="$DEFS -D${trhdr}=1"
  560. fi
  561. rm -f conftest*
  562. done
  563.  
  564. echo checking default archive
  565. # This might guess wrong, but it's not very important.
  566. for dev in rmt8 rmt0 rmt0h rct0 rst0 tape rct/c7d0s2
  567. do
  568.   break    # Hack - disable for AmigaDOS to prevent "dev:" requesters.  -fnf
  569.   if test -n "`ls /dev/$dev 2>/dev/null`"; then
  570.     DEF_AR_FILE=/dev/$dev
  571.     break
  572.   fi
  573. done
  574. if test -z "$DEF_AR_FILE"; then
  575.   DEF_AR_FILE=-
  576. fi
  577. # Hack - force default archive to be tape: for AmigaDOS.  -fnf
  578. DEF_AR_FILE="tape:"
  579.  
  580. for func in strstr valloc mkdir mknod rename ftruncate ftime getcwd
  581. do
  582. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  583. echo checking for ${func}
  584. cat > conftest.c <<EOF
  585. #include <stdio.h>
  586. main() { exit(0); } 
  587. t() { 
  588. #ifdef __stub_${func}
  589. choke me
  590. #else
  591. /* Override any gcc2 internal prototype to avoid an error.  */
  592. extern char ${func}(); ${func}();
  593. #endif
  594.  }
  595. EOF
  596. if eval $compile; then
  597.   DEFS="$DEFS -D${trfunc}=1"
  598. fi
  599. rm -f conftest*
  600. #endif
  601. done
  602.  
  603. echo checking for vprintf
  604. cat > conftest.c <<EOF
  605.  
  606. main() { exit(0); } 
  607. t() { vprintf(); }
  608. EOF
  609. if eval $compile; then
  610.   DEFS="$DEFS -DHAVE_VPRINTF=1"
  611. else
  612.   vprintf_missing=1
  613. fi
  614. rm -f conftest*
  615.  
  616. if test -n "$vprintf_missing"; then
  617. echo checking for _doprnt
  618. cat > conftest.c <<EOF
  619.  
  620. main() { exit(0); } 
  621. t() { _doprnt(); }
  622. EOF
  623. if eval $compile; then
  624.   DEFS="$DEFS -DHAVE_DOPRNT=1"
  625. fi
  626. rm -f conftest*
  627.  
  628. fi
  629.  
  630. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  631. # for constant arguments.  Useless!
  632. echo checking for working alloca.h
  633. cat > conftest.c <<EOF
  634. #include <alloca.h>
  635. main() { exit(0); } 
  636. t() { char *p = alloca(2 * sizeof(int)); }
  637. EOF
  638. if eval $compile; then
  639.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  640. fi
  641. rm -f conftest*
  642.  
  643. decl="#ifdef __GNUC__
  644. #define alloca __builtin_alloca
  645. #else
  646. #if HAVE_ALLOCA_H
  647. #include <alloca.h>
  648. #else
  649. #ifdef _AIX
  650.  #pragma alloca
  651. #else
  652. char *alloca ();
  653. #endif
  654. #endif
  655. #endif
  656. "
  657. echo checking for alloca
  658. cat > conftest.c <<EOF
  659. $decl
  660. main() { exit(0); } 
  661. t() { char *p = (char *) alloca(1); }
  662. EOF
  663. if eval $compile; then
  664.   :
  665. else
  666.   alloca_missing=1
  667. fi
  668. rm -f conftest*
  669.  
  670. if test -n "$alloca_missing"; then
  671.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  672.   # that cause trouble.  Some versions do not even contain alloca or
  673.   # contain a buggy version.  If you still want to use their alloca,
  674.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  675.   ALLOCA=alloca.o
  676. fi
  677.  
  678. echo checking for BSD
  679. #( false && test -f /vmunix || test -f /sdmach || test -f /../../mach ) && DEFS="$DEFS -DBSD42=1"
  680. echo checking for HP-UX
  681. #test -f /hp-ux && test ! -f /vmunix && MALLOC=malloc.o
  682.  
  683. echo checking for Xenix
  684. cat > conftest.c <<EOF
  685. #if defined(M_XENIX) && !defined(M_UNIX)
  686.   yes
  687. #endif
  688.  
  689. EOF
  690. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  691. if egrep "yes" conftest.out >/dev/null 2>&1; then
  692.   XENIX=1
  693. fi
  694. rm -f conftest*
  695.  
  696. if test -n "$XENIX"; then
  697.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  698.   LIBS="$LIBS -lx"
  699.   case "$DEFS" in
  700.   *SYSNDIR*) ;;
  701.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  702.   esac
  703. fi
  704.  
  705. libname=`echo "socket" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  706. LIBS_save="${LIBS}"
  707. LIBS="${LIBS} -l${libname}"
  708. have_lib=""
  709. echo checking for -l${libname}
  710. cat > conftest.c <<EOF
  711.  
  712. main() { exit(0); } 
  713. t() { main(); }
  714. EOF
  715. if eval $compile; then
  716.   have_lib="1"
  717. fi
  718. rm -f conftest*
  719. LIBS="${LIBS_save}"
  720. if test -n "${have_lib}"; then
  721.    :; LIBS="$LIBS -lsocket"
  722. else
  723.    :; 
  724. fi
  725.  
  726. libname=`echo "nsl" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  727. LIBS_save="${LIBS}"
  728. LIBS="${LIBS} -l${libname}"
  729. have_lib=""
  730. echo checking for -l${libname}
  731. cat > conftest.c <<EOF
  732.  
  733. main() { exit(0); } 
  734. t() { main(); }
  735. EOF
  736. if eval $compile; then
  737.   have_lib="1"
  738. fi
  739. rm -f conftest*
  740. LIBS="${LIBS_save}"
  741. if test -n "${have_lib}"; then
  742.    :; LIBS="$LIBS -lnsl"
  743. else
  744.    :; 
  745. fi
  746.  
  747. if test -n "$prefix"; then
  748.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  749.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  750. fi
  751. if test -n "$exec_prefix"; then
  752.   prsub="$prsub
  753. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  754. exec_prefix\\1=\\2$exec_prefix%"
  755. fi
  756.  
  757. trap 'rm -f config.status; exit 1' 1 3 15
  758. echo creating config.status
  759. rm -f config.status
  760. cat > config.status <<EOF
  761. #!/bin/sh
  762. # Generated automatically by configure.
  763. # Run this file to recreate the current configuration.
  764. # This directory was configured as follows,
  765. # on host `(hostname || uname -n) 2>/dev/null`:
  766. #
  767. # $0 $*
  768.  
  769. for arg
  770. do
  771.   case "\$arg" in
  772.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  773.     exec /bin/sh $0 $* ;;
  774.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  775.   esac
  776. done
  777.  
  778. trap 'rm -f Makefile; exit 1' 1 3 15
  779. PROGS='$PROGS'
  780. CC='$CC'
  781. CPP='$CPP'
  782. INSTALL='$INSTALL'
  783. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  784. INSTALL_DATA='$INSTALL_DATA'
  785. YACC='$YACC'
  786. RTAPELIB='$RTAPELIB'
  787. DEF_AR_FILE='$DEF_AR_FILE'
  788. ALLOCA='$ALLOCA'
  789. MALLOC='$MALLOC'
  790. LIBS='$LIBS'
  791. srcdir='$srcdir'
  792. DEFS='$DEFS'
  793. prefix='$prefix'
  794. exec_prefix='$exec_prefix'
  795. prsub='$prsub'
  796. EOF
  797. cat >> config.status <<\EOF
  798.  
  799. top_srcdir=$srcdir
  800. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  801.   srcdir=$top_srcdir
  802.   # Remove last slash and all that follows it.  Not all systems have dirname.
  803.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  804.   if test "$dir" != "$file"; then
  805.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  806.     test ! -d $dir && mkdir $dir
  807.   fi
  808.   echo creating $file
  809.   rm -f $file
  810.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  811.   sed -e "
  812. $prsub
  813. s%@PROGS@%$PROGS%g
  814. s%@CC@%$CC%g
  815. s%@CPP@%$CPP%g
  816. s%@INSTALL@%$INSTALL%g
  817. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  818. s%@INSTALL_DATA@%$INSTALL_DATA%g
  819. s%@YACC@%$YACC%g
  820. s%@RTAPELIB@%$RTAPELIB%g
  821. s%@DEF_AR_FILE@%$DEF_AR_FILE%g
  822. s%@ALLOCA@%$ALLOCA%g
  823. s%@MALLOC@%$MALLOC%g
  824. s%@LIBS@%$LIBS%g
  825. s%@srcdir@%$srcdir%g
  826. s%@DEFS@%$DEFS%
  827. " $top_srcdir/${file}.in >> $file
  828. fi; done
  829.  
  830. exit 0
  831. EOF
  832. chmod +x config.status
  833. test -n "$no_create" || ./config.status
  834.  
  835.