home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / m4-1.1-src.lha / src / amiga / m4-1.1 / configure < prev    next >
Encoding:
Text File  |  1994-02-24  |  25.8 KB  |  1,091 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]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=m4.c
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog| sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131.  
  132. if test -z "$CC"; then
  133.   # Extract the first word of `gcc', so it can be a program name with args.
  134.   set dummy gcc; word=$2
  135.   echo checking for $word
  136.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  137.   for dir in $PATH; do
  138.     test -z "$dir" && dir=.
  139.     if test -f $dir/$word; then
  140.       CC="gcc"
  141.       break
  142.     fi
  143.   done
  144.   IFS="$saveifs"
  145. fi
  146. test -z "$CC" && CC="cc"
  147. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  148.  
  149. # Find out if we are using GNU C, under whatever name.
  150. cat > conftest.c <<EOF
  151. #ifdef __GNUC__
  152.   yes
  153. #endif
  154. EOF
  155. ${CC-cc} -E conftest.c > conftest.out 2>&1
  156. if egrep yes conftest.out >/dev/null 2>&1; then
  157.   GCC=1 # For later tests.
  158. fi
  159. rm -f conftest*
  160.  
  161. if test -z "$RANLIB"; then
  162.   # Extract the first word of `ranlib', so it can be a program name with args.
  163.   set dummy ranlib; word=$2
  164.   echo checking for $word
  165.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  166.   for dir in $PATH; do
  167.     test -z "$dir" && dir=.
  168.     if test -f $dir/$word; then
  169.       RANLIB="ranlib"
  170.       break
  171.     fi
  172.   done
  173.   IFS="$saveifs"
  174. fi
  175. test -z "$RANLIB" && RANLIB=":"
  176. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  177.  
  178. # Make sure to not get the incompatible SysV /etc/install and
  179. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  180. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  181. # or the AFS install, which mishandles nonexistent args, or
  182. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  183. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  184. # anyway.  Sigh.
  185. if test "z${INSTALL}" = "z" ; then
  186.   echo checking for install
  187.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  188.   for dir in $PATH; do
  189.     test -z "$dir" && dir=.
  190.     case $dir in
  191.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  192.     *)
  193.       if test -f $dir/installbsd; then
  194.     INSTALL="$dir/installbsd -c" # OSF1
  195.     INSTALL_PROGRAM='$(INSTALL)'
  196.     INSTALL_DATA='$(INSTALL) -m 644'
  197.     break
  198.       fi
  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. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  216. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  217. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  218. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  219. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  220.  
  221. for p in mawk gawk nawk awk
  222. do
  223. if test -z "$AWK"; then
  224.   # Extract the first word of `$p', so it can be a program name with args.
  225.   set dummy $p; word=$2
  226.   echo checking for $word
  227.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  228.   for dir in $PATH; do
  229.     test -z "$dir" && dir=.
  230.     if test -f $dir/$word; then
  231.       AWK="$p"
  232.       break
  233.     fi
  234.   done
  235.   IFS="$saveifs"
  236. fi
  237.  
  238. test -n "$AWK" && test -n "$verbose" && echo "    setting AWK to $AWK"
  239.  
  240. test -n "$AWK" && break
  241. done
  242.  
  243. echo checking for POSIXized ISC
  244. if test -d /etc/conf/kconfig.d &&
  245.   grep _POSIX_VERSION /gnu/include/sys/unistd.h >/dev/null 2>&1
  246. then
  247.   ISC=1 # If later tests want to check for ISC.
  248.   
  249. {
  250. test -n "$verbose" && \
  251. echo "    defining _POSIX_SOURCE"
  252. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  253. DEFS="$DEFS -D_POSIX_SOURCE=1"
  254. }
  255.  
  256.   if test -n "$GCC"; then
  257.     CC="$CC -posix"
  258.   else
  259.     CC="$CC -Xp"
  260.   fi
  261. fi
  262.  
  263.  
  264. prog='/* Ultrix mips cc rejects this.  */
  265. typedef int charset[2]; const charset x;
  266. /* SunOS 4.1.1 cc rejects this.  */
  267. char const *const *ccp;
  268. char **p;
  269. /* AIX XL C 1.02.0.0 rejects this.
  270.    It does not let you subtract one const X* pointer from another in an arm
  271.    of an if-expression whose if-part is not a constant expression */
  272. const char *g = "string";
  273. ccp = &g + (g ? g-g : 0);
  274. /* HPUX 7.0 cc rejects these. */
  275. ++ccp;
  276. p = (char**) ccp;
  277. ccp = (char const *const *) p;
  278. { /* SCO 3.2v4 cc rejects this.  */
  279.   char *t;
  280.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  281.  
  282.   *t++ = 0;
  283. }
  284. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  285.   int x[] = {25,17};
  286.   const int *foo = &x[0];
  287.   ++foo;
  288. }
  289. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  290.   typedef const int *iptr;
  291.   iptr p = 0;
  292.   ++p;
  293. }
  294. { /* AIX XL C 1.02.0.0 rejects this saying
  295.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  296.   struct s { int j; const int *ap[3]; };
  297.   struct s *b; b->j = 5;
  298. }
  299. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  300.   const int foo = 10;
  301. }'
  302. echo checking for lack of working const
  303. cat > conftest.c <<EOF
  304. #include "confdefs.h"
  305.  
  306. int main() { exit(0); }
  307. int t() { $prog }
  308. EOF
  309. if eval $compile; then
  310.   :
  311. else
  312.   rm -rf conftest*
  313.   
  314. {
  315. test -n "$verbose" && \
  316. echo "    defining" const to be empty
  317. echo "#define" const  >> confdefs.h
  318. DEFS="$DEFS -Dconst="
  319. }
  320.  
  321. fi
  322. rm -f conftest*
  323.  
  324. echo checking for ANSI prototypes
  325. echo checking how to run the C preprocessor
  326. if test -z "$CPP"; then
  327.   # This must be in double quotes, not single quotes, because CPP may get
  328.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  329.   # make.  It must be expanded now.
  330.   CPP="${CC-cc} -E"
  331.   cat > conftest.c <<EOF
  332. #include "confdefs.h"
  333. #include <stdio.h>
  334. Syntax Error
  335. EOF
  336. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  337. if test -z "$err"; then
  338.   :
  339. else
  340.   rm -rf conftest*
  341.   CPP=/lib/cpp
  342. fi
  343. rm -f conftest*
  344. fi
  345. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  346.  
  347. cat > conftest.c <<EOF
  348. #include "confdefs.h"
  349. #ifdef __STDC__
  350.   yes
  351. #endif
  352.  
  353. EOF
  354. eval "$CPP conftest.c > conftest.out 2>&1"
  355. if egrep "yes" conftest.out >/dev/null 2>&1; then
  356.   :
  357. else
  358.   rm -rf conftest*
  359.   U=_
  360. fi
  361. rm -f conftest*
  362.  
  363.  
  364. echo checking for ANSI C header files
  365. cat > conftest.c <<EOF
  366. #include "confdefs.h"
  367. #include <stdlib.h>
  368. #include <stdarg.h>
  369. #include <string.h>
  370. #include <float.h>
  371. EOF
  372. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  373. if test -z "$err"; then
  374.   rm -rf conftest*
  375.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  376. echo '#include "confdefs.h"
  377. #include <string.h>' > conftest.c
  378. eval "$CPP conftest.c > conftest.out 2>&1"
  379. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  380.   rm -rf conftest*
  381.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  382. cat > conftest.c <<EOF
  383. #include "confdefs.h"
  384. #include <ctype.h>
  385. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  386. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  387. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  388. int main () { int i; for (i = 0; i < 256; i++)
  389. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  390. exit (0); }
  391.  
  392. EOF
  393. eval $compile
  394. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  395.   
  396. {
  397. test -n "$verbose" && \
  398. echo "    defining STDC_HEADERS"
  399. echo "#define" STDC_HEADERS 1 >> confdefs.h
  400. DEFS="$DEFS -DSTDC_HEADERS=1"
  401. }
  402.  
  403.  
  404. fi
  405. rm -fr conftest*
  406.  
  407. fi
  408. rm -f conftest*
  409.  
  410.  
  411. fi
  412. rm -f conftest*
  413.  
  414. for hdr in string.h
  415. do
  416. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  417. echo checking for ${hdr}
  418. cat > conftest.c <<EOF
  419. #include "confdefs.h"
  420. #include <${hdr}>
  421. EOF
  422. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  423. if test -z "$err"; then
  424.   rm -rf conftest*
  425.   
  426. {
  427. test -n "$verbose" && \
  428. echo "    defining ${trhdr}"
  429. echo "#define" ${trhdr} 1 >> confdefs.h
  430. DEFS="$DEFS -D${trhdr}=1"
  431. }
  432.  
  433.  
  434. fi
  435. rm -f conftest*
  436. done
  437.  
  438. echo checking whether string.h declares mem functions
  439. echo '#include "confdefs.h"
  440. #include <string.h>' > conftest.c
  441. eval "$CPP conftest.c > conftest.out 2>&1"
  442. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  443.   :
  444. else
  445.   rm -rf conftest*
  446.   echo checking for memory.h
  447. cat > conftest.c <<EOF
  448. #include "confdefs.h"
  449. #include <memory.h>
  450. EOF
  451. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  452. if test -z "$err"; then
  453.   rm -rf conftest*
  454.   
  455. {
  456. test -n "$verbose" && \
  457. echo "    defining NEED_MEMORY_H"
  458. echo "#define" NEED_MEMORY_H 1 >> confdefs.h
  459. DEFS="$DEFS -DNEED_MEMORY_H=1"
  460. }
  461.  
  462.  
  463. fi
  464. rm -f conftest*
  465.  
  466. fi
  467. rm -f conftest*
  468.  
  469.  
  470. echo checking for size_t in sys/types.h
  471. echo '#include "confdefs.h"
  472. #include <sys/types.h>' > conftest.c
  473. eval "$CPP conftest.c > conftest.out 2>&1"
  474. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  475.   :
  476. else
  477.   rm -rf conftest*
  478.   
  479. {
  480. test -n "$verbose" && \
  481. echo "    defining" size_t to be unsigned
  482. echo "#define" size_t unsigned >> confdefs.h
  483. DEFS="$DEFS -Dsize_t=unsigned"
  484. }
  485.  
  486. fi
  487. rm -f conftest*
  488.  
  489.  
  490.  
  491. # Define HAVE_MKSTEMP if mkstemp(3), checked only if not HAVE_TMPFILE.
  492. echo checking for tmpfile
  493. cat > conftest.c <<EOF
  494. #include "confdefs.h"
  495. #include <ctype.h>
  496. int main() { exit(0); }
  497. int t() { 
  498. /* The GNU C library defines this for functions which it implements
  499.     to always fail with ENOSYS.  Some functions are actually named
  500.     something starting with __ and the normal name is an alias.  */
  501. #if defined (__stub_tmpfile) || defined (__stub___tmpfile)
  502. choke me
  503. #else
  504. /* Override any gcc2 internal prototype to avoid an error.  */
  505. extern char tmpfile(); tmpfile();
  506. #endif
  507.  }
  508. EOF
  509. if eval $compile; then
  510.   rm -rf conftest*
  511.   {
  512. test -n "$verbose" && \
  513. echo "    defining HAVE_TMPFILE"
  514. echo "#define" HAVE_TMPFILE 1 >> confdefs.h
  515. DEFS="$DEFS -DHAVE_TMPFILE=1"
  516. }
  517.  
  518.  
  519. else
  520.   rm -rf conftest*
  521.   tmpfile_missing=1
  522. fi
  523. rm -f conftest*
  524.  
  525. if test -n "$tmpfile_missing"; then
  526.   echo checking for mkstemp
  527. cat > conftest.c <<EOF
  528. #include "confdefs.h"
  529. #include <ctype.h>
  530. int main() { exit(0); }
  531. int t() { 
  532. /* The GNU C library defines this for functions which it implements
  533.     to always fail with ENOSYS.  Some functions are actually named
  534.     something starting with __ and the normal name is an alias.  */
  535. #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
  536. choke me
  537. #else
  538. /* Override any gcc2 internal prototype to avoid an error.  */
  539. extern char mkstemp(); mkstemp();
  540. #endif
  541.  }
  542. EOF
  543. if eval $compile; then
  544.   rm -rf conftest*
  545.   {
  546. test -n "$verbose" && \
  547. echo "    defining HAVE_MKSTEMP"
  548. echo "#define" HAVE_MKSTEMP 1 >> confdefs.h
  549. DEFS="$DEFS -DHAVE_MKSTEMP=1"
  550. }
  551.  
  552.  
  553. fi
  554. rm -f conftest*
  555.  
  556. fi
  557.  
  558. echo checking for vprintf
  559. cat > conftest.c <<EOF
  560. #include "confdefs.h"
  561.  
  562. int main() { exit(0); }
  563. int t() { vprintf(); }
  564. EOF
  565. if eval $compile; then
  566.   rm -rf conftest*
  567.   
  568. {
  569. test -n "$verbose" && \
  570. echo "    defining HAVE_VPRINTF"
  571. echo "#define" HAVE_VPRINTF 1 >> confdefs.h
  572. DEFS="$DEFS -DHAVE_VPRINTF=1"
  573. }
  574.  
  575.  
  576. else
  577.   rm -rf conftest*
  578.   vprintf_missing=1
  579. fi
  580. rm -f conftest*
  581.  
  582. if test -n "$vprintf_missing"; then
  583. echo checking for _doprnt
  584. cat > conftest.c <<EOF
  585. #include "confdefs.h"
  586.  
  587. int main() { exit(0); }
  588. int t() { _doprnt(); }
  589. EOF
  590. if eval $compile; then
  591.   rm -rf conftest*
  592.   
  593. {
  594. test -n "$verbose" && \
  595. echo "    defining HAVE_DOPRNT"
  596. echo "#define" HAVE_DOPRNT 1 >> confdefs.h
  597. DEFS="$DEFS -DHAVE_DOPRNT=1"
  598. }
  599.  
  600.  
  601. fi
  602. rm -f conftest*
  603.  
  604. fi
  605.  
  606. echo checking for strerror
  607. cat > conftest.c <<EOF
  608. #include "confdefs.h"
  609. #include <ctype.h>
  610. int main() { exit(0); }
  611. int t() { 
  612. /* The GNU C library defines this for functions which it implements
  613.     to always fail with ENOSYS.  Some functions are actually named
  614.     something starting with __ and the normal name is an alias.  */
  615. #if defined (__stub_strerror) || defined (__stub___strerror)
  616. choke me
  617. #else
  618. /* Override any gcc2 internal prototype to avoid an error.  */
  619. extern char strerror(); strerror();
  620. #endif
  621.  }
  622. EOF
  623. if eval $compile; then
  624.   :
  625. fi
  626. rm -f conftest*
  627.  
  628. # Define HAVE_EFGCVT if [efg]cvt(3), =2 if declared in <stdlib.h>.
  629. echo '#include "confdefs.h"
  630. #include <stdlib.h>' > conftest.c
  631. eval "$CPP conftest.c > conftest.out 2>&1"
  632. if egrep "ecvt" conftest.out >/dev/null 2>&1; then
  633.   rm -rf conftest*
  634.   
  635. {
  636. test -n "$verbose" && \
  637. echo "    defining" HAVE_EFGCVT to be 2
  638. echo "#define" HAVE_EFGCVT 2 >> confdefs.h
  639. DEFS="$DEFS -DHAVE_EFGCVT=2"
  640. }
  641.  
  642.  
  643. else
  644.   rm -rf conftest*
  645.   echo checking for ecvt
  646. cat > conftest.c <<EOF
  647. #include "confdefs.h"
  648. #include <ctype.h>
  649. int main() { exit(0); }
  650. int t() { 
  651. /* The GNU C library defines this for functions which it implements
  652.     to always fail with ENOSYS.  Some functions are actually named
  653.     something starting with __ and the normal name is an alias.  */
  654. #if defined (__stub_ecvt) || defined (__stub___ecvt)
  655. choke me
  656. #else
  657. /* Override any gcc2 internal prototype to avoid an error.  */
  658. extern char ecvt(); ecvt();
  659. #endif
  660.  }
  661. EOF
  662. if eval $compile; then
  663.   rm -rf conftest*
  664.   {
  665. test -n "$verbose" && \
  666. echo "    defining HAVE_EFGCVT"
  667. echo "#define" HAVE_EFGCVT 1 >> confdefs.h
  668. DEFS="$DEFS -DHAVE_EFGCVT=1"
  669. }
  670.  
  671.  
  672. fi
  673. rm -f conftest*
  674.  
  675. fi
  676. rm -f conftest*
  677.  
  678. for func in vfprintf
  679. do
  680. echo checking for ${func}
  681. cat > conftest.c <<EOF
  682. #include "confdefs.h"
  683. #include <ctype.h>
  684. int main() { exit(0); }
  685. int t() { 
  686. /* The GNU C library defines this for functions which it implements
  687.     to always fail with ENOSYS.  Some functions are actually named
  688.     something starting with __ and the normal name is an alias.  */
  689. #if defined (__stub_${func}) || defined (__stub___${func})
  690. choke me
  691. #else
  692. /* Override any gcc2 internal prototype to avoid an error.  */
  693. extern char ${func}(); ${func}();
  694. #endif
  695.  }
  696. EOF
  697. if eval $compile; then
  698.   :
  699. else
  700.   rm -rf conftest*
  701.   LIBOBJS="$LIBOBJS ${func}.o"
  702. test -n "$verbose" && echo "    using ${func}.o instead"
  703. fi
  704. rm -f conftest*
  705.  
  706. done
  707.  
  708. case "$LIBOBJS" in
  709. *vfprintf.o*) for func in _doprnt
  710. do
  711. echo checking for ${func}
  712. cat > conftest.c <<EOF
  713. #include "confdefs.h"
  714. #include <ctype.h>
  715. int main() { exit(0); }
  716. int t() { 
  717. /* The GNU C library defines this for functions which it implements
  718.     to always fail with ENOSYS.  Some functions are actually named
  719.     something starting with __ and the normal name is an alias.  */
  720. #if defined (__stub_${func}) || defined (__stub___${func})
  721. choke me
  722. #else
  723. /* Override any gcc2 internal prototype to avoid an error.  */
  724. extern char ${func}(); ${func}();
  725. #endif
  726.  }
  727. EOF
  728. if eval $compile; then
  729.   :
  730. else
  731.   rm -rf conftest*
  732.   LIBOBJS="$LIBOBJS ${func}.o"
  733. test -n "$verbose" && echo "    using ${func}.o instead"
  734. fi
  735. rm -f conftest*
  736.  
  737. done
  738.  ;;
  739. esac
  740.  
  741. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  742. # for constant arguments.  Useless!
  743. echo checking for working alloca.h
  744. cat > conftest.c <<EOF
  745. #include "confdefs.h"
  746. #include <alloca.h>
  747. int main() { exit(0); }
  748. int t() { char *p = alloca(2 * sizeof(int)); }
  749. EOF
  750. if eval $compile; then
  751.   rm -rf conftest*
  752.   
  753. {
  754. test -n "$verbose" && \
  755. echo "    defining HAVE_ALLOCA_H"
  756. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  757. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  758. }
  759.  
  760.  
  761. fi
  762. rm -f conftest*
  763.  
  764. decl="#ifdef __GNUC__
  765. #define alloca __builtin_alloca
  766. #else
  767. #if HAVE_ALLOCA_H
  768. #include <alloca.h>
  769. #else
  770. #ifdef _AIX
  771.  #pragma alloca
  772. #else
  773. char *alloca ();
  774. #endif
  775. #endif
  776. #endif
  777. "
  778. echo checking for alloca
  779. cat > conftest.c <<EOF
  780. #include "confdefs.h"
  781. $decl
  782. int main() { exit(0); }
  783. int t() { char *p = (char *) alloca(1); }
  784. EOF
  785. if eval $compile; then
  786.   :
  787. else
  788.   rm -rf conftest*
  789.   alloca_missing=1
  790. cat > conftest.c <<EOF
  791. #include "confdefs.h"
  792.  
  793. #if defined(CRAY) && ! defined(CRAY2)
  794. winnitude
  795. #else
  796. lossage
  797. #endif
  798.  
  799. EOF
  800. eval "$CPP conftest.c > conftest.out 2>&1"
  801. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  802.   rm -rf conftest*
  803.   echo checking for _getb67
  804. cat > conftest.c <<EOF
  805. #include "confdefs.h"
  806. #include <ctype.h>
  807. int main() { exit(0); }
  808. int t() { 
  809. /* The GNU C library defines this for functions which it implements
  810.     to always fail with ENOSYS.  Some functions are actually named
  811.     something starting with __ and the normal name is an alias.  */
  812. #if defined (__stub__getb67) || defined (__stub____getb67)
  813. choke me
  814. #else
  815. /* Override any gcc2 internal prototype to avoid an error.  */
  816. extern char _getb67(); _getb67();
  817. #endif
  818.  }
  819. EOF
  820. if eval $compile; then
  821.   rm -rf conftest*
  822.   {
  823. test -n "$verbose" && \
  824. echo "    defining" CRAY_STACKSEG_END to be _getb67
  825. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  826. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  827. }
  828.  
  829.  
  830. else
  831.   rm -rf conftest*
  832.   echo checking for GETB67
  833. cat > conftest.c <<EOF
  834. #include "confdefs.h"
  835. #include <ctype.h>
  836. int main() { exit(0); }
  837. int t() { 
  838. /* The GNU C library defines this for functions which it implements
  839.     to always fail with ENOSYS.  Some functions are actually named
  840.     something starting with __ and the normal name is an alias.  */
  841. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  842. choke me
  843. #else
  844. /* Override any gcc2 internal prototype to avoid an error.  */
  845. extern char GETB67(); GETB67();
  846. #endif
  847.  }
  848. EOF
  849. if eval $compile; then
  850.   rm -rf conftest*
  851.   {
  852. test -n "$verbose" && \
  853. echo "    defining" CRAY_STACKSEG_END to be GETB67
  854. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  855. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  856. }
  857.  
  858.  
  859. else
  860.   rm -rf conftest*
  861.   echo checking for getb67
  862. cat > conftest.c <<EOF
  863. #include "confdefs.h"
  864. #include <ctype.h>
  865. int main() { exit(0); }
  866. int t() { 
  867. /* The GNU C library defines this for functions which it implements
  868.     to always fail with ENOSYS.  Some functions are actually named
  869.     something starting with __ and the normal name is an alias.  */
  870. #if defined (__stub_getb67) || defined (__stub___getb67)
  871. choke me
  872. #else
  873. /* Override any gcc2 internal prototype to avoid an error.  */
  874. extern char getb67(); getb67();
  875. #endif
  876.  }
  877. EOF
  878. if eval $compile; then
  879.   rm -rf conftest*
  880.   {
  881. test -n "$verbose" && \
  882. echo "    defining" CRAY_STACKSEG_END to be getb67
  883. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  884. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  885. }
  886.  
  887.  
  888. fi
  889. rm -f conftest*
  890.  
  891. fi
  892. rm -f conftest*
  893.  
  894. fi
  895. rm -f conftest*
  896.  
  897.  
  898. fi
  899. rm -f conftest*
  900.  
  901.  
  902. fi
  903. rm -f conftest*
  904.  
  905. if test -n "$alloca_missing"; then
  906.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  907.   # that cause trouble.  Some versions do not even contain alloca or
  908.   # contain a buggy version.  If you still want to use their alloca,
  909.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  910.   ALLOCA=alloca.o
  911.   
  912. {
  913. test -n "$verbose" && \
  914. echo "    defining C_ALLOCA"
  915. echo "#define" C_ALLOCA 1 >> confdefs.h
  916. DEFS="$DEFS -DC_ALLOCA=1"
  917. }
  918.  
  919.  
  920.   echo 'checking stack direction for C alloca'
  921.   echo checking whether cross-compiling
  922. # If we cannot run a trivial program, we must be cross compiling.
  923. cat > conftest.c <<EOF
  924. #include "confdefs.h"
  925. main(){exit(0);}
  926. EOF
  927. eval $compile
  928. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  929.   :
  930. else
  931.   cross_compiling=1
  932. fi
  933. rm -fr conftest*
  934.  
  935. if test -n "$cross_compiling"
  936. then
  937.   
  938. {
  939. test -n "$verbose" && \
  940. echo "    defining" STACK_DIRECTION to be 0
  941. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  942. DEFS="$DEFS -DSTACK_DIRECTION=0"
  943. }
  944.  
  945. else
  946. cat > conftest.c <<EOF
  947. #include "confdefs.h"
  948. find_stack_direction ()
  949. {
  950.   static char *addr = 0;
  951.   auto char dummy;
  952.   if (addr == 0)
  953.     {
  954.       addr = &dummy;
  955.       return find_stack_direction ();
  956.     }
  957.   else
  958.     return (&dummy > addr) ? 1 : -1;
  959. }
  960. main ()
  961. {
  962.   exit (find_stack_direction() < 0);
  963. }
  964. EOF
  965. eval $compile
  966. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  967.   
  968. {
  969. test -n "$verbose" && \
  970. echo "    defining" STACK_DIRECTION to be 1
  971. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  972. DEFS="$DEFS -DSTACK_DIRECTION=1"
  973. }
  974.  
  975.  
  976. else
  977.   
  978. {
  979. test -n "$verbose" && \
  980. echo "    defining" STACK_DIRECTION to be -1
  981. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  982. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  983. }
  984.  
  985. fi
  986. fi
  987. rm -fr conftest*
  988. fi
  989.  
  990.  
  991. # Set default prefixes.
  992. if test -n "$prefix"; then
  993.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  994.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  995. fi
  996. if test -n "$exec_prefix"; then
  997.   prsub="$prsub
  998. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  999. fi
  1000. # Quote sed substitution magic chars in DEFS.
  1001. cat >conftest.def <<EOF
  1002. $DEFS
  1003. EOF
  1004. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  1005. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  1006. rm -f conftest.def
  1007. # Substitute for predefined variables.
  1008.  
  1009. trap 'rm -f config.status; exit 1' 1 3 15
  1010. echo creating config.status
  1011. rm -f config.status
  1012. cat > config.status <<EOF
  1013. #!/bin/sh
  1014. # Generated automatically by configure.
  1015. # Run this file to recreate the current configuration.
  1016. # This directory was configured as follows,
  1017. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1018. #
  1019. # $0 $configure_args
  1020.  
  1021. for arg
  1022. do
  1023.   case "\$arg" in
  1024.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1025.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  1026.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  1027.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1028.   esac
  1029. done
  1030.  
  1031. trap 'rm -f Makefile lib/Makefile checks/Makefile; exit 1' 1 3 15
  1032. CC='$CC'
  1033. RANLIB='$RANLIB'
  1034. INSTALL='$INSTALL'
  1035. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1036. INSTALL_DATA='$INSTALL_DATA'
  1037. AWK='$AWK'
  1038. CPP='$CPP'
  1039. U='$U'
  1040. LIBOBJS='$LIBOBJS'
  1041. ALLOCA='$ALLOCA'
  1042. LIBS='$LIBS'
  1043. srcdir='$srcdir'
  1044. DEFS='$DEFS'
  1045. prefix='$prefix'
  1046. exec_prefix='$exec_prefix'
  1047. prsub='$prsub'
  1048. extrasub='$extrasub'
  1049. EOF
  1050. cat >> config.status <<\EOF
  1051.  
  1052. top_srcdir=$srcdir
  1053.  
  1054. CONFIG_FILES=${CONFIG_FILES-"Makefile lib/Makefile checks/Makefile"}
  1055. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  1056.   srcdir=$top_srcdir
  1057.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1058.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1059.   if test "$dir" != "$file"; then
  1060.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1061.     test ! -d $dir && mkdir $dir
  1062.   fi
  1063.   echo creating $file
  1064.   rm -f $file
  1065.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1066.   sed -e "
  1067. $prsub
  1068. $extrasub
  1069. s%@CC@%$CC%g
  1070. s%@RANLIB@%$RANLIB%g
  1071. s%@INSTALL@%$INSTALL%g
  1072. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1073. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1074. s%@AWK@%$AWK%g
  1075. s%@CPP@%$CPP%g
  1076. s%@U@%$U%g
  1077. s%@LIBOBJS@%$LIBOBJS%g
  1078. s%@ALLOCA@%$ALLOCA%g
  1079. s%@LIBS@%$LIBS%g
  1080. s%@srcdir@%$srcdir%g
  1081. s%@DEFS@%$DEFS%
  1082. " $top_srcdir/${file}.in >> $file
  1083. fi; done
  1084.  
  1085.  
  1086. exit 0
  1087. EOF
  1088. chmod +x config.status
  1089. ${CONFIG_SHELL-/bin/sh} config.status
  1090.  
  1091.