home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / sed-2.03-src.lha / src / amiga / sed-2.03 / configure < prev    next >
Encoding:
Text File  |  1994-02-24  |  18.2 KB  |  752 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] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -fr conftest* core; exit 1' 1 3 15
  82.  
  83. # NLS nuisances.
  84. # These must not be set unconditionally because not all systems understand
  85. # e.g. LANG=C (notably SCO).
  86. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  87. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  88.  
  89. rm -f conftest*
  90. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  91.  
  92. # A filename unique to this package, relative to the directory that
  93. # configure is in, which we can look for to find out if srcdir is correct.
  94. unique_file=sed.c
  95.  
  96. # Find the source files, if location was not specified.
  97. if test -z "$srcdir"; then
  98.   srcdirdefaulted=yes
  99.   # Try the directory containing this script, then `..'.
  100.   prog=$0
  101.   confdir=`echo $prog| sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  102.   test "X$confdir" = "X$prog" && confdir=.
  103.   srcdir=$confdir
  104.   if test ! -r $srcdir/$unique_file; then
  105.     srcdir=..
  106.   fi
  107. fi
  108. if test ! -r $srcdir/$unique_file; then
  109.   if test x$srcdirdefaulted = xyes; then
  110.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  111.   else
  112.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  113.   fi
  114.   exit 1
  115. fi
  116. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  117. # But we can't avoid them for `..', to make subdirectories work.
  118. case $srcdir in
  119.   .|/*|~*) ;;
  120.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  121. esac
  122.  
  123. # Save the original args to write them into config.status later.
  124. configure_args="$*"
  125.  
  126. if test -z "$CC"; then
  127.   # Extract the first word of `gcc', so it can be a program name with args.
  128.   set dummy gcc; word=$2
  129.   echo checking for $word
  130.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  131.   for dir in $PATH; do
  132.     test -z "$dir" && dir=.
  133.     if test -f $dir/$word; then
  134.       CC="gcc"
  135.       break
  136.     fi
  137.   done
  138.   IFS="$saveifs"
  139. fi
  140. test -z "$CC" && CC="cc"
  141. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  142.  
  143. # Find out if we are using GNU C, under whatever name.
  144. cat > conftest.c <<EOF
  145. #ifdef __GNUC__
  146.   yes
  147. #endif
  148. EOF
  149. ${CC-cc} -E conftest.c > conftest.out 2>&1
  150. if egrep yes conftest.out >/dev/null 2>&1; then
  151.   GCC=1 # For later tests.
  152. fi
  153. rm -f conftest*
  154.  
  155. echo checking how to run the C preprocessor
  156. if test -z "$CPP"; then
  157.   # This must be in double quotes, not single quotes, because CPP may get
  158.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  159.   # make.  It must be expanded now.
  160.   CPP="${CC-cc} -E"
  161.   cat > conftest.c <<EOF
  162. #include <stdio.h>
  163. Syntax Error
  164. EOF
  165. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  166. if test -z "$err"; then
  167.   :
  168. else
  169.   CPP=/lib/cpp
  170. fi
  171. rm -f conftest*
  172. fi
  173. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  174.  
  175. # Make sure to not get the incompatible SysV /etc/install and
  176. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  177. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  178. # or the AFS install, which mishandles nonexistent args, or
  179. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  180. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  181. # anyway.  Sigh.
  182. if test "z${INSTALL}" = "z" ; then
  183.   echo checking for install
  184.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  185.   for dir in $PATH; do
  186.     test -z "$dir" && dir=.
  187.     case $dir in
  188.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  189.     *)
  190.       if test -f $dir/installbsd; then
  191.     INSTALL="$dir/installbsd -c" # OSF1
  192.     INSTALL_PROGRAM='$(INSTALL)'
  193.     INSTALL_DATA='$(INSTALL) -m 644'
  194.     break
  195.       fi
  196.       if test -f $dir/install; then
  197.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  198.       : # AIX
  199.     else
  200.       INSTALL="$dir/install -c"
  201.       INSTALL_PROGRAM='$(INSTALL)'
  202.       INSTALL_DATA='$(INSTALL) -m 644'
  203.       break
  204.     fi
  205.       fi
  206.       ;;
  207.     esac
  208.   done
  209.   IFS="$saveifs"
  210. fi
  211. INSTALL=${INSTALL-cp}
  212. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  213. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  214.  
  215. echo checking for minix/config.h
  216. cat > conftest.c <<EOF
  217. #include <minix/config.h>
  218. EOF
  219. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  220. if test -z "$err"; then
  221.   MINIX=1
  222. fi
  223. rm -f conftest*
  224.  
  225. # The Minix shell can't assign to the same variable on the same line!
  226. if test -n "$MINIX"; then
  227.   
  228. {
  229. test -n "$verbose" && \
  230. echo "    defining _POSIX_SOURCE"
  231. DEFS="$DEFS -D_POSIX_SOURCE=1"
  232. }
  233.  
  234.   
  235. {
  236. test -n "$verbose" && \
  237. echo "    defining _POSIX_1_SOURCE to be 2"
  238. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  239. }
  240.  
  241.   
  242. {
  243. test -n "$verbose" && \
  244. echo "    defining _MINIX"
  245. DEFS="$DEFS -D_MINIX=1"
  246. }
  247.  
  248. fi
  249.  
  250. echo checking for POSIXized ISC
  251. if test -d /etc/conf/kconfig.d &&
  252.   grep _POSIX_VERSION /gnu/include/sys/unistd.h >/dev/null 2>&1
  253. then
  254.   ISC=1 # If later tests want to check for ISC.
  255.   
  256. {
  257. test -n "$verbose" && \
  258. echo "    defining _POSIX_SOURCE"
  259. DEFS="$DEFS -D_POSIX_SOURCE=1"
  260. }
  261.  
  262.   if test -n "$GCC"; then
  263.     CC="$CC -posix"
  264.   else
  265.     CC="$CC -Xp"
  266.   fi
  267. fi
  268.  
  269. echo checking for ANSI C header files
  270. cat > conftest.c <<EOF
  271. #include <stdlib.h>
  272. #include <stdarg.h>
  273. #include <string.h>
  274. #include <float.h>
  275. EOF
  276. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  277. if test -z "$err"; then
  278.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  279. echo '#include <string.h>' > conftest.c
  280. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  281. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  282.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  283. cat > conftest.c <<EOF
  284. #include <ctype.h>
  285. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  286. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  287. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  288. int main () { int i; for (i = 0; i < 256; i++)
  289. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  290. exit (0); }
  291.  
  292. EOF
  293. eval $compile
  294. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  295.   
  296. {
  297. test -n "$verbose" && \
  298. echo "    defining STDC_HEADERS"
  299. DEFS="$DEFS -DSTDC_HEADERS=1"
  300. }
  301.  
  302. fi
  303. rm -f conftest*
  304. fi
  305. rm -f conftest*
  306.  
  307. fi
  308. rm -f conftest*
  309.  
  310. for hdr in string.h
  311. do
  312. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  313. echo checking for ${hdr}
  314. cat > conftest.c <<EOF
  315. #include <${hdr}>
  316. EOF
  317. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  318. if test -z "$err"; then
  319.   
  320. {
  321. test -n "$verbose" && \
  322. echo "    defining ${trhdr}"
  323. DEFS="$DEFS -D${trhdr}=1"
  324. }
  325.  
  326. fi
  327. rm -f conftest*
  328. done
  329.  
  330. echo checking for vprintf
  331. cat > conftest.c <<EOF
  332.  
  333. int main() { exit(0); }
  334. int t() { vprintf(); }
  335. EOF
  336. if eval $compile; then
  337.   
  338. {
  339. test -n "$verbose" && \
  340. echo "    defining HAVE_VPRINTF"
  341. DEFS="$DEFS -DHAVE_VPRINTF=1"
  342. }
  343.  
  344. else
  345.   vprintf_missing=1
  346. fi
  347. rm -f conftest*
  348.  
  349. if test -n "$vprintf_missing"; then
  350. echo checking for _doprnt
  351. cat > conftest.c <<EOF
  352.  
  353. int main() { exit(0); }
  354. int t() { _doprnt(); }
  355. EOF
  356. if eval $compile; then
  357.   
  358. {
  359. test -n "$verbose" && \
  360. echo "    defining HAVE_DOPRNT"
  361. DEFS="$DEFS -DHAVE_DOPRNT=1"
  362. }
  363.  
  364. fi
  365. rm -f conftest*
  366.  
  367. fi
  368.  
  369. for func in bcopy memcpy
  370. do
  371. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  372. echo checking for ${func}
  373. cat > conftest.c <<EOF
  374. #include <ctype.h>
  375. int main() { exit(0); }
  376. int t() { 
  377. /* The GNU C library defines this for functions which it implements
  378.     to always fail with ENOSYS.  Some functions are actually named
  379.     something starting with __ and the normal name is an alias.  */
  380. #if defined (__stub_${func}) || defined (__stub___${func})
  381. choke me
  382. #else
  383. /* Override any gcc2 internal prototype to avoid an error.  */
  384. extern char ${func}(); ${func}();
  385. #endif
  386.  }
  387. EOF
  388. if eval $compile; then
  389.   {
  390. test -n "$verbose" && \
  391. echo "    defining ${trfunc}"
  392. DEFS="$DEFS -D${trfunc}=1"
  393. }
  394.  
  395. fi
  396. rm -f conftest*
  397. done
  398.  
  399. prog='/* Ultrix mips cc rejects this.  */
  400. typedef int charset[2]; const charset x;
  401. /* SunOS 4.1.1 cc rejects this.  */
  402. char const *const *ccp;
  403. char **p;
  404. /* AIX XL C 1.02.0.0 rejects this.
  405.    It does not let you subtract one const X* pointer from another in an arm
  406.    of an if-expression whose if-part is not a constant expression */
  407. const char *g = "string";
  408. ccp = &g + (g ? g-g : 0);
  409. /* HPUX 7.0 cc rejects these. */
  410. ++ccp;
  411. p = (char**) ccp;
  412. ccp = (char const *const *) p;
  413. { /* SCO 3.2v4 cc rejects this.  */
  414.   char *t;
  415.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  416.  
  417.   *t++ = 0;
  418. }
  419. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  420.   int x[] = {25,17};
  421.   const int *foo = &x[0];
  422.   ++foo;
  423. }
  424. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  425.   typedef const int *iptr;
  426.   iptr p = 0;
  427.   ++p;
  428. }
  429. { /* AIX XL C 1.02.0.0 rejects this saying
  430.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  431.   struct s { int j; const int *ap[3]; };
  432.   struct s *b; b->j = 5;
  433. }'
  434. echo checking for working const
  435. cat > conftest.c <<EOF
  436.  
  437. int main() { exit(0); }
  438. int t() { $prog }
  439. EOF
  440. if eval $compile; then
  441.   :
  442. else
  443.   
  444. {
  445. test -n "$verbose" && \
  446. echo "    defining const to be empty"
  447. DEFS="$DEFS -Dconst="
  448. }
  449.  
  450. fi
  451. rm -f conftest*
  452.  
  453. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  454. # for constant arguments.  Useless!
  455. echo checking for working alloca.h
  456. cat > conftest.c <<EOF
  457. #include <alloca.h>
  458. int main() { exit(0); }
  459. int t() { char *p = alloca(2 * sizeof(int)); }
  460. EOF
  461. if eval $compile; then
  462.   
  463. {
  464. test -n "$verbose" && \
  465. echo "    defining HAVE_ALLOCA_H"
  466. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  467. }
  468.  
  469. fi
  470. rm -f conftest*
  471.  
  472. decl="#ifdef __GNUC__
  473. #define alloca __builtin_alloca
  474. #else
  475. #if HAVE_ALLOCA_H
  476. #include <alloca.h>
  477. #else
  478. #ifdef _AIX
  479.  #pragma alloca
  480. #else
  481. char *alloca ();
  482. #endif
  483. #endif
  484. #endif
  485. "
  486. echo checking for alloca
  487. cat > conftest.c <<EOF
  488. $decl
  489. int main() { exit(0); }
  490. int t() { char *p = (char *) alloca(1); }
  491. EOF
  492. if eval $compile; then
  493.   :
  494. else
  495.   alloca_missing=1
  496. cat > conftest.c <<EOF
  497.  
  498. #if defined(CRAY) && ! defined(CRAY2)
  499. winnitude
  500. #else
  501. lossage
  502. #endif
  503.  
  504. EOF
  505. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  506. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  507.   echo checking for _getb67
  508. cat > conftest.c <<EOF
  509. #include <ctype.h>
  510. int main() { exit(0); }
  511. int t() { 
  512. /* The GNU C library defines this for functions which it implements
  513.     to always fail with ENOSYS.  Some functions are actually named
  514.     something starting with __ and the normal name is an alias.  */
  515. #if defined (__stub__getb67) || defined (__stub____getb67)
  516. choke me
  517. #else
  518. /* Override any gcc2 internal prototype to avoid an error.  */
  519. extern char _getb67(); _getb67();
  520. #endif
  521.  }
  522. EOF
  523. if eval $compile; then
  524.   {
  525. test -n "$verbose" && \
  526. echo "    defining CRAY_STACKSEG_END to be _getb67"
  527. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  528. }
  529.  
  530. else
  531.   echo checking for GETB67
  532. cat > conftest.c <<EOF
  533. #include <ctype.h>
  534. int main() { exit(0); }
  535. int t() { 
  536. /* The GNU C library defines this for functions which it implements
  537.     to always fail with ENOSYS.  Some functions are actually named
  538.     something starting with __ and the normal name is an alias.  */
  539. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  540. choke me
  541. #else
  542. /* Override any gcc2 internal prototype to avoid an error.  */
  543. extern char GETB67(); GETB67();
  544. #endif
  545.  }
  546. EOF
  547. if eval $compile; then
  548.   {
  549. test -n "$verbose" && \
  550. echo "    defining CRAY_STACKSEG_END to be GETB67"
  551. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  552. }
  553.  
  554. else
  555.   echo checking for getb67
  556. cat > conftest.c <<EOF
  557. #include <ctype.h>
  558. int main() { exit(0); }
  559. int t() { 
  560. /* The GNU C library defines this for functions which it implements
  561.     to always fail with ENOSYS.  Some functions are actually named
  562.     something starting with __ and the normal name is an alias.  */
  563. #if defined (__stub_getb67) || defined (__stub___getb67)
  564. choke me
  565. #else
  566. /* Override any gcc2 internal prototype to avoid an error.  */
  567. extern char getb67(); getb67();
  568. #endif
  569.  }
  570. EOF
  571. if eval $compile; then
  572.   {
  573. test -n "$verbose" && \
  574. echo "    defining CRAY_STACKSEG_END to be getb67"
  575. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  576. }
  577.  
  578. fi
  579. rm -f conftest*
  580.  
  581. fi
  582. rm -f conftest*
  583.  
  584. fi
  585. rm -f conftest*
  586.  
  587. fi
  588. rm -f conftest*
  589.  
  590.  
  591. fi
  592. rm -f conftest*
  593.  
  594. if test -n "$alloca_missing"; then
  595.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  596.   # that cause trouble.  Some versions do not even contain alloca or
  597.   # contain a buggy version.  If you still want to use their alloca,
  598.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  599.   ALLOCA=alloca.o
  600.  
  601.   echo 'checking stack direction for C alloca'
  602.   echo checking whether cross-compiling
  603. # If we cannot run a trivial program, we must be cross compiling.
  604. cat > conftest.c <<EOF
  605. main(){exit(0);}
  606. EOF
  607. eval $compile
  608. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  609.   :
  610. else
  611.   cross_compiling=1
  612. fi
  613. rm -f conftest*
  614.  
  615. if test -n "$cross_compiling"
  616. then
  617.   
  618. {
  619. test -n "$verbose" && \
  620. echo "    defining STACK_DIRECTION to be 0"
  621. DEFS="$DEFS -DSTACK_DIRECTION=0"
  622. }
  623.  
  624. else
  625. cat > conftest.c <<EOF
  626. find_stack_direction ()
  627. {
  628.   static char *addr = 0;
  629.   auto char dummy;
  630.   if (addr == 0)
  631.     {
  632.       addr = &dummy;
  633.       return find_stack_direction ();
  634.     }
  635.   else
  636.     return (&dummy > addr) ? 1 : -1;
  637. }
  638. main ()
  639. {
  640.   exit (find_stack_direction() < 0);
  641. }
  642. EOF
  643. eval $compile
  644. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  645.   
  646. {
  647. test -n "$verbose" && \
  648. echo "    defining STACK_DIRECTION to be 1"
  649. DEFS="$DEFS -DSTACK_DIRECTION=1"
  650. }
  651.  
  652. else
  653.   
  654. {
  655. test -n "$verbose" && \
  656. echo "    defining STACK_DIRECTION to be -1"
  657. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  658. }
  659.  
  660. fi
  661. fi
  662. rm -f conftest*
  663. fi
  664.  
  665. if test -n "$prefix"; then
  666.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  667.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  668. fi
  669. if test -n "$exec_prefix"; then
  670.   prsub="$prsub
  671. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  672. fi
  673. cat >conftest.def <<EOF
  674. $DEFS
  675. EOF
  676. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  677. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  678. rm -f conftest.def
  679.  
  680. trap 'rm -f config.status; exit 1' 1 3 15
  681. echo creating config.status
  682. rm -f config.status
  683. cat > config.status <<EOF
  684. #!/bin/sh
  685. # Generated automatically by configure.
  686. # Run this file to recreate the current configuration.
  687. # This directory was configured as follows,
  688. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  689. #
  690. # $0 $configure_args
  691.  
  692. for arg
  693. do
  694.   case "\$arg" in
  695.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  696.     exec /bin/sh $0 $configure_args ;;
  697.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  698.   esac
  699. done
  700.  
  701. trap 'rm -f Makefile; exit 1' 1 3 15
  702. CC='$CC'
  703. CPP='$CPP'
  704. INSTALL='$INSTALL'
  705. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  706. INSTALL_DATA='$INSTALL_DATA'
  707. ALLOCA='$ALLOCA'
  708. LIBS='$LIBS'
  709. srcdir='$srcdir'
  710. DEFS='$DEFS'
  711. prefix='$prefix'
  712. exec_prefix='$exec_prefix'
  713. prsub='$prsub'
  714. EOF
  715. cat >> config.status <<\EOF
  716.  
  717. top_srcdir=$srcdir
  718.  
  719. # Allow make-time overrides of the generated file list.
  720. test -n "$gen_files" || gen_files="Makefile"
  721.  
  722. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  723.   srcdir=$top_srcdir
  724.   # Remove last slash and all that follows it.  Not all systems have dirname.
  725.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  726.   if test "$dir" != "$file"; then
  727.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  728.     test ! -d $dir && mkdir $dir
  729.   fi
  730.   echo creating $file
  731.   rm -f $file
  732.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  733.   sed -e "
  734. $prsub
  735. s%@CC@%$CC%g
  736. s%@CPP@%$CPP%g
  737. s%@INSTALL@%$INSTALL%g
  738. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  739. s%@INSTALL_DATA@%$INSTALL_DATA%g
  740. s%@ALLOCA@%$ALLOCA%g
  741. s%@LIBS@%$LIBS%g
  742. s%@srcdir@%$srcdir%g
  743. s%@DEFS@%$DEFS%
  744. " $top_srcdir/${file}.in >> $file
  745. fi; done
  746.  
  747. exit 0
  748. EOF
  749. chmod +x config.status
  750. test -n "$no_create" || ./config.status
  751.  
  752.