home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / useful / dist / gnu / textutils / textutils-1.9-amiga / configure < prev    next >
Encoding:
Text File  |  1993-12-14  |  39.6 KB  |  1,570 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.        "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-gcc} $CFLAGS conftest.c -o conftest $LIBS"
  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=src/fold.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.  
  133. # We want these before the checks, so the checks can modify their values.
  134. CFLAGS="-O"    #HACK (fnf)
  135. LDFLAGS=""    #HACK (fnf)
  136. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
  137. test -z "$LDFLAGS" && LDFLAGS=-g
  138.  
  139. if test -z "$CC"; then
  140.   # Extract the first word of `gcc', so it can be a program name with args.
  141.   set dummy gcc; word=$2
  142.   echo checking for $word
  143.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  144.   for dir in $PATH; do
  145.     test -z "$dir" && dir=.
  146.     if test -f $dir/$word; then
  147.       CC="gcc"
  148.       break
  149.     fi
  150.   done
  151.   IFS="$saveifs"
  152. fi
  153. test -z "$CC" && CC="cc"
  154. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  155.  
  156. # Find out if we are using GNU C, under whatever name.
  157. cat > conftest.c <<EOF
  158. #ifdef __GNUC__
  159.   yes
  160. #endif
  161. EOF
  162. ${CC-gcc} -E conftest.c > conftest.out 2>&1
  163. if egrep yes conftest.out >/dev/null 2>&1; then
  164.   GCC=1 # For later tests.
  165. fi
  166. rm -f conftest*
  167.  
  168.  
  169. # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  170. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
  171.  
  172.  
  173. echo checking how to run the C preprocessor
  174. CPP="/lib/gcc-lib/amigados/2.3.3/cpp"    #HACK
  175. if test -z "$CPP"; then
  176.   # This must be in double quotes, not single quotes, because CPP may get
  177.   # substituted into the Makefile and ``${CC-gcc}'' will simply confuse
  178.   # make.  It must be expanded now.
  179.   CPP="${CC-gcc} -E"
  180.   cat > conftest.c <<EOF
  181. #include "confdefs.h"
  182. #include <stdio.h>
  183. Syntax Error
  184. EOF
  185. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  186. if test -z "$err"; then
  187.   :
  188. else
  189.   rm -rf conftest*
  190.   CPP=/lib/cpp
  191. fi
  192. rm -f conftest*
  193. fi
  194. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  195.  
  196. if test -n "$GCC"; then
  197.   echo checking whether -traditional is needed
  198.   pattern="Autoconf.*'x'"
  199.   prog='#include <sgtty.h>
  200. Autoconf TIOCGETP'
  201.   cat > conftest.c <<EOF
  202. #include "confdefs.h"
  203. $prog
  204. EOF
  205. eval "$CPP conftest.c > conftest.out 2>&1"
  206. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  207.   rm -rf conftest*
  208.   need_trad=1
  209.  
  210. fi
  211. rm -f conftest*
  212.  
  213.  
  214.   if test -z "$need_trad"; then
  215.     prog='#include <termio.h>
  216. Autoconf TCGETA'
  217.     cat > conftest.c <<EOF
  218. #include "confdefs.h"
  219. $prog
  220. EOF
  221. eval "$CPP conftest.c > conftest.out 2>&1"
  222. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  223.   rm -rf conftest*
  224.   need_trad=1
  225.  
  226. fi
  227. rm -f conftest*
  228.  
  229.   fi
  230.   test -n "$need_trad" && CC="$CC -traditional"
  231. fi
  232.  
  233. # Make sure to not get the incompatible SysV /etc/install and
  234. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  235. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  236. # or the AFS install, which mishandles nonexistent args, or
  237. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  238. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  239. # anyway.  Sigh.
  240. INSTALL=/bin/ginstall    #HACK (fnf)
  241. if test "z${INSTALL}" = "z" ; then
  242.   echo checking for install
  243.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  244.   for dir in $PATH; do
  245.     test -z "$dir" && dir=.
  246.     case $dir in
  247.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  248.     *)
  249.       if test -f $dir/installbsd; then
  250.     INSTALL="$dir/installbsd -c" # OSF1
  251.     INSTALL_PROGRAM='$(INSTALL)'
  252.     INSTALL_DATA='$(INSTALL) -m 644'
  253.     break
  254.       fi
  255.       if test -f $dir/install; then
  256.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  257.       : # AIX
  258.     else
  259.       INSTALL="$dir/install -c"
  260.       INSTALL_PROGRAM='$(INSTALL)'
  261.       INSTALL_DATA='$(INSTALL) -m 644'
  262.       break
  263.     fi
  264.       fi
  265.       ;;
  266.     esac
  267.   done
  268.   IFS="$saveifs"
  269. fi
  270. INSTALL=${INSTALL-cp}
  271. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  272. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  273. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  274. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  275. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  276.  
  277. if test -z "$RANLIB"; then
  278.   # Extract the first word of `ranlib', so it can be a program name with args.
  279.   set dummy ranlib; word=$2
  280.   echo checking for $word
  281.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  282.   for dir in $PATH; do
  283.     test -z "$dir" && dir=.
  284.     if test -f $dir/$word; then
  285.       RANLIB="ranlib"
  286.       break
  287.     fi
  288.   done
  289.   IFS="$saveifs"
  290. fi
  291. test -z "$RANLIB" && RANLIB=":"
  292. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  293.  
  294. echo checking for AIX
  295. cat > conftest.c <<EOF
  296. #include "confdefs.h"
  297. #ifdef _AIX
  298.   yes
  299. #endif
  300.  
  301. EOF
  302. eval "$CPP conftest.c > conftest.out 2>&1"
  303. if egrep "yes" conftest.out >/dev/null 2>&1; then
  304.   rm -rf conftest*
  305.   
  306. {
  307. test -n "$verbose" && \
  308. echo "    defining _ALL_SOURCE"
  309. echo "#define" _ALL_SOURCE 1 >> confdefs.h
  310. DEFS="$DEFS -D_ALL_SOURCE=1"
  311. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  312. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  313. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  314. "
  315. }
  316.  
  317.  
  318. fi
  319. rm -f conftest*
  320.  
  321.  
  322. echo checking for minix/config.h
  323. cat > conftest.c <<EOF
  324. #include "confdefs.h"
  325. #include <minix/config.h>
  326. EOF
  327. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  328. if test -z "$err"; then
  329.   rm -rf conftest*
  330.   MINIX=1
  331.  
  332. fi
  333. rm -f conftest*
  334.  
  335. # The Minix shell can't assign to the same variable on the same line!
  336. if test -n "$MINIX"; then
  337.   
  338. {
  339. test -n "$verbose" && \
  340. echo "    defining _POSIX_SOURCE"
  341. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  342. DEFS="$DEFS -D_POSIX_SOURCE=1"
  343. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  344. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  345. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  346. "
  347. }
  348.  
  349.   
  350. {
  351. test -n "$verbose" && \
  352. echo "    defining" _POSIX_1_SOURCE to be 2
  353. echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
  354. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  355. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  356. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  357. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  358. "
  359. }
  360.  
  361.   
  362. {
  363. test -n "$verbose" && \
  364. echo "    defining _MINIX"
  365. echo "#define" _MINIX 1 >> confdefs.h
  366. DEFS="$DEFS -D_MINIX=1"
  367. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  368. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  369. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  370. "
  371. }
  372.  
  373. fi
  374.  
  375. echo checking for POSIXized ISC
  376. if test -d /etc/conf/kconfig.d &&
  377.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  378. then
  379.   ISC=1 # If later tests want to check for ISC.
  380.   
  381. {
  382. test -n "$verbose" && \
  383. echo "    defining _POSIX_SOURCE"
  384. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  385. DEFS="$DEFS -D_POSIX_SOURCE=1"
  386. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  387. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  388. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  389. "
  390. }
  391.  
  392.   if test -n "$GCC"; then
  393.     CC="$CC -posix"
  394.   else
  395.     CC="$CC -Xp"
  396.   fi
  397. fi
  398.  
  399. echo checking for return type of signal handlers
  400. cat > conftest.c <<EOF
  401. #include "confdefs.h"
  402. #include <sys/types.h>
  403. #include <signal.h>
  404. #ifdef signal
  405. #undef signal
  406. #endif
  407. extern void (*signal ()) ();
  408. int main() { exit(0); }
  409. int t() { int i; }
  410. EOF
  411. if $compile; then
  412.   rm -rf conftest*
  413.   
  414. {
  415. test -n "$verbose" && \
  416. echo "    defining" RETSIGTYPE to be void
  417. echo "#define" RETSIGTYPE void >> confdefs.h
  418. DEFS="$DEFS -DRETSIGTYPE=void"
  419. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  420. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  421. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  422. "
  423. }
  424.  
  425.  
  426. else
  427.   rm -rf conftest*
  428.   
  429. {
  430. test -n "$verbose" && \
  431. echo "    defining" RETSIGTYPE to be int
  432. echo "#define" RETSIGTYPE int >> confdefs.h
  433. DEFS="$DEFS -DRETSIGTYPE=int"
  434. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  435. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  436. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  437. "
  438. }
  439.  
  440. fi
  441. rm -f conftest*
  442.  
  443.  
  444. echo checking for size_t in sys/types.h
  445. echo '#include "confdefs.h"
  446. #include <sys/types.h>' > conftest.c
  447. eval "$CPP conftest.c > conftest.out 2>&1"
  448. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  449.   :
  450. else
  451.   rm -rf conftest*
  452.   
  453. {
  454. test -n "$verbose" && \
  455. echo "    defining" size_t to be unsigned
  456. echo "#define" size_t unsigned >> confdefs.h
  457. DEFS="$DEFS -Dsize_t=unsigned"
  458. SEDDEFS="${SEDDEFS}\${SEDdA}size_t\${SEDdB}size_t\${SEDdC}unsigned\${SEDdD}
  459. \${SEDuA}size_t\${SEDuB}size_t\${SEDuC}unsigned\${SEDuD}
  460. \${SEDeA}size_t\${SEDeB}size_t\${SEDeC}unsigned\${SEDeD}
  461. "
  462. }
  463.  
  464. fi
  465. rm -f conftest*
  466.  
  467. prog='/* Ultrix mips cc rejects this.  */
  468. typedef int charset[2]; const charset x;
  469. /* SunOS 4.1.1 cc rejects this.  */
  470. char const *const *ccp;
  471. char **p;
  472. /* AIX XL C 1.02.0.0 rejects this.
  473.    It does not let you subtract one const X* pointer from another in an arm
  474.    of an if-expression whose if-part is not a constant expression */
  475. const char *g = "string";
  476. ccp = &g + (g ? g-g : 0);
  477. /* HPUX 7.0 cc rejects these. */
  478. ++ccp;
  479. p = (char**) ccp;
  480. ccp = (char const *const *) p;
  481. { /* SCO 3.2v4 cc rejects this.  */
  482.   char *t;
  483.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  484.  
  485.   *t++ = 0;
  486. }
  487. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  488.   int x[] = {25,17};
  489.   const int *foo = &x[0];
  490.   ++foo;
  491. }
  492. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  493.   typedef const int *iptr;
  494.   iptr p = 0;
  495.   ++p;
  496. }
  497. { /* AIX XL C 1.02.0.0 rejects this saying
  498.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  499.   struct s { int j; const int *ap[3]; };
  500.   struct s *b; b->j = 5;
  501. }
  502. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  503.   const int foo = 10;
  504. }'
  505. echo checking for lack of working const
  506. cat > conftest.c <<EOF
  507. #include "confdefs.h"
  508.  
  509. int main() { exit(0); }
  510. int t() { $prog }
  511. EOF
  512. if $compile; then
  513.   :
  514. else
  515.   rm -rf conftest*
  516.   
  517. {
  518. test -n "$verbose" && \
  519. echo "    defining" const to be empty
  520. echo "#define" const  >> confdefs.h
  521. DEFS="$DEFS -Dconst="
  522. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  523. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  524. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  525. "
  526. }
  527.  
  528. fi
  529. rm -f conftest*
  530.  
  531. echo checking for long double
  532. if test -n "$GCC"; then
  533.  
  534. {
  535. test -n "$verbose" && \
  536. echo "    defining HAVE_LONG_DOUBLE"
  537. echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
  538. DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
  539. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_DOUBLE\${SEDdB}HAVE_LONG_DOUBLE\${SEDdC}1\${SEDdD}
  540. \${SEDuA}HAVE_LONG_DOUBLE\${SEDuB}HAVE_LONG_DOUBLE\${SEDuC}1\${SEDuD}
  541. \${SEDeA}HAVE_LONG_DOUBLE\${SEDeB}HAVE_LONG_DOUBLE\${SEDeC}1\${SEDeD}
  542. "
  543. }
  544.  
  545. else
  546. cat > conftest.c <<EOF
  547. #include "confdefs.h"
  548. int main() {
  549. /* The Stardent Vistra knows sizeof(long double), but doesn't support it.  */
  550. long double foo = 0.0;
  551. /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
  552. exit(sizeof(long double) < sizeof(double)); }
  553. EOF
  554. $compile
  555. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  556.   
  557. {
  558. test -n "$verbose" && \
  559. echo "    defining HAVE_LONG_DOUBLE"
  560. echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
  561. DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
  562. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_DOUBLE\${SEDdB}HAVE_LONG_DOUBLE\${SEDdC}1\${SEDdD}
  563. \${SEDuA}HAVE_LONG_DOUBLE\${SEDuB}HAVE_LONG_DOUBLE\${SEDuC}1\${SEDuD}
  564. \${SEDeA}HAVE_LONG_DOUBLE\${SEDeB}HAVE_LONG_DOUBLE\${SEDeC}1\${SEDeD}
  565. "
  566. }
  567.  
  568.  
  569. fi
  570. rm -fr conftest*
  571. fi
  572.  
  573. echo checking for 64-bit long ints
  574. cat > conftest.c <<EOF
  575. #include "confdefs.h"
  576. main() { exit(sizeof(long int) != 8); }
  577. EOF
  578. $compile
  579. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  580.   
  581. {
  582. test -n "$verbose" && \
  583. echo "    defining LONG_64_BITS"
  584. echo "#define" LONG_64_BITS 1 >> confdefs.h
  585. DEFS="$DEFS -DLONG_64_BITS=1"
  586. SEDDEFS="${SEDDEFS}\${SEDdA}LONG_64_BITS\${SEDdB}LONG_64_BITS\${SEDdC}1\${SEDdD}
  587. \${SEDuA}LONG_64_BITS\${SEDuB}LONG_64_BITS\${SEDuC}1\${SEDuD}
  588. \${SEDeA}LONG_64_BITS\${SEDeB}LONG_64_BITS\${SEDeC}1\${SEDeD}
  589. "
  590. }
  591.  
  592.  
  593. fi
  594. rm -fr conftest*
  595.  
  596. echo checking for ANSI C header files
  597. cat > conftest.c <<EOF
  598. #include "confdefs.h"
  599. #include <stdlib.h>
  600. #include <stdarg.h>
  601. #include <string.h>
  602. #include <float.h>
  603. EOF
  604. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  605. if test -z "$err"; then
  606.   rm -rf conftest*
  607.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  608. echo '#include "confdefs.h"
  609. #include <string.h>' > conftest.c
  610. eval "$CPP conftest.c > conftest.out 2>&1"
  611. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  612.   rm -rf conftest*
  613.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  614. cat > conftest.c <<EOF
  615. #include "confdefs.h"
  616. #include <ctype.h>
  617. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  618. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  619. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  620. int main () { int i; for (i = 0; i < 256; i++)
  621. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  622. exit (0); }
  623.  
  624. EOF
  625. $compile
  626. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  627.   
  628. {
  629. test -n "$verbose" && \
  630. echo "    defining STDC_HEADERS"
  631. echo "#define" STDC_HEADERS 1 >> confdefs.h
  632. DEFS="$DEFS -DSTDC_HEADERS=1"
  633. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  634. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  635. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  636. "
  637. }
  638.  
  639.  
  640. fi
  641. rm -fr conftest*
  642.  
  643. fi
  644. rm -f conftest*
  645.  
  646.  
  647. fi
  648. rm -f conftest*
  649.  
  650. echo checking byte ordering
  651. cat > conftest.c <<EOF
  652. #include "confdefs.h"
  653. main () {
  654.   /* Are we little or big endian?  From Harbison&Steele.  */
  655.   union
  656.   {
  657.     long l;
  658.     char c[sizeof (long)];
  659.   } u;
  660.   u.l = 1;
  661.   exit (u.c[sizeof (long) - 1] == 1);
  662. }
  663. EOF
  664. $compile
  665. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  666.   :
  667. else
  668.   
  669. {
  670. test -n "$verbose" && \
  671. echo "    defining WORDS_BIGENDIAN"
  672. echo "#define" WORDS_BIGENDIAN 1 >> confdefs.h
  673. DEFS="$DEFS -DWORDS_BIGENDIAN=1"
  674. SEDDEFS="${SEDDEFS}\${SEDdA}WORDS_BIGENDIAN\${SEDdB}WORDS_BIGENDIAN\${SEDdC}1\${SEDdD}
  675. \${SEDuA}WORDS_BIGENDIAN\${SEDuB}WORDS_BIGENDIAN\${SEDuC}1\${SEDuD}
  676. \${SEDeA}WORDS_BIGENDIAN\${SEDeB}WORDS_BIGENDIAN\${SEDeC}1\${SEDeD}
  677. "
  678. }
  679.  
  680. fi
  681. rm -fr conftest*
  682.  
  683. echo checking for broken stat file mode macros
  684. cat > conftest.c <<EOF
  685. #include "confdefs.h"
  686. #include <sys/types.h>
  687. #include <sys/stat.h>
  688. #ifdef S_ISBLK
  689. #if S_ISBLK (S_IFDIR)
  690. You lose.
  691. #endif
  692. #ifdef S_IFCHR
  693. #if S_ISBLK (S_IFCHR)
  694. You lose.
  695. #endif
  696. #endif /* S_IFCHR */
  697. #endif /* S_ISBLK */
  698. #ifdef S_ISLNK
  699. #if S_ISLNK (S_IFREG)
  700. You lose.
  701. #endif
  702. #endif /* S_ISLNK */
  703. #ifdef S_ISSOCK
  704. #if S_ISSOCK (S_IFREG)
  705. You lose.
  706. #endif
  707. #endif /* S_ISSOCK */
  708.  
  709. EOF
  710. eval "$CPP conftest.c > conftest.out 2>&1"
  711. if egrep "You lose" conftest.out >/dev/null 2>&1; then
  712.   rm -rf conftest*
  713.   
  714. {
  715. test -n "$verbose" && \
  716. echo "    defining STAT_MACROS_BROKEN"
  717. echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h
  718. DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
  719. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD}
  720. \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD}
  721. \${SEDeA}STAT_MACROS_BROKEN\${SEDeB}STAT_MACROS_BROKEN\${SEDeC}1\${SEDeD}
  722. "
  723. }
  724.  
  725.  
  726. fi
  727. rm -f conftest*
  728.  
  729. for hdr in limits.h string.h memory.h fcntl.h unistd.h
  730. do
  731. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  732. echo checking for ${hdr}
  733. cat > conftest.c <<EOF
  734. #include "confdefs.h"
  735. #include <${hdr}>
  736. EOF
  737. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  738. if test -z "$err"; then
  739.   rm -rf conftest*
  740.   
  741. {
  742. test -n "$verbose" && \
  743. echo "    defining ${trhdr}"
  744. echo "#define" ${trhdr} 1 >> confdefs.h
  745. DEFS="$DEFS -D${trhdr}=1"
  746. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  747. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  748. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  749. "
  750. }
  751.  
  752.  
  753. fi
  754. rm -f conftest*
  755. done
  756.  
  757. for func in bcopy memcmp memset stpcpy strtoul
  758. do
  759. echo checking for ${func}
  760. cat > conftest.c <<EOF
  761. #include "confdefs.h"
  762. #include <ctype.h>
  763. int main() { exit(0); }
  764. int t() { 
  765. /* The GNU C library defines this for functions which it implements
  766.     to always fail with ENOSYS.  Some functions are actually named
  767.     something starting with __ and the normal name is an alias.  */
  768. #if defined (__stub_${func}) || defined (__stub___${func})
  769. choke me
  770. #else
  771. /* Override any gcc2 internal prototype to avoid an error.  */
  772. extern char ${func}(); ${func}();
  773. #endif
  774.  }
  775. EOF
  776. if $compile; then
  777.   :
  778. else
  779.   rm -rf conftest*
  780.   LIBOBJS="$LIBOBJS ${func}.o"
  781. test -n "$verbose" && echo "    using ${func}.o instead"
  782. fi
  783. rm -f conftest*
  784.  
  785. done
  786.  
  787. echo "checking if memcmp is 8-bit clean"
  788. cat > conftest.c <<EOF
  789. #include "confdefs.h"
  790.  
  791. main()
  792. {
  793.   char c1 = 0x80, c2 = 0x81;
  794.   exit(memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
  795. }
  796.  
  797. EOF
  798. $compile
  799. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  800.   
  801. test -n "$verbose" && echo "    memcmp is 8-bit clean"
  802.  
  803.  
  804. else
  805.   
  806. test -n "$verbose" && echo "    memcmp is NOT 8-bit clean -- using replacement"
  807. case "$LIBOBJS" in
  808. *memcmp*) ;;
  809. *) LIBOBJS="$LIBOBJS memcmp.o" ;;
  810. esac
  811.  
  812. fi
  813. rm -fr conftest*
  814. for func in strerror
  815. do
  816. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  817. echo checking for ${func}
  818. cat > conftest.c <<EOF
  819. #include "confdefs.h"
  820. #include <ctype.h>
  821. int main() { exit(0); }
  822. int t() { 
  823. /* The GNU C library defines this for functions which it implements
  824.     to always fail with ENOSYS.  Some functions are actually named
  825.     something starting with __ and the normal name is an alias.  */
  826. #if defined (__stub_${func}) || defined (__stub___${func})
  827. choke me
  828. #else
  829. /* Override any gcc2 internal prototype to avoid an error.  */
  830. extern char ${func}(); ${func}();
  831. #endif
  832.  }
  833. EOF
  834. if $compile; then
  835.   rm -rf conftest*
  836.   {
  837. test -n "$verbose" && \
  838. echo "    defining ${trfunc}"
  839. echo "#define" ${trfunc} 1 >> confdefs.h
  840. DEFS="$DEFS -D${trfunc}=1"
  841. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  842. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  843. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  844. "
  845. }
  846.  
  847.  
  848. fi
  849. rm -f conftest*
  850. done
  851.  
  852. echo checking for vprintf
  853. cat > conftest.c <<EOF
  854. #include "confdefs.h"
  855.  
  856. int main() { exit(0); }
  857. int t() { vprintf(); }
  858. EOF
  859. if $compile; then
  860.   rm -rf conftest*
  861.   
  862. {
  863. test -n "$verbose" && \
  864. echo "    defining HAVE_VPRINTF"
  865. echo "#define" HAVE_VPRINTF 1 >> confdefs.h
  866. DEFS="$DEFS -DHAVE_VPRINTF=1"
  867. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
  868. \${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
  869. \${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
  870. "
  871. }
  872.  
  873.  
  874. else
  875.   rm -rf conftest*
  876.   vprintf_missing=1
  877. fi
  878. rm -f conftest*
  879.  
  880. if test -n "$vprintf_missing"; then
  881. echo checking for _doprnt
  882. cat > conftest.c <<EOF
  883. #include "confdefs.h"
  884.  
  885. int main() { exit(0); }
  886. int t() { _doprnt(); }
  887. EOF
  888. if $compile; then
  889.   rm -rf conftest*
  890.   
  891. {
  892. test -n "$verbose" && \
  893. echo "    defining HAVE_DOPRNT"
  894. echo "#define" HAVE_DOPRNT 1 >> confdefs.h
  895. DEFS="$DEFS -DHAVE_DOPRNT=1"
  896. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
  897. \${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
  898. \${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
  899. "
  900. }
  901.  
  902.  
  903. fi
  904. rm -f conftest*
  905.  
  906. fi
  907.  
  908. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  909. # for constant arguments.  Useless!
  910. echo checking for working alloca.h
  911. cat > conftest.c <<EOF
  912. #include "confdefs.h"
  913. #include <alloca.h>
  914. int main() { exit(0); }
  915. int t() { char *p = alloca(2 * sizeof(int)); }
  916. EOF
  917. if $compile; then
  918.   rm -rf conftest*
  919.   
  920. {
  921. test -n "$verbose" && \
  922. echo "    defining HAVE_ALLOCA_H"
  923. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  924. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  925. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  926. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  927. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  928. "
  929. }
  930.  
  931.  
  932. fi
  933. rm -f conftest*
  934.  
  935. decl="#ifdef __GNUC__
  936. #define alloca __builtin_alloca
  937. #else
  938. #if HAVE_ALLOCA_H
  939. #include <alloca.h>
  940. #else
  941. #ifdef _AIX
  942.  #pragma alloca
  943. #else
  944. char *alloca ();
  945. #endif
  946. #endif
  947. #endif
  948. "
  949. echo checking for alloca
  950. cat > conftest.c <<EOF
  951. #include "confdefs.h"
  952. $decl
  953. int main() { exit(0); }
  954. int t() { char *p = (char *) alloca(1); }
  955. EOF
  956. if $compile; then
  957.   :
  958. else
  959.   rm -rf conftest*
  960.   alloca_missing=1
  961. cat > conftest.c <<EOF
  962. #include "confdefs.h"
  963.  
  964. #if defined(CRAY) && ! defined(CRAY2)
  965. winnitude
  966. #else
  967. lossage
  968. #endif
  969.  
  970. EOF
  971. eval "$CPP conftest.c > conftest.out 2>&1"
  972. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  973.   rm -rf conftest*
  974.   echo checking for _getb67
  975. cat > conftest.c <<EOF
  976. #include "confdefs.h"
  977. #include <ctype.h>
  978. int main() { exit(0); }
  979. int t() { 
  980. /* The GNU C library defines this for functions which it implements
  981.     to always fail with ENOSYS.  Some functions are actually named
  982.     something starting with __ and the normal name is an alias.  */
  983. #if defined (__stub__getb67) || defined (__stub____getb67)
  984. choke me
  985. #else
  986. /* Override any gcc2 internal prototype to avoid an error.  */
  987. extern char _getb67(); _getb67();
  988. #endif
  989.  }
  990. EOF
  991. if $compile; then
  992.   rm -rf conftest*
  993.   {
  994. test -n "$verbose" && \
  995. echo "    defining" CRAY_STACKSEG_END to be _getb67
  996. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  997. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  998. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  999. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1000. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1001. "
  1002. }
  1003.  
  1004.  
  1005. else
  1006.   rm -rf conftest*
  1007.   echo checking for GETB67
  1008. cat > conftest.c <<EOF
  1009. #include "confdefs.h"
  1010. #include <ctype.h>
  1011. int main() { exit(0); }
  1012. int t() { 
  1013. /* The GNU C library defines this for functions which it implements
  1014.     to always fail with ENOSYS.  Some functions are actually named
  1015.     something starting with __ and the normal name is an alias.  */
  1016. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1017. choke me
  1018. #else
  1019. /* Override any gcc2 internal prototype to avoid an error.  */
  1020. extern char GETB67(); GETB67();
  1021. #endif
  1022.  }
  1023. EOF
  1024. if $compile; then
  1025.   rm -rf conftest*
  1026.   {
  1027. test -n "$verbose" && \
  1028. echo "    defining" CRAY_STACKSEG_END to be GETB67
  1029. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  1030. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1031. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1032. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1033. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1034. "
  1035. }
  1036.  
  1037.  
  1038. else
  1039.   rm -rf conftest*
  1040.   echo checking for getb67
  1041. cat > conftest.c <<EOF
  1042. #include "confdefs.h"
  1043. #include <ctype.h>
  1044. int main() { exit(0); }
  1045. int t() { 
  1046. /* The GNU C library defines this for functions which it implements
  1047.     to always fail with ENOSYS.  Some functions are actually named
  1048.     something starting with __ and the normal name is an alias.  */
  1049. #if defined (__stub_getb67) || defined (__stub___getb67)
  1050. choke me
  1051. #else
  1052. /* Override any gcc2 internal prototype to avoid an error.  */
  1053. extern char getb67(); getb67();
  1054. #endif
  1055.  }
  1056. EOF
  1057. if $compile; then
  1058.   rm -rf conftest*
  1059.   {
  1060. test -n "$verbose" && \
  1061. echo "    defining" CRAY_STACKSEG_END to be getb67
  1062. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  1063. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1064. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1065. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1066. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1067. "
  1068. }
  1069.  
  1070.  
  1071. fi
  1072. rm -f conftest*
  1073.  
  1074. fi
  1075. rm -f conftest*
  1076.  
  1077. fi
  1078. rm -f conftest*
  1079.  
  1080.  
  1081. fi
  1082. rm -f conftest*
  1083.  
  1084.  
  1085. fi
  1086. rm -f conftest*
  1087.  
  1088. if test -n "$alloca_missing"; then
  1089.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1090.   # that cause trouble.  Some versions do not even contain alloca or
  1091.   # contain a buggy version.  If you still want to use their alloca,
  1092.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1093.   ALLOCA=alloca.o
  1094.   
  1095. {
  1096. test -n "$verbose" && \
  1097. echo "    defining C_ALLOCA"
  1098. echo "#define" C_ALLOCA 1 >> confdefs.h
  1099. DEFS="$DEFS -DC_ALLOCA=1"
  1100. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  1101. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  1102. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  1103. "
  1104. }
  1105.  
  1106.  
  1107.   echo 'checking stack direction for C alloca'
  1108.   echo checking whether cross-compiling
  1109. # If we cannot run a trivial program, we must be cross compiling.
  1110. cat > conftest.c <<EOF
  1111. #include "confdefs.h"
  1112. main(){exit(0);}
  1113. EOF
  1114. $compile
  1115. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1116.   :
  1117. else
  1118.   cross_compiling=1
  1119. fi
  1120. rm -fr conftest*
  1121.  
  1122. if test -n "$cross_compiling"
  1123. then
  1124.   
  1125. {
  1126. test -n "$verbose" && \
  1127. echo "    defining" STACK_DIRECTION to be 0
  1128. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  1129. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1130. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1131. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1132. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1133. "
  1134. }
  1135.  
  1136. else
  1137. cat > conftest.c <<EOF
  1138. #include "confdefs.h"
  1139. find_stack_direction ()
  1140. {
  1141.   static char *addr = 0;
  1142.   auto char dummy;
  1143.   if (addr == 0)
  1144.     {
  1145.       addr = &dummy;
  1146.       return find_stack_direction ();
  1147.     }
  1148.   else
  1149.     return (&dummy > addr) ? 1 : -1;
  1150. }
  1151. main ()
  1152. {
  1153.   exit (find_stack_direction() < 0);
  1154. }
  1155. EOF
  1156. $compile
  1157. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1158.   
  1159. {
  1160. test -n "$verbose" && \
  1161. echo "    defining" STACK_DIRECTION to be 1
  1162. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  1163. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1164. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1165. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1166. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1167. "
  1168. }
  1169.  
  1170.  
  1171. else
  1172.   
  1173. {
  1174. test -n "$verbose" && \
  1175. echo "    defining" STACK_DIRECTION to be -1
  1176. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  1177. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1178. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1179. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1180. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1181. "
  1182. }
  1183.  
  1184. fi
  1185. fi
  1186. rm -fr conftest*
  1187. fi
  1188.  
  1189. echo checking for st_blksize in struct stat
  1190. cat > conftest.c <<EOF
  1191. #include "confdefs.h"
  1192. #include <sys/types.h>
  1193. #include <sys/stat.h>
  1194. int main() { exit(0); }
  1195. int t() { struct stat s; s.st_blksize; }
  1196. EOF
  1197. if $compile; then
  1198.   rm -rf conftest*
  1199.   
  1200. {
  1201. test -n "$verbose" && \
  1202. echo "    defining HAVE_ST_BLKSIZE"
  1203. echo "#define" HAVE_ST_BLKSIZE 1 >> confdefs.h
  1204. DEFS="$DEFS -DHAVE_ST_BLKSIZE=1"
  1205. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ST_BLKSIZE\${SEDdB}HAVE_ST_BLKSIZE\${SEDdC}1\${SEDdD}
  1206. \${SEDuA}HAVE_ST_BLKSIZE\${SEDuB}HAVE_ST_BLKSIZE\${SEDuC}1\${SEDuD}
  1207. \${SEDeA}HAVE_ST_BLKSIZE\${SEDeB}HAVE_ST_BLKSIZE\${SEDeC}1\${SEDeD}
  1208. "
  1209. }
  1210.  
  1211.  
  1212. fi
  1213. rm -f conftest*
  1214.  
  1215. echo checking for directory library header
  1216. dirheader=
  1217. if test -z "$dirheader"; then
  1218.   echo checking for dirent.h
  1219. cat > conftest.c <<EOF
  1220. #include "confdefs.h"
  1221. #include <sys/types.h>
  1222. #include <dirent.h>
  1223. int main() { exit(0); }
  1224. int t() { DIR *dirp = 0; }
  1225. EOF
  1226. if $compile; then
  1227.   rm -rf conftest*
  1228.   
  1229. {
  1230. test -n "$verbose" && \
  1231. echo "    defining DIRENT"
  1232. echo "#define" DIRENT 1 >> confdefs.h
  1233. DEFS="$DEFS -DDIRENT=1"
  1234. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  1235. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  1236. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  1237. "
  1238. }
  1239.  dirheader=dirent.h
  1240.  
  1241. fi
  1242. rm -f conftest*
  1243. fi
  1244. if test -z "$dirheader"; then
  1245.   echo checking for sys/ndir.h
  1246. cat > conftest.c <<EOF
  1247. #include "confdefs.h"
  1248. #include <sys/types.h>
  1249. #include <sys/ndir.h>
  1250. int main() { exit(0); }
  1251. int t() { DIR *dirp = 0; }
  1252. EOF
  1253. if $compile; then
  1254.   rm -rf conftest*
  1255.   
  1256. {
  1257. test -n "$verbose" && \
  1258. echo "    defining SYSNDIR"
  1259. echo "#define" SYSNDIR 1 >> confdefs.h
  1260. DEFS="$DEFS -DSYSNDIR=1"
  1261. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  1262. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  1263. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  1264. "
  1265. }
  1266.  dirheader=sys/ndir.h
  1267.  
  1268. fi
  1269. rm -f conftest*
  1270. fi
  1271. if test -z "$dirheader"; then
  1272.   echo checking for sys/dir.h
  1273. cat > conftest.c <<EOF
  1274. #include "confdefs.h"
  1275. #include <sys/types.h>
  1276. #include <sys/dir.h>
  1277. int main() { exit(0); }
  1278. int t() { DIR *dirp = 0; }
  1279. EOF
  1280. if $compile; then
  1281.   rm -rf conftest*
  1282.   
  1283. {
  1284. test -n "$verbose" && \
  1285. echo "    defining SYSDIR"
  1286. echo "#define" SYSDIR 1 >> confdefs.h
  1287. DEFS="$DEFS -DSYSDIR=1"
  1288. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  1289. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  1290. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  1291. "
  1292. }
  1293.  dirheader=sys/dir.h
  1294.  
  1295. fi
  1296. rm -f conftest*
  1297. fi
  1298. if test -z "$dirheader"; then
  1299.   echo checking for ndir.h
  1300. cat > conftest.c <<EOF
  1301. #include "confdefs.h"
  1302. #include <sys/types.h>
  1303. #include <ndir.h>
  1304. int main() { exit(0); }
  1305. int t() { DIR *dirp = 0; }
  1306. EOF
  1307. if $compile; then
  1308.   rm -rf conftest*
  1309.   
  1310. {
  1311. test -n "$verbose" && \
  1312. echo "    defining NDIR"
  1313. echo "#define" NDIR 1 >> confdefs.h
  1314. DEFS="$DEFS -DNDIR=1"
  1315. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  1316. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  1317. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  1318. "
  1319. }
  1320.  dirheader=ndir.h
  1321.  
  1322. fi
  1323. rm -f conftest*
  1324. fi
  1325.  
  1326. echo checking for closedir return value
  1327. cat > conftest.c <<EOF
  1328. #include "confdefs.h"
  1329. #include <sys/types.h>
  1330. #include <$dirheader>
  1331. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  1332. EOF
  1333. $compile
  1334. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1335.   :
  1336. else
  1337.   
  1338. {
  1339. test -n "$verbose" && \
  1340. echo "    defining VOID_CLOSEDIR"
  1341. echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
  1342. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  1343. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  1344. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  1345. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  1346. "
  1347. }
  1348.  
  1349. fi
  1350. rm -fr conftest*
  1351.  
  1352. echo checking for Xenix
  1353. cat > conftest.c <<EOF
  1354. #include "confdefs.h"
  1355. #if defined(M_XENIX) && !defined(M_UNIX)
  1356.   yes
  1357. #endif
  1358.  
  1359. EOF
  1360. eval "$CPP conftest.c > conftest.out 2>&1"
  1361. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1362.   rm -rf conftest*
  1363.   XENIX=1
  1364.  
  1365. fi
  1366. rm -f conftest*
  1367.  
  1368. if test -n "$XENIX"; then
  1369.   LIBS="$LIBS -lx"
  1370.   case "$DEFS" in
  1371.   *SYSNDIR*) ;;
  1372.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  1373.   esac
  1374. fi
  1375.  
  1376. # Set default prefixes.
  1377. if test -n "$prefix"; then
  1378.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1379.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1380. fi
  1381. if test -n "$exec_prefix"; then
  1382.   prsub="$prsub
  1383. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  1384. fi
  1385. # Quote sed substitution magic chars in DEFS.
  1386. cat >conftest.def <<EOF
  1387. $DEFS
  1388. EOF
  1389. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  1390. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  1391. rm -f conftest.def
  1392. # Substitute for predefined variables.
  1393.  
  1394. trap 'rm -f config.status; exit 1' 1 3 15
  1395. echo creating config.status
  1396. rm -f config.status
  1397. cat > config.status <<EOF
  1398. #!/bin/sh
  1399. # Generated automatically by configure.
  1400. # Run this file to recreate the current configuration.
  1401. # This directory was configured as follows,
  1402. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1403. #
  1404. # $0 $configure_args
  1405.  
  1406. for arg
  1407. do
  1408.   case "\$arg" in
  1409.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1410.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  1411.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  1412.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1413.   esac
  1414. done
  1415.  
  1416. trap 'rm -fr Makefile lib/Makefile src/Makefile man/Makefile config.h conftest*; exit 1' 1 3 15
  1417. CC='$CC'
  1418. CFLAGS='$CFLAGS'
  1419. LDFLAGS='$LDFLAGS'
  1420. CPP='$CPP'
  1421. INSTALL='$INSTALL'
  1422. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1423. INSTALL_DATA='$INSTALL_DATA'
  1424. RANLIB='$RANLIB'
  1425. LIBOBJS='$LIBOBJS'
  1426. ALLOCA='$ALLOCA'
  1427. LIBS='$LIBS'
  1428. srcdir='$srcdir'
  1429. prefix='$prefix'
  1430. exec_prefix='$exec_prefix'
  1431. prsub='$prsub'
  1432. extrasub='$extrasub'
  1433. EOF
  1434. cat >> config.status <<\EOF
  1435.  
  1436. top_srcdir=$srcdir
  1437.  
  1438. CONFIG_FILES=${CONFIG_FILES-"Makefile lib/Makefile src/Makefile man/Makefile"}
  1439. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  1440.   srcdir=$top_srcdir
  1441.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1442.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1443.   if test "$dir" != "$file"; then
  1444.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1445.     test ! -d $dir && mkdir $dir
  1446.   fi
  1447.   echo creating $file
  1448.   rm -f $file
  1449.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1450.   sed -e "
  1451. $prsub
  1452. $extrasub
  1453. s%@CC@%$CC%g
  1454. s%@CFLAGS@%$CFLAGS%g
  1455. s%@LDFLAGS@%$LDFLAGS%g
  1456. s%@CPP@%$CPP%g
  1457. s%@INSTALL@%$INSTALL%g
  1458. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1459. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1460. s%@RANLIB@%$RANLIB%g
  1461. s%@LIBOBJS@%$LIBOBJS%g
  1462. s%@ALLOCA@%$ALLOCA%g
  1463. s%@LIBS@%$LIBS%g
  1464. s%@srcdir@%$srcdir%g
  1465. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  1466. fi; done
  1467.  
  1468. CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
  1469. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  1470. echo creating $file
  1471.  
  1472. # These sed commands are put into SEDDEFS when defining a macro.
  1473. # They are broken into pieces to make the sed script easier to manage.
  1474. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1475. # is the cpp macro being defined and VALUE is the value it is being given.
  1476. # Each defining turns into a single global substitution command.
  1477. #
  1478. # SEDd sets the value in "#define NAME VALUE" lines.
  1479. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1480. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1481. SEDdC='\3'
  1482. SEDdD='@g'
  1483. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1484. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1485. SEDuB='\([     ]\)@\1#\2define\3'
  1486. SEDuC=' '
  1487. SEDuD='\4@g'
  1488. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1489. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1490. SEDeB='$@\1#\2define\3'
  1491. SEDeC=' '
  1492. SEDeD='@g'
  1493. rm -f conftest.sed
  1494. EOF
  1495. # Turn off quoting long enough to insert the sed commands.
  1496. rm -f conftest.sh
  1497. cat > conftest.sh <<EOF
  1498. $SEDDEFS
  1499. EOF
  1500.  
  1501. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1502. # on the size of here documents.
  1503.  
  1504. # Maximum number of lines to put in a single here document.
  1505. maxshlines=9
  1506.  
  1507. while :
  1508. do
  1509.   # wc gives bogus results for an empty file on some systems.
  1510.   lines=`grep -c . conftest.sh`
  1511.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1512.   rm -f conftest.s1 conftest.s2
  1513.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1514.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1515.   # Write a limited-size here document to append to conftest.sed.
  1516.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1517.   cat conftest.s1 >> config.status
  1518.   echo 'CONFEOF' >> config.status
  1519.   rm -f conftest.s1 conftest.sh
  1520.   mv conftest.s2 conftest.sh
  1521. done
  1522. rm -f conftest.sh
  1523.  
  1524. # Now back to your regularly scheduled config.status.
  1525. cat >> config.status <<\EOF
  1526. # This sed command replaces #undef's with comments.  This is necessary, for
  1527. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1528. # on some systems where configure will not decide to define it in
  1529. # config.h.
  1530. cat >> conftest.sed <<\CONFEOF
  1531. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1532. CONFEOF
  1533. rm -f conftest.h
  1534. # Break up the sed commands because old seds have small limits.
  1535. maxsedlines=20
  1536. cp $top_srcdir/$file.in conftest.h1
  1537. while :
  1538. do
  1539.   lines=`grep -c . conftest.sed`
  1540.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1541.   rm -f conftest.s1 conftest.s2 conftest.h2
  1542.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1543.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1544.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1545.   rm -f conftest.s1 conftest.h1 conftest.sed
  1546.   mv conftest.h2 conftest.h1
  1547.   mv conftest.s2 conftest.sed
  1548. done
  1549. rm -f conftest.sed conftest.h
  1550. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1551. cat conftest.h1 >> conftest.h
  1552. rm -f conftest.h1
  1553. if cmp -s $file conftest.h 2>/dev/null; then
  1554.   # The file exists and we would not be changing it.
  1555.   echo "$file is unchanged"
  1556.   rm -f conftest.h
  1557. else
  1558.   rm -f $file
  1559.   mv conftest.h $file
  1560. fi
  1561. fi; done
  1562.  
  1563.  
  1564.  
  1565. exit 0
  1566. EOF
  1567. chmod +x config.status
  1568. ${CONFIG_SHELL-/bin/sh} config.status
  1569.  
  1570.