* Makefile.in (autoconf-install): New target.
[deliverable/binutils-gdb.git] / gas / configure.in
index 3a8d28f3be1ee737cbf503ae44c6ec5691c17f0a..a3ea10a02e4b5c3fe88540b768c709790918e21b 100644 (file)
@@ -34,6 +34,13 @@ AC_ARG_ENABLE(shared,
   *opcodes*) shared=true shared_opcodes=true ;;
   *) shared=false ;;
 esac])dnl
+AC_ARG_ENABLE(commonbfdlib,
+[  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
+[case "${enableval}" in
+  yes) commonbfdlib=true ;;
+  no)  commonbfdlib=false ;;
+  *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
+esac])dnl
 
 # Generate a header file -- gets more post-processing by Makefile later.
 AC_CONFIG_HEADER(conf)
@@ -63,7 +70,9 @@ emulations=""
 
 for this_target in $target $canon_targets ; do
 
-    eval `echo $this_target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
+changequote(,)dnl
+    eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
+changequote([,])dnl
 
     # check for architecture variants
     case ${cpu} in
@@ -77,7 +86,7 @@ changequote(,)dnl
       m683??)          cpu_type=m68k ;;
 changequote([,])dnl
       m8*)             cpu_type=m88k ;;
-      mips*el)         cpu_type=mips endian=little;;
+      mips*el)         cpu_type=mips endian=little ;;
       mips*)           cpu_type=mips endian=big ;;
       powerpcle*)      cpu_type=ppc endian=little ;;
       powerpc*)                cpu_type=ppc endian=big ;;
@@ -107,6 +116,7 @@ changequote([,])dnl
       a29k-nyu-sym1)        fmt=coff targ=ebmon29k ;;
       a29k-*-vxworks*)      fmt=coff ;;
 
+      alpha-*-*vms*)       fmt=evax ;;
       alpha-*-netware*)     fmt=ecoff ;;
       alpha-*-osf*)         fmt=ecoff ;;
       alpha-*-linuxecoff*)  fmt=ecoff ;;
@@ -127,13 +137,15 @@ changequote([,])dnl
       arm-*-riscix*)        fmt=aout ;;
       arm-*-pe)             fmt=coff targ=armcoff em=pe ;;
 
-# start-sanitize-d10v
       d10v-*-*)                    fmt=elf bfd_gas=yes ;;
-# end-sanitize-d10v
+# start-sanitize-d30v
+      d30v-*-*)                    fmt=elf bfd_gas=yes ;;
+# end-sanitize-d30v
 
       hppa-*-*elf*)         fmt=elf em=hppa ;;
       hppa-*-lites*)        fmt=elf em=hppa ;;
       hppa-*-osf*)          fmt=som em=hppa ;;
+      hppa-*-rtems*)        fmt=elf em=hppa ;;
       hppa-*-hpux*)         fmt=som em=hppa ;;
       hppa-*-bsd*)          fmt=som em=hppa ;;
       hppa-*-hiux*)         fmt=som em=hppa ;;
@@ -142,6 +154,7 @@ changequote([,])dnl
 
       i386-ibm-aix*)        fmt=coff targ=i386coff
                             em=i386aix ;;
+      i386-sequent-bsd*)    fmt=aout em=dynix bfd_gas=yes ;;
       i386-*-bsd*)          fmt=aout em=386bsd ;;
       i386-*-netbsd0.8)     fmt=aout em=386bsd ;;
       i386-*-netbsd*)       fmt=aout em=nbsd bfd_gas=yes;;
@@ -181,8 +194,9 @@ changequote([,])dnl
       m68k-motorola-sysv*)  fmt=coff targ=m68kcoff em=delta ;;
       m68k-bull-sysv3*)     fmt=coff targ=m68kcoff em=dpx2 ;;
       m68k-apollo-*)        fmt=coff targ=apollo em=apollo ;;
-      m68k-*-sysv4 | m68k-*-elf) # must be before -sysv*
-                           fmt=elf ;;
+      m68k-*-sysv4*) # must be before -sysv*
+                           fmt=elf em=svr4 ;;
+      m68k-*-elf*)         fmt=elf ;;
       m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
                            fmt=coff targ=m68kcoff ;;
       m68k-*-hpux*)         fmt=hp300 em=hp300 ;;
@@ -211,22 +225,21 @@ changequote([,])dnl
                            esac
                            ;;
       mips-*-ecoff*)        fmt=ecoff targ=mips-big ;;
-      mips-*-gnu*)          fmt=aout
-                           case "$endian" in
-                           big) targ=mips-big ;;
-                           *)   targ=mips-lit ;;
-                           esac
-                           ;;
+      mips-*-irix6*)       fmt=elf targ=mips-big ;;
       mips-*-irix5*)        fmt=elf targ=mips-big ;;
       mips-*-irix*)         fmt=ecoff targ=mips-big ;;
+      mips-*-lnews*)        fmt=ecoff targ=mips-lit em=lnews ;;
       mips-*-riscos*)       fmt=ecoff targ=mips-big ;;
       mips-*-sysv*)         fmt=ecoff targ=mips-big ;;
-      mips-*-elf*)          fmt=elf 
+      mips-*-elf* | mips-*-rtems* | mips-*-linux* | mips-*-gnu*)
+                           fmt=elf 
                            case "$endian" in
                            big) targ=mips-big ;;
                            *)   targ=mips-lit ;;
                            esac
                            ;;
+      mn10200-*-*)         fmt=elf bfd_gas=yes ;;
+      mn10300-*-*)         fmt=elf bfd_gas=yes ;;
       ppc-*-pe | ppc-*-cygwin32 | ppc-*-winnt*)
                            fmt=coff em=pe 
                            case "$endian" in
@@ -235,6 +248,7 @@ changequote([,])dnl
                            esac
                             ;;
       ppc-*-aix*)           fmt=coff ;;
+      ppc-*-beos*)          fmt=coff ;;
       ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
                            fmt=elf
                            case "$endian" in
@@ -265,7 +279,8 @@ changequote([,])dnl
                            fmt=coff em=macos ;;
       ppc-*-netware*)       fmt=elf em=ppcnw ;;
 
-      sh-*-coff)            fmt=coff ;;
+      sh-*-elf*)           fmt=elf ;;
+      sh-*-coff*)           fmt=coff ;;
 
       ns32k-pc532-mach* | ns32k-pc532-ux*)    fmt=aout em=pc532mach ;;
       ns32k-pc532-netbsd* | ns32k-pc532-lites*)  fmt=aout em=nbsd532 ;;
@@ -273,14 +288,21 @@ changequote([,])dnl
       sparc-*-rtems*)       fmt=aout ;;
       sparc-*-sunos4*)      fmt=aout em=sun3 ;;
       sparc-*-aout | sparc*-*-vxworks*)
-                           fmt=aout ;;
+                           fmt=aout em=sparcaout ;;
       sparc-*-coff)         fmt=coff ;;
+      sparc-*-linux*aout*)  fmt=aout em=linux ;;
+      sparc-*-linux*)      fmt=elf em=linux ;;
       sparc-*-lynxos*)      fmt=coff em=lynx ;;
       sparc-fujitsu-none)   fmt=aout ;;
-      sparc-*-elf | sparc-*-solaris*)
+      sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*)
                            fmt=elf ;;
       sparc-*-netbsd*)      fmt=aout em=nbsd bfd_gas=yes ;;
 
+# start-sanitize-tic80
+      tic80-*-*)           fmt=coff targ=tic80coff;;
+# end-sanitize-tic80
+      v850-*-*)                    fmt=elf bfd_gas=yes ;;
+
       vax-*-bsd* | vax-*-ultrix*)
                            fmt=aout ;;
       vax-*-vms)            fmt=vms ;;
@@ -349,6 +371,26 @@ changequote([,])dnl
        *) extra_objects="$extra_objects m68k-parse.o" ;;
        esac
        ;;
+
+      mips)
+       echo ${extra_objects} | grep -s "itbl-parse.o" 
+       if test $? -ne 0 ; then
+         extra_objects="$extra_objects itbl-parse.o"
+       fi
+
+       echo ${extra_objects} | grep -s "itbl-lex.o" 
+       if test $? -ne 0 ; then
+         extra_objects="$extra_objects itbl-lex.o"
+       fi
+
+       echo ${extra_objects} | grep -s "itbl-ops.o" 
+       if test $? -ne 0 ; then
+         extra_objects="$extra_objects itbl-ops.o"
+       fi
+       ;;
+
+      *)
+       ;;
     esac
 
 # See if we really can support this configuration with the emulation code.
@@ -372,6 +414,11 @@ changequote([,])dnl
 
     case ${generic_target}-${fmt} in
       mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
+      mips-*-linux*-*) case "$endian" in
+                       big)    emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
+                       *)      emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;;
+                       esac ;;
+      mips-*-lnews*-ecoff) ;;
       mips-*-*-ecoff)  case "$endian" in
                        big)    emulation="mipsbecoff mipslecoff mipsecoff" ;;
                        *)      emulation="mipslecoff mipsbecoff mipsecoff" ;;
@@ -379,6 +426,10 @@ changequote([,])dnl
       mips-*-*-elf)    case "$endian" in
                        big)    emulation="mipsbelf mipslelf mipself" ;;
                        *)      emulation="mipslelf mipsbelf mipself" ;;
+      # Uncommenting the next line will turn on support for i386 COFF
+      # in any i386 ELF configuration.  This probably doesn't work
+      # correctly.
+      # i386-*-*-elf)  emulation="i386coff i386elf" ;;
                        esac ;;
     esac
 
@@ -473,6 +524,10 @@ for em in . $emulations ; do
        fmt=elf   file=mipself ;;
     mipsbecoff | mipslecoff)
        fmt=ecoff file=mipsecoff ;;
+    i386coff)
+       fmt=coff  file=i386coff ;;
+    i386elf)
+       fmt=elf   file=i386elf ;;
   esac
   formats="$formats $fmt"
   emfiles="$emfiles e-$file.o"
@@ -508,13 +563,6 @@ AC_SUBST(extra_objects)
 AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS)
 AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION")
 
-files="config/tc-${target_cpu_type}.c config/tc-${target_cpu_type}.h \
-       config/obj-${obj_format}.h config/obj-${obj_format}.c \
-       config/te-${te_file}.h config/atof-${atof}.c \
-       $extra_files"
-links="targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c \
-       $extra_links"
-
 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
   yes-*-coff)  need_bfd=yes ;;
   no-*-coff)   need_bfd=yes
@@ -531,11 +579,10 @@ esac
 
 AC_SUBST(target_cpu_type)
 AC_SUBST(obj_format)
+AC_SUBST(te_file)
 AC_SUBST(atof)
 dnl AC_SUBST(emulation)
 
-AC_LINK_FILES($files, $links)
-
 case "${primary_bfd_gas}" in
   yes) AC_DEFINE(BFD_ASSEMBLER)
        need_bfd=yes ;;
@@ -571,8 +618,6 @@ yes)
   esac
   ;;
 esac
-AC_SUBST(OPCODES_DEP)
-AC_SUBST(OPCODES_LIB)
 
 case "${need_bfd}" in
 yes)
@@ -602,10 +647,20 @@ yes)
     fi
     ;;
   esac
+
+  if test "${commonbfdlib}" = "true"; then
+    # when a shared libbfd is built with --enable-commonbfdlib,
+    # all of libopcodes is available in libbfd.so
+    OPCODES_LIB=
+  fi
   ;;
 esac
+
 AC_SUBST(BFDDEP)
 AC_SUBST(BFDLIB)
+AC_SUBST(OPCODES_DEP)
+AC_SUBST(OPCODES_LIB)
+
 AC_SUBST(ALL_OBJ_DEPS)
 
 AC_DEFINE_UNQUOTED(TARGET_ALIAS,       "${target_alias}")
@@ -655,6 +710,10 @@ gas_test_headers="
 #endif
 #ifdef HAVE_STRING_H
 #include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
 #endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
@@ -663,8 +722,10 @@ gas_test_headers="
 #include <unistd.h>
 #endif
 "
+GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
 GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
 GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
+GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers)
 
 # Does errno.h declare errno, or do we have to add a separate declaration
 # for it?
@@ -675,6 +736,7 @@ GAS_CHECK_DECL_NEEDED(errno, f, int f, [
 ])
 
 HLDFLAGS=
+HLDENV=
 RPATH_ENVVAR=LD_LIBRARY_PATH
 # If we have shared libraries, try to set rpath reasonably.
 if test "${shared}" = "true"; then
@@ -683,7 +745,7 @@ if test "${shared}" = "true"; then
     HLDFLAGS='-Wl,+s,+b,$(libdir)'
     RPATH_ENVVAR=SHLIB_PATH
     ;;
-  *-*-irix5*)
+  *-*-irix5* | *-*-irix6*)
     HLDFLAGS='-Wl,-rpath,$(libdir)'
     ;;
   *-*-linux*aout*)
@@ -691,9 +753,12 @@ if test "${shared}" = "true"; then
   *-*-linux*)
     HLDFLAGS='-Wl,-rpath,$(libdir)'
     ;;
-  *-*-sysv4* | *-*-solaris*)
+  *-*-solaris*)
     HLDFLAGS='-R $(libdir)'
     ;;
+  *-*-sysv4*)
+    HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
+    ;;
   esac
 fi
 
@@ -719,7 +784,23 @@ case "${host}" in
     ;;
 esac
 AC_SUBST(HLDFLAGS)
+AC_SUBST(HLDENV)
 AC_SUBST(RPATH_ENVVAR)
 
 dnl This must come last.
-AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in)
+
+dnl We used to make symlinks to files in the source directory, but now
+dnl we just use the right name for .c files, and create .h files in
+dnl the build directory which include the right .h file.  Make sure
+dnl the old symlinks don't exist, so that a reconfigure in an existing
+dnl directory behaves reasonably.
+
+AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in,
+[rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
+ echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
+ echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
+ echo '#include "te-'"${te_file}"'.h"' > targ-env.h
+ echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h],
+[target_cpu_type=${target_cpu_type}
+ obj_format=${obj_format}
+ te_file=${te_file}])
This page took 0.027601 seconds and 4 git commands to generate.