home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / glibc-1.06 / configure.in < prev    next >
Encoding:
Text File  |  1993-05-21  |  13.7 KB  |  514 lines

  1. dnl Autoconf sets the quotes to [ and ], which hoses shell commands.
  2. dnl We get rid of the quotes altogether, and turn them on for AC_*.
  3. changequote(,)dnl
  4. #! /bin/sh
  5.  
  6. # Configuration script for the GNU C Library.
  7. dnl You can ignore the following line if you are reading this sentence.
  8. # DO NOT EDIT!  This script is generated from configure.in; edit that instead.
  9.  
  10. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  11. # This file is part of the GNU C Library.
  12.  
  13. # The GNU C Library is free software; you can redistribute it and/or
  14. # modify it under the terms of the GNU Library General Public License as
  15. # published by the Free Software Foundation; either version 2 of the
  16. # License, or (at your option) any later version.
  17.  
  18. # The GNU C Library is distributed in the hope that it will be useful,
  19. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  21. # Library General Public License for more details.
  22.  
  23. # You should have received a copy of the GNU Library General Public
  24. # License along with the GNU C Library; see the file COPYING.LIB.  If
  25. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  26. # Cambridge, MA 02139, USA.
  27.  
  28. #
  29. #    Configure the GNU C Library.
  30. #
  31.  
  32. prog="`basename $0`"
  33.  
  34. # All the standard GNU configure options are accepted but only
  35. # --nfp, --with-gnu-ld, and --with-gnu-as are meaningful.
  36. nfp=
  37. gnu_ld=
  38. gnu_as=
  39. version=
  40. release=
  41. prefix=
  42. exec_prefix=
  43. verbose=
  44.  
  45. lose=
  46. for arg in $*; do
  47.   if [ x$next != x ]; then
  48.     eval "$next = \$arg"
  49.     next=
  50.   else
  51.     case $arg in
  52.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  53.     srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
  54.     ;;
  55.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  56.     next=srcdir
  57.     ;;
  58.      -target | --target | --targe | --targ | --tar | --ta | --t)
  59.     next=target
  60.     ;;
  61.      -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  62.     target=`echo $arg | sed 's/-*t[a-z]*=//'`
  63.     ;; 
  64.  
  65.      -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
  66.     gnu_ld=--with-gnu-ld
  67.     ;;
  68.  
  69.      -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
  70.         gnu_as=--with-gnu-as
  71.     ;;
  72.  
  73.      -nfp | --nfp | --nf | --n)
  74.     nfp=--nfp
  75.     ;;
  76.  
  77.      -with-* | --with-*)
  78.        ;; # ignored
  79.  
  80.      -x | --x)
  81.        ;; # ignored
  82.  
  83.      -os-release=* | -os-releas=* | -os-relea=* | -os-rele=* | -os-rel=* \
  84.      | -os-re=* | -os-r=* | --os-release=* | --os-releas=* | --os-relea=* \
  85.      | --os-rele=* | --os-rel=* | --os-re=* | --os-r=*)
  86.        release=`echo $arg | sed 's/-*os-r[a-z]*=//'`
  87.        ;;
  88.      -os-release | -os-releas | -os-relea | -os-rele | -os-rel \
  89.      | -os-re | -os-r | --os-release | --os-releas | --os-relea \
  90.      | --os-rele | --os-rel | --os-re | --os-r)
  91.        next=release
  92.        ;;
  93.  
  94.      -os-version=* | -os-versio=* | -os-versi=* | -os-vers=* | -os-ver=* \
  95.      | -os-ver=* | -os-ve=* | -os-v=* | --os-version=* | --os-versio=* \
  96.      | --os-versi=* | --os-vers=* | --os-ver=* | --os-ver=* | --os-ve=* \
  97.      | --os-v=*)
  98.        version=`echo $arg | sed 's/-*os-v[a-z]*=//'`
  99.        ;;
  100.      -os-version | -os-versio | -os-versi | -os-vers | -os-ver \
  101.      | -os-ver | -os-ve | -os-v |--os-version | --os-versio \
  102.      | --os-versi | --os-vers | --os-ver | --os-ver | --os-ve | --os-v)
  103.        next=version
  104.        ;;
  105.  
  106.      # For backward compatibility, also recognize exact --exec_prefix.
  107.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  108.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'`
  109.     ;;
  110.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  111.     next=exec_prefix
  112.     ;;
  113.  
  114.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  115.     prefix=`echo $arg | sed 's/[-a-z_]*=//'`
  116.     ;;
  117.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  118.     next=prefix
  119.     ;;
  120.  
  121.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  122.        # Autoconf-generated code below will test this.
  123.        verbose=yes
  124.        ;;
  125.  
  126.      -*)
  127.     echo "Invalid option \`$arg'" 1>&2
  128.     lose=yes
  129.     ;;
  130.      *)
  131.     if [ ! "$target" ]; then
  132.       target=$arg
  133.     else
  134.       lose=yes
  135.     fi
  136.     ;;
  137.     esac
  138.   fi
  139. done
  140.  
  141. # NEXT will be set iff we have seen an option that wants an arg, but no arg.
  142. if [ "$next" ]; then
  143.   echo "$0: the \`--${next}' option requires an argument" >&2
  144.   lose=yes
  145. fi
  146.  
  147. dnl This deals with setting srcdir if it needs to be set.
  148. changequote([,])
  149. AC_PREPARE(features.h)
  150. changequote(,)
  151.  
  152. if [ ! "$target" ]; then
  153.   echo 'No target given.  Trying to guess target...'
  154.   target=`$srcdir/config.guess`
  155. fi
  156.  
  157. if [ "$lose" = yes -o ! "$target" ]; then
  158.   echo "\
  159. Usage: $prog [--srcdir=DIR] [--prefix=DIR] [--exec-prefix=DIR]
  160.          [--nfp] [--with-gnu-ld] [--with-gnu-as] TARGET" >&2
  161.   if [ -r config.status ]; then
  162.     cat config.status >&2
  163.   fi
  164.   exit 1
  165. fi
  166.  
  167. # Canonicalize the configuration name.
  168. config=`$srcdir/config.sub $target`
  169. if [ ! "$config" ]; then
  170.   # config.sub has written an error message.
  171.   exit 1
  172. fi
  173.  
  174. sysdep_dir=$srcdir/sysdeps
  175.  
  176. # machine-vendor-os
  177. eval "`echo $config | \
  178.        sed 's/^\(.*\)-\(.*\)-\(.*\)$/machine=\1 vendor=\2 os=\3/'`"
  179.  
  180. # Make sco3.2v4 become sco3.2.4.
  181. os="`echo $os | sed 's/\([0-9]\)v\([0-9]\)/\1.\2/g'`"
  182.  
  183. case "$os" in
  184. gnu*)
  185.   os=mach/hurd ;;
  186. sunos* | ultrix* | newsos* | dynix* | bsd*)
  187.   base_os=unix/bsd ;;
  188. linux* | sysv* | isc* | esix* | sco* | minix*)
  189.   base_os=unix/sysv ;;
  190. solaris[2-9]*)
  191.   base_os=unix/sysv/sysv4 ;;
  192. esac
  193.  
  194. case "$os" in
  195. gnu* | linux*)
  196.   gnu_ld=--with-gnu-ld
  197.   gnu_as=--with-gnu-as
  198. esac
  199.  
  200. # For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
  201. tail=$os
  202. ostry=$os
  203. while o=`echo $tail | sed 's/\.[^.]*$//'`; [ $o != $tail ]; do
  204.   ostry="$ostry /$o"
  205.   tail=$o
  206. done  
  207. o=`echo $tail | sed 's/[0-9]*$//'`
  208. if [ $o != $tail ]; then
  209.   ostry="$ostry /$o"
  210. fi
  211.  
  212. # For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
  213. base=
  214. tail=$base_os
  215. while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$b" ]; do
  216.   set $b
  217.   base="$base /$1"
  218.   tail="$2"
  219. done
  220.  
  221. # Find what sysdep directories exist.
  222. sysnames=
  223. for b in $base ''; do
  224.   for v in /$vendor ''; do
  225.     for o in /$ostry ''; do
  226.       for m in /$machine ''; do
  227.         if [ -d $sysdep_dir$b$v$o$m ]; then
  228.           sysnames="$sysnames $b$v$o$m"
  229.       [ "$o" -o "$b" ] && os_used=t
  230.       [ "$m" ] && machine_used=t
  231.     fi
  232.       done
  233.     done
  234.   done
  235. done
  236.  
  237. if [ ! "$os_used" -a "$os" != none ]; then
  238.   echo Operating system $os is not supported. >&2
  239.   exit 1
  240. fi
  241. if [ ! "$machine_used" -a "$machine" != none ]; then
  242.   echo The $machine is not supported. >&2
  243.   exit 1
  244. fi
  245.  
  246. # We have now validated the configuration.
  247.  
  248. PWD=`pwd`
  249. echo Configuring the GNU C library in $PWD
  250. echo on `(hostname || uname -n) 2>/dev/null | sed 1q` for ${config}.
  251.  
  252. # Remove the leading slashes.
  253. sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"
  254.  
  255. # Prepend the machine's FPU directory unless --nfp.
  256. if [ ! "$nfp" -a -d $sysdep_dir/$machine/fpu ]; then
  257.   sysnames="${machine}/fpu $sysnames"
  258. fi
  259.  
  260. # Expand the list of system names into a full list of directories
  261. # from each element's parent name and Implies file (if present).
  262. set $sysnames
  263. while [ $# -gt 0 ]; do
  264.   name=$1
  265.   shift
  266.  
  267.   if [ -f $sysdep_dir/$name/Implies ]; then
  268.     # Collect more names from the `Implies' file (removing comments).
  269.     implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
  270.   else
  271.     implied=
  272.   fi
  273.  
  274.   # Add NAME to the list of names.
  275.   names="$names $name"
  276.  
  277.   # Find the parent of NAME, using the empty string if it has none.
  278.   parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"
  279.  
  280.   # Append the names implied by NAME, and NAME's parent (if it has one),
  281.   # to the list of names to be processed (the argument list).
  282.   sysnames="`echo $* $implied $parent`"
  283.   if [ "$sysnames" != "" ]; then
  284.     set $sysnames
  285.   fi
  286. done
  287.  
  288. # Add the default directories.
  289. names="$names generic stub"
  290.  
  291. # Now uniquize the list.
  292. seen=
  293. sysnames=
  294. for name in $names; do
  295.   if echo "$seen" | fgrep -x $name >/dev/null; then
  296.     # Already in the list.
  297.     true;
  298.   else
  299.     # A new one.
  300.     if [ "$seen" = "" ]; then
  301.       seen="$name" sysnames="$name"
  302.     else
  303.       seen="$seen
  304. $name"
  305.       sysnames="$sysnames $name"
  306.     fi
  307.   fi
  308. done
  309.  
  310. echo Using system-dependent files from directories:
  311. for dir in $sysnames; do echo "    $dir"; done
  312.  
  313. # This will get text that should go into config.make.
  314. config_vars=
  315.  
  316. changequote([,])dnl The world is now safe for m4, and unsafe for shell.
  317. dnl Be sure to add each macro used here to aclocal.m4 (which see).
  318. AC_PROG_INSTALL
  319. AC_PROG_RANLIB
  320.  
  321. AC_PROG_CC
  322. AC_PROG_CPP
  323.  
  324. echo checking for signed size_t type
  325. echo '#include <stddef.h>
  326. FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
  327. eval "$CPP conftest.c 2>/dev/null" \
  328. | grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null \
  329. || AC_DEFINE(__SIZE_TYPE__, unsigned)
  330. rm -f conftest*
  331.  
  332. AC_HEADER_EGREP(__gnuc_va_list, stdarg.h, [config_vars="$config_vars
  333. stdarg.h = # The installed <stdarg.h> defines __gnuc_va_list."])
  334.  
  335. changequote(,)dnl The world is again safe for shell scripts.
  336.  
  337. # Iterate over all the sysdep directories we will use, running their
  338. # configure fragments, and looking for a uname implementation.
  339. uname=
  340. for dir in $sysnames; do
  341.   if test -r $sysdep_dir/$dir/configure; then
  342.     echo running configure fragment for $dir
  343.     . $sysdep_dir/$dir/configure
  344.   fi
  345.   test ! "$uname" && \
  346.   test -r $sysdep_dir/$dir/uname.c -o -r $sysdep_dir/$dir/uname.S && uname=$dir
  347. done
  348.  
  349. # If we will use the generic uname implementation, we must figure out what
  350. # it will say by examining the system, and write the results in config-name.h.
  351. if [ "$uname" = generic ]; then
  352.  
  353.   echo trying to guess OS release and version for uname
  354.  
  355.   kernel_release=
  356.   kernel_version=
  357.  
  358.   if [ ! "$release" -o ! "$version" ]; then
  359.     if [ -r /vmunix ]; then
  360.       kernel_id=`strings /vmunix | grep UNIX`
  361.     elif [ -r /dynix ]; then
  362.       kernel_id=`strings /dynix | grep DYNIX`
  363.     else
  364.       kernel_id=
  365.     fi
  366.     if [ "$kernel_id" ]; then
  367.       kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
  368.       kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
  369.     fi
  370.   fi
  371.  
  372.   sysname=`echo $os | sed 's/[0-9.]*$//'`
  373.   if [ $sysname != $os ]; then
  374.     config_release=`echo $os | sed s/$sysname//`
  375.   fi
  376.  
  377.   if [ "$release" ]; then
  378.     # All is well.
  379.     true
  380.   elif [ x`echo "$config_release" | sed "s/^$kernel_release//"` \
  381.      != x$config_release ]; then
  382.     # The configuration release is a substring of the kernel release.
  383.     release=$kernel_release
  384.   elif [ x$config_release != x ]; then
  385.     release=$config_release
  386.   elif [ x$kernel_release != x ]; then
  387.     release=$kernel_release
  388.   else
  389.     cat <<END
  390. I don't know what release of $sysname you are using.  Please enter the
  391. release number now.  This information is used only for the \`uname' function,
  392. so it is not critical.
  393. END
  394.     read release
  395.     if [ ! "$release" ]; then
  396.       release=unknown
  397.     fi
  398.   fi
  399.  
  400.   if [ "$version" ]; then
  401.     # All is well.
  402.     true
  403.   elif [ ! "$kernel_version" ]; then
  404.     cat <<END
  405. I don't know what version of $sysname $release you are using.  Please enter
  406. the version number now.  This information is used only for the uname
  407. function, so it is not critical.
  408. END
  409.     read version
  410.     if [ ! "$version" ]; then
  411.       version=unknown
  412.     fi
  413.   else
  414.     version=$kernel_version
  415.   fi
  416.  
  417.   cat > config-name.h <<END
  418. /* This file was generated automatically by configure.  Do not edit.
  419.    This is used by the generic uname function.  */
  420. #define UNAME_SYSNAME "${sysname}"
  421. #define UNAME_RELEASE "${release}"
  422. #define UNAME_VERSION "${version}"
  423. #define UNAME_MACHINE "${machine}-${vendor}"
  424. END
  425.  
  426.   system_name="$sysname $release version $version on $vendor $machine"
  427. else
  428.   # Not generic uname.  We don't need config-name.h at all.
  429.   system_name=$config
  430. fi
  431.  
  432. if [ "$gnu_ld" ]; then
  433.   DEFS="$DEFS -DHAVE_GNU_LD"
  434. fi
  435. if [ "$gnu_as" ]; then
  436.   DEFS="$DEFS -DHAVE_GNU_AS"
  437. fi
  438.  
  439. (
  440.   echo '# This file was generated automatically by configure.  Do not edit.'
  441.   echo '# Put configuration parameters in configparms instead.'
  442.   echo "config-machine = ${machine}"
  443.   echo "config-vendor = ${vendor}"
  444.   echo "config-os = ${os}"
  445.   echo "config-sysdirs = ${sysnames}"
  446.   if [ "$prefix" ]; then
  447.     echo "prefix = ${prefix}"
  448.   fi
  449.   if [ "$exec_prefix" ]; then
  450.     echo "exec_prefix = ${exec_prefix}"
  451.   fi
  452.   echo "config-defines = ${DEFS}"
  453.   for var in INSTALL INSTALL_PROGRAM INSTALL_DATA RANLIB; do
  454.     eval "echo \"${var} = \${$var}\""
  455.   done
  456.   echo "$config_vars"
  457. ) > config.make
  458. echo "Wrote config.make in $PWD."
  459.  
  460. switches=
  461. if [ "$gnu_as" ]; then
  462.   switches="$switches --with-gnu-as"
  463. fi
  464. if [ "$gnu_ld" ]; then
  465.   switches="$switches --with-gnu-ld"
  466. fi
  467. if [ "$exec_prefix" ]; then
  468.   switches="$switches --exec_prefix=$exec_prefix"
  469. fi
  470. if [ "$prefix" ]; then
  471.   switches="$switches --prefix=$prefix"
  472. fi
  473. if [ "$release" ]; then
  474.   switches="$switches --os-release='$release'"
  475. fi
  476. if [ "$version" ]; then
  477.   switches="$switches --os-version='$version'"
  478. fi
  479.  
  480. if [ $srcdir != . ]; then
  481.   if [ $srcdir = .. ]; then
  482.     cwd=`pwd`
  483.     objdir=`basename $cwd`
  484.   else
  485.     objdir=`pwd`
  486.   fi
  487.   cat > Makefile <<END
  488. # This file was generated automatically by configure.  Do not edit.
  489. srcdir = $srcdir
  490.  
  491. all .DEFAULT:
  492.     \$(MAKE) -C \$(srcdir) ARCH=$objdir \$@
  493. END
  494.  
  495. echo "Wrote Makefile in $PWD."
  496. fi
  497.  
  498. cat > config.status <<END
  499. #!/bin/sh
  500. # This file was generated automatically by configure.  Do not edit.
  501. # The GNU C library was configured in $PWD for
  502. # $system_name as follows:
  503. $0 $config --srcdir=$srcdir $switches
  504. END
  505. chmod a+x config.status
  506. echo "Wrote config.status in $PWD."
  507.  
  508. exit 0
  509. dnl This gets rid of the random stuff autoconf has stuffed in weird places.
  510. divert(-1)dnl AC_This is here so I can search for `AC_' to find the frobs.
  511. dnl Local Variables:
  512. dnl compile-command: "m4 /gd/gnu/autoconf/acgeneral.m4 /gd/gnu/autoconf/acspecific.m4 configure.in > configure && chmod a+x configure"
  513. dnl End:
  514.