home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / uuencode-1.0-src.lha / src / amiga / uuencode-1.0 / configure < prev    next >
Text File  |  1994-02-24  |  15KB  |  587 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=uuencode.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. # Make sure to not get the incompatible SysV /etc/install and
  156. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  157. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  158. # or the AFS install, which mishandles nonexistent args, or
  159. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  160. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  161. # anyway.  Sigh.
  162. if test "z${INSTALL}" = "z" ; then
  163.   echo checking for install
  164.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  165.   for dir in $PATH; do
  166.     test -z "$dir" && dir=.
  167.     case $dir in
  168.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  169.     *)
  170.       if test -f $dir/installbsd; then
  171.     INSTALL="$dir/installbsd -c" # OSF1
  172.     INSTALL_PROGRAM='$(INSTALL)'
  173.     INSTALL_DATA='$(INSTALL) -m 644'
  174.     break
  175.       fi
  176.       if test -f $dir/install; then
  177.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  178.       : # AIX
  179.     else
  180.       INSTALL="$dir/install -c"
  181.       INSTALL_PROGRAM='$(INSTALL)'
  182.       INSTALL_DATA='$(INSTALL) -m 644'
  183.       break
  184.     fi
  185.       fi
  186.       ;;
  187.     esac
  188.   done
  189.   IFS="$saveifs"
  190. fi
  191. INSTALL=${INSTALL-cp}
  192. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  193. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  194.  
  195. echo checking for void
  196. cat > conftest.c <<EOF
  197.  
  198. int main() { exit(0); }
  199. int t() { extern void foo (); (void) exit (0); }
  200. EOF
  201. if eval $compile; then
  202.   :
  203. else
  204.   
  205. {
  206. test -n "$verbose" && \
  207. echo "    defining void to be int"
  208. DEFS="$DEFS -Dvoid=int"
  209. }
  210.  
  211. fi
  212. rm -f conftest*
  213.  
  214. prog='/* Ultrix mips cc rejects this.  */
  215. typedef int charset[2]; const charset x;
  216. /* SunOS 4.1.1 cc rejects this.  */
  217. char const *const *ccp;
  218. char **p;
  219. /* AIX XL C 1.02.0.0 rejects this.
  220.    It does not let you subtract one const X* pointer from another in an arm
  221.    of an if-expression whose if-part is not a constant expression */
  222. const char *g = "string";
  223. ccp = &g + (g ? g-g : 0);
  224. /* HPUX 7.0 cc rejects these. */
  225. ++ccp;
  226. p = (char**) ccp;
  227. ccp = (char const *const *) p;
  228. { /* SCO 3.2v4 cc rejects this.  */
  229.   char *t;
  230.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  231.  
  232.   *t++ = 0;
  233. }
  234. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  235.   int x[] = {25,17};
  236.   const int *foo = &x[0];
  237.   ++foo;
  238. }
  239. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  240.   typedef const int *iptr;
  241.   iptr p = 0;
  242.   ++p;
  243. }
  244. { /* AIX XL C 1.02.0.0 rejects this saying
  245.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  246.   struct s { int j; const int *ap[3]; };
  247.   struct s *b; b->j = 5;
  248. }'
  249. echo checking for working const
  250. cat > conftest.c <<EOF
  251.  
  252. int main() { exit(0); }
  253. int t() { $prog }
  254. EOF
  255. if eval $compile; then
  256.   :
  257. else
  258.   
  259. {
  260. test -n "$verbose" && \
  261. echo "    defining const to be empty"
  262. DEFS="$DEFS -Dconst="
  263. }
  264.  
  265. fi
  266. rm -f conftest*
  267.  
  268. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  269. # for constant arguments.  Useless!
  270. echo checking for working alloca.h
  271. cat > conftest.c <<EOF
  272. #include <alloca.h>
  273. int main() { exit(0); }
  274. int t() { char *p = alloca(2 * sizeof(int)); }
  275. EOF
  276. if eval $compile; then
  277.   
  278. {
  279. test -n "$verbose" && \
  280. echo "    defining HAVE_ALLOCA_H"
  281. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  282. }
  283.  
  284. fi
  285. rm -f conftest*
  286.  
  287. decl="#ifdef __GNUC__
  288. #define alloca __builtin_alloca
  289. #else
  290. #if HAVE_ALLOCA_H
  291. #include <alloca.h>
  292. #else
  293. #ifdef _AIX
  294.  #pragma alloca
  295. #else
  296. char *alloca ();
  297. #endif
  298. #endif
  299. #endif
  300. "
  301. echo checking for alloca
  302. cat > conftest.c <<EOF
  303. $decl
  304. int main() { exit(0); }
  305. int t() { char *p = (char *) alloca(1); }
  306. EOF
  307. if eval $compile; then
  308.   :
  309. else
  310.   alloca_missing=1
  311. echo checking how to run the C preprocessor
  312. if test -z "$CPP"; then
  313.   # This must be in double quotes, not single quotes, because CPP may get
  314.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  315.   # make.  It must be expanded now.
  316.   CPP="${CC-cc} -E"
  317.   cat > conftest.c <<EOF
  318. #include <stdio.h>
  319. Syntax Error
  320. EOF
  321. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  322. if test -z "$err"; then
  323.   :
  324. else
  325.   CPP=/lib/cpp
  326. fi
  327. rm -f conftest*
  328. fi
  329. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  330.  
  331. cat > conftest.c <<EOF
  332.  
  333. #if defined(CRAY) && ! defined(CRAY2)
  334. winnitude
  335. #else
  336. lossage
  337. #endif
  338.  
  339. EOF
  340. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  341. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  342.   echo checking for _getb67
  343. cat > conftest.c <<EOF
  344. #include <ctype.h>
  345. int main() { exit(0); }
  346. int t() { 
  347. /* The GNU C library defines this for functions which it implements
  348.     to always fail with ENOSYS.  Some functions are actually named
  349.     something starting with __ and the normal name is an alias.  */
  350. #if defined (__stub__getb67) || defined (__stub____getb67)
  351. choke me
  352. #else
  353. /* Override any gcc2 internal prototype to avoid an error.  */
  354. extern char _getb67(); _getb67();
  355. #endif
  356.  }
  357. EOF
  358. if eval $compile; then
  359.   {
  360. test -n "$verbose" && \
  361. echo "    defining CRAY_STACKSEG_END to be _getb67"
  362. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  363. }
  364.  
  365. else
  366.   echo checking for GETB67
  367. cat > conftest.c <<EOF
  368. #include <ctype.h>
  369. int main() { exit(0); }
  370. int t() { 
  371. /* The GNU C library defines this for functions which it implements
  372.     to always fail with ENOSYS.  Some functions are actually named
  373.     something starting with __ and the normal name is an alias.  */
  374. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  375. choke me
  376. #else
  377. /* Override any gcc2 internal prototype to avoid an error.  */
  378. extern char GETB67(); GETB67();
  379. #endif
  380.  }
  381. EOF
  382. if eval $compile; then
  383.   {
  384. test -n "$verbose" && \
  385. echo "    defining CRAY_STACKSEG_END to be GETB67"
  386. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  387. }
  388.  
  389. else
  390.   echo checking for getb67
  391. cat > conftest.c <<EOF
  392. #include <ctype.h>
  393. int main() { exit(0); }
  394. int t() { 
  395. /* The GNU C library defines this for functions which it implements
  396.     to always fail with ENOSYS.  Some functions are actually named
  397.     something starting with __ and the normal name is an alias.  */
  398. #if defined (__stub_getb67) || defined (__stub___getb67)
  399. choke me
  400. #else
  401. /* Override any gcc2 internal prototype to avoid an error.  */
  402. extern char getb67(); getb67();
  403. #endif
  404.  }
  405. EOF
  406. if eval $compile; then
  407.   {
  408. test -n "$verbose" && \
  409. echo "    defining CRAY_STACKSEG_END to be getb67"
  410. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  411. }
  412.  
  413. fi
  414. rm -f conftest*
  415.  
  416. fi
  417. rm -f conftest*
  418.  
  419. fi
  420. rm -f conftest*
  421.  
  422. fi
  423. rm -f conftest*
  424.  
  425.  
  426. fi
  427. rm -f conftest*
  428.  
  429. if test -n "$alloca_missing"; then
  430.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  431.   # that cause trouble.  Some versions do not even contain alloca or
  432.   # contain a buggy version.  If you still want to use their alloca,
  433.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  434.   ALLOCA=alloca.o
  435.  
  436.   echo 'checking stack direction for C alloca'
  437.   echo checking whether cross-compiling
  438. # If we cannot run a trivial program, we must be cross compiling.
  439. cat > conftest.c <<EOF
  440. main(){exit(0);}
  441. EOF
  442. eval $compile
  443. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  444.   :
  445. else
  446.   cross_compiling=1
  447. fi
  448. rm -f conftest*
  449.  
  450. if test -n "$cross_compiling"
  451. then
  452.   
  453. {
  454. test -n "$verbose" && \
  455. echo "    defining STACK_DIRECTION to be 0"
  456. DEFS="$DEFS -DSTACK_DIRECTION=0"
  457. }
  458.  
  459. else
  460. cat > conftest.c <<EOF
  461. find_stack_direction ()
  462. {
  463.   static char *addr = 0;
  464.   auto char dummy;
  465.   if (addr == 0)
  466.     {
  467.       addr = &dummy;
  468.       return find_stack_direction ();
  469.     }
  470.   else
  471.     return (&dummy > addr) ? 1 : -1;
  472. }
  473. main ()
  474. {
  475.   exit (find_stack_direction() < 0);
  476. }
  477. EOF
  478. eval $compile
  479. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  480.   
  481. {
  482. test -n "$verbose" && \
  483. echo "    defining STACK_DIRECTION to be 1"
  484. DEFS="$DEFS -DSTACK_DIRECTION=1"
  485. }
  486.  
  487. else
  488.   
  489. {
  490. test -n "$verbose" && \
  491. echo "    defining STACK_DIRECTION to be -1"
  492. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  493. }
  494.  
  495. fi
  496. fi
  497. rm -f conftest*
  498. fi
  499.  
  500. if test -n "$prefix"; then
  501.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  502.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  503. fi
  504. if test -n "$exec_prefix"; then
  505.   prsub="$prsub
  506. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  507. fi
  508. cat >conftest.def <<EOF
  509. $DEFS
  510. EOF
  511. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  512. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  513. rm -f conftest.def
  514.  
  515. trap 'rm -f config.status; exit 1' 1 3 15
  516. echo creating config.status
  517. rm -f config.status
  518. cat > config.status <<EOF
  519. #!/bin/sh
  520. # Generated automatically by configure.
  521. # Run this file to recreate the current configuration.
  522. # This directory was configured as follows,
  523. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  524. #
  525. # $0 $configure_args
  526.  
  527. for arg
  528. do
  529.   case "\$arg" in
  530.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  531.     exec /bin/sh $0 $configure_args ;;
  532.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  533.   esac
  534. done
  535.  
  536. trap 'rm -f Makefile; exit 1' 1 3 15
  537. CC='$CC'
  538. INSTALL='$INSTALL'
  539. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  540. INSTALL_DATA='$INSTALL_DATA'
  541. CPP='$CPP'
  542. ALLOCA='$ALLOCA'
  543. LIBS='$LIBS'
  544. srcdir='$srcdir'
  545. DEFS='$DEFS'
  546. prefix='$prefix'
  547. exec_prefix='$exec_prefix'
  548. prsub='$prsub'
  549. EOF
  550. cat >> config.status <<\EOF
  551.  
  552. top_srcdir=$srcdir
  553.  
  554. # Allow make-time overrides of the generated file list.
  555. test -n "$gen_files" || gen_files="Makefile"
  556.  
  557. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  558.   srcdir=$top_srcdir
  559.   # Remove last slash and all that follows it.  Not all systems have dirname.
  560.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  561.   if test "$dir" != "$file"; then
  562.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  563.     test ! -d $dir && mkdir $dir
  564.   fi
  565.   echo creating $file
  566.   rm -f $file
  567.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  568.   sed -e "
  569. $prsub
  570. s%@CC@%$CC%g
  571. s%@INSTALL@%$INSTALL%g
  572. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  573. s%@INSTALL_DATA@%$INSTALL_DATA%g
  574. s%@CPP@%$CPP%g
  575. s%@ALLOCA@%$ALLOCA%g
  576. s%@LIBS@%$LIBS%g
  577. s%@srcdir@%$srcdir%g
  578. s%@DEFS@%$DEFS%
  579. " $top_srcdir/${file}.in >> $file
  580. fi; done
  581.  
  582. exit 0
  583. EOF
  584. chmod +x config.status
  585. test -n "$no_create" || ./config.status
  586.  
  587.