home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / groff-1.09-src.lha / src / amiga / groff-1.09 / configure < prev    next >
Text File  |  1994-02-21  |  33KB  |  1,413 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=`/bin/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=`/bin/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=`/bin/echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`/bin/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="`/bin/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=groff/groff.cc
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog| sed 's|/$||' | sed 's|//|/|' | sed 's|/[^/]*$||'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131. # Hack so we don't have to remember to configure with 
  132. # -prefix=/gnu all the time.
  133. prefix=/gnu
  134. if test -z "$prefix"
  135. then
  136.   echo checking for grops to derive installation directory prefix
  137.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="$IFS:"
  138.   for dir in $PATH; do
  139.     test -z "$dir" && dir=.
  140.     if test $dir != . && test -f $dir/grops; then
  141.       # Not all systems have dirname.
  142.       prefix=`echo $dir|sed 's%/[^/][^/]*$%%'`
  143.       break
  144.     fi
  145.   done
  146.   IFS="$saveifs"
  147.   echo "    chose installation directory prefix ${prefix}"
  148. fi
  149. if test -z "$prefix"
  150. then
  151.   echo checking for gcc to derive installation directory prefix
  152.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="$IFS:"
  153.   for dir in $PATH; do
  154.     test -z "$dir" && dir=.
  155.     if test $dir != . && test -f $dir/gcc; then
  156.       # Not all systems have dirname.
  157.       prefix=`echo $dir|sed 's%/[^/][^/]*$%%'`
  158.       break
  159.     fi
  160.   done
  161.   IFS="$saveifs"
  162.   echo "    chose installation directory prefix ${prefix}"
  163. fi
  164.  
  165. if test -z "$CC"; then
  166.   # Extract the first word of `gcc', so it can be a program name with args.
  167.   set dummy gcc; word=$2
  168.   echo checking for $word
  169.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  170.   for dir in $PATH; do
  171.     test -z "$dir" && dir=.
  172.     if test -f $dir/$word; then
  173.       CC="gcc"
  174.       break
  175.     fi
  176.   done
  177.   IFS="$saveifs"
  178. fi
  179. test -z "$CC" && CC="cc"
  180. test -n "$CC" && test -n "$verbose" && echo "    setting CC to $CC"
  181.  
  182. # Find out if we are using GNU C, under whatever name.
  183. cat > conftest.c <<EOF
  184. #ifdef __GNUC__
  185.   yes
  186. #endif
  187. EOF
  188. ${CC-cc} -E conftest.c > conftest.out 2>&1
  189. if egrep yes conftest.out >/dev/null 2>&1; then
  190.   GCC=1 # For later tests.
  191. fi
  192. rm -f conftest*
  193.  
  194. cc_compile='$CCC conftest.cc -o conftest $CCLIBS $LIBS >/dev/null 2>&1'
  195.  
  196. if test -z "$CCC"; then
  197. # See whether the C compiler is also a C++ compiler.
  198. echo checking if C compiler is also a C++ compiler
  199. cat <<EOF > conftest.cc
  200. #ifdef __cplusplus
  201.   yes
  202. #endif
  203. EOF
  204. $CC -E conftest.cc >conftest.out 2>&1
  205. if egrep yes conftest.out >/dev/null 2>&1; then
  206.   CCC="$CC"
  207. fi
  208. fi
  209. if test -z "$CCC"; then
  210.   # Extract the first word of `g++', so it can be a program name with args.
  211.   set dummy g++; word=$2
  212.   echo checking for $word
  213.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  214.   for dir in $PATH; do
  215.     test -z "$dir" && dir=.
  216.     if test -f $dir/$word; then
  217.       CCC="g++"
  218.       break
  219.     fi
  220.   done
  221.   IFS="$saveifs"
  222. fi
  223.  
  224. test -n "$CCC" && test -n "$verbose" && echo "    setting CCC to $CCC"
  225.  
  226. if test -z "$CCC"; then
  227.   # Extract the first word of `CC', so it can be a program name with args.
  228.   set dummy CC; 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.       CCC="CC"
  235.       break
  236.     fi
  237.   done
  238.   IFS="$saveifs"
  239. fi
  240.  
  241. test -n "$CCC" && test -n "$verbose" && echo "    setting CCC to $CCC"
  242.  
  243. if test -z "$CCC"; then
  244.   # Extract the first word of `cc++', so it can be a program name with args.
  245.   set dummy cc++; word=$2
  246.   echo checking for $word
  247.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  248.   for dir in $PATH; do
  249.     test -z "$dir" && dir=.
  250.     if test -f $dir/$word; then
  251.       CCC="cc++"
  252.       break
  253.     fi
  254.   done
  255.   IFS="$saveifs"
  256. f