home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / useful / dist / gnu / diffutils / diffutils-2.6-amiga / configure < prev    next >
Encoding:
Text File  |  1993-12-11  |  37.3 KB  |  1,442 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        with_$package='$val' ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile="${CC-gcc} $CFLAGS conftest.c -o conftest $LIBS"
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=diff.h
  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. srcdir=../diffutils-2.6-amiga    #HACK
  113. if test ! -r $srcdir/$unique_file; then
  114.   if test x$srcdirdefaulted = xyes; then
  115.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  116.   else
  117.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  118.   fi
  119.   exit 1
  120. fi
  121. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  122. # But we can't avoid them for `..', to make subdirectories work.
  123. case $srcdir in
  124.   .|/*|~*) ;;
  125.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  126. esac
  127.  
  128.  
  129. # Save the original args to write them into config.status later.
  130. configure_args="$*"
  131.  
  132.  
  133. if test -z "$CC"; then
  134.   # Extract the first word of `gcc', so it can be a program name with args.
  135.   set dummy gcc; word=$2
  136.   echo checking for $word
  137.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  138.   for dir in $PATH; do
  139.     test -z "$dir" && dir=.
  140.     if test -f $dir/$word; then
  141.       CC="gcc"
  142.       break
  143.     fi
  144.   done
  145.   IFS="$saveifs"
  146. fi
  147. test -z "$CC" && CC="cc"
  148. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  149.  
  150. # Find out if we are using GNU C, under whatever name.
  151. cat > conftest.c <<EOF
  152. #ifdef __GNUC__
  153.   yes
  154. #endif
  155. EOF
  156. ${CC-gcc} -E conftest.c > conftest.out 2>&1
  157. if egrep yes conftest.out >/dev/null 2>&1; then
  158.   GCC=1 # For later tests.
  159. fi
  160. rm -f conftest*
  161.  
  162. echo checking how to run the C preprocessor
  163. CPP="/lib/gcc-lib/amigados/2.3.3/cpp"    #HACK
  164. if test -z "$CPP"; then
  165.   # This must be in double quotes, not single quotes, because CPP may get
  166.   # substituted into the Makefile and ``${CC-gcc}'' will simply confuse
  167.   # make.  It must be expanded now.
  168.   CPP="${CC-gcc} -E"
  169.   cat > conftest.c <<EOF
  170. #include "confdefs.h"
  171. #include <stdio.h>
  172. Syntax Error
  173. EOF
  174. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  175. if test -z "$err"; then
  176.   :
  177. else
  178.   rm -rf conftest*
  179.   CPP=/lib/cpp
  180. fi
  181. rm -f conftest*
  182. fi
  183. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  184.  
  185. # Make sure to not get the incompatible SysV /etc/install and
  186. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  187. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  188. # or the AFS install, which mishandles nonexistent args, or
  189. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  190. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  191. # anyway.  Sigh.
  192. if test "z${INSTALL}" = "z" ; then
  193.   echo checking for install
  194.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  195.   for dir in $PATH; do
  196.     test -z "$dir" && dir=.
  197.     case $dir in
  198.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  199.     *)
  200.       if test -f $dir/installbsd; then
  201.     INSTALL="$dir/installbsd -c" # OSF1
  202.     INSTALL_PROGRAM='$(INSTALL)'
  203.     INSTALL_DATA='$(INSTALL) -m 644'
  204.     break
  205.       fi
  206.       if test -f $dir/install; then
  207.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  208.       : # AIX
  209.     else
  210.       INSTALL="$dir/install -c"
  211.       INSTALL_PROGRAM='$(INSTALL)'
  212.       INSTALL_DATA='$(INSTALL) -m 644'
  213.       break
  214.     fi
  215.       fi
  216.       ;;
  217.     esac
  218.   done
  219.   IFS="$saveifs"
  220. fi
  221. INSTALL=${INSTALL-cp}
  222. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  223. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  224. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  225. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  226. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  227.  
  228. echo checking for minix/config.h
  229. cat > conftest.c <<EOF
  230. #include "confdefs.h"
  231. #include <minix/config.h>
  232. EOF
  233. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  234. if test -z "$err"; then
  235.   rm -rf conftest*
  236.   MINIX=1
  237.  
  238. fi
  239. rm -f conftest*
  240.  
  241. # The Minix shell can't assign to the same variable on the same line!
  242. if test -n "$MINIX"; then
  243.   
  244. {
  245. test -n "$verbose" && \
  246. echo "    defining _POSIX_SOURCE"
  247. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  248. DEFS="$DEFS -D_POSIX_SOURCE=1"
  249. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  250. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  251. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  252. "
  253. }
  254.  
  255.   
  256. {
  257. test -n "$verbose" && \
  258. echo "    defining" _POSIX_1_SOURCE to be 2
  259. echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
  260. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  261. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  262. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  263. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  264. "
  265. }
  266.  
  267.   
  268. {
  269. test -n "$verbose" && \
  270. echo "    defining _MINIX"
  271. echo "#define" _MINIX 1 >> confdefs.h
  272. DEFS="$DEFS -D_MINIX=1"
  273. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  274. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  275. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  276. "
  277. }
  278.  
  279. fi
  280.  
  281. echo checking for POSIXized ISC
  282. if test -d /etc/conf/kconfig.d &&
  283.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  284. then
  285.   ISC=1 # If later tests want to check for ISC.
  286.   
  287. {
  288. test -n "$verbose" && \
  289. echo "    defining _POSIX_SOURCE"
  290. echo "#define" _POSIX_SOURCE 1 >> confdefs.h
  291. DEFS="$DEFS -D_POSIX_SOURCE=1"
  292. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  293. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  294. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  295. "
  296. }
  297.  
  298.   if test -n "$GCC"; then
  299.     CC="$CC -posix"
  300.   else
  301.     CC="$CC -Xp"
  302.   fi
  303. fi
  304.  
  305. echo checking for directory library header
  306. dirheader=
  307. if test -z "$dirheader"; then
  308.   echo checking for dirent.h
  309. cat > conftest.c <<EOF
  310. #include "confdefs.h"
  311. #include <sys/types.h>
  312. #include <dirent.h>
  313. int main() { exit(0); }
  314. int t() { DIR *dirp = 0; }
  315. EOF
  316. if $compile; then
  317.   rm -rf conftest*
  318.   
  319. {
  320. test -n "$verbose" && \
  321. echo "    defining DIRENT"
  322. echo "#define" DIRENT 1 >> confdefs.h
  323. DEFS="$DEFS -DDIRENT=1"
  324. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  325. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  326. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  327. "
  328. }
  329.  dirheader=dirent.h
  330.  
  331. fi
  332. rm -f conftest*
  333. fi
  334. if test -z "$dirheader"; then
  335.   echo checking for sys/ndir.h
  336. cat > conftest.c <<EOF
  337. #include "confdefs.h"
  338. #include <sys/types.h>
  339. #include <sys/ndir.h>
  340. int main() { exit(0); }
  341. int t() { DIR *dirp = 0; }
  342. EOF
  343. if $compile; then
  344.   rm -rf conftest*
  345.   
  346. {
  347. test -n "$verbose" && \
  348. echo "    defining SYSNDIR"
  349. echo "#define" SYSNDIR 1 >> confdefs.h
  350. DEFS="$DEFS -DSYSNDIR=1"
  351. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  352. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  353. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  354. "
  355. }
  356.  dirheader=sys/ndir.h
  357.  
  358. fi
  359. rm -f conftest*
  360. fi
  361. if test -z "$dirheader"; then
  362.   echo checking for sys/dir.h
  363. cat > conftest.c <<EOF
  364. #include "confdefs.h"
  365. #include <sys/types.h>
  366. #include <sys/dir.h>
  367. int main() { exit(0); }
  368. int t() { DIR *dirp = 0; }
  369. EOF
  370. if $compile; then
  371.   rm -rf conftest*
  372.   
  373. {
  374. test -n "$verbose" && \
  375. echo "    defining SYSDIR"
  376. echo "#define" SYSDIR 1 >> confdefs.h
  377. DEFS="$DEFS -DSYSDIR=1"
  378. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  379. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  380. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  381. "
  382. }
  383.  dirheader=sys/dir.h
  384.  
  385. fi
  386. rm -f conftest*
  387. fi
  388. if test -z "$dirheader"; then
  389.   echo checking for ndir.h
  390. cat > conftest.c <<EOF
  391. #include "confdefs.h"
  392. #include <sys/types.h>
  393. #include <ndir.h>
  394. int main() { exit(0); }
  395. int t() { DIR *dirp = 0; }
  396. EOF
  397. if $compile; then
  398.   rm -rf conftest*
  399.   
  400. {
  401. test -n "$verbose" && \
  402. echo "    defining NDIR"
  403. echo "#define" NDIR 1 >> confdefs.h
  404. DEFS="$DEFS -DNDIR=1"
  405. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  406. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  407. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  408. "
  409. }
  410.  dirheader=ndir.h
  411.  
  412. fi
  413. rm -f conftest*
  414. fi
  415.  
  416. echo checking for closedir return value
  417. cat > conftest.c <<EOF
  418. #include "confdefs.h"
  419. #include <sys/types.h>
  420. #include <$dirheader>
  421. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  422. EOF
  423. $compile
  424. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  425.   :
  426. else
  427.   
  428. {
  429. test -n "$verbose" && \
  430. echo "    defining VOID_CLOSEDIR"
  431. echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
  432. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  433. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  434. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  435. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  436. "
  437. }
  438.  
  439. fi
  440. rm -fr conftest*
  441.  
  442. prog='/* Ultrix mips cc rejects this.  */
  443. typedef int charset[2]; const charset x;
  444. /* SunOS 4.1.1 cc rejects this.  */
  445. char const *const *ccp;
  446. char **p;
  447. /* AIX XL C 1.02.0.0 rejects this.
  448.    It does not let you subtract one const X* pointer from another in an arm
  449.    of an if-expression whose if-part is not a constant expression */
  450. const char *g = "string";
  451. ccp = &g + (g ? g-g : 0);
  452. /* HPUX 7.0 cc rejects these. */
  453. ++ccp;
  454. p = (char**) ccp;
  455. ccp = (char const *const *) p;
  456. { /* SCO 3.2v4 cc rejects this.  */
  457.   char *t;
  458.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  459.  
  460.   *t++ = 0;
  461. }
  462. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  463.   int x[] = {25,17};
  464.   const int *foo = &x[0];
  465.   ++foo;
  466. }
  467. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  468.   typedef const int *iptr;
  469.   iptr p = 0;
  470.   ++p;
  471. }
  472. { /* AIX XL C 1.02.0.0 rejects this saying
  473.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  474.   struct s { int j; const int *ap[3]; };
  475.   struct s *b; b->j = 5;
  476. }
  477. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  478.   const int foo = 10;
  479. }'
  480. echo checking for lack of working const
  481. cat > conftest.c <<EOF
  482. #include "confdefs.h"
  483.  
  484. int main() { exit(0); }
  485. int t() { $prog }
  486. EOF
  487. if $compile; then
  488.   :
  489. else
  490.   rm -rf conftest*
  491.   
  492. {
  493. test -n "$verbose" && \
  494. echo "    defining" const to be empty
  495. echo "#define" const  >> confdefs.h
  496. DEFS="$DEFS -Dconst="
  497. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  498. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  499. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  500. "
  501. }
  502.  
  503. fi
  504. rm -f conftest*
  505.  
  506. echo checking for ANSI C header files
  507. cat > conftest.c <<EOF
  508. #include "confdefs.h"
  509. #include <stdlib.h>
  510. #include <stdarg.h>
  511. #include <string.h>
  512. #include <float.h>
  513. EOF
  514. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  515. if test -z "$err"; then
  516.   rm -rf conftest*
  517.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  518. echo '#include "confdefs.h"
  519. #include <string.h>' > conftest.c
  520. eval "$CPP conftest.c > conftest.out 2>&1"
  521. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  522.   rm -rf conftest*
  523.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  524. cat > conftest.c <<EOF
  525. #include "confdefs.h"
  526. #include <ctype.h>
  527. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  528. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  529. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  530. int main () { int i; for (i = 0; i < 256; i++)
  531. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  532. exit (0); }
  533.  
  534. EOF
  535. $compile
  536. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  537.   
  538. {
  539. test -n "$verbose" && \
  540. echo "    defining STDC_HEADERS"
  541. echo "#define" STDC_HEADERS 1 >> confdefs.h
  542. DEFS="$DEFS -DSTDC_HEADERS=1"
  543. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  544. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  545. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  546. "
  547. }
  548.  
  549.  
  550. fi
  551. rm -fr conftest*
  552.  
  553. fi
  554. rm -f conftest*
  555.  
  556.  
  557. fi
  558. rm -f conftest*
  559.  
  560. for hdr in unistd.h fcntl.h limits.h stdlib.h string.h sys/wait.h time.h
  561. do
  562. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  563. echo checking for ${hdr}
  564. cat > conftest.c <<EOF
  565. #include "confdefs.h"
  566. #include <${hdr}>
  567. EOF
  568. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  569. if test -z "$err"; then
  570.   rm -rf conftest*
  571.   
  572. {
  573. test -n "$verbose" && \
  574. echo "    defining ${trhdr}"
  575. echo "#define" ${trhdr} 1 >> confdefs.h
  576. DEFS="$DEFS -D${trhdr}=1"
  577. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  578. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  579. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  580. "
  581. }
  582.  
  583.  
  584. fi
  585. rm -f conftest*
  586. done
  587.  
  588. echo checking for pid_t in sys/types.h
  589. echo '#include "confdefs.h"
  590. #include <sys/types.h>' > conftest.c
  591. eval "$CPP conftest.c > conftest.out 2>&1"
  592. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  593.   :
  594. else
  595.   rm -rf conftest*
  596.   
  597. {
  598. test -n "$verbose" && \
  599. echo "    defining" pid_t to be int
  600. echo "#define" pid_t int >> confdefs.h
  601. DEFS="$DEFS -Dpid_t=int"
  602. SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
  603. \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
  604. \${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
  605. "
  606. }
  607.  
  608. fi
  609. rm -f conftest*
  610.  
  611. echo checking for return type of signal handlers
  612. cat > conftest.c <<EOF
  613. #include "confdefs.h"
  614. #include <sys/types.h>
  615. #include <signal.h>
  616. #ifdef signal
  617. #undef signal
  618. #endif
  619. extern void (*signal ()) ();
  620. int main() { exit(0); }
  621. int t() { int i; }
  622. EOF
  623. if $compile; then
  624.   rm -rf conftest*
  625.   
  626. {
  627. test -n "$verbose" && \
  628. echo "    defining" RETSIGTYPE to be void
  629. echo "#define" RETSIGTYPE void >> confdefs.h
  630. DEFS="$DEFS -DRETSIGTYPE=void"
  631. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  632. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  633. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  634. "
  635. }
  636.  
  637.  
  638. else
  639.   rm -rf conftest*
  640.   
  641. {
  642. test -n "$verbose" && \
  643. echo "    defining" RETSIGTYPE to be int
  644. echo "#define" RETSIGTYPE int >> confdefs.h
  645. DEFS="$DEFS -DRETSIGTYPE=int"
  646. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  647. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  648. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  649. "
  650. }
  651.  
  652. fi
  653. rm -f conftest*
  654.  
  655.  
  656. for func in dup2 memchr sigaction strerror waitpid
  657. do
  658. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  659. echo checking for ${func}
  660. cat > conftest.c <<EOF
  661. #include "confdefs.h"
  662. #include <ctype.h>
  663. int main() { exit(0); }
  664. int t() { 
  665. /* The GNU C library defines this for functions which it implements
  666.     to always fail with ENOSYS.  Some functions are actually named
  667.     something starting with __ and the normal name is an alias.  */
  668. #if defined (__stub_${func}) || defined (__stub___${func})
  669. choke me
  670. #else
  671. /* Override any gcc2 internal prototype to avoid an error.  */
  672. extern char ${func}(); ${func}();
  673. #endif
  674.  }
  675. EOF
  676. if $compile; then
  677.   rm -rf conftest*
  678.   {
  679. test -n "$verbose" && \
  680. echo "    defining ${trfunc}"
  681. echo "#define" ${trfunc} 1 >> confdefs.h
  682. DEFS="$DEFS -D${trfunc}=1"
  683. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  684. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  685. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  686. "
  687. }
  688.  
  689.  
  690. fi
  691. rm -f conftest*
  692. done
  693.  
  694. echo checking for vfork.h
  695. cat > conftest.c <<EOF
  696. #include "confdefs.h"
  697. #include <vfork.h>
  698. EOF
  699. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  700. if test -z "$err"; then
  701.   rm -rf conftest*
  702.   
  703. {
  704. test -n "$verbose" && \
  705. echo "    defining HAVE_VFORK_H"
  706. echo "#define" HAVE_VFORK_H 1 >> confdefs.h
  707. DEFS="$DEFS -DHAVE_VFORK_H=1"
  708. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VFORK_H\${SEDdB}HAVE_VFORK_H\${SEDdC}1\${SEDdD}
  709. \${SEDuA}HAVE_VFORK_H\${SEDuB}HAVE_VFORK_H\${SEDuC}1\${SEDuD}
  710. \${SEDeA}HAVE_VFORK_H\${SEDeB}HAVE_VFORK_H\${SEDeC}1\${SEDeD}
  711. "
  712. }
  713.  
  714.  
  715. fi
  716. rm -f conftest*
  717.  
  718. echo checking for working vfork
  719.  
  720. cat > conftest.c <<EOF
  721. #include "confdefs.h"
  722. /* Thanks to Paul Eggert for this test.  */
  723. #include <stdio.h>
  724. #include <sys/types.h>
  725. #include <sys/stat.h>
  726. #include <signal.h>
  727. #ifdef HAVE_UNISTD_H
  728. #include <unistd.h>
  729. #endif
  730. #ifdef HAVE_VFORK_H
  731. #include <vfork.h>
  732. #endif
  733. static int signalled;
  734. static RETSIGTYPE catch (s) int s; { signalled = 1; }
  735. main() {
  736.   pid_t parent = getpid ();
  737.   pid_t child;
  738.  
  739.   signal (SIGINT, catch);
  740.  
  741.   child = vfork ();
  742.  
  743.   if (child == 0) {
  744.     /* On sparc systems, changes by the child to local and incoming
  745.        argument registers are propagated back to the parent.
  746.        The compiler is told about this with #include <vfork.h>,
  747.        but some compilers (e.g. gcc -O) don't grok <vfork.h>.
  748.        Test for this by using lots of local variables, at least
  749.        as many local variables as main has allocated so far
  750.        including compiler temporaries.  4 locals are enough for
  751.        gcc 1.40.3 on a sparc, but we use 8 to be safe.
  752.        A buggy compiler should reuse the register of parent
  753.        for one of the local variables, since it will think that
  754.        parent can't possibly be used any more in this routine.
  755.        Assigning to the local variable will thus munge parent
  756.        in the parent process.  */
  757.     pid_t
  758.       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
  759.       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
  760.     /* Convince the compiler that p..p7 are live; otherwise, it might
  761.        use the same hardware register for all 8 local variables.  */
  762.     if (p != p1 || p != p2 || p != p3 || p != p4
  763.     || p != p5 || p != p6 || p != p7)
  764.       _exit(1);
  765.  
  766.     /* On some systems (e.g. SunOS 5.2), if the parent is catching
  767.        a signal, the child ignores the signal before execing,
  768.        and the parent later receives that signal, the parent dumps core.
  769.        Test for this by ignoring SIGINT in the child.  */
  770.     signal (SIGINT, SIG_IGN);
  771.  
  772.     /* On some systems (e.g. IRIX 3.3),
  773.        vfork doesn't separate parent from child file descriptors.
  774.        If the child closes a descriptor before it execs or exits,
  775.        this munges the parent's descriptor as well.
  776.        Test for this by closing stdout in the child.  */
  777.     _exit(close(fileno(stdout)) != 0);
  778.   } else {
  779.     int status;
  780.     struct stat st;
  781.  
  782.     while (wait(&status) != child)
  783.       ;
  784.     exit(
  785.      /* Was there some problem with vforking?  */
  786.      child < 0
  787.  
  788.      /* Did the child fail?  (This shouldn't happen.)  */
  789.      || status
  790.  
  791.      /* Did the vfork/compiler bug occur?  */
  792.      || parent != getpid()
  793.  
  794.      /* Did the signal handling bug occur?  */
  795.      || kill(parent, SIGINT) != 0
  796.      || signalled != 1
  797.  
  798.      /* Did the file descriptor bug occur?  */
  799.      || fstat(fileno(stdout), &st) != 0
  800.      );
  801.   }
  802. }
  803. EOF
  804. $compile
  805. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  806.   :
  807. else
  808.   
  809. {
  810. test -n "$verbose" && \
  811. echo "    defining" vfork to be fork
  812. echo "#define" vfork fork >> confdefs.h
  813. DEFS="$DEFS -Dvfork=fork"
  814. SEDDEFS="${SEDDEFS}\${SEDdA}vfork\${SEDdB}vfork\${SEDdC}fork\${SEDdD}
  815. \${SEDuA}vfork\${SEDuB}vfork\${SEDuC}fork\${SEDuD}
  816. \${SEDeA}vfork\${SEDeB}vfork\${SEDeC}fork\${SEDeD}
  817. "
  818. }
  819.  
  820. fi
  821. rm -fr conftest*
  822.  
  823. echo checking for vprintf
  824. cat > conftest.c <<EOF
  825. #include "confdefs.h"
  826.  
  827. int main() { exit(0); }
  828. int t() { vprintf(); }
  829. EOF
  830. if $compile; then
  831.   rm -rf conftest*
  832.   
  833. {
  834. test -n "$verbose" && \
  835. echo "    defining HAVE_VPRINTF"
  836. echo "#define" HAVE_VPRINTF 1 >> confdefs.h
  837. DEFS="$DEFS -DHAVE_VPRINTF=1"
  838. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
  839. \${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
  840. \${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
  841. "
  842. }
  843.  
  844.  
  845. else
  846.   rm -rf conftest*
  847.   vprintf_missing=1
  848. fi
  849. rm -f conftest*
  850.  
  851. if test -n "$vprintf_missing"; then
  852. echo checking for _doprnt
  853. cat > conftest.c <<EOF
  854. #include "confdefs.h"
  855.  
  856. int main() { exit(0); }
  857. int t() { _doprnt(); }
  858. EOF
  859. if $compile; then
  860.   rm -rf conftest*
  861.   
  862. {
  863. test -n "$verbose" && \
  864. echo "    defining HAVE_DOPRNT"
  865. echo "#define" HAVE_DOPRNT 1 >> confdefs.h
  866. DEFS="$DEFS -DHAVE_DOPRNT=1"
  867. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
  868. \${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
  869. \${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
  870. "
  871. }
  872.  
  873.  
  874. fi
  875. rm -f conftest*
  876.  
  877. fi
  878.  
  879. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  880. # for constant arguments.  Useless!
  881. echo checking for working alloca.h
  882. cat > conftest.c <<EOF
  883. #include "confdefs.h"
  884. #include <alloca.h>
  885. int main() { exit(0); }
  886. int t() { char *p = alloca(2 * sizeof(int)); }
  887. EOF
  888. if $compile; then
  889.   rm -rf conftest*
  890.   
  891. {
  892. test -n "$verbose" && \
  893. echo "    defining HAVE_ALLOCA_H"
  894. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  895. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  896. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  897. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  898. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  899. "
  900. }
  901.  
  902.  
  903. fi
  904. rm -f conftest*
  905.  
  906. decl="#ifdef __GNUC__
  907. #define alloca __builtin_alloca
  908. #else
  909. #if HAVE_ALLOCA_H
  910. #include <alloca.h>
  911. #else
  912. #ifdef _AIX
  913.  #pragma alloca
  914. #else
  915. char *alloca ();
  916. #endif
  917. #endif
  918. #endif
  919. "
  920. echo checking for alloca
  921. cat > conftest.c <<EOF
  922. #include "confdefs.h"
  923. $decl
  924. int main() { exit(0); }
  925. int t() { char *p = (char *) alloca(1); }
  926. EOF
  927. if $compile; then
  928.   :
  929. else
  930.   rm -rf conftest*
  931.   alloca_missing=1
  932. cat > conftest.c <<EOF
  933. #include "confdefs.h"
  934.  
  935. #if defined(CRAY) && ! defined(CRAY2)
  936. winnitude
  937. #else
  938. lossage
  939. #endif
  940.  
  941. EOF
  942. eval "$CPP conftest.c > conftest.out 2>&1"
  943. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  944.   rm -rf conftest*
  945.   echo checking for _getb67
  946. cat > conftest.c <<EOF
  947. #include "confdefs.h"
  948. #include <ctype.h>
  949. int main() { exit(0); }
  950. int t() { 
  951. /* The GNU C library defines this for functions which it implements
  952.     to always fail with ENOSYS.  Some functions are actually named
  953.     something starting with __ and the normal name is an alias.  */
  954. #if defined (__stub__getb67) || defined (__stub____getb67)
  955. choke me
  956. #else
  957. /* Override any gcc2 internal prototype to avoid an error.  */
  958. extern char _getb67(); _getb67();
  959. #endif
  960.  }
  961. EOF
  962. if $compile; then
  963.   rm -rf conftest*
  964.   {
  965. test -n "$verbose" && \
  966. echo "    defining" CRAY_STACKSEG_END to be _getb67
  967. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  968. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  969. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  970. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  971. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  972. "
  973. }
  974.  
  975.  
  976. else
  977.   rm -rf conftest*
  978.   echo checking for GETB67
  979. cat > conftest.c <<EOF
  980. #include "confdefs.h"
  981. #include <ctype.h>
  982. int main() { exit(0); }
  983. int t() { 
  984. /* The GNU C library defines this for functions which it implements
  985.     to always fail with ENOSYS.  Some functions are actually named
  986.     something starting with __ and the normal name is an alias.  */
  987. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  988. choke me
  989. #else
  990. /* Override any gcc2 internal prototype to avoid an error.  */
  991. extern char GETB67(); GETB67();
  992. #endif
  993.  }
  994. EOF
  995. if $compile; then
  996.   rm -rf conftest*
  997.   {
  998. test -n "$verbose" && \
  999. echo "    defining" CRAY_STACKSEG_END to be GETB67
  1000. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  1001. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1002. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1003. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1004. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1005. "
  1006. }
  1007.  
  1008.  
  1009. else
  1010.   rm -rf conftest*
  1011.   echo checking for getb67
  1012. cat > conftest.c <<EOF
  1013. #include "confdefs.h"
  1014. #include <ctype.h>
  1015. int main() { exit(0); }
  1016. int t() { 
  1017. /* The GNU C library defines this for functions which it implements
  1018.     to always fail with ENOSYS.  Some functions are actually named
  1019.     something starting with __ and the normal name is an alias.  */
  1020. #if defined (__stub_getb67) || defined (__stub___getb67)
  1021. choke me
  1022. #else
  1023. /* Override any gcc2 internal prototype to avoid an error.  */
  1024. extern char getb67(); getb67();
  1025. #endif
  1026.  }
  1027. EOF
  1028. if $compile; then
  1029.   rm -rf conftest*
  1030.   {
  1031. test -n "$verbose" && \
  1032. echo "    defining" CRAY_STACKSEG_END to be getb67
  1033. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  1034. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1035. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1036. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1037. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1038. "
  1039. }
  1040.  
  1041.  
  1042. fi
  1043. rm -f conftest*
  1044.  
  1045. fi
  1046. rm -f conftest*
  1047.  
  1048. fi
  1049. rm -f conftest*
  1050.  
  1051.  
  1052. fi
  1053. rm -f conftest*
  1054.  
  1055.  
  1056. fi
  1057. rm -f conftest*
  1058.  
  1059. if test -n "$alloca_missing"; then
  1060.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1061.   # that cause trouble.  Some versions do not even contain alloca or
  1062.   # contain a buggy version.  If you still want to use their alloca,
  1063.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1064.   ALLOCA=alloca.o
  1065.   
  1066. {
  1067. test -n "$verbose" && \
  1068. echo "    defining C_ALLOCA"
  1069. echo "#define" C_ALLOCA 1 >> confdefs.h
  1070. DEFS="$DEFS -DC_ALLOCA=1"
  1071. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  1072. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  1073. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  1074. "
  1075. }
  1076.  
  1077.  
  1078.   echo 'checking stack direction for C alloca'
  1079.   echo checking whether cross-compiling
  1080. # If we cannot run a trivial program, we must be cross compiling.
  1081. cat > conftest.c <<EOF
  1082. #include "confdefs.h"
  1083. main(){exit(0);}
  1084. EOF
  1085. $compile
  1086. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1087.   :
  1088. else
  1089.   cross_compiling=1
  1090. fi
  1091. rm -fr conftest*
  1092.  
  1093. if test -n "$cross_compiling"
  1094. then
  1095.   
  1096. {
  1097. test -n "$verbose" && \
  1098. echo "    defining" STACK_DIRECTION to be 0
  1099. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  1100. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1101. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1102. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1103. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1104. "
  1105. }
  1106.  
  1107. else
  1108. cat > conftest.c <<EOF
  1109. #include "confdefs.h"
  1110. find_stack_direction ()
  1111. {
  1112.   static char *addr = 0;
  1113.   auto char dummy;
  1114.   if (addr == 0)
  1115.     {
  1116.       addr = &dummy;
  1117.       return find_stack_direction ();
  1118.     }
  1119.   else
  1120.     return (&dummy > addr) ? 1 : -1;
  1121. }
  1122. main ()
  1123. {
  1124.   exit (find_stack_direction() < 0);
  1125. }
  1126. EOF
  1127. $compile
  1128. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1129.   
  1130. {
  1131. test -n "$verbose" && \
  1132. echo "    defining" STACK_DIRECTION to be 1
  1133. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  1134. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1135. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1136. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1137. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1138. "
  1139. }
  1140.  
  1141.  
  1142. else
  1143.   
  1144. {
  1145. test -n "$verbose" && \
  1146. echo "    defining" STACK_DIRECTION to be -1
  1147. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  1148. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1149. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1150. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1151. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1152. "
  1153. }
  1154.  
  1155. fi
  1156. fi
  1157. rm -fr conftest*
  1158. fi
  1159.  
  1160. echo checking for st_blksize in struct stat
  1161. cat > conftest.c <<EOF
  1162. #include "confdefs.h"
  1163. #include <sys/types.h>
  1164. #include <sys/stat.h>
  1165. int main() { exit(0); }
  1166. int t() { struct stat s; s.st_blksize; }
  1167. EOF
  1168. if $compile; then
  1169.   rm -rf conftest*
  1170.   
  1171. {
  1172. test -n "$verbose" && \
  1173. echo "    defining HAVE_ST_BLKSIZE"
  1174. echo "#define" HAVE_ST_BLKSIZE 1 >> confdefs.h
  1175. DEFS="$DEFS -DHAVE_ST_BLKSIZE=1"
  1176. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ST_BLKSIZE\${SEDdB}HAVE_ST_BLKSIZE\${SEDdC}1\${SEDdD}
  1177. \${SEDuA}HAVE_ST_BLKSIZE\${SEDuB}HAVE_ST_BLKSIZE\${SEDuC}1\${SEDuD}
  1178. \${SEDeA}HAVE_ST_BLKSIZE\${SEDeB}HAVE_ST_BLKSIZE\${SEDeC}1\${SEDeD}
  1179. "
  1180. }
  1181.  
  1182.  
  1183. fi
  1184. rm -f conftest*
  1185.  
  1186. echo checking for broken stat file mode macros
  1187. cat > conftest.c <<EOF
  1188. #include "confdefs.h"
  1189. #include <sys/types.h>
  1190. #include <sys/stat.h>
  1191. #ifdef S_ISBLK
  1192. #if S_ISBLK (S_IFDIR)
  1193. You lose.
  1194. #endif
  1195. #ifdef S_IFCHR
  1196. #if S_ISBLK (S_IFCHR)
  1197. You lose.
  1198. #endif
  1199. #endif /* S_IFCHR */
  1200. #endif /* S_ISBLK */
  1201. #ifdef S_ISLNK
  1202. #if S_ISLNK (S_IFREG)
  1203. You lose.
  1204. #endif
  1205. #endif /* S_ISLNK */
  1206. #ifdef S_ISSOCK
  1207. #if S_ISSOCK (S_IFREG)
  1208. You lose.
  1209. #endif
  1210. #endif /* S_ISSOCK */
  1211.  
  1212. EOF
  1213. eval "$CPP conftest.c > conftest.out 2>&1"
  1214. if egrep "You lose" conftest.out >/dev/null 2>&1; then
  1215.   rm -rf conftest*
  1216.   
  1217. {
  1218. test -n "$verbose" && \
  1219. echo "    defining STAT_MACROS_BROKEN"
  1220. echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h
  1221. DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
  1222. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD}
  1223. \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD}
  1224. \${SEDeA}STAT_MACROS_BROKEN\${SEDeB}STAT_MACROS_BROKEN\${SEDeC}1\${SEDeD}
  1225. "
  1226. }
  1227.  
  1228.  
  1229. fi
  1230. rm -f conftest*
  1231.  
  1232. echo checking for Xenix
  1233. cat > conftest.c <<EOF
  1234. #include "confdefs.h"
  1235. #if defined(M_XENIX) && !defined(M_UNIX)
  1236.   yes
  1237. #endif
  1238.  
  1239. EOF
  1240. eval "$CPP conftest.c > conftest.out 2>&1"
  1241. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1242.   rm -rf conftest*
  1243.   XENIX=1
  1244.  
  1245. fi
  1246. rm -f conftest*
  1247.  
  1248. if test -n "$XENIX"; then
  1249.   LIBS="$LIBS -lx"
  1250.   case "$DEFS" in
  1251.   *SYSNDIR*) ;;
  1252.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  1253.   esac
  1254. fi
  1255.  
  1256. # Set default prefixes.
  1257. if test -n "$prefix"; then
  1258.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1259.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1260. fi
  1261. if test -n "$exec_prefix"; then
  1262.   prsub="$prsub
  1263. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  1264. fi
  1265. # Quote sed substitution magic chars in DEFS.
  1266. cat >conftest.def <<EOF
  1267. $DEFS
  1268. EOF
  1269. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  1270. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  1271. rm -f conftest.def
  1272. # Substitute for predefined variables.
  1273.  
  1274. trap 'rm -f config.status; exit 1' 1 3 15
  1275. echo creating config.status
  1276. rm -f config.status
  1277. cat > config.status <<EOF
  1278. #!/bin/sh
  1279. # Generated automatically by configure.
  1280. # Run this file to recreate the current configuration.
  1281. # This directory was configured as follows,
  1282. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1283. #
  1284. # $0 $configure_args
  1285.  
  1286. for arg
  1287. do
  1288.   case "\$arg" in
  1289.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1290.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  1291.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  1292.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1293.   esac
  1294. done
  1295.  
  1296. trap 'rm -fr Makefile config.h conftest*; exit 1' 1 3 15
  1297. CC='$CC'
  1298. CPP='$CPP'
  1299. INSTALL='$INSTALL'
  1300. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1301. INSTALL_DATA='$INSTALL_DATA'
  1302. ALLOCA='$ALLOCA'
  1303. LIBS='$LIBS'
  1304. srcdir='$srcdir'
  1305. prefix='$prefix'
  1306. exec_prefix='$exec_prefix'
  1307. prsub='$prsub'
  1308. extrasub='$extrasub'
  1309. EOF
  1310. cat >> config.status <<\EOF
  1311.  
  1312. top_srcdir=$srcdir
  1313.  
  1314. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  1315. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  1316.   srcdir=$top_srcdir
  1317.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1318.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1319.   if test "$dir" != "$file"; then
  1320.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1321.     test ! -d $dir && mkdir $dir
  1322.   fi
  1323.   echo creating $file
  1324.   rm -f $file
  1325.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1326.   sed -e "
  1327. $prsub
  1328. $extrasub
  1329. s%@CC@%$CC%g
  1330. s%@CPP@%$CPP%g
  1331. s%@INSTALL@%$INSTALL%g
  1332. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1333. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1334. s%@ALLOCA@%$ALLOCA%g
  1335. s%@LIBS@%$LIBS%g
  1336. s%@srcdir@%$srcdir%g
  1337. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  1338. fi; done
  1339.  
  1340. CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
  1341. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  1342. echo creating $file
  1343.  
  1344. # These sed commands are put into SEDDEFS when defining a macro.
  1345. # They are broken into pieces to make the sed script easier to manage.
  1346. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1347. # is the cpp macro being defined and VALUE is the value it is being given.
  1348. # Each defining turns into a single global substitution command.
  1349. #
  1350. # SEDd sets the value in "#define NAME VALUE" lines.
  1351. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1352. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1353. SEDdC='\3'
  1354. SEDdD='@g'
  1355. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1356. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1357. SEDuB='\([     ]\)@\1#\2define\3'
  1358. SEDuC=' '
  1359. SEDuD='\4@g'
  1360. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1361. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1362. SEDeB='$@\1#\2define\3'
  1363. SEDeC=' '
  1364. SEDeD='@g'
  1365. rm -f conftest.sed
  1366. EOF
  1367. # Turn off quoting long enough to insert the sed commands.
  1368. rm -f conftest.sh
  1369. cat > conftest.sh <<EOF
  1370. $SEDDEFS
  1371. EOF
  1372.  
  1373. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1374. # on the size of here documents.
  1375.  
  1376. # Maximum number of lines to put in a single here document.
  1377. maxshlines=9
  1378.  
  1379. while :
  1380. do
  1381.   # wc gives bogus results for an empty file on some systems.
  1382.   lines=`grep -c . conftest.sh`
  1383.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1384.   rm -f conftest.s1 conftest.s2
  1385.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1386.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1387.   # Write a limited-size here document to append to conftest.sed.
  1388.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1389.   cat conftest.s1 >> config.status
  1390.   echo 'CONFEOF' >> config.status
  1391.   rm -f conftest.s1 conftest.sh
  1392.   mv conftest.s2 conftest.sh
  1393. done
  1394. rm -f conftest.sh
  1395.  
  1396. # Now back to your regularly scheduled config.status.
  1397. cat >> config.status <<\EOF
  1398. # This sed command replaces #undef's with comments.  This is necessary, for
  1399. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1400. # on some systems where configure will not decide to define it in
  1401. # config.h.
  1402. cat >> conftest.sed <<\CONFEOF
  1403. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1404. CONFEOF
  1405. rm -f conftest.h
  1406. # Break up the sed commands because old seds have small limits.
  1407. maxsedlines=20
  1408. cp $top_srcdir/$file.in conftest.h1
  1409. while :
  1410. do
  1411.   lines=`grep -c . conftest.sed`
  1412.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1413.   rm -f conftest.s1 conftest.s2 conftest.h2
  1414.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1415.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1416.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1417.   rm -f conftest.s1 conftest.h1 conftest.sed
  1418.   mv conftest.h2 conftest.h1
  1419.   mv conftest.s2 conftest.sed
  1420. done
  1421. rm -f conftest.sed conftest.h
  1422. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1423. cat conftest.h1 >> conftest.h
  1424. rm -f conftest.h1
  1425. if cmp -s $file conftest.h 2>/dev/null; then
  1426.   # The file exists and we would not be changing it.
  1427.   echo "$file is unchanged"
  1428.   rm -f conftest.h
  1429. else
  1430.   rm -f $file
  1431.   mv conftest.h $file
  1432. fi
  1433. fi; done
  1434.  
  1435.  
  1436.  
  1437. exit 0
  1438. EOF
  1439. chmod +x config.status
  1440. ${CONFIG_SHELL-/bin/sh} config.status
  1441.  
  1442.