* mh-hp300: Don't define CFLAGS to empty. Why should hp300 be
[binutils-gdb.git] / configure.in
index 344c79a908e0b1936f9791744a9e7d20020eab21..e206884c3dc2ed28777513c4b63e2500d5f53ee4 100644 (file)
@@ -30,9 +30,9 @@ host_libs="mmalloc libiberty opcodes bfd readline glob gash tcl tk tclX"
 #
 host_tools="texinfo byacc flex bison binutils ld gas gcc gdb make patch
            prms send-pr gprof gdbtest tgas etc expect dejagnu sim
-            m4 autoconf ispell grep diff rcs cvs dosutils fileutils shellutils
+            m4 autoconf ispell grep diff rcs cvs fileutils shellutils
            textutils wdiff find emacs uudecode hello tar gzip indent
-           recode release"
+           recode release sed utils"
 
 
 # these libraries are built for the target environment, and are built after
@@ -83,16 +83,15 @@ srcname="gnu development package"
 # per-host:
 
 case "${host}" in
-  alpha-dec-osf*)         host_makefile_frag=config/mh-alphaosf ;;
   m68k-hp-hpux)                  host_makefile_frag=config/mh-hp300 ;;
   m68k-apollo-sysv*)      host_makefile_frag=config/mh-apollo68 ;;
   m68k-apollo-bsd*)       host_makefile_frag=config/mh-a68bsd ;;
   m88k-motorola-sysv*)    host_makefile_frag=config/mh-delta88;;
   m88k-dg-dgux*)         host_makefile_frag=config/mh-dgux ;;
-  mips-dec-ultrix*)       host_makefile_frag=config/mh-decstation ;;
-  mips-sgi-irix4*)        host_makefile_frag=config/mh-irix4 ;;
-  mips-sgi-irix3*)        host_makefile_frag=config/mh-sysv ;;
-  mips-*-sysv*)                  host_makefile_frag=config/mh-riscos ;;
+  mips*-dec-ultrix*)      host_makefile_frag=config/mh-decstation ;;
+  mips*-sgi-irix4*)       host_makefile_frag=config/mh-irix4 ;;
+  mips*-sgi-irix3*)       host_makefile_frag=config/mh-sysv ;;
+  mips*-*-sysv*)         host_makefile_frag=config/mh-riscos ;;
   i[34]86-ncr-sysv4*)     host_makefile_frag=config/mh-ncr3000 ;;
   i[34]86-*-sco*)         host_makefile_frag=config/mh-sco ;;
   i[34]86-*-isc*)        host_makefile_frag=config/mh-sysv ;;
@@ -106,6 +105,7 @@ case "${host}" in
   m68k-sun-*)            host_makefile_frag=config/mh-sun3 ;;
   *-sun-*)               host_makefile_frag=config/mh-sun ;;
   *-hp-hpux)              host_makefile_frag=config/mh-hpux ;;
+  *-*-hiux*)              host_makefile_frag=config/mh-hpux ;;
   *-*-lynxos*)           host_makefile_frag=config/mh-lynxos ;;
   *-*-sysv4*)             host_makefile_frag=config/mh-sysv4 ;;
   *-*-sysv*)              host_makefile_frag=config/mh-sysv ;;
@@ -113,6 +113,14 @@ esac
 
 # per-target:
 
+gasdir=gas
+use_gnu_ld=
+use_gnu_as=
+
+case "${target}" in
+  hppa*-hp-hpux)         target_makefile_frag=config/mt-hppa ;;
+esac
+
 # some tools are so dependent upon X11 that if we're not building with X, 
 # it's not even worth trying to configure, much less build, that tool.
 
@@ -129,7 +137,7 @@ esac
 
 
 
-# some tools are only suitable for building in a "native" situation.
+# Some tools are only suitable for building in a "native" situation.
 # Those are added when we have a host==target configuration.  For cross
 # toolchains, we add some directories that should only be useful in a
 # cross-compiler.
@@ -148,13 +156,16 @@ else
        done
 fi     
 
+## start-sanitize-for-fsf
 
-# remove more programs from consideration, based on the host or 
+# Remove more programs from consideration, based on the host or 
 # target this usually means that a port of the program doesn't
-# exist yet.
+# exist yet.  This section gets removed for FSF releases,
+# where we want the configure scripts in the subdirectories to
+# complain if the target or host isn't supported.
 
 case "${host}" in
-  alpha-dec-osf1)
+  alpha-dec-osf1*)
     configdirs=`echo ${configdirs} | sed -e 's/gdb//'`
     ;;
   i[34]86-*-go32)
@@ -168,8 +179,8 @@ case "${host}" in
 esac
 
 case "${target}" in
-  alpha-dec-osf1)
-    configdirs=`echo ${configdirs} | sed -e 's/ld//;s/binutils//;s/gas//'`
+  alpha-dec-osf1*)
+    configdirs=`echo ${configdirs} | sed -e 's/gas //'`
     configdirs=`echo ${configdirs} | sed -e 's/gdb//;s/emacs//;s/fileutils//'`
     configdirs=`echo ${configdirs} | sed -e 's/grep//;s/libg++//;s/libio//'`
     ;; 
@@ -188,46 +199,89 @@ case "${target}" in
   hppa*-*-osf)
     # Do configure ld/binutils/gas for this case.
     ;;
+  m68k-hp-hpux*)
+    configdirs=`echo ${configdirs} | sed -e 's/emacs//'`
+    ;; 
   hppa*-*-*)
-    configdirs=`echo ${configdirs} | sed -e 's/ld//;s/binutils//;s/gas//'`
+    # HP's C compiler doesn't handle Emacs correctly
+    case "${CC}" in
+       "" | cc*) configdirs=`echo ${configdirs} | sed -e 's/emacs//'` ;;
+        *) echo "building emacs" ;;
+    esac
+    configdirs=`echo ${configdirs} | sed -e 's/ld//;s/binutils//;s/gas /pagas /;s/shellutils//'`
+    gasdir=pagas
     ;;
   i[34]86-*-go32)
     # add the go32 support tools to the list
     configdirs=`echo go32 ${configdirs}`
     ;;
+  i[34]86-*-sysv4*)
+    # The SYSV4 C compiler doesn't handle Emacs correctly
+    case "${CC}" in
+       "" | cc*) configdirs=`echo ${configdirs} | sed -e 's/emacs//'` ;;
+        *) ;;
+    esac
+    # but that's okay since emacs doesn't work anyway
+    configdirs=`echo ${configdirs} | sed -e 's/emacs//'`
+    ;;
   rs6000-*-*)
-    configdirs=`echo ${configdirs} | sed -e 's/ld//;s/binutils//;s/gas//;s/gprof//'`
+    # a gcc built textutils will cause the linker to hang on 'join'
+    configdirs=`echo ${configdirs} | sed -e 's/ld//;s/binutils//;s/gas //;s/gprof//;s/textutils//'`
     ;;
   mips-*-*)
     configdirs=`echo ${configdirs} | sed -e 's/gprof//'`
     ;;
   sh-*-*)
-    configdirs=`echo gprof ${configdirs}`
+    case "${host}" in
+      i[34]86-*-go32) ;; # don't add gprof
+      *) configdirs=`echo gprof ${configdirs}` ;;
+    esac
+    ;;
+  sparc-*-sunos4*)
+    use_gnu_ld=no
+    ;;
+  sparc-*-solaris2*)
+    configdirs=`echo ${configdirs} | sed -e 's/ld//'`
     ;;
   i[34]86-*-sco*)
     configdirs=`echo ${configdirs} | sed -e 's/gprof//'`
     ;;
-  *-*-solaris2*)
-    configdirs=`echo ${configdirs} | sed -e 's/ld//;s/gas//'`
-    ;;
-  *-*-sysv4*)
-    configdirs=`echo ${configdirs} | sed -e 's/ld//;s/binutils//;s/gas//'`
+  *-*-sysv4)
+    use_gnu_ld=no
     ;;
   *-*-vms)
     configdirs=`echo ${configdirs} | sed -e 's/bfd//;s/ld//;s/binutils//'`
     ;;
 esac
 
+## end-sanitize-for-fsf
+
 # Set with_gnu_as and with_gnu_ld as appropriate.
-# This is commented out for now.
-#if [ x${with_gnu_as} != xyes ] && echo ${configdirs} | grep gas > /dev/null && [ -d ${srcdir}/gas ]; then
-#  with_gnu_as=yes
-#  withoptions="$withoptions -with-gnu-as"
-#fi
-#if [ x${with_gnu_ld} != xyes ] && echo ${configdirs} | grep ld > /dev/null && [ -d ${srcdir}/ld ]; then
-#  with_gnu_ld=yes
-#  withoptions="$withoptions -with-gnu-ld"
-#fi
+#
+# This is done by determining whether or not the appropriate directory
+# is available, and by checking whether or not specific configurations
+# have requested that this magic not happen.
+# 
+# The command line options always override the explicit settings in 
+# configure.in, and the settings in configure.in override this magic.
+#
+# If the default for a toolchain is to use GNU as and ld, and you don't 
+# want to do that, then you should use the --without-gnu-as and
+# --without-gnu-ld options for the configure script.
+
+if [ x${use_gnu_as} = x ] ; then
+  if [ x${with_gnu_as} != xno ] && echo ${configdirs} | grep "${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
+    with_gnu_as=yes
+    withoptions="$withoptions --with-gnu-as"
+  fi
+fi
+
+if [ x${use_gnu_ld} = x ] ; then
+  if [ x${with_gnu_ld} != xno ] && echo ${configdirs} | grep ld > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
+    with_gnu_ld=yes
+    withoptions="$withoptions --with-gnu-ld"
+  fi
+fi
 
 #
 # Local Variables: