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