home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / linux / tools / amiga / gzip-1.1.2.lha / gzip-1.1.2 / configure < prev    next >
Encoding:
Text File  |  1993-06-02  |  22.0 KB  |  978 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=gzip.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. if test -z "$CC"; then
  123.   # Extract the first word of `gcc', so it can be a program name with args.
  124.   set dummy gcc; word=$2
  125.   echo checking for $word
  126.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  127.   for dir in $PATH; do
  128.     test -z "$dir" && dir=.
  129.     if test -f $dir/$word; then
  130.       CC="gcc"
  131.       break
  132.     fi
  133.   done
  134.   IFS="$saveifs"
  135. fi
  136. test -z "$CC" && CC="cc"
  137. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  138.  
  139. # Find out if we are using GNU C, under whatever name.
  140. cat > conftest.c <<EOF
  141. #ifdef __GNUC__
  142.   yes
  143. #endif
  144. EOF
  145. ${CC-cc} -E conftest.c > conftest.out 2>&1
  146. if egrep yes conftest.out >/dev/null 2>&1; then
  147.   GCC=1 # For later tests.
  148.   CFLAGS="${CFLAGS--O}"
  149. fi
  150. rm -f conftest*
  151.  
  152. echo checking for underline in external names
  153. test -z "$CPP" -a -f /lib/cpp && CPP=/lib/cpp
  154. test -z "$CPP" && CPP="$CC -E"
  155. cat > conftest.c <<EOF
  156. int foo() {return 0;}
  157. EOF
  158. eval "$CC -c conftest.c > /dev/null 2>&1"
  159. if nm conftest.o | grep _foo > /dev/null 2>&1 ; then
  160.   :
  161. else
  162.   CPP="${CPP} -DNO_UNDERLINE"
  163. fi
  164. echo checking for assembler
  165. rm -f _match.o conftest.c conftest.o
  166. OBJA=""
  167. if eval "$CPP $srcdir/match.S > _match.s 2>/dev/null"; then
  168.   if test ! -s _match.s || grep error < _match.s > /dev/null; then
  169.     :
  170.   elif eval "$CC -c _match.s >/dev/null 2>&1" && test -f _match.o; then
  171.     DEFS="${DEFS} -DASMV"
  172.     OBJA=match.o
  173.   fi
  174. fi
  175. rm -f _match.s _match.o
  176. # Make sure to not get the incompatible SysV /etc/install and
  177. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  178. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  179. # or the AFS install, which mishandles nonexistent args, or
  180. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  181. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  182. # anyway.  Sigh.
  183. if test "z${INSTALL}" = "z" ; then
  184.   echo checking for install
  185.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  186.   for dir in $PATH; do
  187.     test -z "$dir" && dir=.
  188.     case $dir in
  189.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  190.     *)
  191.       if test -f $dir/installbsd; then
  192.     INSTALL="$dir/installbsd -c" # OSF1
  193.     INSTALL_PROGRAM='$(INSTALL)'
  194.     INSTALL_DATA='$(INSTALL) -m 644'
  195.     break
  196.       fi
  197.       if test -f $dir/install; then
  198.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  199.       : # AIX
  200.     else
  201.       INSTALL="$dir/install -c"
  202.       INSTALL_PROGRAM='$(INSTALL)'
  203.       INSTALL_DATA='$(INSTALL) -m 644'
  204.       break
  205.     fi
  206.       fi
  207.       ;;
  208.     esac
  209.   done
  210.   IFS="$saveifs"
  211. fi
  212. INSTALL=${INSTALL-cp}
  213. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  214. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  215.  
  216. echo checking for AIX
  217. echo checking how to run the C preprocessor
  218. if test -z "$CPP"; then
  219.   CPP='${CC-cc} -E'
  220.   cat > conftest.c <<EOF
  221. #include <stdio.h>
  222. EOF
  223. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  224. if test -z "$err"; then
  225.   :
  226. else
  227.   CPP=/lib/cpp
  228. fi
  229. rm -f conftest*
  230. fi
  231.  
  232. cat > conftest.c <<EOF
  233. #ifdef _AIX
  234.   yes
  235. #endif
  236.  
  237. EOF
  238. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  239. if egrep "yes" conftest.out >/dev/null 2>&1; then
  240.   {
  241. test -n "$verbose" && \
  242. echo '    defining' _ALL_SOURCE
  243. DEFS="$DEFS -D_ALL_SOURCE=1"
  244. }
  245.  
  246. fi
  247. rm -f conftest*
  248.  
  249.  
  250. echo checking for minix/config.h
  251. cat > conftest.c <<EOF
  252. #include <minix/config.h>
  253. EOF
  254. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  255. if test -z "$err"; then
  256.   MINIX=1
  257. fi
  258. rm -f conftest*
  259.  
  260. # The Minix shell can't assign to the same variable on the same line!
  261. if test -n "$MINIX"; then
  262.   {
  263. test -n "$verbose" && \
  264. echo '    defining' _POSIX_SOURCE
  265. DEFS="$DEFS -D_POSIX_SOURCE=1"
  266. }
  267.  
  268.   {
  269. test -n "$verbose" && \
  270. echo '    defining' _POSIX_1_SOURCE to be '2'
  271. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  272. }
  273.  
  274.   {
  275. test -n "$verbose" && \
  276. echo '    defining' _MINIX
  277. DEFS="$DEFS -D_MINIX=1"
  278. }
  279.  
  280. fi
  281.  
  282. echo checking for POSIXized ISC
  283. if test -d /etc/conf/kconfig.d &&
  284.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  285. then
  286.   ISC=1 # If later tests want to check for ISC.
  287.   {
  288. test -n "$verbose" && \
  289. echo '    defining' _POSIX_SOURCE
  290. DEFS="$DEFS -D_POSIX_SOURCE=1"
  291. }
  292.  
  293.   if test -n "$GCC"; then
  294.     CC="$CC -posix"
  295.   else
  296.     CC="$CC -Xp"
  297.   fi
  298. fi
  299.  
  300. echo checking for DYNIX/ptx libseq
  301. cat > conftest.c <<EOF
  302. #if defined(_SEQUENT_)
  303.   yes
  304. #endif
  305.  
  306. EOF
  307. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  308. if egrep "yes" conftest.out >/dev/null 2>&1; then
  309.   SEQUENT=1
  310. fi
  311. rm -f conftest*
  312.  
  313. test -n "$SEQUENT" && test -f /usr/lib/libseq.a &&
  314.   LIBS="$LIBS -lseq"
  315.  
  316. echo checking for ANSI C header files
  317. cat > conftest.c <<EOF
  318. #include <stdlib.h>
  319. #include <stdarg.h>
  320. #include <string.h>
  321. #include <float.h>
  322. EOF
  323. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  324. if test -z "$err"; then
  325.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  326. echo '#include <string.h>' > conftest.c
  327. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  328. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  329.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  330. cat > conftest.c <<EOF
  331. #include <ctype.h>
  332. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  333. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  334. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  335. int main () { int i; for (i = 0; i < 256; i++)
  336. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  337. exit (0); }
  338.  
  339. EOF
  340. eval $compile
  341. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  342.   {
  343. test -n "$verbose" && \
  344. echo '    defining' STDC_HEADERS
  345. DEFS="$DEFS -DSTDC_HEADERS=1"
  346. }
  347.  
  348. fi
  349. rm -f conftest*
  350. fi
  351. rm -f conftest*
  352.  
  353. fi
  354. rm -f conftest*
  355.  
  356. echo checking for string.h
  357. cat > conftest.c <<EOF
  358. #include <string.h>
  359. EOF
  360. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  361. if test -z "$err"; then
  362.   :
  363. else
  364.   {
  365. test -n "$verbose" && \
  366. echo '    defining' NO_STRING_H
  367. DEFS="$DEFS -DNO_STRING_H=1"
  368. }
  369.  
  370. fi
  371. rm -f conftest*
  372.  
  373. echo checking for stdlib.h
  374. cat > conftest.c <<EOF
  375. #include <stdlib.h>
  376. EOF
  377. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  378. if test -z "$err"; then
  379.   :
  380. else
  381.   {
  382. test -n "$verbose" && \
  383. echo '    defining' NO_STDLIB_H
  384. DEFS="$DEFS -DNO_STDLIB_H=1"
  385. }
  386.  
  387. fi
  388. rm -f conftest*
  389.  
  390. echo checking for memory.h
  391. cat > conftest.c <<EOF
  392. #include <memory.h>
  393. EOF
  394. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  395. if test -z "$err"; then
  396.   :
  397. else
  398.   {
  399. test -n "$verbose" && \
  400. echo '    defining' NO_MEMORY_H
  401. DEFS="$DEFS -DNO_MEMORY_H=1"
  402. }
  403.  
  404. fi
  405. rm -f conftest*
  406.  
  407. echo checking for fcntl.h
  408. cat > conftest.c <<EOF
  409. #include <fcntl.h>
  410. EOF
  411. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  412. if test -z "$err"; then
  413.   :
  414. else
  415.   {
  416. test -n "$verbose" && \
  417. echo '    defining' NO_FCNTL_H
  418. DEFS="$DEFS -DNO_FCNTL_H=1"
  419. }
  420.  
  421. fi
  422. rm -f conftest*
  423.  
  424. for hdr in unistd.h
  425. do
  426. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  427. echo checking for ${hdr}
  428. cat > conftest.c <<EOF
  429. #include <${hdr}>
  430. EOF
  431. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  432. if test -z "$err"; then
  433.   {
  434. test -n "$verbose" && \
  435. echo '    defining' ${trhdr}
  436. DEFS="$DEFS -D${trhdr}=1"
  437. }
  438.  
  439. fi
  440. rm -f conftest*
  441. done
  442.  
  443. utime=0
  444. echo checking for utime.h
  445. cat > conftest.c <<EOF
  446. #include <utime.h>
  447. EOF
  448. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  449. if test -z "$err"; then
  450.   utime=1 
  451. else
  452.   {
  453. test -n "$verbose" && \
  454. echo '    defining' NO_UTIME_H
  455. DEFS="$DEFS -DNO_UTIME_H=1"
  456. }
  457.  
  458. fi
  459. rm -f conftest*
  460.  
  461. if test $utime -eq 0; then
  462.   for hdr in sys/utime.h
  463. do
  464. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  465. echo checking for ${hdr}
  466. cat > conftest.c <<EOF
  467. #include <${hdr}>
  468. EOF
  469. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  470. if test -z "$err"; then
  471.   {
  472. test -n "$verbose" && \
  473. echo '    defining' ${trhdr}
  474. DEFS="$DEFS -D${trhdr}=1"
  475. }
  476.  
  477. fi
  478. rm -f conftest*
  479. done
  480.  
  481. fi
  482. echo checking for directory library header
  483. dirheader=
  484. if test -z "$dirheader"; then
  485.   echo checking for dirent.h
  486. cat > conftest.c <<EOF
  487. #include <sys/types.h>
  488. #include <dirent.h>
  489. int main() { exit(0); }
  490. int t() { DIR *dirp = opendir ("/"); }
  491. EOF
  492. if eval $compile; then
  493.   {
  494. test -n "$verbose" && \
  495. echo '    defining' DIRENT
  496. DEFS="$DEFS -DDIRENT=1"
  497. }
  498.  dirheader=dirent.h
  499. fi
  500. rm -f conftest*
  501. fi
  502. if test -z "$dirheader"; then
  503.   echo checking for sys/ndir.h
  504. cat > conftest.c <<EOF
  505. #include <sys/types.h>
  506. #include <sys/ndir.h>
  507. int main() { exit(0); }
  508. int t() { DIR *dirp = opendir ("/"); }
  509. EOF
  510. if eval $compile; then
  511.   {
  512. test -n "$verbose" && \
  513. echo '    defining' SYSNDIR
  514. DEFS="$DEFS -DSYSNDIR=1"
  515. }
  516.  dirheader=sys/ndir.h
  517. fi
  518. rm -f conftest*
  519. fi
  520. if test -z "$dirheader"; then
  521.   echo checking for sys/dir.h
  522. cat > conftest.c <<EOF
  523. #include <sys/types.h>
  524. #include <sys/dir.h>
  525. int main() { exit(0); }
  526. int t() { DIR *dirp = opendir ("/"); }
  527. EOF
  528. if eval $compile; then
  529.   {
  530. test -n "$verbose" && \
  531. echo '    defining' SYSDIR
  532. DEFS="$DEFS -DSYSDIR=1"
  533. }
  534.  dirheader=sys/dir.h
  535. fi
  536. rm -f conftest*
  537. fi
  538. if test -z "$dirheader"; then
  539.   echo checking for ndir.h
  540. cat > conftest.c <<EOF
  541. #include <sys/types.h>
  542. #include <ndir.h>
  543. int main() { exit(0); }
  544. int t() { DIR *dirp = opendir ("/"); }
  545. EOF
  546. if eval $compile; then
  547.   {
  548. test -n "$verbose" && \
  549. echo '    defining' NDIR
  550. DEFS="$DEFS -DNDIR=1"
  551. }
  552.  dirheader=ndir.h
  553. fi
  554. rm -f conftest*
  555. fi
  556.  
  557. echo checking for closedir return value
  558. cat > conftest.c <<EOF
  559. #include <sys/types.h>
  560. #include <$dirheader>
  561. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  562. EOF
  563. eval $compile
  564. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  565.   :
  566. else
  567.   {
  568. test -n "$verbose" && \
  569. echo '    defining' VOID_CLOSEDIR
  570. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  571. }
  572.  
  573. fi
  574. rm -f conftest*
  575.  
  576. echo checking for Xenix
  577. cat > conftest.c <<EOF
  578. #if defined(M_XENIX) && !defined(M_UNIX)
  579.   yes
  580. #endif
  581.  
  582. EOF
  583. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  584. if egrep "yes" conftest.out >/dev/null 2>&1; then
  585.   XENIX=1
  586. fi
  587. rm -f conftest*
  588.  
  589. if test -n "$XENIX"; then
  590.   LIBS="$LIBS -lx"
  591.   case "$DEFS" in
  592.   *SYSNDIR*) ;;
  593.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  594.   esac
  595. fi
  596.  
  597. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  598. # for constant arguments.  Useless!
  599. echo checking for working alloca.h
  600. cat > conftest.c <<EOF
  601. #include <alloca.h>
  602. int main() { exit(0); }
  603. int t() { char *p = alloca(2 * sizeof(int)); }
  604. EOF
  605. if eval $compile; then
  606.   {
  607. test -n "$verbose" && \
  608. echo '    defining' HAVE_ALLOCA_H
  609. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  610. }
  611.  
  612. fi
  613. rm -f conftest*
  614.  
  615. decl="#ifdef __GNUC__
  616. #define alloca __builtin_alloca
  617. #else
  618. #if HAVE_ALLOCA_H
  619. #include <alloca.h>
  620. #else
  621. #ifdef _AIX
  622.  #pragma alloca
  623. #else
  624. char *alloca ();
  625. #endif
  626. #endif
  627. #endif
  628. "
  629. echo checking for alloca
  630. cat > conftest.c <<EOF
  631. $decl
  632. int main() { exit(0); }
  633. int t() { char *p = (char *) alloca(1); }
  634. EOF
  635. if eval $compile; then
  636.   :
  637. else
  638.   alloca_missing=1
  639. cat > conftest.c <<EOF
  640.  
  641. #if defined(CRAY) && ! defined(CRAY2)
  642. winnitude
  643. #else
  644. lossage
  645. #endif
  646.  
  647. EOF
  648. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  649. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  650.   echo checking for _getb67
  651. cat > conftest.c <<EOF
  652. #include <ctype.h>
  653. int main() { exit(0); }
  654. int t() { 
  655. /* The GNU C library defines this for functions which it implements
  656.     to always fail with ENOSYS.  Some functions are actually named
  657.     something starting with __ and the normal name is an alias.  */
  658. #if defined (__stub__getb67) || defined (__stub____getb67)
  659. choke me
  660. #else
  661. /* Override any gcc2 internal prototype to avoid an error.  */
  662. extern char _getb67(); _getb67();
  663. #endif
  664.  }
  665. EOF
  666. if eval $compile; then
  667.   {
  668. test -n "$verbose" && \
  669. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  670. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  671. }
  672.  
  673. else
  674.   echo checking for GETB67
  675. cat > conftest.c <<EOF
  676. #include <ctype.h>
  677. int main() { exit(0); }
  678. int t() { 
  679. /* The GNU C library defines this for functions which it implements
  680.     to always fail with ENOSYS.  Some functions are actually named
  681.     something starting with __ and the normal name is an alias.  */
  682. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  683. choke me
  684. #else
  685. /* Override any gcc2 internal prototype to avoid an error.  */
  686. extern char GETB67(); GETB67();
  687. #endif
  688.  }
  689. EOF
  690. if eval $compile; then
  691.   {
  692. test -n "$verbose" && \
  693. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  694. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  695. }
  696.  
  697. else
  698.   echo checking for getb67
  699. cat > conftest.c <<EOF
  700. #include <ctype.h>
  701. int main() { exit(0); }
  702. int t() { 
  703. /* The GNU C library defines this for functions which it implements
  704.     to always fail with ENOSYS.  Some functions are actually named
  705.     something starting with __ and the normal name is an alias.  */
  706. #if defined (__stub_getb67) || defined (__stub___getb67)
  707. choke me
  708. #else
  709. /* Override any gcc2 internal prototype to avoid an error.  */
  710. extern char getb67(); getb67();
  711. #endif
  712.  }
  713. EOF
  714. if eval $compile; then
  715.   {
  716. test -n "$verbose" && \
  717. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  718. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  719. }
  720.  
  721. fi
  722. rm -f conftest*
  723.  
  724. fi
  725. rm -f conftest*
  726.  
  727. fi
  728. rm -f conftest*
  729.  
  730. fi
  731. rm -f conftest*
  732.  
  733.  
  734. fi
  735. rm -f conftest*
  736.  
  737. if test -n "$alloca_missing"; then
  738.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  739.   # that cause trouble.  Some versions do not even contain alloca or
  740.   # contain a buggy version.  If you still want to use their alloca,
  741.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  742.   ALLOCA=alloca.o
  743. if test -z "check_stack_dir"; then
  744.   echo 'checking stack direction for C alloca'
  745.   echo checking whether cross-compiling
  746. # If we cannot run a trivial program, we must be cross compiling.
  747. cat > conftest.c <<EOF
  748. main(){exit(0);}
  749. EOF
  750. eval $compile
  751. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  752.   :
  753. else
  754.   cross_compiling=1
  755. fi
  756. rm -f conftest*
  757.  
  758. if test -n "$cross_compiling"
  759. then
  760.   {
  761. test -n "$verbose" && \
  762. echo '    defining' STACK_DIRECTION to be '0'
  763. DEFS="$DEFS -DSTACK_DIRECTION=0"
  764. }
  765.  
  766. else
  767. cat > conftest.c <<EOF
  768. find_stack_direction ()
  769. {
  770.   static char *addr = 0;
  771.   auto char dummy;
  772.   if (addr == 0)
  773.     {
  774.       addr = &dummy;
  775.       return find_stack_direction ();
  776.     }
  777.   else
  778.     return (&dummy > addr) ? 1 : -1;
  779. }
  780. main ()
  781. {
  782.   exit (find_stack_direction() < 0);
  783. }
  784. EOF
  785. eval $compile
  786. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  787.   {
  788. test -n "$verbose" && \
  789. echo '    defining' STACK_DIRECTION to be '1'
  790. DEFS="$DEFS -DSTACK_DIRECTION=1"
  791. }
  792.  
  793. else
  794.   {
  795. test -n "$verbose" && \
  796. echo '    defining' STACK_DIRECTION to be '-1'
  797. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  798. }
  799.  
  800. fi
  801. fi
  802. rm -f conftest*
  803. fi
  804. fi
  805.  
  806. echo checking for return type of signal handlers
  807. cat > conftest.c <<EOF
  808. #include <sys/types.h>
  809. #include <signal.h>
  810. #ifdef signal
  811. #undef signal
  812. #endif
  813. extern int (*signal ()) ();
  814. int main() { exit(0); }
  815. int t() { int i; }
  816. EOF
  817. if eval $compile; then
  818.   {
  819. test -n "$verbose" && \
  820. echo '    defining' RETSIGTYPE to be 'int'
  821. DEFS="$DEFS -DRETSIGTYPE=int"
  822. }
  823.  
  824. fi
  825. rm -f conftest*
  826.  
  827.  
  828. echo checking for size_t in sys/types.h
  829. echo '#include <sys/types.h>' > conftest.c
  830. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  831. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  832.   :
  833. else
  834.   {
  835. test -n "$verbose" && \
  836. echo '    defining' size_t to be 'unsigned'
  837. DEFS="$DEFS -Dsize_t=unsigned"
  838. }
  839.  
  840. fi
  841. rm -f conftest*
  842.  
  843. echo "checking if \`#!' works in shell scripts"
  844. cat <<'__EOF__' > conftest.csh
  845. #!/bin/csh -f
  846. setenv SHELL /bin/csh
  847. # Avoid tcsh bug 'Bad Hertz Value':
  848. setenv HZ 60
  849. # Make sure foo doesn't get exported into the environment
  850. # Astoundingly, some versions of csh don't have unsetenv.
  851. if (${?foo}) unsetenv foo >& /dev/null
  852. if (${?foo}) unset foo
  853. set output="`./conftest.sh`"
  854. if ( "$output" == "foo=bar" ) then
  855.    exit 0
  856. endif
  857. exit 1
  858. __EOF__
  859. cat <<'__EOF__' > conftest.sh
  860. #!/bin/sh
  861. set foo=bar
  862. echo "$*"
  863. __EOF__
  864. chmod 777 conftest.csh conftest.sh
  865. (csh -f ./conftest.csh) 2> /dev/null
  866. if test $? = 0 ; then
  867.    :; SEDCMD="1d"
  868. else
  869.    :; SEDCMD=""
  870. fi
  871. rm -f conftest.csh conftest.sh
  872.  
  873. if test -z "$prefix"
  874. then
  875.   echo checking for gzip to derive installation directory prefix
  876.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="$IFS:"
  877.   for dir in $PATH; do
  878.     test -z "$dir" && dir=.
  879.     if test $dir != . && test -f $dir/gzip; then
  880.       # Not all systems have dirname.
  881.       prefix=`echo $dir|sed 's%/[^/][^/]*$%%'`
  882.       break
  883.     fi
  884.   done
  885.   IFS="$saveifs"
  886.   echo "    chose installation directory prefix ${prefix}"
  887. fi
  888.  
  889. if test -n "$prefix"; then
  890.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  891.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  892. fi
  893. if test -n "$exec_prefix"; then
  894.   prsub="$prsub
  895. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  896. exec_prefix\\1=\\2$exec_prefix%"
  897. fi
  898. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  899.  
  900. trap 'rm -f config.status; exit 1' 1 3 15
  901. echo creating config.status
  902. rm -f config.status
  903. cat > config.status <<EOF
  904. #!/bin/sh
  905. # Generated automatically by configure.
  906. # Run this file to recreate the current configuration.
  907. # This directory was configured as follows,
  908. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  909. #
  910. # $0 $*
  911.  
  912. for arg
  913. do
  914.   case "\$arg" in
  915.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  916.     exec /bin/sh $0 $* ;;
  917.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  918.   esac
  919. done
  920.  
  921. trap 'rm -f Makefile; exit 1' 1 3 15
  922. CC='$CC'
  923. INSTALL='$INSTALL'
  924. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  925. INSTALL_DATA='$INSTALL_DATA'
  926. CPP='$CPP'
  927. ALLOCA='$ALLOCA'
  928. CFLAGS='$CFLAGS'
  929. OBJA='$OBJA'
  930. SEDCMD='$SEDCMD'
  931. LIBS='$LIBS'
  932. srcdir='$srcdir'
  933. DEFS='$DEFS'
  934. prefix='$prefix'
  935. exec_prefix='$exec_prefix'
  936. prsub='$prsub'
  937. EOF
  938. cat >> config.status <<\EOF
  939.  
  940. top_srcdir=$srcdir
  941.  
  942. # Allow make-time overrides of the generated file list.
  943. test -n "$gen_files" || gen_files="Makefile"
  944.  
  945. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  946.   srcdir=$top_srcdir
  947.   # Remove last slash and all that follows it.  Not all systems have dirname.
  948.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  949.   if test "$dir" != "$file"; then
  950.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  951.     test ! -d $dir && mkdir $dir
  952.   fi
  953.   echo creating $file
  954.   rm -f $file
  955.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  956.   sed -e "
  957. $prsub
  958. s%@CC@%$CC%g
  959. s%@INSTALL@%$INSTALL%g
  960. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  961. s%@INSTALL_DATA@%$INSTALL_DATA%g
  962. s%@CPP@%$CPP%g
  963. s%@ALLOCA@%$ALLOCA%g
  964. s%@CFLAGS@%$CFLAGS%g
  965. s%@OBJA@%$OBJA%g
  966. s%@SEDCMD@%$SEDCMD%g
  967. s%@LIBS@%$LIBS%g
  968. s%@srcdir@%$srcdir%g
  969. s%@DEFS@%$DEFS%
  970. " $top_srcdir/${file}.in >> $file
  971. fi; done
  972.  
  973. exit 0
  974. EOF
  975. chmod +x config.status
  976. test -n "$no_create" || ./config.status
  977.  
  978.