home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / gdbm-1.7.1.tar.gz / gdbm-1.7.1.tar / gdbm-1.7.1 / configure < prev    next >
Text File  |  1993-11-13  |  29KB  |  1,068 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=gdbmdefs.h
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131.  
  132. if test -z "$CC"; then
  133.   # Extract the first word of `gcc', so it can be a program name with args.
  134.   set dummy gcc; word=$2
  135.   echo checking for $word
  136.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  137.   for dir in $PATH; do
  138.     test -z "$dir" && dir=.
  139.     if test -f $dir/$word; then
  140.       CC="gcc"
  141.       break
  142.     fi
  143.   done
  144.   IFS="$saveifs"
  145. fi
  146. test -z "$CC" && CC="cc"
  147. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  148.  
  149. # Find out if we are using GNU C, under whatever name.
  150. cat > conftest.c <<EOF
  151. #ifdef __GNUC__
  152.   yes
  153. #endif
  154. EOF
  155. ${CC-cc} -E conftest.c > conftest.out 2>&1
  156. if egrep yes conftest.out >/dev/null 2>&1; then
  157.   GCC=1 # For later tests.
  158. fi
  159. rm -f conftest*
  160.  
  161. echo checking how to run the C preprocessor
  162. if test -z "$CPP"; then
  163.   # This must be in double quotes, not single quotes, because CPP may get
  164.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  165.   # make.  It must be expanded now.
  166.   CPP="${CC-cc} -E"
  167.   cat > conftest.c <<EOF
  168. #include "confdefs.h"
  169. #include <stdio.h>
  170. Syntax Error
  171. EOF
  172. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  173. if test -z "$err"; then
  174.   :
  175. else
  176.   rm -rf conftest*
  177.   CPP=/lib/cpp
  178. fi
  179. rm -f conftest*
  180. fi
  181. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  182.  
  183. # Make sure to not get the incompatible SysV /etc/install and
  184. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  185. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  186. # or the AFS install, which mishandles nonexistent args, or
  187. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  188. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  189. # anyway.  Sigh.
  190. if test "z${INSTALL}" = "z" ; then
  191.   echo checking for install
  192.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  193.   for dir in $PATH; do
  194.     test -z "$dir" && dir=.
  195.     case $dir in
  196.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  197.     *)
  198.       if test -f $dir/installbsd; then
  199.     INSTALL="$dir/installbsd -c" # OSF1
  200.     INSTALL_PROGRAM='$(INSTALL)'
  201.     INSTALL_DATA='$(INSTALL) -m 644'
  202.     break
  203.       fi
  204.       if test -f $dir/install; then
  205.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  206.       : # AIX
  207.     else
  208.       INSTALL="$dir/install -c"
  209.       INSTALL_PROGRAM='$(INSTALL)'
  210.       INSTALL_DATA='$(INSTALL) -m 644'
  211.       break
  212.     fi
  213.       fi
  214.       ;;
  215.     esac
  216.   done
  217.   IFS="$saveifs"
  218. fi
  219. INSTALL=${INSTALL-cp}
  220. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  221. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  222. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  223. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  224. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  225.  
  226. if test -z "$RANLIB"; then
  227.   # Extract the first word of `ranlib', so it can be a program name with args.
  228.   set dummy ranlib; word=$2
  229.   echo checking for $word
  230.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  231.   for dir in $PATH; do
  232.     test -z "$dir" && dir=.
  233.     if test -f $dir/$word; then
  234.       RANLIB="ranlib"
  235.       break
  236.     fi
  237.   done
  238.   IFS="$saveifs"
  239. fi
  240. test -z "$RANLIB" && RANLIB=":"
  241. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  242.  
  243. echo checking integer size
  244. cat > conftest.c <<EOF
  245. #include "confdefs.h"
  246. main() { exit(sizeof(int) != 2); }
  247. EOF
  248. eval $compile
  249. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  250.   
  251. {
  252. test -n "$verbose" && \
  253. echo "    defining INT_16_BITS"
  254. echo "#define" INT_16_BITS 1 >> confdefs.h
  255. DEFS="$DEFS -DINT_16_BITS=1"
  256. SEDDEFS="${SEDDEFS}\${SEDdA}INT_16_BITS\${SEDdB}INT_16_BITS\${SEDdC}1\${SEDdD}
  257. \${SEDuA}INT_16_BITS\${SEDuB}INT_16_BITS\${SEDuC}1\${SEDuD}
  258. \${SEDeA}INT_16_BITS\${SEDeB}INT_16_BITS\${SEDeC}1\${SEDeD}
  259. "
  260. }
  261.  
  262.  
  263. fi
  264. rm -fr conftest*
  265.  
  266. echo checking for 64-bit long ints
  267. cat > conftest.c <<EOF
  268. #include "confdefs.h"
  269. main() { exit(sizeof(long int) != 8); }
  270. EOF
  271. eval $compile
  272. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  273.   
  274. {
  275. test -n "$verbose" && \
  276. echo "    defining LONG_64_BITS"
  277. echo "#define" LONG_64_BITS 1 >> confdefs.h
  278. DEFS="$DEFS -DLONG_64_BITS=1"
  279. SEDDEFS="${SEDDEFS}\${SEDdA}LONG_64_BITS\${SEDdB}LONG_64_BITS\${SEDdC}1\${SEDdD}
  280. \${SEDuA}LONG_64_BITS\${SEDuB}LONG_64_BITS\${SEDuC}1\${SEDuD}
  281. \${SEDeA}LONG_64_BITS\${SEDeB}LONG_64_BITS\${SEDeC}1\${SEDeD}
  282. "
  283. }
  284.  
  285.  
  286. fi
  287. rm -fr conftest*
  288.  
  289. prog='/* Ultrix mips cc rejects this.  */
  290. typedef int charset[2]; const charset x;
  291. /* SunOS 4.1.1 cc rejects this.  */
  292. char const *const *ccp;
  293. char **p;
  294. /* AIX XL C 1.02.0.0 rejects this.
  295.    It does not let you subtract one const X* pointer from another in an arm
  296.    of an if-expression whose if-part is not a constant expression */
  297. const char *g = "string";
  298. ccp = &g + (g ? g-g : 0);
  299. /* HPUX 7.0 cc rejects these. */
  300. ++ccp;
  301. p = (char**) ccp;
  302. ccp = (char const *const *) p;
  303. { /* SCO 3.2v4 cc rejects this.  */
  304.   char *t;
  305.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  306.  
  307.   *t++ = 0;
  308. }
  309. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  310.   int x[] = {25,17};
  311.   const int *foo = &x[0];
  312.   ++foo;
  313. }
  314. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  315.   typedef const int *iptr;
  316.   iptr p = 0;
  317.   ++p;
  318. }
  319. { /* AIX XL C 1.02.0.0 rejects this saying
  320.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  321.   struct s { int j; const int *ap[3]; };
  322.   struct s *b; b->j = 5;
  323. }
  324. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  325.   const int foo = 10;
  326. }'
  327. echo checking for lack of working const
  328. cat > conftest.c <<EOF
  329. #include "confdefs.h"
  330.  
  331. int main() { exit(0); }
  332. int t() { $prog }
  333. EOF
  334. if eval $compile; then
  335.   :
  336. else
  337.   rm -rf conftest*
  338.   
  339. {
  340. test -n "$verbose" && \
  341. echo "    defining" const to be empty
  342. echo "#define" const  >> confdefs.h
  343. DEFS="$DEFS -Dconst="
  344. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  345. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  346. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  347. "
  348. }
  349.  
  350. fi
  351. rm -f conftest*
  352.  
  353. for hdr in stdlib.h string.h sys/file.h unistd.h fcntl.h sys/types.h
  354. do
  355. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  356. echo checking for ${hdr}
  357. cat > conftest.c <<EOF
  358. #include "confdefs.h"
  359. #include <${hdr}>
  360. EOF
  361. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  362. if test -z "$err"; then
  363.   rm -rf conftest*
  364.   
  365. {
  366. test -n "$verbose" && \
  367. echo "    defining ${trhdr}"
  368. echo "#define" ${trhdr} 1 >> confdefs.h
  369. DEFS="$DEFS -D${trhdr}=1"
  370. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  371. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  372. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  373. "
  374. }
  375.  
  376.  
  377. fi
  378. rm -f conftest*
  379. done
  380.  
  381. for func in rename ftruncate flock bcopy fsync
  382. do
  383. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  384. echo checking for ${func}
  385. cat > conftest.c <<EOF
  386. #include "confdefs.h"
  387. #include <ctype.h>
  388. int main() { exit(0); }
  389. int t() { 
  390. /* The GNU C library defines this for functions which it implements
  391.     to always fail with ENOSYS.  Some functions are actually named
  392.     something starting with __ and the normal name is an alias.  */
  393. #if defined (__stub_${func}) || defined (__stub___${func})
  394. choke me
  395. #else
  396. /* Override any gcc2 internal prototype to avoid an error.  */
  397. extern char ${func}(); ${func}();
  398. #endif
  399.  }
  400. EOF
  401. if eval $compile; then
  402.   rm -rf conftest*
  403.   {
  404. test -n "$verbose" && \
  405. echo "    defining ${trfunc}"
  406. echo "#define" ${trfunc} 1 >> confdefs.h
  407. DEFS="$DEFS -D${trfunc}=1"
  408. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  409. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  410. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  411. "
  412. }
  413.  
  414.  
  415. fi
  416. rm -f conftest*
  417. done
  418.  
  419. echo checking for off_t in sys/types.h
  420. echo '#include "confdefs.h"
  421. #include <sys/types.h>' > conftest.c
  422. eval "$CPP conftest.c > conftest.out 2>&1"
  423. if egrep "off_t" conftest.out >/dev/null 2>&1; then
  424.   :
  425. else
  426.   rm -rf conftest*
  427.   
  428. {
  429. test -n "$verbose" && \
  430. echo "    defining" off_t to be long
  431. echo "#define" off_t long >> confdefs.h
  432. DEFS="$DEFS -Doff_t=long"
  433. SEDDEFS="${SEDDEFS}\${SEDdA}off_t\${SEDdB}off_t\${SEDdC}long\${SEDdD}
  434. \${SEDuA}off_t\${SEDuB}off_t\${SEDuC}long\${SEDuD}
  435. \${SEDeA}off_t\${SEDeB}off_t\${SEDeC}long\${SEDeD}
  436. "
  437. }
  438.  
  439. fi
  440. rm -f conftest*
  441.  
  442. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  443. # for constant arguments.  Useless!
  444. echo checking for working alloca.h
  445. cat > conftest.c <<EOF
  446. #include "confdefs.h"
  447. #include <alloca.h>
  448. int main() { exit(0); }
  449. int t() { char *p = alloca(2 * sizeof(int)); }
  450. EOF
  451. if eval $compile; then
  452.   rm -rf conftest*
  453.   
  454. {
  455. test -n "$verbose" && \
  456. echo "    defining HAVE_ALLOCA_H"
  457. echo "#define" HAVE_ALLOCA_H 1 >> confdefs.h
  458. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  459. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ALLOCA_H\${SEDdB}HAVE_ALLOCA_H\${SEDdC}1\${SEDdD}
  460. \${SEDuA}HAVE_ALLOCA_H\${SEDuB}HAVE_ALLOCA_H\${SEDuC}1\${SEDuD}
  461. \${SEDeA}HAVE_ALLOCA_H\${SEDeB}HAVE_ALLOCA_H\${SEDeC}1\${SEDeD}
  462. "
  463. }
  464.  
  465.  
  466. fi
  467. rm -f conftest*
  468.  
  469. decl="#ifdef __GNUC__
  470. #define alloca __builtin_alloca
  471. #else
  472. #if HAVE_ALLOCA_H
  473. #include <alloca.h>
  474. #else
  475. #ifdef _AIX
  476.  #pragma alloca
  477. #else
  478. char *alloca ();
  479. #endif
  480. #endif
  481. #endif
  482. "
  483. echo checking for alloca
  484. cat > conftest.c <<EOF
  485. #include "confdefs.h"
  486. $decl
  487. int main() { exit(0); }
  488. int t() { char *p = (char *) alloca(1); }
  489. EOF
  490. if eval $compile; then
  491.   :
  492. else
  493.   rm -rf conftest*
  494.   alloca_missing=1
  495. cat > conftest.c <<EOF
  496. #include "confdefs.h"
  497.  
  498. #if defined(CRAY) && ! defined(CRAY2)
  499. winnitude
  500. #else
  501. lossage
  502. #endif
  503.  
  504. EOF
  505. eval "$CPP conftest.c > conftest.out 2>&1"
  506. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  507.   rm -rf conftest*
  508.   echo checking for _getb67
  509. cat > conftest.c <<EOF
  510. #include "confdefs.h"
  511. #include <ctype.h>
  512. int main() { exit(0); }
  513. int t() { 
  514. /* The GNU C library defines this for functions which it implements
  515.     to always fail with ENOSYS.  Some functions are actually named
  516.     something starting with __ and the normal name is an alias.  */
  517. #if defined (__stub__getb67) || defined (__stub____getb67)
  518. choke me
  519. #else
  520. /* Override any gcc2 internal prototype to avoid an error.  */
  521. extern char _getb67(); _getb67();
  522. #endif
  523.  }
  524. EOF
  525. if eval $compile; then
  526.   rm -rf conftest*
  527.   {
  528. test -n "$verbose" && \
  529. echo "    defining" CRAY_STACKSEG_END to be _getb67
  530. echo "#define" CRAY_STACKSEG_END _getb67 >> confdefs.h
  531. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  532. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}_getb67\${SEDdD}
  533. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}_getb67\${SEDuD}
  534. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}_getb67\${SEDeD}
  535. "
  536. }
  537.  
  538.  
  539. else
  540.   rm -rf conftest*
  541.   echo checking for GETB67
  542. cat > conftest.c <<EOF
  543. #include "confdefs.h"
  544. #include <ctype.h>
  545. int main() { exit(0); }
  546. int t() { 
  547. /* The GNU C library defines this for functions which it implements
  548.     to always fail with ENOSYS.  Some functions are actually named
  549.     something starting with __ and the normal name is an alias.  */
  550. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  551. choke me
  552. #else
  553. /* Override any gcc2 internal prototype to avoid an error.  */
  554. extern char GETB67(); GETB67();
  555. #endif
  556.  }
  557. EOF
  558. if eval $compile; then
  559.   rm -rf conftest*
  560.   {
  561. test -n "$verbose" && \
  562. echo "    defining" CRAY_STACKSEG_END to be GETB67
  563. echo "#define" CRAY_STACKSEG_END GETB67 >> confdefs.h
  564. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  565. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}GETB67\${SEDdD}
  566. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}GETB67\${SEDuD}
  567. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}GETB67\${SEDeD}
  568. "
  569. }
  570.  
  571.  
  572. else
  573.   rm -rf conftest*
  574.   echo checking for getb67
  575. cat > conftest.c <<EOF
  576. #include "confdefs.h"
  577. #include <ctype.h>
  578. int main() { exit(0); }
  579. int t() { 
  580. /* The GNU C library defines this for functions which it implements
  581.     to always fail with ENOSYS.  Some functions are actually named
  582.     something starting with __ and the normal name is an alias.  */
  583. #if defined (__stub_getb67) || defined (__stub___getb67)
  584. choke me
  585. #else
  586. /* Override any gcc2 internal prototype to avoid an error.  */
  587. extern char getb67(); getb67();
  588. #endif
  589.  }
  590. EOF
  591. if eval $compile; then
  592.   rm -rf conftest*
  593.   {
  594. test -n "$verbose" && \
  595. echo "    defining" CRAY_STACKSEG_END to be getb67
  596. echo "#define" CRAY_STACKSEG_END getb67 >> confdefs.h
  597. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  598. SEDDEFS="${SEDDEFS}\${SEDdA}CRAY_STACKSEG_END\${SEDdB}CRAY_STACKSEG_END\${SEDdC}getb67\${SEDdD}
  599. \${SEDuA}CRAY_STACKSEG_END\${SEDuB}CRAY_STACKSEG_END\${SEDuC}getb67\${SEDuD}
  600. \${SEDeA}CRAY_STACKSEG_END\${SEDeB}CRAY_STACKSEG_END\${SEDeC}getb67\${SEDeD}
  601. "
  602. }
  603.  
  604.  
  605. fi
  606. rm -f conftest*
  607.  
  608. fi
  609. rm -f conftest*
  610.  
  611. fi
  612. rm -f conftest*
  613.  
  614.  
  615. fi
  616. rm -f conftest*
  617.  
  618.  
  619. fi
  620. rm -f conftest*
  621.  
  622. if test -n "$alloca_missing"; then
  623.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  624.   # that cause trouble.  Some versions do not even contain alloca or
  625.   # contain a buggy version.  If you still want to use their alloca,
  626.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  627.   ALLOCA=alloca.o
  628.   
  629. {
  630. test -n "$verbose" && \
  631. echo "    defining C_ALLOCA"
  632. echo "#define" C_ALLOCA 1 >> confdefs.h
  633. DEFS="$DEFS -DC_ALLOCA=1"
  634. SEDDEFS="${SEDDEFS}\${SEDdA}C_ALLOCA\${SEDdB}C_ALLOCA\${SEDdC}1\${SEDdD}
  635. \${SEDuA}C_ALLOCA\${SEDuB}C_ALLOCA\${SEDuC}1\${SEDuD}
  636. \${SEDeA}C_ALLOCA\${SEDeB}C_ALLOCA\${SEDeC}1\${SEDeD}
  637. "
  638. }
  639.  
  640.  
  641.   echo 'checking stack direction for C alloca'
  642.   echo checking whether cross-compiling
  643. # If we cannot run a trivial program, we must be cross compiling.
  644. cat > conftest.c <<EOF
  645. #include "confdefs.h"
  646. main(){exit(0);}
  647. EOF
  648. eval $compile
  649. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  650.   :
  651. else
  652.   cross_compiling=1
  653. fi
  654. rm -fr conftest*
  655.  
  656. if test -n "$cross_compiling"
  657. then
  658.   
  659. {
  660. test -n "$verbose" && \
  661. echo "    defining" STACK_DIRECTION to be 0
  662. echo "#define" STACK_DIRECTION 0 >> confdefs.h
  663. DEFS="$DEFS -DSTACK_DIRECTION=0"
  664. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}0\${SEDdD}
  665. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}0\${SEDuD}
  666. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}0\${SEDeD}
  667. "
  668. }
  669.  
  670. else
  671. cat > conftest.c <<EOF
  672. #include "confdefs.h"
  673. find_stack_direction ()
  674. {
  675.   static char *addr = 0;
  676.   auto char dummy;
  677.   if (addr == 0)
  678.     {
  679.       addr = &dummy;
  680.       return find_stack_direction ();
  681.     }
  682.   else
  683.     return (&dummy > addr) ? 1 : -1;
  684. }
  685. main ()
  686. {
  687.   exit (find_stack_direction() < 0);
  688. }
  689. EOF
  690. eval $compile
  691. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  692.   
  693. {
  694. test -n "$verbose" && \
  695. echo "    defining" STACK_DIRECTION to be 1
  696. echo "#define" STACK_DIRECTION 1 >> confdefs.h
  697. DEFS="$DEFS -DSTACK_DIRECTION=1"
  698. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}1\${SEDdD}
  699. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}1\${SEDuD}
  700. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}1\${SEDeD}
  701. "
  702. }
  703.  
  704.  
  705. else
  706.   
  707. {
  708. test -n "$verbose" && \
  709. echo "    defining" STACK_DIRECTION to be -1
  710. echo "#define" STACK_DIRECTION -1 >> confdefs.h
  711. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  712. SEDDEFS="${SEDDEFS}\${SEDdA}STACK_DIRECTION\${SEDdB}STACK_DIRECTION\${SEDdC}-1\${SEDdD}
  713. \${SEDuA}STACK_DIRECTION\${SEDuB}STACK_DIRECTION\${SEDuC}-1\${SEDuD}
  714. \${SEDeA}STACK_DIRECTION\${SEDeB}STACK_DIRECTION\${SEDeC}-1\${SEDeD}
  715. "
  716. }
  717.  
  718. fi
  719. fi
  720. rm -fr conftest*
  721. fi
  722.  
  723. LIBS_save="${LIBS}"
  724. LIBS="${LIBS} -ldbm"
  725. have_lib=""
  726. echo checking for -ldbm
  727. cat > conftest.c <<EOF
  728. #include "confdefs.h"
  729.  
  730. int main() { exit(0); }
  731. int t() { main(); }
  732. EOF
  733. if eval $compile; then
  734.   rm -rf conftest*
  735.   have_lib="1"
  736.  
  737. fi
  738. rm -f conftest*
  739. LIBS="${LIBS_save}"
  740. if test -n "${have_lib}"; then
  741.    
  742. {
  743. test -n "$verbose" && \
  744. echo "    defining HAVE_LIBDBM"
  745. echo "#define" HAVE_LIBDBM 1 >> confdefs.h
  746. DEFS="$DEFS -DHAVE_LIBDBM=1"
  747. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBDBM\${SEDdB}HAVE_LIBDBM\${SEDdC}1\${SEDdD}
  748. \${SEDuA}HAVE_LIBDBM\${SEDuB}HAVE_LIBDBM\${SEDuC}1\${SEDuD}
  749. \${SEDeA}HAVE_LIBDBM\${SEDeB}HAVE_LIBDBM\${SEDeC}1\${SEDeD}
  750. "
  751. }
  752.  
  753.    LIBS="${LIBS} -ldbm"
  754. fi
  755.  
  756. LIBS_save="${LIBS}"
  757. LIBS="${LIBS} -lndbm"
  758. have_lib=""
  759. echo checking for -lndbm
  760. cat > conftest.c <<EOF
  761. #include "confdefs.h"
  762.  
  763. int main() { exit(0); }
  764. int t() { main(); }
  765. EOF
  766. if eval $compile; then
  767.   rm -rf conftest*
  768.   have_lib="1"
  769.  
  770. fi
  771. rm -f conftest*
  772. LIBS="${LIBS_save}"
  773. if test -n "${have_lib}"; then
  774.    
  775. {
  776. test -n "$verbose" && \
  777. echo "    defining HAVE_LIBNDBM"
  778. echo "#define" HAVE_LIBNDBM 1 >> confdefs.h
  779. DEFS="$DEFS -DHAVE_LIBNDBM=1"
  780. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBNDBM\${SEDdB}HAVE_LIBNDBM\${SEDdC}1\${SEDdD}
  781. \${SEDuA}HAVE_LIBNDBM\${SEDuB}HAVE_LIBNDBM\${SEDuC}1\${SEDuD}
  782. \${SEDeA}HAVE_LIBNDBM\${SEDeB}HAVE_LIBNDBM\${SEDeC}1\${SEDeD}
  783. "
  784. }
  785.  
  786.    LIBS="${LIBS} -lndbm"
  787. fi
  788.  
  789. LIBS_save="${LIBS}"
  790. LIBS="${LIBS} -lc"
  791. have_lib=""
  792. echo checking for -lc
  793. cat > conftest.c <<EOF
  794. #include "confdefs.h"
  795.  
  796. int main() { exit(0); }
  797. int t() { main(); }
  798. EOF
  799. if eval $compile; then
  800.   rm -rf conftest*
  801.   have_lib="1"
  802.  
  803. fi
  804. rm -f conftest*
  805. LIBS="${LIBS_save}"
  806. if test -n "${have_lib}"; then
  807.    
  808. {
  809. test -n "$verbose" && \
  810. echo "    defining HAVE_LIBC"
  811. echo "#define" HAVE_LIBC 1 >> confdefs.h
  812. DEFS="$DEFS -DHAVE_LIBC=1"
  813. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIBC\${SEDdB}HAVE_LIBC\${SEDdC}1\${SEDdD}
  814. \${SEDuA}HAVE_LIBC\${SEDuB}HAVE_LIBC\${SEDuC}1\${SEDuD}
  815. \${SEDeA}HAVE_LIBC\${SEDeB}HAVE_LIBC\${SEDeC}1\${SEDeD}
  816. "
  817. }
  818.  
  819.    LIBS="${LIBS} -lc"
  820. fi
  821.  
  822. for func in getopt
  823. do
  824. echo checking for ${func}
  825. cat > conftest.c <<EOF
  826. #include "confdefs.h"
  827. #include <ctype.h>
  828. int main() { exit(0); }
  829. int t() { 
  830. /* The GNU C library defines this for functions which it implements
  831.     to always fail with ENOSYS.  Some functions are actually named
  832.     something starting with __ and the normal name is an alias.  */
  833. #if defined (__stub_${func}) || defined (__stub___${func})
  834. choke me
  835. #else
  836. /* Override any gcc2 internal prototype to avoid an error.  */
  837. extern char ${func}(); ${func}();
  838. #endif
  839.  }
  840. EOF
  841. if eval $compile; then
  842.   :
  843. else
  844.   rm -rf conftest*
  845.   LIBOBJS="$LIBOBJS ${func}.o"
  846. test -n "$verbose" && echo "    using ${func}.o instead"
  847. fi
  848. rm -f conftest*
  849.  
  850. done
  851.  
  852. echo checking for st_blksize in struct stat
  853. cat > conftest.c <<EOF
  854. #include "confdefs.h"
  855. #include <sys/types.h>
  856. #include <sys/stat.h>
  857. int main() { exit(0); }
  858. int t() { struct stat s; s.st_blksize; }
  859. EOF
  860. if eval $compile; then
  861.   rm -rf conftest*
  862.   
  863. {
  864. test -n "$verbose" && \
  865. echo "    defining HAVE_ST_BLKSIZE"
  866. echo "#define" HAVE_ST_BLKSIZE 1 >> confdefs.h
  867. DEFS="$DEFS -DHAVE_ST_BLKSIZE=1"
  868. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_ST_BLKSIZE\${SEDdB}HAVE_ST_BLKSIZE\${SEDdC}1\${SEDdD}
  869. \${SEDuA}HAVE_ST_BLKSIZE\${SEDuB}HAVE_ST_BLKSIZE\${SEDuC}1\${SEDuD}
  870. \${SEDeA}HAVE_ST_BLKSIZE\${SEDeB}HAVE_ST_BLKSIZE\${SEDeC}1\${SEDeD}
  871. "
  872. }
  873.  
  874.  
  875. fi
  876. rm -f conftest*
  877.  
  878. # Set default prefixes.
  879. if test -n "$prefix"; then
  880.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  881.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  882. fi
  883. if test -n "$exec_prefix"; then
  884.   prsub="$prsub
  885. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  886. fi
  887. # Quote sed substitution magic chars in DEFS.
  888. cat >conftest.def <<EOF
  889. $DEFS
  890. EOF
  891. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  892. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  893. rm -f conftest.def
  894. # Substitute for predefined variables.
  895.  
  896. trap 'rm -f config.status; exit 1' 1 3 15
  897. echo creating config.status
  898. rm -f config.status
  899. cat > config.status <<EOF
  900. #!/bin/sh
  901. # Generated automatically by configure.
  902. # Run this file to recreate the current configuration.
  903. # This directory was configured as follows,
  904. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  905. #
  906. # $0 $configure_args
  907.  
  908. for arg
  909. do
  910.   case "\$arg" in
  911.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  912.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  913.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  914.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  915.   esac
  916. done
  917.  
  918. trap 'rm -fr Makefile autoconf.h conftest*; exit 1' 1 3 15
  919. CC='$CC'
  920. CPP='$CPP'
  921. INSTALL='$INSTALL'
  922. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  923. INSTALL_DATA='$INSTALL_DATA'
  924. RANLIB='$RANLIB'
  925. ALLOCA='$ALLOCA'
  926. LIBOBJS='$LIBOBJS'
  927. LIBS='$LIBS'
  928. srcdir='$srcdir'
  929. prefix='$prefix'
  930. exec_prefix='$exec_prefix'
  931. prsub='$prsub'
  932. extrasub='$extrasub'
  933. EOF
  934. cat >> config.status <<\EOF
  935.  
  936. top_srcdir=$srcdir
  937.  
  938. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  939. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  940.   srcdir=$top_srcdir
  941.   # Remove last slash and all that follows it.  Not all systems have dirname.
  942.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  943.   if test "$dir" != "$file"; then
  944.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  945.     test ! -d $dir && mkdir $dir
  946.   fi
  947.   echo creating $file
  948.   rm -f $file
  949.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  950.   sed -e "
  951. $prsub
  952. $extrasub
  953. s%@CC@%$CC%g
  954. s%@CPP@%$CPP%g
  955. s%@INSTALL@%$INSTALL%g
  956. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  957. s%@INSTALL_DATA@%$INSTALL_DATA%g
  958. s%@RANLIB@%$RANLIB%g
  959. s%@ALLOCA@%$ALLOCA%g
  960. s%@LIBOBJS@%$LIBOBJS%g
  961. s%@LIBS@%$LIBS%g
  962. s%@srcdir@%$srcdir%g
  963. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  964. fi; done
  965.  
  966. CONFIG_HEADERS=${CONFIG_HEADERS-"autoconf.h"}
  967. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  968. echo creating $file
  969.  
  970. # These sed commands are put into SEDDEFS when defining a macro.
  971. # They are broken into pieces to make the sed script easier to manage.
  972. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  973. # is the cpp macro being defined and VALUE is the value it is being given.
  974. # Each defining turns into a single global substitution command.
  975. #
  976. # SEDd sets the value in "#define NAME VALUE" lines.
  977. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  978. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  979. SEDdC='\3'
  980. SEDdD='@g'
  981. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  982. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  983. SEDuB='\([     ]\)@\1#\2define\3'
  984. SEDuC=' '
  985. SEDuD='\4@g'
  986. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  987. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  988. SEDeB='$@\1#\2define\3'
  989. SEDeC=' '
  990. SEDeD='@g'
  991. rm -f conftest.sed
  992. EOF
  993. # Turn off quoting long enough to insert the sed commands.
  994. rm -f conftest.sh
  995. cat > conftest.sh <<EOF
  996. $SEDDEFS
  997. EOF
  998.  
  999. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1000. # on the size of here documents.
  1001.  
  1002. # Maximum number of lines to put in a single here document.
  1003. maxshlines=9
  1004.  
  1005. while :
  1006. do
  1007.   # wc gives bogus results for an empty file on some systems.
  1008.   lines=`grep -c . conftest.sh`
  1009.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1010.   rm -f conftest.s1 conftest.s2
  1011.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1012.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1013.   # Write a limited-size here document to append to conftest.sed.
  1014.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1015.   cat conftest.s1 >> config.status
  1016.   echo 'CONFEOF' >> config.status
  1017.   rm -f conftest.s1 conftest.sh
  1018.   mv conftest.s2 conftest.sh
  1019. done
  1020. rm -f conftest.sh
  1021.  
  1022. # Now back to your regularly scheduled config.status.
  1023. cat >> config.status <<\EOF
  1024. # This sed command replaces #undef's with comments.  This is necessary, for
  1025. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1026. # on some systems where configure will not decide to define it in
  1027. # autoconf.h.
  1028. cat >> conftest.sed <<\CONFEOF
  1029. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1030. CONFEOF
  1031. rm -f conftest.h
  1032. # Break up the sed commands because old seds have small limits.
  1033. maxsedlines=20
  1034. cp $top_srcdir/$file.in conftest.h1
  1035. while :
  1036. do
  1037.   lines=`grep -c . conftest.sed`
  1038.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1039.   rm -f conftest.s1 conftest.s2 conftest.h2
  1040.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1041.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1042.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1043.   rm -f conftest.s1 conftest.h1 conftest.sed
  1044.   mv conftest.h2 conftest.h1
  1045.   mv conftest.s2 conftest.sed
  1046. done
  1047. rm -f conftest.sed conftest.h
  1048. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1049. cat conftest.h1 >> conftest.h
  1050. rm -f conftest.h1
  1051. if cmp -s $file conftest.h 2>/dev/null; then
  1052.   # The file exists and we would not be changing it.
  1053.   echo "$file is unchanged"
  1054.   rm -f conftest.h
  1055. else
  1056.   rm -f $file
  1057.   mv conftest.h $file
  1058. fi
  1059. fi; done
  1060.  
  1061.  
  1062.  
  1063. exit 0
  1064. EOF
  1065. chmod +x config.status
  1066. ${CONFIG_SHELL-/bin/sh} config.status
  1067.  
  1068.