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