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