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