home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / make-3.70-src.lha / src / amiga / make-3.70 / configure < prev    next >
Encoding:
Text File  |  1994-02-21  |  59.3 KB  |  2,360 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf version 1.7.1 
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This configure script is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License as published
  8. # by the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This script is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
  14. # 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 $ac_clean_files; exit 1' 1 3 15
  83. trap 'rm -f confdefs* $ac_clean_files' 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 -rf 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=vpath.c
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog| sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.         
  131.  
  132. # We want these before the checks, so the checks can modify their values.
  133. test -z "$CFLAGS" && CFLAGS=-O2
  134. test -z "$LDFLAGS" && LDFLAGS=
  135.  
  136. if test -z "$CC"; then
  137.   # Extract the first word of `gcc', so it can be a program name with args.
  138.   set dummy gcc; word=$2
  139.   echo checking for $word
  140.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  141.   for dir in $PATH; do
  142.     test -z "$dir" && dir=.
  143.     if test -f $dir/$word; then
  144.       CC="gcc"
  145.       break
  146.     fi
  147.   done
  148.   IFS="$saveifs"
  149. fi
  150. test -z "$CC" && CC="cc"
  151. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  152.  
  153. # Find out if we are using GNU C, under whatever name.
  154. cat > conftest.c <<EOF
  155. #ifdef __GNUC__
  156.   yes
  157. #endif
  158. EOF
  159. ${CC-cc} -E conftest.c > conftest.out 2>&1
  160. if egrep yes conftest.out >/dev/null 2>&1; then
  161.   GCC=1 # For later tests.
  162. fi
  163. rm -f conftest*
  164.  
  165. # Make sure to not get the incompatible SysV /etc/install and
  166. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  167. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  168. # or the AFS install, which mishandles nonexistent args, or
  169. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  170. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  171. # anyway.  Sigh.
  172. if test "z${INSTALL}" = "z" ; then
  173.   echo checking for install
  174.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  175.   for dir in $PATH; do
  176.     #test -z "$dir" && dir=.
  177.     case "$dir" in
  178.     ''|.|/etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  179.     *)
  180.       if test -f $dir/installbsd; then
  181.     INSTALL="$dir/installbsd -c" # OSF1
  182.     INSTALL_PROGRAM='$(INSTALL)'
  183.     INSTALL_DATA='$(INSTALL) -m 644'
  184.     break
  185.       fi
  186.       if test -f $dir/install; then
  187.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  188.       : # AIX
  189.     else
  190.       INSTALL="$dir/install -c"
  191.       INSTALL_PROGRAM='$(INSTALL)'
  192.       INSTALL_DATA='$(INSTALL) -m 644'
  193.       break
  194.     fi
  195.       fi
  196.       ;;
  197.     esac
  198.   done
  199.   IFS="$saveifs"
  200. fi
  201. if test -z "$INSTALL"; then
  202.   if test -f ${srcdir}/install.sh; then
  203.     # As a last resort, use the slow shell script.
  204.     # We want the top-level source directory, not the subdir's srcdir,
  205.     # so expand srcdir now rather than in the Makefile.
  206.     INSTALL="${srcdir}/install.sh -c"
  207.   else
  208.     echo "warning: ${srcdir}/install.sh not found; using cp"
  209.     INSTALL=cp
  210.   fi
  211. fi
  212. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  213. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  214. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  215. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  216. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  217.  
  218. if test -z "$RANLIB"; then
  219.   # Extract the first word of `ranlib', so it can be a program name with args.
  220.   set dummy ranlib; word=$2
  221.   echo checking for $word
  222.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  223.   for dir in $PATH; do
  224.     test -z "$dir" && dir=.
  225.     if test -f $dir/$word; then
  226.       RANLIB="ranlib"
  227.       break
  228.     fi
  229.   done
  230.   IFS="$saveifs"
  231. fi
  232. test -z "$RANLIB" && RANLIB=":"
  233. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  234.  
  235. echo checking how to run the C preprocessor
  236. if test -z "$CPP"; then
  237.   # This must be in double quotes, not single quotes, because CPP may get
  238.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  239.   # make.  It must be expanded now.
  240.   CPP="${CC-cc} -E"
  241.   cat > conftest.c <<EOF
  242. #include "confdefs.h"
  243. #include <stdio.h>
  244. Syntax Error
  245. EOF
  246. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  247. if test -z "$err"; then
  248.   :
  249. else
  250.   rm -rf conftest*
  251.   CPP="${CC-cc} -E -traditional-cpp"
  252.   cat > conftest.c <<EOF
  253. #include "confdefs.h"
  254. #include <stdio.h>
  255. Syntax Error
  256. EOF
  257. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  258. if test -z "$err"; then
  259.   :
  260. else
  261.   rm -rf conftest*
  262.   CPP=/lib/cpp
  263. fi
  264. rm -f conftest*
  265. fi
  266. rm -f conftest*
  267. fi
  268. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  269.             echo checking for AIX
  270. cat > conftest.c <<EOF
  271. #include "confdefs.h"
  272. #ifdef _AIX
  273.   yes
  274. #endif
  275.  
  276. EOF
  277. eval "$CPP conftest.c > conftest.out 2>&1"
  278. if egrep "yes" conftest.out >/dev/null 2>&1; then
  279.   rm -rf conftest*
  280.   
  281. {
  282. test -n "$verbose" && \
  283. echo "    defining _ALL_SOURCE"
  284. echo "#define _ALL_SOURCE 1" >> confdefs.h
  285. DEFS="$DEFS -D_ALL_SOURCE=1"
  286. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  287. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  288. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  289. "
  290. }
  291.  
  292.  
  293. fi
  294. rm -f conftest*
  295.  
  296.  
  297. echo checking for POSIXized ISC
  298. if test -d /etc/conf/kconfig.d &&
  299.   grep _POSIX_VERSION /gnu/include/sys/unistd.h >/dev/null 2>&1
  300. then
  301.   ISC=1 # If later tests want to check for ISC.
  302.   
  303. {
  304. test -n "$verbose" && \
  305. echo "    defining _POSIX_SOURCE"
  306. echo "#define _POSIX_SOURCE 1" >> confdefs.h
  307. DEFS="$DEFS -D_POSIX_SOURCE=1"
  308. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  309. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  310. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  311. "
  312. }
  313.  
  314.   if test -n "$GCC"; then
  315.     CC="$CC -posix"
  316.   else
  317.     CC="$CC -Xp"
  318.   fi
  319. fi
  320.  
  321. echo checking for minix/config.h
  322. cat > conftest.c <<EOF
  323. #include "confdefs.h"
  324. #include <minix/config.h>
  325. EOF
  326. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  327. if test -z "$err"; then
  328.   rm -rf conftest*
  329.   MINIX=1
  330.  
  331. fi
  332. rm -f conftest*
  333.  
  334. # The Minix shell can't assign to the same variable on the same line!
  335. if test -n "$MINIX"; then
  336.   
  337. {
  338. test -n "$verbose" && \
  339. echo "    defining _POSIX_SOURCE"
  340. echo "#define _POSIX_SOURCE 1" >> confdefs.h
  341. DEFS="$DEFS -D_POSIX_SOURCE=1"
  342. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  343. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  344. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  345. "
  346. }
  347.  
  348.   
  349. {
  350. test -n "$verbose" && \
  351. echo "    defining _POSIX_1_SOURCE to be 2"
  352. echo "#define _POSIX_1_SOURCE 2" >> confdefs.h
  353. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  354. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  355. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  356. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  357. "
  358. }
  359.  
  360.   
  361. {
  362. test -n "$verbose" && \
  363. echo "    defining _MINIX"
  364. echo "#define _MINIX 1" >> confdefs.h
  365. DEFS="$DEFS -D_MINIX=1"
  366. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  367. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  368. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  369. "
  370. }
  371.  
  372. fi
  373.  
  374. echo checking for ANSI C header files
  375. cat > conftest.c <<EOF
  376. #include "confdefs.h"
  377. #include <stdlib.h>
  378. #include <stdarg.h>
  379. #include <string.h>
  380. #include <float.h>
  381. EOF
  382. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  383. if test -z "$err"; then
  384.   rm -rf conftest*
  385.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  386. echo '#include "confdefs.h"
  387. #include <string.h>' > conftest.c
  388. eval "$CPP conftest.c > conftest.out 2>&1"
  389. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  390.   rm -rf conftest*
  391.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  392. cat > conftest.c <<EOF
  393. #include "confdefs.h"
  394. #include <ctype.h>
  395. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  396. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  397. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  398. int main () { int i; for (i = 0; i < 256; i++)
  399. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  400. exit (0); }
  401.  
  402. EOF
  403. eval $compile
  404. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  405.   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  406. echo '#include "confdefs.h"
  407. #include <stdlib.h>' > conftest.c
  408. eval "$CPP conftest.c > conftest.out 2>&1"
  409. if egrep "free" conftest.out >/dev/null 2>&1; then
  410.   rm -rf conftest*
  411.   
  412. {
  413. test -n "$verbose" && \
  414. echo "    defining STDC_HEADERS"
  415. echo "#define STDC_HEADERS 1" >> confdefs.h
  416. DEFS="$DEFS -DSTDC_HEADERS=1"
  417. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  418. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  419. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  420. "
  421. }
  422.  
  423.  
  424. fi
  425. rm -f conftest*
  426.  
  427.  
  428. fi
  429. rm -fr conftest*
  430.  
  431. fi
  432. rm -f conftest*
  433.  
  434.  
  435. fi
  436. rm -f conftest*
  437.  
  438. echo checking for directory library header
  439. dirheader=
  440. if test -z "$dirheader"; then
  441.   echo checking for dirent.h
  442. cat > conftest.c <<EOF
  443. #include "confdefs.h"
  444. #include <sys/types.h>
  445. #include <dirent.h>
  446. int main() { exit(0); }
  447. int t() { DIR *dirp = 0; }
  448. EOF
  449. if eval $compile; then
  450.   rm -rf conftest*
  451.   
  452. {
  453. test -n "$verbose" && \
  454. echo "    defining DIRENT"
  455. echo "#define DIRENT 1" >> confdefs.h
  456. DEFS="$DEFS -DDIRENT=1"
  457. SEDDEFS="${SEDDEFS}\${SEDdA}DIRENT\${SEDdB}DIRENT\${SEDdC}1\${SEDdD}
  458. \${SEDuA}DIRENT\${SEDuB}DIRENT\${SEDuC}1\${SEDuD}
  459. \${SEDeA}DIRENT\${SEDeB}DIRENT\${SEDeC}1\${SEDeD}
  460. "
  461. }
  462.  dirheader=dirent.h
  463.  
  464. fi
  465. rm -f conftest*
  466. fi
  467. if test -z "$dirheader"; then
  468.   echo checking for sys/ndir.h
  469. cat > conftest.c <<EOF
  470. #include "confdefs.h"
  471. #include <sys/types.h>
  472. #include <sys/ndir.h>
  473. int main() { exit(0); }
  474. int t() { DIR *dirp = 0; }
  475. EOF
  476. if eval $compile; then
  477.   rm -rf conftest*
  478.   
  479. {
  480. test -n "$verbose" && \
  481. echo "    defining SYSNDIR"
  482. echo "#define SYSNDIR 1" >> confdefs.h
  483. DEFS="$DEFS -DSYSNDIR=1"
  484. SEDDEFS="${SEDDEFS}\${SEDdA}SYSNDIR\${SEDdB}SYSNDIR\${SEDdC}1\${SEDdD}
  485. \${SEDuA}SYSNDIR\${SEDuB}SYSNDIR\${SEDuC}1\${SEDuD}
  486. \${SEDeA}SYSNDIR\${SEDeB}SYSNDIR\${SEDeC}1\${SEDeD}
  487. "
  488. }
  489.  dirheader=sys/ndir.h
  490.  
  491. fi
  492. rm -f conftest*
  493. fi
  494. if test -z "$dirheader"; then
  495.   echo checking for sys/dir.h
  496. cat > conftest.c <<EOF
  497. #include "confdefs.h"
  498. #include <sys/types.h>
  499. #include <sys/dir.h>
  500. int main() { exit(0); }
  501. int t() { DIR *dirp = 0; }
  502. EOF
  503. if eval $compile; then
  504.   rm -rf conftest*
  505.   
  506. {
  507. test -n "$verbose" && \
  508. echo "    defining SYSDIR"
  509. echo "#define SYSDIR 1" >> confdefs.h
  510. DEFS="$DEFS -DSYSDIR=1"
  511. SEDDEFS="${SEDDEFS}\${SEDdA}SYSDIR\${SEDdB}SYSDIR\${SEDdC}1\${SEDdD}
  512. \${SEDuA}SYSDIR\${SEDuB}SYSDIR\${SEDuC}1\${SEDuD}
  513. \${SEDeA}SYSDIR\${SEDeB}SYSDIR\${SEDeC}1\${SEDeD}
  514. "
  515. }
  516.  dirheader=sys/dir.h
  517.  
  518. fi
  519. rm -f conftest*
  520. fi
  521. if test -z "$dirheader"; then
  522.   echo checking for ndir.h
  523. cat > conftest.c <<EOF
  524. #include "confdefs.h"
  525. #include <sys/types.h>
  526. #include <ndir.h>
  527. int main() { exit(0); }
  528. int t() { DIR *dirp = 0; }
  529. EOF
  530. if eval $compile; then
  531.   rm -rf conftest*
  532.   
  533. {
  534. test -n "$verbose" && \
  535. echo "    defining NDIR"
  536. echo "#define NDIR 1" >> confdefs.h
  537. DEFS="$DEFS -DNDIR=1"
  538. SEDDEFS="${SEDDEFS}\${SEDdA}NDIR\${SEDdB}NDIR\${SEDdC}1\${SEDdD}
  539. \${SEDuA}NDIR\${SEDuB}NDIR\${SEDuC}1\${SEDuD}
  540. \${SEDeA}NDIR\${SEDeB}NDIR\${SEDeC}1\${SEDeD}
  541. "
  542. }
  543.  dirheader=ndir.h
  544.  
  545. fi
  546. rm -f conftest*
  547. fi
  548.  
  549. echo checking for closedir return value
  550. cat > conftest.c <<EOF
  551. #include "confdefs.h"
  552. #include <sys/types.h>
  553. #include <$dirheader>
  554. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  555. EOF
  556. eval $compile
  557. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  558.   :
  559. else
  560.   
  561. {
  562. test -n "$verbose" && \
  563. echo "    defining VOID_CLOSEDIR"
  564. echo "#define VOID_CLOSEDIR 1" >> confdefs.h
  565. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  566. SEDDEFS="${SEDDEFS}\${SEDdA}VOID_CLOSEDIR\${SEDdB}VOID_CLOSEDIR\${SEDdC}1\${SEDdD}
  567. \${SEDuA}VOID_CLOSEDIR\${SEDuB}VOID_CLOSEDIR\${SEDuC}1\${SEDuD}
  568. \${SEDeA}VOID_CLOSEDIR\${SEDeB}VOID_CLOSEDIR\${SEDeC}1\${SEDeD}
  569. "
  570. }
  571.  
  572. fi
  573. rm -fr conftest*
  574.  
  575. echo checking for uid_t in sys/types.h
  576. echo '#include "confdefs.h"
  577. #include <sys/types.h>' > conftest.c
  578. eval "$CPP conftest.c > conftest.out 2>&1"
  579. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  580.   :
  581. else
  582.   rm -rf conftest*
  583.   
  584. {
  585. test -n "$verbose" && \
  586. echo "    defining uid_t to be int"
  587. echo "#define uid_t int" >> confdefs.h
  588. DEFS="$DEFS -Duid_t=int"
  589. SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
  590. \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
  591. \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
  592. "
  593. }
  594.  
  595. {
  596. test -n "$verbose" && \
  597. echo "    defining gid_t to be int"
  598. echo "#define gid_t int" >> confdefs.h
  599. DEFS="$DEFS -Dgid_t=int"
  600. SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
  601. \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
  602. \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
  603. "
  604. }
  605.  
  606. fi
  607. rm -f conftest*
  608.             echo checking for type of array argument to getgroups
  609. prog='/* Thanks to Mike Rendell for this test.  */
  610. #include <sys/types.h>
  611. #define NGID 256
  612. #undef MAX
  613. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  614. main()
  615. {
  616.   gid_t gidset[NGID];
  617.   int i, n;
  618.   union { gid_t gval; long lval; }  val;
  619.  
  620.   val.lval = -1;
  621.   for (i = 0; i < NGID; i++)
  622.     gidset[i] = val.gval;
  623.   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
  624.                  gidset);
  625.   /* Exit non-zero if getgroups seems to require an array of ints.  This
  626.      happens when gid_t is short but getgroups modifies an array of ints.  */
  627.   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
  628. }'
  629. cat > conftest.c <<EOF
  630. #include "confdefs.h"
  631. $prog
  632. EOF
  633. eval $compile
  634. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  635.   
  636. {
  637. test -n "$verbose" && \
  638. echo "    defining GETGROUPS_T to be gid_t"
  639. echo "#define GETGROUPS_T gid_t" >> confdefs.h
  640. DEFS="$DEFS -DGETGROUPS_T=gid_t"
  641. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}gid_t\${SEDdD}
  642. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}gid_t\${SEDuD}
  643. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}gid_t\${SEDeD}
  644. "
  645. }
  646.  
  647.  
  648. else
  649.   
  650. {
  651. test -n "$verbose" && \
  652. echo "    defining GETGROUPS_T to be int"
  653. echo "#define GETGROUPS_T int" >> confdefs.h
  654. DEFS="$DEFS -DGETGROUPS_T=int"
  655. SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}int\${SEDdD}
  656. \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}int\${SEDuD}
  657. \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}int\${SEDeD}
  658. "
  659. }
  660.  
  661. fi
  662. rm -fr conftest*
  663.  
  664. echo checking for pid_t in sys/types.h
  665. echo '#include "confdefs.h"
  666. #include <sys/types.h>' > conftest.c
  667. eval "$CPP conftest.c > conftest.out 2>&1"
  668. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  669.   :
  670. else
  671.   rm -rf conftest*
  672.   
  673. {
  674. test -n "$verbose" && \
  675. echo "    defining pid_t to be int"
  676. echo "#define pid_t int" >> confdefs.h
  677. DEFS="$DEFS -Dpid_t=int"
  678. SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
  679. \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
  680. \${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
  681. "
  682. }
  683.  
  684. fi
  685. rm -f conftest*
  686.  
  687. echo checking for return type of signal handlers
  688. cat > conftest.c <<EOF
  689. #include "confdefs.h"
  690. #include <sys/types.h>
  691. #include <signal.h>
  692. #ifdef signal
  693. #undef signal
  694. #endif
  695. extern void (*signal ()) ();
  696. int main() { exit(0); }
  697. int t() { int i; }
  698. EOF
  699. if eval $compile; then
  700.   rm -rf conftest*
  701.   
  702. {
  703. test -n "$verbose" && \
  704. echo "    defining RETSIGTYPE to be void"
  705. echo "#define RETSIGTYPE void" >> confdefs.h
  706. DEFS="$DEFS -DRETSIGTYPE=void"
  707. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  708. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  709. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  710. "
  711. }
  712.  
  713.  
  714. else
  715.   rm -rf conftest*
  716.   
  717. {
  718. test -n "$verbose" && \
  719. echo "    defining RETSIGTYPE to be int"
  720. echo "#define RETSIGTYPE int" >> confdefs.h
  721. DEFS="$DEFS -DRETSIGTYPE=int"
  722. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  723. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  724. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  725. "
  726. }
  727.  
  728. fi
  729. rm -f conftest*
  730.  
  731.  
  732. for hdr in unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
  733.             sys/timeb.h
  734. do
  735. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  736. echo checking for ${hdr}
  737. cat > conftest.c <<EOF
  738. #include "confdefs.h"
  739. #include <${hdr}>
  740. EOF
  741. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  742. if test -z "$err"; then
  743.   rm -rf conftest*
  744.   
  745. {
  746. test -n "$verbose" && \
  747. echo "    defining ${trhdr}"
  748. echo "#define ${trhdr} 1" >> confdefs.h
  749. DEFS="$DEFS -D${trhdr}=1"
  750. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  751. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  752. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  753. "
  754. }
  755.  
  756.  
  757. fi
  758. rm -f conftest*
  759. done
  760.  
  761. echo checking whether $CC and cc understand -c and -o together
  762. echo 'foo(){}' > conftest.c
  763. # Make sure it works both with $CC and with simple cc.
  764. # We do the test twice because some compilers refuse to overwrite an
  765. # existing .o file with -o, though they will create one.
  766. if ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 \
  767.  && test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1
  768. then
  769.   # Test first that cc exists at all.
  770.   if cc -c conftest.c >/dev/null 2>&1
  771.   then
  772.     if cc -c conftest.c -o conftest2.o >/dev/null 2>&1 && \
  773.        test -f conftest2.o && cc -c conftest.c -o conftest2.o >/dev/null 2>&1
  774.     then
  775.       :
  776.     else
  777.       
  778. {
  779. test -n "$verbose" && \
  780. echo "    defining NO_MINUS_C_MINUS_O"
  781. echo "#define NO_MINUS_C_MINUS_O 1" >> confdefs.h
  782. DEFS="$DEFS -DNO_MINUS_C_MINUS_O=1"
  783. SEDDEFS="${SEDDEFS}\${SEDdA}NO_MINUS_C_MINUS_O\${SEDdB}NO_MINUS_C_MINUS_O\${SEDdC}1\${SEDdD}
  784. \${SEDuA}NO_MINUS_C_MINUS_O\${SEDuB}NO_MINUS_C_MINUS_O\${SEDuC}1\${SEDuD}
  785. \${SEDeA}NO_MINUS_C_MINUS_O\${SEDeB}NO_MINUS_C_MINUS_O\${SEDeC}1\${SEDeD}
  786. "
  787. }
  788.  
  789.     fi
  790.   fi
  791. else
  792.   
  793. {
  794. test -n "$verbose" && \
  795. echo "    defining NO_MINUS_C_MINUS_O"
  796. echo "#define NO_MINUS_C_MINUS_O 1" >> confdefs.h
  797. DEFS="$DEFS -DNO_MINUS_C_MINUS_O=1"
  798. SEDDEFS="${SEDDEFS}\${SEDdA}NO_MINUS_C_MINUS_O\${SEDdB}NO_MINUS_C_MINUS_O\${SEDdC}1\${SEDdD}
  799. \${SEDuA}NO_MINUS_C_MINUS_O\${SEDuB}NO_MINUS_C_MINUS_O\${SEDuC}1\${SEDuD}
  800. \${SEDeA}NO_MINUS_C_MINUS_O\${SEDeB}NO_MINUS_C_MINUS_O\${SEDeC}1\${SEDeD}
  801. "
  802. }
  803.  
  804. fi
  805. rm -f conftest*
  806.  
  807. prog='/* Ultrix mips cc rejects this.  */
  808. typedef int charset[2]; const charset x;
  809. /* SunOS 4.1.1 cc rejects this.  */
  810. char const *const *ccp;
  811. char **p;
  812. /* AIX XL C 1.02.0.0 rejects this.
  813.    It does not let you subtract one const X* pointer from another in an arm
  814.    of an if-expression whose if-part is not a constant expression */
  815. const char *g = "string";
  816. ccp = &g + (g ? g-g : 0);
  817. /* HPUX 7.0 cc rejects these. */
  818. ++ccp;
  819. p = (char**) ccp;
  820. ccp = (char const *const *) p;
  821. { /* SCO 3.2v4 cc rejects this.  */
  822.   char *t;
  823.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  824.  
  825.   *t++ = 0;
  826. }
  827. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  828.   int x[] = {25,17};
  829.   const int *foo = &x[0];
  830.   ++foo;
  831. }
  832. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  833.   typedef const int *iptr;
  834.   iptr p = 0;
  835.   ++p;
  836. }
  837. { /* AIX XL C 1.02.0.0 rejects this saying
  838.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  839.   struct s { int j; const int *ap[3]; };
  840.   struct s *b; b->j = 5;
  841. }
  842. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  843.   const int foo = 10;
  844. }'
  845. echo checking for lack of working const
  846. cat > conftest.c <<EOF
  847. #include "confdefs.h"
  848.  
  849. int main() { exit(0); }
  850. int t() { $prog }
  851. EOF
  852. if eval $compile; then
  853.   :
  854. else
  855.   rm -rf conftest*
  856.   
  857. {
  858. test -n "$verbose" && \
  859. echo "    defining const to be empty"
  860. echo "#define const " >> confdefs.h
  861. DEFS="$DEFS -Dconst="
  862. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  863. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  864. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  865. "
  866. }
  867.  
  868. fi
  869. rm -f conftest*
  870.             echo checking for broken stat file mode macros
  871. cat > conftest.c <<EOF
  872. #include "confdefs.h"
  873. #include <sys/types.h>
  874. #include <sys/stat.h>
  875. #ifdef S_ISBLK
  876. #if S_ISBLK (S_IFDIR)
  877. You lose.
  878. #endif
  879. #ifdef S_IFCHR
  880. #if S_ISBLK (S_IFCHR)
  881. You lose.
  882. #endif
  883. #endif /* S_IFCHR */
  884. #endif /* S_ISBLK */
  885. #ifdef S_ISLNK
  886. #if S_ISLNK (S_IFREG)
  887. You lose.
  888. #endif
  889. #endif /* S_ISLNK */
  890. #ifdef S_ISSOCK
  891. #if S_ISSOCK (S_IFREG)
  892. You lose.
  893. #endif
  894. #endif /* S_ISSOCK */
  895.  
  896. EOF
  897. eval "$CPP conftest.c > conftest.out 2>&1"
  898. if egrep "You lose" conftest.out >/dev/null 2>&1; then
  899.   rm -rf conftest*
  900.   
  901. {
  902. test -n "$verbose" && \
  903. echo "    defining STAT_MACROS_BROKEN"
  904. echo "#define STAT_MACROS_BROKEN 1" >> confdefs.h
  905. DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
  906. SEDDEFS="${SEDDEFS}\${SEDdA}STAT_MACROS_BROKEN\${SEDdB}STAT_MACROS_BROKEN\${SEDdC}1\${SEDdD}
  907. \${SEDuA}STAT_MACROS_BROKEN\${SEDuB}STAT_MACROS_BROKEN\${SEDuC}1\${SEDuD}
  908. \${SEDeA}STAT_MACROS_BROKEN\${SEDeB}STAT_MACROS_BROKEN\${SEDeC}1\${SEDeD}
  909. "
  910. }
  911.  
  912.  
  913. fi
  914. rm -f conftest*
  915.  
  916.  
  917.  
  918.  
  919. for func in getdtablesize sys_siglist _sys_siglist psignal \
  920.           dup2 getcwd sigsetmask getgroups setlinebuf \
  921.           setreuid setregid strerror
  922. do
  923. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  924. echo checking for ${func}
  925. cat > conftest.c <<EOF
  926. #include "confdefs.h"
  927. #include <ctype.h>
  928. int main() { exit(0); }
  929. int t() { 
  930. /* The GNU C library defines this for functions which it implements
  931.     to always fail with ENOSYS.  Some functions are actually named
  932.     something starting with __ and the normal name is an alias.  */
  933. #if defined (__stub_${func}) || defined (__stub___${func})
  934. choke me
  935. #else
  936. /* Override any gcc2 internal prototype to avoid an error.  */
  937. extern char ${func}(); ${func}();
  938. #endif
  939.  }
  940. EOF
  941. if eval $compile; then
  942.   rm -rf conftest*
  943.   {
  944. test -n "$verbose" && \
  945. echo "    defining ${trfunc}"
  946. echo "#define ${trfunc} 1" >> confdefs.h
  947. DEFS="$DEFS -D${trfunc}=1"
  948. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  949. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  950. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  951. "
  952. }
  953.  
  954.  
  955. fi
  956. rm -f conftest*
  957. done
  958.  
  959. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  960. # for constant arguments.  Useless!
  961. echo checking for working alloca.h
  962. cat > conftest.c <<EOF
  963. #include "confdefs.h"
  964. #include <alloca.h>
  965. int main() { exit(0); }
  966. int t() { char *p = alloca(2 * sizeof(int)); }
  967. EOF
  968. if eval $compile; then
  969.   rm -rf conftest*
  970.   
  971. {
  972. test -n "$verbose" && \
  973. echo "    defining HAVE_ALLOCA_H"
  974. echo "#define HAVE_ALLOCA_H 1" >> confdefs.h
  975. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  976. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  977. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  978. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  979. "
  980. }
  981.  
  982.  
  983. fi
  984. rm -f conftest*
  985.  
  986. decl="#ifdef __GNUC__
  987. #define alloca __builtin_alloca
  988. #else
  989. #if HAVE_ALLOCA_H
  990. #include <alloca.h>
  991. #else
  992. #ifdef _AIX
  993.  #pragma alloca
  994. #else
  995. char *alloca ();
  996. #endif
  997. #endif
  998. #endif
  999. "
  1000. echo checking for alloca
  1001. cat > conftest.c <<EOF
  1002. #include "confdefs.h"
  1003. $decl
  1004. int main() { exit(0); }
  1005. int t() { char *p = (char *) alloca(1); }
  1006. EOF
  1007. if eval $compile; then
  1008.   rm -rf conftest*
  1009.   
  1010. {
  1011. test -n "$verbose" && \
  1012. echo "    defining HAVE_ALLOCA"
  1013. echo "#define HAVE_ALLOCA 1" >> confdefs.h
  1014. DEFS="$DEFS -DHAVE_ALLOCA=1"
  1015. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA\${SEDdB}HAVE_ALLOCA\${SEDdC}1\${SEDdD}
  1016. \${SEDuA}HAVE_ALLOCA\${SEDuB}HAVE_ALLOCA\${SEDuC}1\${SEDuD}
  1017. \${SEDeA}HAVE_ALLOCA\${SEDeB}HAVE_ALLOCA\${SEDeC}1\${SEDeD}
  1018. "
  1019. }
  1020.  
  1021.  
  1022. else
  1023.   rm -rf conftest*
  1024.   alloca_missing=1
  1025. cat > conftest.c <<EOF
  1026. #include "confdefs.h"
  1027.  
  1028. #if defined(CRAY) && ! defined(CRAY2)
  1029. winnitude
  1030. #else
  1031. lossage
  1032. #endif
  1033.  
  1034. EOF
  1035. eval "$CPP conftest.c > conftest.out 2>&1"
  1036. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  1037.   rm -rf conftest*
  1038.   echo checking for _getb67
  1039. cat > conftest.c <<EOF
  1040. #include "confdefs.h"
  1041. #include <ctype.h>
  1042. int main() { exit(0); }
  1043. int t() { 
  1044. /* The GNU C library defines this for functions which it implements
  1045.     to always fail with ENOSYS.  Some functions are actually named
  1046.     something starting with __ and the normal name is an alias.  */
  1047. #if defined (__stub__getb67) || defined (__stub____getb67)
  1048. choke me
  1049. #else
  1050. /* Override any gcc2 internal prototype to avoid an error.  */
  1051. extern char _getb67(); _getb67();
  1052. #endif
  1053.  }
  1054. EOF
  1055. if eval $compile; then
  1056.   rm -rf conftest*
  1057.   {
  1058. test -n "$verbose" && \
  1059. echo "    defining CRAY_STACKSEG_END to be _getb67"
  1060. echo "#define CRAY_STACKSEG_END _getb67" >> confdefs.h
  1061. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  1062. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  1063. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  1064. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  1065. "
  1066. }
  1067.  
  1068.  
  1069. else
  1070.   rm -rf conftest*
  1071.   echo checking for GETB67
  1072. cat > conftest.c <<EOF
  1073. #include "confdefs.h"
  1074. #include <ctype.h>
  1075. int main() { exit(0); }
  1076. int t() { 
  1077. /* The GNU C library defines this for functions which it implements
  1078.     to always fail with ENOSYS.  Some functions are actually named
  1079.     something starting with __ and the normal name is an alias.  */
  1080. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  1081. choke me
  1082. #else
  1083. /* Override any gcc2 internal prototype to avoid an error.  */
  1084. extern char GETB67(); GETB67();
  1085. #endif
  1086.  }
  1087. EOF
  1088. if eval $compile; then
  1089.   rm -rf conftest*
  1090.   {
  1091. test -n "$verbose" && \
  1092. echo "    defining CRAY_STACKSEG_END to be GETB67"
  1093. echo "#define CRAY_STACKSEG_END GETB67" >> confdefs.h
  1094. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  1095. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  1096. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  1097. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  1098. "
  1099. }
  1100.  
  1101.  
  1102. else
  1103.   rm -rf conftest*
  1104.   echo checking for getb67
  1105. cat > conftest.c <<EOF
  1106. #include "confdefs.h"
  1107. #include <ctype.h>
  1108. int main() { exit(0); }
  1109. int t() { 
  1110. /* The GNU C library defines this for functions which it implements
  1111.     to always fail with ENOSYS.  Some functions are actually named
  1112.     something starting with __ and the normal name is an alias.  */
  1113. #if defined (__stub_getb67) || defined (__stub___getb67)
  1114. choke me
  1115. #else
  1116. /* Override any gcc2 internal prototype to avoid an error.  */
  1117. extern char getb67(); getb67();
  1118. #endif
  1119.  }
  1120. EOF
  1121. if eval $compile; then
  1122.   rm -rf conftest*
  1123.   {
  1124. test -n "$verbose" && \
  1125. echo "    defining CRAY_STACKSEG_END to be getb67"
  1126. echo "#define CRAY_STACKSEG_END getb67" >> confdefs.h
  1127. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  1128. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  1129. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  1130. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  1131. "
  1132. }
  1133.  
  1134.  
  1135. fi
  1136. rm -f conftest*
  1137.  
  1138. fi
  1139. rm -f conftest*
  1140.  
  1141. fi
  1142. rm -f conftest*
  1143.  
  1144.  
  1145. fi
  1146. rm -f conftest*
  1147.  
  1148.  
  1149. fi
  1150. rm -f conftest*
  1151.  
  1152. if test -n "$alloca_missing"; then
  1153.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1154.   # that cause trouble.  Some versions do not even contain alloca or
  1155.   # contain a buggy version.  If you still want to use their alloca,
  1156.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1157.   ALLOCA=alloca.o
  1158.   
  1159. {
  1160. test -n "$verbose" && \
  1161. echo "    defining C_ALLOCA"
  1162. echo "#define C_ALLOCA 1" >> confdefs.h
  1163. DEFS="$DEFS -DC_ALLOCA=1"
  1164. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  1165. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  1166. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  1167. "
  1168. }
  1169.  
  1170.  
  1171.   echo 'checking stack direction for C alloca'
  1172.   echo checking whether cross-compiling
  1173. # If we cannot run a trivial program, we must be cross compiling.
  1174. cat > conftest.c <<EOF
  1175. #include "confdefs.h"
  1176. main(){exit(0);}
  1177. EOF
  1178. eval $compile
  1179. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1180.   :
  1181. else
  1182.   cross_compiling=1
  1183. fi
  1184. rm -fr conftest*
  1185.  
  1186. if test -n "$cross_compiling"
  1187. then
  1188.   
  1189. {
  1190. test -n "$verbose" && \
  1191. echo "    defining STACK_DIRECTION to be 0"
  1192. echo "#define STACK_DIRECTION 0" >> confdefs.h
  1193. DEFS="$DEFS -DSTACK_DIRECTION=0"
  1194. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  1195. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  1196. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  1197. "
  1198. }
  1199.  
  1200. else
  1201. cat > conftest.c <<EOF
  1202. #include "confdefs.h"
  1203. find_stack_direction ()
  1204. {
  1205.   static char *addr = 0;
  1206.   auto char dummy;
  1207.   if (addr == 0)
  1208.     {
  1209.       addr = &dummy;
  1210.       return find_stack_direction ();
  1211.     }
  1212.   else
  1213.     return (&dummy > addr) ? 1 : -1;
  1214. }
  1215. main ()
  1216. {
  1217.   exit (find_stack_direction() < 0);
  1218. }
  1219. EOF
  1220. eval $compile
  1221. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1222.   
  1223. {
  1224. test -n "$verbose" && \
  1225. echo "    defining STACK_DIRECTION to be 1"
  1226. echo "#define STACK_DIRECTION 1" >> confdefs.h
  1227. DEFS="$DEFS -DSTACK_DIRECTION=1"
  1228. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  1229. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  1230. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  1231. "
  1232. }
  1233.  
  1234.  
  1235. else
  1236.   
  1237. {
  1238. test -n "$verbose" && \
  1239. echo "    defining STACK_DIRECTION to be -1"
  1240. echo "#define STACK_DIRECTION -1" >> confdefs.h
  1241. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  1242. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  1243. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  1244. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  1245. "
  1246. }
  1247.  
  1248. fi
  1249. fi
  1250. rm -fr conftest*
  1251. fi
  1252.  
  1253. echo checking for vfork.h
  1254. cat > conftest.c <<EOF
  1255. #include "confdefs.h"
  1256. #include <vfork.h>
  1257. EOF
  1258. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1259. if test -z "$err"; then
  1260.   rm -rf conftest*
  1261.   
  1262. {
  1263. test -n "$verbose" && \
  1264. echo "    defining HAVE_VFORK_H"
  1265. echo "#define HAVE_VFORK_H 1" >> confdefs.h
  1266. DEFS="$DEFS -DHAVE_VFORK_H=1"
  1267. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VFORK_H\${SEDdB}HAVE_VFORK_H\${SEDdC}1\${SEDdD}
  1268. \${SEDuA}HAVE_VFORK_H\${SEDuB}HAVE_VFORK_H\${SEDuC}1\${SEDuD}
  1269. \${SEDeA}HAVE_VFORK_H\${SEDeB}HAVE_VFORK_H\${SEDeC}1\${SEDeD}
  1270. "
  1271. }
  1272.  
  1273.  
  1274. fi
  1275. rm -f conftest*
  1276.  
  1277. echo checking for working vfork
  1278.  
  1279. cat > conftest.c <<EOF
  1280. #include "confdefs.h"
  1281. /* Thanks to Paul Eggert for this test.  */
  1282. #include <stdio.h>
  1283. #include <sys/types.h>
  1284. #include <sys/stat.h>
  1285. #include <signal.h>
  1286. #ifdef HAVE_UNISTD_H
  1287. #include <unistd.h>
  1288. #endif
  1289. #ifdef HAVE_VFORK_H
  1290. #include <vfork.h>
  1291. #endif
  1292. static int signalled;
  1293. static RETSIGTYPE catch (s) int s; { signalled = 1; }
  1294. main() {
  1295.   pid_t parent = getpid ();
  1296.   pid_t child;
  1297.  
  1298.   signal (SIGINT, catch);
  1299.  
  1300.   child = vfork ();
  1301.  
  1302.   if (child == 0) {
  1303.     /* On sparc systems, changes by the child to local and incoming
  1304.        argument registers are propagated back to the parent.
  1305.        The compiler is told about this with #include <vfork.h>,
  1306.        but some compilers (e.g. gcc -O) don't grok <vfork.h>.
  1307.        Test for this by using lots of local variables, at least
  1308.        as many local variables as main has allocated so far
  1309.        including compiler temporaries.  4 locals are enough for
  1310.        gcc 1.40.3 on a sparc, but we use 8 to be safe.
  1311.        A buggy compiler should reuse the register of parent
  1312.        for one of the local variables, since it will think that
  1313.        parent can't possibly be used any more in this routine.
  1314.        Assigning to the local variable will thus munge parent
  1315.        in the parent process.  */
  1316.     pid_t
  1317.       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
  1318.       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
  1319.     /* Convince the compiler that p..p7 are live; otherwise, it might
  1320.        use the same hardware register for all 8 local variables.  */
  1321.     if (p != p1 || p != p2 || p != p3 || p != p4
  1322.     || p != p5 || p != p6 || p != p7)
  1323.       _exit(1);
  1324.  
  1325.     /* On some systems (e.g. SunOS 5.2), if the parent is catching
  1326.        a signal, the child ignores the signal before execing,
  1327.        and the parent later receives that signal, the parent dumps core.
  1328.        Test for this by ignoring SIGINT in the child.  */
  1329.     signal (SIGINT, SIG_IGN);
  1330.  
  1331.     /* On some systems (e.g. IRIX 3.3),
  1332.        vfork doesn't separate parent from child file descriptors.
  1333.        If the child closes a descriptor before it execs or exits,
  1334.        this munges the parent's descriptor as well.
  1335.        Test for this by closing stdout in the child.  */
  1336.     _exit(close(fileno(stdout)) != 0);
  1337.   } else {
  1338.     int status;
  1339.     struct stat st;
  1340.  
  1341.     while (wait(&status) != child)
  1342.       ;
  1343.     exit(
  1344.      /* Was there some problem with vforking?  */
  1345.      child < 0
  1346.  
  1347.      /* Did the child fail?  (This shouldn't happen.)  */
  1348.      || status
  1349.  
  1350.      /* Did the vfork/compiler bug occur?  */
  1351.      || parent != getpid()
  1352.  
  1353.      /* Did the signal handling bug occur?  */
  1354.      || kill(parent, SIGINT) != 0
  1355.      || signalled != 1
  1356.  
  1357.      /* Did the file descriptor bug occur?  */
  1358.      || fstat(fileno(stdout), &st) != 0
  1359.      );
  1360.   }
  1361. }
  1362. EOF
  1363. eval $compile
  1364. if true; then
  1365.   :
  1366. else
  1367.   
  1368. {
  1369. test -n "$verbose" && \
  1370. echo "    defining vfork to be fork"
  1371. echo "#define vfork fork" >> confdefs.h
  1372. DEFS="$DEFS -Dvfork=fork"
  1373. SEDDEFS="${SEDDEFS}\${SEDdA}vfork\${SEDdB}vfork\${SEDdC}fork\${SEDdD}
  1374. \${SEDuA}vfork\${SEDuB}vfork\${SEDuC}fork\${SEDuD}
  1375. \${SEDeA}vfork\${SEDeB}vfork\${SEDeC}fork\${SEDeD}
  1376. "
  1377. }
  1378.  
  1379. fi
  1380. rm -fr conftest*
  1381.  
  1382. cat > conftest.c <<EOF
  1383. #include "confdefs.h"
  1384. #include <stdio.h>
  1385. /* If setvbuf has the reversed format, exit 0. */
  1386. main () {
  1387.   /* This call has the arguments reversed.
  1388.      A reversed system may check and see that the address of main
  1389.      is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
  1390.   if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
  1391.     exit(1);
  1392.   putc('\r', stdout);
  1393.   exit(0);            /* Non-reversed systems segv here.  */
  1394. }
  1395. EOF
  1396. eval $compile
  1397. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1398.   
  1399. {
  1400. test -n "$verbose" && \
  1401. echo "    defining SETVBUF_REVERSED"
  1402. echo "#define SETVBUF_REVERSED 1" >> confdefs.h
  1403. DEFS="$DEFS -DSETVBUF_REVERSED=1"
  1404. SEDDEFS="${SEDDEFS}\${SEDdA}SETVBUF_REVERSED\${SEDdB}SETVBUF_REVERSED\${SEDdC}1\${SEDdD}
  1405. \${SEDuA}SETVBUF_REVERSED\${SEDuB}SETVBUF_REVERSED\${SEDuC}1\${SEDuD}
  1406. \${SEDeA}SETVBUF_REVERSED\${SEDeB}SETVBUF_REVERSED\${SEDeC}1\${SEDeD}
  1407. "
  1408. }
  1409.  
  1410.  
  1411. fi
  1412. rm -fr conftest*
  1413. rm -f core
  1414.  
  1415. # Some definitions of getloadavg require that the program be installed setgid.
  1416. NEED_SETGID=false
  1417. need_func=true
  1418.  
  1419. # Check for the 4.4BSD definition of getloadavg.
  1420. LIBS_save="${LIBS}"
  1421. LIBS="${LIBS} -lutil"
  1422. have_lib=""
  1423. echo checking for -lutil
  1424. cat > conftest.c <<EOF
  1425. #include "confdefs.h"
  1426.  
  1427. int main() { exit(0); }
  1428. int t() { main(); }
  1429. EOF
  1430. if eval $compile; then
  1431.   rm -rf conftest*
  1432.   have_lib="1"
  1433.  
  1434. fi
  1435. rm -f conftest*
  1436. LIBS="${LIBS_save}"
  1437. if test -n "${have_lib}"; then
  1438.    :; LIBS_save="${LIBS}"
  1439. LIBS="${LIBS} -lkvm"
  1440. have_lib=""
  1441. echo checking for -lkvm
  1442. cat > conftest.c <<EOF
  1443. #include "confdefs.h"
  1444.  
  1445. int main() { exit(0); }
  1446. int t() { main(); }
  1447. EOF
  1448. if eval $compile; then
  1449.   rm -rf conftest*
  1450.   have_lib="1"
  1451.  
  1452. fi
  1453. rm -f conftest*
  1454. LIBS="${LIBS_save}"
  1455. if test -n "${have_lib}"; then
  1456.    :; LIBS="$LIBS -lutil -lkvm" need_func=false
  1457. else
  1458.    :; 
  1459. fi
  1460.  
  1461. else
  1462.    :; 
  1463. fi
  1464.  
  1465.  
  1466. if $need_func; then
  1467. # There is a commonly available library for RS/6000 AIX.
  1468. # Since it is not a standard part of AIX, it might be installed locally.
  1469. LIBS_old="$LIBS"
  1470. LIBS="-L/local/lib $LIBS"
  1471. LIBS_save="${LIBS}"
  1472. LIBS="${LIBS} -lgetloadavg"
  1473. have_lib=""
  1474. echo checking for -lgetloadavg
  1475. cat > conftest.c <<EOF
  1476. #include "confdefs.h"
  1477.  
  1478. int main() { exit(0); }
  1479. int t() { main(); }
  1480. EOF
  1481. if eval $compile; then
  1482.   rm -rf conftest*
  1483.   have_lib="1"
  1484.  
  1485. fi
  1486. rm -f conftest*
  1487. LIBS="${LIBS_save}"
  1488. if test -n "${have_lib}"; then
  1489.    :; LIBS="$LIBS -lgetloadavg" need_func=false
  1490. else
  1491.    :; LIBS="$LIBS_old"
  1492. fi
  1493.  
  1494. fi
  1495.  
  1496. # Make sure it is really in the library, if we think we found it at all.
  1497. for func in getloadavg
  1498. do
  1499. echo checking for ${func}
  1500. cat > conftest.c <<EOF
  1501. #include "confdefs.h"
  1502. #include <ctype.h>
  1503. int main() { exit(0); }
  1504. int t() { 
  1505. /* The GNU C library defines this for functions which it implements
  1506.     to always fail with ENOSYS.  Some functions are actually named
  1507.     something starting with __ and the normal name is an alias.  */
  1508. #if defined (__stub_${func}) || defined (__stub___${func})
  1509. choke me
  1510. #else
  1511. /* Override any gcc2 internal prototype to avoid an error.  */
  1512. extern char ${func}(); ${func}();
  1513. #endif
  1514.  }
  1515. EOF
  1516. if eval $compile; then
  1517.   :
  1518. else
  1519.   rm -rf conftest*
  1520.   LIBOBJS="$LIBOBJS ${func}.o"
  1521. test -n "$verbose" && echo "    using ${func}.o instead"
  1522. fi
  1523. rm -f conftest*
  1524.  
  1525. done
  1526.  
  1527.  
  1528. case "$LIBOBJS" in
  1529. *getloadavg*)
  1530. need_func=true
  1531. echo checking for sys/dg_sys_info.h
  1532. cat > conftest.c <<EOF
  1533. #include "confdefs.h"
  1534. #include <sys/dg_sys_info.h>
  1535. EOF
  1536. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1537. if test -z "$err"; then
  1538.   rm -rf conftest*
  1539.   
  1540. {
  1541. test -n "$verbose" && \
  1542. echo "    defining DGUX"
  1543. echo "#define DGUX 1" >> confdefs.h
  1544. DEFS="$DEFS -DDGUX=1"
  1545. SEDDEFS="${SEDDEFS}\${SEDdA}DGUX\${SEDdB}DGUX\${SEDdC}1\${SEDdD}
  1546. \${SEDuA}DGUX\${SEDuB}DGUX\${SEDuC}1\${SEDuD}
  1547. \${SEDeA}DGUX\${SEDeB}DGUX\${SEDeC}1\${SEDeD}
  1548. "
  1549. }
  1550.  need_func=false
  1551. # Some versions of DGUX need -ldgc for dg_sys_info.
  1552. LIBS_save="${LIBS}"
  1553. LIBS="${LIBS} -ldgc"
  1554. have_lib=""
  1555. echo checking for -ldgc
  1556. cat > conftest.c <<EOF
  1557. #include "confdefs.h"
  1558.  
  1559. int main() { exit(0); }
  1560. int t() { main(); }
  1561. EOF
  1562. if eval $compile; then
  1563.   rm -rf conftest*
  1564.   have_lib="1"
  1565.  
  1566. fi
  1567. rm -f conftest*
  1568. LIBS="${LIBS_save}"
  1569. if test -n "${have_lib}"; then
  1570.    
  1571. {
  1572. test -n "$verbose" && \
  1573. echo "    defining HAVE_LIBDGC"
  1574. echo "#define HAVE_LIBDGC 1" >> confdefs.h
  1575. DEFS="$DEFS -DHAVE_LIBDGC=1"
  1576. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDGC\${SEDdB}HAVE_LIBDGC\${SEDdC}1\${SEDdD}
  1577. \${SEDuA}HAVE_LIBDGC\${SEDuB}HAVE_LIBDGC\${SEDuC}1\${SEDuD}
  1578. \${SEDeA}HAVE_LIBDGC\${SEDeB}HAVE_LIBDGC\${SEDeC}1\${SEDeD}
  1579. "
  1580. }
  1581.  
  1582.    LIBS="${LIBS} -ldgc"
  1583. fi
  1584.  
  1585.  
  1586. fi
  1587. rm -f conftest*
  1588.  
  1589. if $need_func; then
  1590. # We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
  1591. # uses stabs), but it's still SVR4.  We cannot check for <elf.h> because
  1592. # Irix 4.0.5F has the header but not the library.
  1593. LIBS_save="${LIBS}"
  1594. LIBS="${LIBS} -lelf"
  1595. have_lib=""
  1596. echo checking for -lelf
  1597. cat > conftest.c <<EOF
  1598. #include "confdefs.h"
  1599.  
  1600. int main() { exit(0); }
  1601. int t() { main(); }
  1602. EOF
  1603. if eval $compile; then
  1604.   rm -rf conftest*
  1605.   have_lib="1"
  1606.  
  1607. fi
  1608. rm -f conftest*
  1609. LIBS="${LIBS_save}"
  1610. if test -n "${have_lib}"; then
  1611.    :; 
  1612. {
  1613. test -n "$verbose" && \
  1614. echo "    defining SVR4"
  1615. echo "#define SVR4 1" >> confdefs.h
  1616. DEFS="$DEFS -DSVR4=1"
  1617. SEDDEFS="${SEDDEFS}\${SEDdA}SVR4\${SEDdB}SVR4\${SEDdC}1\${SEDdD}
  1618. \${SEDuA}SVR4\${SEDuB}SVR4\${SEDuC}1\${SEDuD}
  1619. \${SEDeA}SVR4\${SEDeB}SVR4\${SEDeC}1\${SEDeD}
  1620. "
  1621. }
  1622.  LIBS="$LIBS -lelf" need_func=false
  1623.   LIBS_save="${LIBS}"
  1624. LIBS="${LIBS} -lkvm"
  1625. have_lib=""
  1626. echo checking for -lkvm
  1627. cat > conftest.c <<EOF
  1628. #include "confdefs.h"
  1629.  
  1630. int main() { exit(0); }
  1631. int t() { main(); }
  1632. EOF
  1633. if eval $compile; then
  1634.   rm -rf conftest*
  1635.   have_lib="1"
  1636.  
  1637. fi
  1638. rm -f conftest*
  1639. LIBS="${LIBS_save}"
  1640. if test -n "${have_lib}"; then
  1641.    :; LIBS="$LIBS -lkvm"
  1642. else
  1643.    :; 
  1644. fi
  1645.  
  1646. else
  1647.    :; 
  1648. fi
  1649.  
  1650. fi
  1651. if $need_func; then
  1652. echo checking for inq_stats/cpustats.h
  1653. cat > conftest.c <<EOF
  1654. #include "confdefs.h"
  1655. #include <inq_stats/cpustats.h>
  1656. EOF
  1657. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1658. if test -z "$err"; then
  1659.   rm -rf conftest*
  1660.   
  1661. {
  1662. test -n "$verbose" && \
  1663. echo "    defining UMAX4_3"
  1664. echo "#define UMAX4_3 1" >> confdefs.h
  1665. DEFS="$DEFS -DUMAX4_3=1"
  1666. SEDDEFS="${SEDDEFS}\${SEDdA}UMAX4_3\${SEDdB}UMAX4_3\${SEDdC}1\${SEDdD}
  1667. \${SEDuA}UMAX4_3\${SEDuB}UMAX4_3\${SEDuC}1\${SEDuD}
  1668. \${SEDeA}UMAX4_3\${SEDeB}UMAX4_3\${SEDeC}1\${SEDeD}
  1669. "
  1670. }
  1671.  
  1672. {
  1673. test -n "$verbose" && \
  1674. echo "    defining UMAX"
  1675. echo "#define UMAX 1" >> confdefs.h
  1676. DEFS="$DEFS -DUMAX=1"
  1677. SEDDEFS="${SEDDEFS}\${SEDdA}UMAX\${SEDdB}UMAX\${SEDdC}1\${SEDdD}
  1678. \${SEDuA}UMAX\${SEDuB}UMAX\${SEDuC}1\${SEDuD}
  1679. \${SEDeA}UMAX\${SEDeB}UMAX\${SEDeC}1\${SEDeD}
  1680. "
  1681. }
  1682.  
  1683.   need_func=false
  1684.  
  1685. fi
  1686. rm -f conftest*
  1687.  
  1688. fi
  1689. if $need_func; then
  1690. echo checking for sys/cpustats.h
  1691. cat > conftest.c <<EOF
  1692. #include "confdefs.h"
  1693. #include <sys/cpustats.h>
  1694. EOF
  1695. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1696. if test -z "$err"; then
  1697.   rm -rf conftest*
  1698.   
  1699. {
  1700. test -n "$verbose" && \
  1701. echo "    defining UMAX"
  1702. echo "#define UMAX 1" >> confdefs.h
  1703. DEFS="$DEFS -DUMAX=1"
  1704. SEDDEFS="${SEDDEFS}\${SEDdA}UMAX\${SEDdB}UMAX\${SEDdC}1\${SEDdD}
  1705. \${SEDuA}UMAX\${SEDuB}UMAX\${SEDuC}1\${SEDuD}
  1706. \${SEDeA}UMAX\${SEDeB}UMAX\${SEDeC}1\${SEDeD}
  1707. "
  1708. }
  1709.  need_func=false
  1710.  
  1711. fi
  1712. rm -f conftest*
  1713.  
  1714. fi
  1715. if $need_func; then
  1716. for hdr in mach/mach.h
  1717. do
  1718. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1719. echo checking for ${hdr}
  1720. cat > conftest.c <<EOF
  1721. #include "confdefs.h"
  1722. #include <${hdr}>
  1723. EOF
  1724. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1725. if test -z "$err"; then
  1726.   rm -rf conftest*
  1727.   
  1728. {
  1729. test -n "$verbose" && \
  1730. echo "    defining ${trhdr}"
  1731. echo "#define ${trhdr} 1" >> confdefs.h
  1732. DEFS="$DEFS -D${trhdr}=1"
  1733. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1734. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1735. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1736. "
  1737. }
  1738.  
  1739.  
  1740. fi
  1741. rm -f conftest*
  1742. done
  1743.  
  1744. fi
  1745.  
  1746. echo checking for nlist.h
  1747. cat > conftest.c <<EOF
  1748. #include "confdefs.h"
  1749. #include <nlist.h>
  1750. EOF
  1751. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1752. if test -z "$err"; then
  1753.   rm -rf conftest*
  1754.   
  1755. {
  1756. test -n "$verbose" && \
  1757. echo "    defining NLIST_STRUCT"
  1758. echo "#define NLIST_STRUCT 1" >> confdefs.h
  1759. DEFS="$DEFS -DNLIST_STRUCT=1"
  1760. SEDDEFS="${SEDDEFS}\${SEDdA}NLIST_STRUCT\${SEDdB}NLIST_STRUCT\${SEDdC}1\${SEDdD}
  1761. \${SEDuA}NLIST_STRUCT\${SEDuB}NLIST_STRUCT\${SEDuC}1\${SEDuD}
  1762. \${SEDeA}NLIST_STRUCT\${SEDeB}NLIST_STRUCT\${SEDeC}1\${SEDeD}
  1763. "
  1764. }
  1765.  
  1766. echo checking for n_un in struct nlist
  1767. cat > conftest.c <<EOF
  1768. #include "confdefs.h"
  1769. #include <nlist.h>
  1770. int main() { exit(0); }
  1771. int t() { struct nlist n; n.n_un.n_name = 0; }
  1772. EOF
  1773. if eval $compile; then
  1774.   rm -rf conftest*
  1775.   
  1776. {
  1777. test -n "$verbose" && \
  1778. echo "    defining NLIST_NAME_UNION"
  1779. echo "#define NLIST_NAME_UNION 1" >> confdefs.h
  1780. DEFS="$DEFS -DNLIST_NAME_UNION=1"
  1781. SEDDEFS="${SEDDEFS}\${SEDdA}NLIST_NAME_UNION\${SEDdB}NLIST_NAME_UNION\${SEDdC}1\${SEDdD}
  1782. \${SEDuA}NLIST_NAME_UNION\${SEDuB}NLIST_NAME_UNION\${SEDuC}1\${SEDuD}
  1783. \${SEDeA}NLIST_NAME_UNION\${SEDeB}NLIST_NAME_UNION\${SEDeC}1\${SEDeD}
  1784. "
  1785. }
  1786.  
  1787.  
  1788. fi
  1789. rm -f conftest*
  1790.  
  1791.  
  1792. fi
  1793. rm -f conftest*
  1794.  
  1795. # Figure out whether we will need to install setgid.
  1796. cat > conftest.c <<EOF
  1797. #include "confdefs.h"
  1798. dnl
  1799. #include "${srcdir}/getloadavg.c"
  1800. #ifdef LDAV_PRIVILEGED
  1801. Yowza Am I SETGID yet
  1802. #endif
  1803. EOF
  1804. eval "$CPP conftest.c > conftest.out 2>&1"
  1805. if egrep "Yowza Am I SETGID yet" conftest.out >/dev/null 2>&1; then
  1806.   rm -rf conftest*
  1807.   
  1808. {
  1809. test -n "$verbose" && \
  1810. echo "    defining GETLOADAVG_PRIVILEGED"
  1811. echo "#define GETLOADAVG_PRIVILEGED 1" >> confdefs.h
  1812. DEFS="$DEFS -DGETLOADAVG_PRIVILEGED=1"
  1813. SEDDEFS="${SEDDEFS}\${SEDdA}GETLOADAVG_PRIVILEGED\${SEDdB}GETLOADAVG_PRIVILEGED\${SEDdC}1\${SEDdD}
  1814. \${SEDuA}GETLOADAVG_PRIVILEGED\${SEDuB}GETLOADAVG_PRIVILEGED\${SEDuC}1\${SEDuD}
  1815. \${SEDeA}GETLOADAVG_PRIVILEGED\${SEDeB}GETLOADAVG_PRIVILEGED\${SEDeC}1\${SEDeD}
  1816. "
  1817. }
  1818.  NEED_SETGID=true
  1819.  
  1820. fi
  1821. rm -f conftest*
  1822. ;;
  1823.  
  1824. *) 
  1825. {
  1826. test -n "$verbose" && \
  1827. echo "    defining HAVE_GETLOADAVG"
  1828. echo "#define HAVE_GETLOADAVG 1" >> confdefs.h
  1829. DEFS="$DEFS -DHAVE_GETLOADAVG=1"
  1830. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_GETLOADAVG\${SEDdB}HAVE_GETLOADAVG\${SEDdC}1\${SEDdD}
  1831. \${SEDuA}HAVE_GETLOADAVG\${SEDuB}HAVE_GETLOADAVG\${SEDuC}1\${SEDuD}
  1832. \${SEDeA}HAVE_GETLOADAVG\${SEDeB}HAVE_GETLOADAVG\${SEDeC}1\${SEDeD}
  1833. "
  1834. }
  1835.  ;;
  1836. esac
  1837.  
  1838. if $NEED_SETGID; then
  1839.   # Figure out what group owns /dev/kmem.
  1840.   # The installed program will need to be setgid and owned by that group.
  1841.   # On Solaris, /dev/kmem is a symlink.  Get info on the real file.
  1842.   ls_output=`ls -lgL /dev/kmem 2>/dev/null`
  1843.   # If we got an error (system does not support symlinks), try without -L.
  1844.   test -z "$ls_output" && ls_output=`ls -lg /dev/kmem`
  1845.   KMEM_GROUP=`echo $ls_output \
  1846.     | sed -ne 's/[     ][     ]*/ /g;
  1847.            s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\)  *.*/\1/;
  1848.            / /s/.* //;p;'`
  1849. fi
  1850.  
  1851. echo checking for strcoll
  1852. cat > conftest.c <<EOF
  1853. #include "confdefs.h"
  1854. #include <string.h>
  1855. main ()
  1856. {
  1857.   exit (strcoll ("abc", "def") >= 0 ||
  1858.     strcoll ("ABC", "DEF") >= 0 ||
  1859.     strcoll ("123", "456") >= 0);
  1860. }
  1861. EOF
  1862. eval $compile
  1863. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1864.   
  1865. {
  1866. test -n "$verbose" && \
  1867. echo "    defining HAVE_STRCOLL"
  1868. echo "#define HAVE_STRCOLL 1" >> confdefs.h
  1869. DEFS="$DEFS -DHAVE_STRCOLL=1"
  1870. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STRCOLL\${SEDdB}HAVE_STRCOLL\${SEDdC}1\${SEDdD}
  1871. \${SEDuA}HAVE_STRCOLL\${SEDuB}HAVE_STRCOLL\${SEDuC}1\${SEDuD}
  1872. \${SEDeA}HAVE_STRCOLL\${SEDeB}HAVE_STRCOLL\${SEDeC}1\${SEDeD}
  1873. "
  1874. }
  1875.  
  1876.  
  1877. fi
  1878. rm -fr conftest*
  1879.  
  1880. for hdr in sys/wait.h
  1881. do
  1882. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  1883. echo checking for ${hdr}
  1884. cat > conftest.c <<EOF
  1885. #include "confdefs.h"
  1886. #include <${hdr}>
  1887. EOF
  1888. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1889. if test -z "$err"; then
  1890.   rm -rf conftest*
  1891.   
  1892. {
  1893. test -n "$verbose" && \
  1894. echo "    defining ${trhdr}"
  1895. echo "#define ${trhdr} 1" >> confdefs.h
  1896. DEFS="$DEFS -D${trhdr}=1"
  1897. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  1898. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  1899. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  1900. "
  1901. }
  1902.  
  1903.  
  1904. fi
  1905. rm -f conftest*
  1906. done
  1907.  for func in waitpid wait3
  1908. do
  1909. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1910. echo checking for ${func}
  1911. cat > conftest.c <<EOF
  1912. #include "confdefs.h"
  1913. #include <ctype.h>
  1914. int main() { exit(0); }
  1915. int t() { 
  1916. /* The GNU C library defines this for functions which it implements
  1917.     to always fail with ENOSYS.  Some functions are actually named
  1918.     something starting with __ and the normal name is an alias.  */
  1919. #if defined (__stub_${func}) || defined (__stub___${func})
  1920. choke me
  1921. #else
  1922. /* Override any gcc2 internal prototype to avoid an error.  */
  1923. extern char ${func}(); ${func}();
  1924. #endif
  1925.  }
  1926. EOF
  1927. if eval $compile; then
  1928.   rm -rf conftest*
  1929.   {
  1930. test -n "$verbose" && \
  1931. echo "    defining ${trfunc}"
  1932. echo "#define ${trfunc} 1" >> confdefs.h
  1933. DEFS="$DEFS -D${trfunc}=1"
  1934. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1935. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1936. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1937. "
  1938. }
  1939.  
  1940.  
  1941. fi
  1942. rm -f conftest*
  1943. done
  1944.  
  1945. echo checking for union wait
  1946. cat > conftest.c <<EOF
  1947. #include "confdefs.h"
  1948. #include <sys/types.h>
  1949. #include <sys/wait.h>
  1950. int main() { exit(0); }
  1951. int t() { union wait status; int pid; pid = wait (&status);
  1952. #ifdef WEXITSTATUS
  1953. /* Some POSIXoid systems have both the new-style macros and the old
  1954.    union wait type, and they do not work together.  If union wait
  1955.    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
  1956. if (WEXITSTATUS (status) != 0) pid = -1;
  1957. #endif
  1958. #ifdef HAVE_WAITPID
  1959. /* Make sure union wait works with waitpid.  */
  1960. pid = waitpid (-1, &status, 0);
  1961. #endif
  1962.  }
  1963. EOF
  1964. if eval $compile; then
  1965.   rm -rf conftest*
  1966.   
  1967. {
  1968. test -n "$verbose" && \
  1969. echo "    defining HAVE_UNION_WAIT"
  1970. echo "#define HAVE_UNION_WAIT 1" >> confdefs.h
  1971. DEFS="$DEFS -DHAVE_UNION_WAIT=1"
  1972. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNION_WAIT\${SEDdB}HAVE_UNION_WAIT\${SEDdC}1\${SEDdD}
  1973. \${SEDuA}HAVE_UNION_WAIT\${SEDuB}HAVE_UNION_WAIT\${SEDuC}1\${SEDuD}
  1974. \${SEDeA}HAVE_UNION_WAIT\${SEDeB}HAVE_UNION_WAIT\${SEDeC}1\${SEDeD}
  1975. "
  1976. }
  1977.  
  1978.  
  1979. fi
  1980. rm -f conftest*
  1981.  
  1982.  
  1983. echo checking for sys_siglist declaration in signal.h or unistd.h
  1984. cat > conftest.c <<EOF
  1985. #include "confdefs.h"
  1986. #include <signal.h>
  1987. /* NetBSD declares sys_siglist in <unistd.h>.  */
  1988. #ifdef HAVE_UNISTD_H
  1989. #include <unistd.h>
  1990. #endif
  1991. int main() { exit(0); }
  1992. int t() { char *msg = *(sys_siglist + 1); }
  1993. EOF
  1994. if eval $compile; then
  1995.   rm -rf conftest*
  1996.   
  1997. {
  1998. test -n "$verbose" && \
  1999. echo "    defining SYS_SIGLIST_DECLARED"
  2000. echo "#define SYS_SIGLIST_DECLARED 1" >> confdefs.h
  2001. DEFS="$DEFS -DSYS_SIGLIST_DECLARED=1"
  2002. SEDDEFS="${SEDDEFS}\${SEDdA}SYS_SIGLIST_DECLARED\${SEDdB}SYS_SIGLIST_DECLARED\${SEDdC}1\${SEDdD}
  2003. \${SEDuA}SYS_SIGLIST_DECLARED\${SEDuB}SYS_SIGLIST_DECLARED\${SEDuC}1\${SEDuD}
  2004. \${SEDeA}SYS_SIGLIST_DECLARED\${SEDeB}SYS_SIGLIST_DECLARED\${SEDeC}1\${SEDeD}
  2005. "
  2006. }
  2007.  
  2008.  
  2009. fi
  2010. rm -f conftest*
  2011.  
  2012.  
  2013. # The presence of the following is not meant to imply
  2014. # that make necessarily works on those systems.
  2015. LIBS_save="${LIBS}"
  2016. LIBS="${LIBS} -lseq"
  2017. have_lib=""
  2018. echo checking for -lseq
  2019. cat > conftest.c <<EOF
  2020. #include "confdefs.h"
  2021.  
  2022. int main() { exit(0); }
  2023. int t() { main(); }
  2024. EOF
  2025. if eval $compile; then
  2026.   rm -rf conftest*
  2027.   have_lib="1"
  2028.  
  2029. fi
  2030. rm -f conftest*
  2031. LIBS="${LIBS_save}"
  2032. if test -n "${have_lib}"; then
  2033.    :; LIBS="$LIBS -lseq"
  2034. else
  2035.    :; 
  2036. fi
  2037.  
  2038.  
  2039. echo checking for Xenix
  2040. cat > conftest.c <<EOF
  2041. #include "confdefs.h"
  2042. #if defined(M_XENIX) && !defined(M_UNIX)
  2043.   yes
  2044. #endif
  2045.  
  2046. EOF
  2047. eval "$CPP conftest.c > conftest.out 2>&1"
  2048. if egrep "yes" conftest.out >/dev/null 2>&1; then
  2049.   rm -rf conftest*
  2050.   XENIX=1
  2051.  
  2052. fi
  2053. rm -f conftest*
  2054.  
  2055. if test -n "$XENIX"; then
  2056.   LIBS="$LIBS -lx"
  2057.   case "$DEFS" in
  2058.   *SYSNDIR*) ;;
  2059.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  2060.   esac
  2061. fi
  2062.  
  2063. LIBS_save="${LIBS}"
  2064. LIBS="${LIBS} -lsun"
  2065. have_lib=""
  2066. echo checking for -lsun
  2067. cat > conftest.c <<EOF
  2068. #include "confdefs.h"
  2069.  
  2070. int main() { exit(0); }
  2071. int t() { main(); }
  2072. EOF
  2073. if eval $compile; then
  2074.   rm -rf conftest*
  2075.   have_lib="1"
  2076.  
  2077. fi
  2078. rm -f conftest*
  2079. LIBS="${LIBS_save}"
  2080. if test -n "${have_lib}"; then
  2081.    :; LIBS="$LIBS -lsun"
  2082. else
  2083.    :; 
  2084. fi
  2085.  
  2086.  
  2087.  
  2088.  REMOTE=stub
  2089. # check whether --with-customs was given
  2090. withval="$with_customs"
  2091. if test -n "$withval"; then
  2092.   REMOTE=cstms
  2093. LIBS="$LIBS libcustoms.a"
  2094. fi
  2095.  
  2096.  
  2097. echo checking for location of SCCS get command
  2098. if false; then
  2099.   SCCS_GET=/usr/sccs/get
  2100.   
  2101. {
  2102. test -n "$verbose" && \
  2103. echo "    defining SCCS_GET to be \"/usr/sccs/get\""
  2104. echo "#define SCCS_GET \"/usr/sccs/get\"" >> confdefs.h
  2105. DEFS="$DEFS -DSCCS_GET=\"/usr/sccs/get\""
  2106. SEDDEFS="${SEDDEFS}\${SEDdA}SCCS_GET\${SEDdB}SCCS_GET\${SEDdC}\"/usr/sccs/get\"\${SEDdD}
  2107. \${SEDuA}SCCS_GET\${SEDuB}SCCS_GET\${SEDuC}\"/usr/sccs/get\"\${SEDuD}
  2108. \${SEDeA}SCCS_GET\${SEDeB}SCCS_GET\${SEDeC}\"/usr/sccs/get\"\${SEDeD}
  2109. "
  2110. }
  2111.  
  2112. else
  2113.   SCCS_GET=get
  2114.   
  2115. {
  2116. test -n "$verbose" && \
  2117. echo "    defining SCCS_GET to be \"get\""
  2118. echo "#define SCCS_GET \"get\"" >> confdefs.h
  2119. DEFS="$DEFS -DSCCS_GET=\"get\""
  2120. SEDDEFS="${SEDDEFS}\${SEDdA}SCCS_GET\${SEDdB}SCCS_GET\${SEDdC}\"get\"\${SEDdD}
  2121. \${SEDuA}SCCS_GET\${SEDuB}SCCS_GET\${SEDuC}\"get\"\${SEDuD}
  2122. \${SEDeA}SCCS_GET\${SEDeB}SCCS_GET\${SEDeC}\"get\"\${SEDeD}
  2123. "
  2124. }
  2125.  
  2126. fi
  2127. ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
  2128. if ( false || admin -n s.conftest ) >/dev/null 2>&1 &&
  2129.    test -f s.conftest; then
  2130.   # We successfully created an SCCS file.
  2131.   echo checking if SCCS get command understands -G
  2132.   if $SCCS_GET s.conftest -Gconftoast >/dev/null 2>&1 &&
  2133.      test -f conftoast; then
  2134.     
  2135. {
  2136. test -n "$verbose" && \
  2137. echo "    defining SCCS_GET_MINUS_G"
  2138. echo "#define SCCS_GET_MINUS_G 1" >> confdefs.h
  2139. DEFS="$DEFS -DSCCS_GET_MINUS_G=1"
  2140. SEDDEFS="${SEDDEFS}\${SEDdA}SCCS_GET_MINUS_G\${SEDdB}SCCS_GET_MINUS_G\${SEDdC}1\${SEDdD}
  2141. \${SEDuA}SCCS_GET_MINUS_G\${SEDuB}SCCS_GET_MINUS_G\${SEDuC}1\${SEDuD}
  2142. \${SEDeA}SCCS_GET_MINUS_G\${SEDeB}SCCS_GET_MINUS_G\${SEDeC}1\${SEDeD}
  2143. "
  2144. }
  2145.  
  2146.   fi
  2147. fi
  2148. rm -f s.conftest conftoast
  2149.  
  2150. # Set default prefixes.
  2151. if test "z$prefix" != 'z' ; then
  2152.   test "z$exec_prefix" = 'z' && exec_prefix='${prefix}'
  2153.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  2154. fi
  2155. if test -n "$exec_prefix"; then
  2156.   prsub="$prsub
  2157. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  2158. fi
  2159. # Quote sed substitution magic chars in DEFS.
  2160. cat >conftest.def <<EOF
  2161. $DEFS
  2162. EOF
  2163. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  2164. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  2165. rm -f conftest.def
  2166. # Substitute for predefined variables.
  2167.  
  2168. trap 'rm -f config.status; exit 1' 1 3 15
  2169. echo creating config.status
  2170. rm -f config.status
  2171. cat > config.status <<EOF
  2172. #!/bin/sh
  2173. # Generated automatically by configure.
  2174. # Run this file to recreate the current configuration.
  2175. # This directory was configured as follows,
  2176. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2177. #
  2178. # $0 $configure_args
  2179.  
  2180. for arg
  2181. do
  2182.   case "\$arg" in
  2183.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  2184.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  2185.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  2186.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  2187.   esac
  2188. done
  2189.  
  2190. trap 'rm -fr Makefile build.sh glob/Makefile config.h conftest*; exit 1' 1 3 15
  2191. CFLAGS='$CFLAGS'
  2192. LDFLAGS='$LDFLAGS'
  2193. CC='$CC'
  2194. INSTALL='$INSTALL'
  2195. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  2196. INSTALL_DATA='$INSTALL_DATA'
  2197. RANLIB='$RANLIB'
  2198. CPP='$CPP'
  2199. LIBOBJS='$LIBOBJS'
  2200. ALLOCA='$ALLOCA'
  2201. NEED_SETGID='$NEED_SETGID'
  2202. KMEM_GROUP='$KMEM_GROUP'
  2203. REMOTE='$REMOTE'
  2204. LIBS='$LIBS'
  2205. srcdir='$srcdir'
  2206. prefix='$prefix'
  2207. exec_prefix='$exec_prefix'
  2208. prsub='$prsub'
  2209. extrasub='$extrasub'
  2210. EOF
  2211. cat >> config.status <<\EOF
  2212.  
  2213. top_srcdir=$srcdir
  2214.  
  2215. CONFIG_FILES=${CONFIG_FILES-"Makefile build.sh glob/Makefile"}
  2216. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  2217.   srcdir=$top_srcdir
  2218.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2219.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  2220.   if test "$dir" != "$file"; then
  2221.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  2222.     test ! -d "$dir" && mkdir "$dir"
  2223.   fi
  2224.   echo creating "$file"
  2225.   rm -f "$file"
  2226.   comment_str="Generated automatically from `echo $file|sed 's|.*/||'`.in by configure."
  2227.   case "$file" in
  2228.     *.c | *.h | *.C | *.cc | *.m )  echo "/* $comment_str */" > "$file" ;;
  2229.     * )          echo "# $comment_str"     > "$file" ;;
  2230.   esac
  2231.   sed -e "
  2232. $prsub
  2233. $extrasub
  2234. s%@CFLAGS@%$CFLAGS%g
  2235. s%@LDFLAGS@%$LDFLAGS%g
  2236. s%@CC@%$CC%g
  2237. s%@INSTALL@%$INSTALL%g
  2238. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  2239. s%@INSTALL_DATA@%$INSTALL_DATA%g
  2240. s%@RANLIB@%$RANLIB%g
  2241. s%@CPP@%$CPP%g
  2242. s%@LIBOBJS@%$LIBOBJS%g
  2243. s%@ALLOCA@%$ALLOCA%g
  2244. s%@NEED_SETGID@%$NEED_SETGID%g
  2245. s%@KMEM_GROUP@%$KMEM_GROUP%g
  2246. s%@REMOTE@%$REMOTE%g
  2247. s%@LIBS@%$LIBS%g
  2248. s%@srcdir@%$srcdir%g
  2249. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  2250. fi; done
  2251.  
  2252. CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
  2253. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  2254. echo creating $file
  2255.  
  2256. # These sed commands are put into SEDDEFS when defining a macro.
  2257. # They are broken into pieces to make the sed script easier to manage.
  2258. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  2259. # is the cpp macro being defined and VALUE is the value it is being given.
  2260. # Each defining turns into a single global substitution command.
  2261. # Hopefully no one uses "!" as a variable value.
  2262. # Other candidates for the sed separators, like , and @, do get used.
  2263. #
  2264. # SEDd sets the value in "#define NAME VALUE" lines.
  2265. SEDdA='s!^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2266. SEDdB='\([     ][     ]*\)[^     ]*!\1#\2'
  2267. SEDdC='\3'
  2268. SEDdD='!g'
  2269. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2270. SEDuA='s!^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2271. SEDuB='\([     ]\)!\1#\2define\3'
  2272. SEDuC=' '
  2273. SEDuD='\4!g'
  2274. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2275. SEDeA='s!^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2276. SEDeB='$!\1#\2define\3'
  2277. SEDeC=' '
  2278. SEDeD='!g'
  2279. rm -f conftest.sed
  2280. EOF
  2281. # Turn off quoting long enough to insert the sed commands.
  2282. rm -f conftest.sh
  2283. cat > conftest.sh <<EOF
  2284. $SEDDEFS
  2285. EOF
  2286.  
  2287. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  2288. # on the size of here documents.
  2289.  
  2290. # Maximum number of lines to put in a single here document.
  2291. maxshlines=9
  2292.  
  2293. while :
  2294. do
  2295.   # wc gives bogus results for an empty file on some systems.
  2296.   lines=`grep -c . conftest.sh`
  2297.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2298.   rm -f conftest.s1 conftest.s2
  2299.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  2300.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  2301.   # Write a limited-size here document to append to conftest.sed.
  2302.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  2303.   cat conftest.s1 >> config.status
  2304.   echo 'CONFEOF' >> config.status
  2305.   rm -f conftest.s1 conftest.sh
  2306.   mv conftest.s2 conftest.sh
  2307. done
  2308. rm -f conftest.sh
  2309.  
  2310. # Now back to your regularly scheduled config.status.
  2311. cat >> config.status <<\EOF
  2312. # This sed command replaces #undef's with comments.  This is necessary, for
  2313. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2314. # on some systems where configure will not decide to define it in
  2315. # config.h.
  2316. cat >> conftest.sed <<\CONFEOF
  2317. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  2318. CONFEOF
  2319. rm -f conftest.h
  2320. # Break up the sed commands because old seds have small limits.
  2321. maxsedlines=20
  2322. cp $top_srcdir/$file.in conftest.h1
  2323. while :
  2324. do
  2325.   lines=`grep -c . conftest.sed`
  2326.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2327.   rm -f conftest.s1 conftest.s2 conftest.h2
  2328.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  2329.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  2330.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  2331.   rm -f conftest.s1 conftest.h1 conftest.sed
  2332.   mv conftest.h2 conftest.h1
  2333.   mv conftest.s2 conftest.sed
  2334. done
  2335. rm -f conftest.sed conftest.h
  2336. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  2337. cat conftest.h1 >> conftest.h
  2338. rm -f conftest.h1
  2339. if cmp -s $file conftest.h 2>/dev/null; then
  2340.   # The file exists and we would not be changing it.
  2341.   echo "$file is unchanged"
  2342.   rm -f conftest.h
  2343. else
  2344.   rm -f $file
  2345.   mv conftest.h $file
  2346. fi
  2347. fi; done
  2348.  
  2349.  
  2350.  
  2351. # Makefile uses this timestamp file to know when to remake Makefile,
  2352. # build.sh, and glob/Makefile.
  2353. touch stamp-config
  2354. exit 0
  2355. EOF
  2356. chmod +x config.status
  2357. ${CONFIG_SHELL-/bin/sh} config.status
  2358.  
  2359.  
  2360.