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