* m32c-desc.c: Regenerate.
[deliverable/binutils-gdb.git] / opcodes / configure.in
index 721c239689da9099923ca65df352116df482aaa7..dd9dabf100a101d1f348ec5573c8fad4e27346ac 100644 (file)
@@ -40,13 +40,6 @@ AC_ARG_ENABLE(targets,
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
 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 opcodes commonbfdlib option]) ;;
-esac])dnl
 
 AM_BINUTILS_WARNINGS
 
@@ -98,36 +91,85 @@ AC_SUBST(cgendir)
 
 using_cgen=no
 
+# Check if linker supports --as-needed and --no-as-needed options
+AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
+       [bfd_cv_ld_as_needed=no
+       if $LD --help 2>/dev/null | grep as-needed > /dev/null; then
+               bfd_cv_ld_as_needed=yes
+       fi
+       ])
+
+LT_LIB_M
+
+#Libs for generator progs
+if test "x$cross_compiling" = "xno"; then
+  BUILD_LIBS=../libiberty/libiberty.a
+  BUILD_LIB_DEPS=$BUILD_LIBS
+else
+  # if cross-compiling, assume that the system provides -liberty
+  # and that the version is compatible with new headers.
+  BUILD_LIBS=-liberty
+  BUILD_LIB_DEPS=
+fi
+BUILD_LIBS="$BUILD_LIBS $LIBINTL"
+BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP"
+
+AC_SUBST(BUILD_LIBS)
+AC_SUBST(BUILD_LIB_DEPS)
+
 # Horrible hacks to build DLLs on Windows and a shared library elsewhere.
 SHARED_LDFLAGS=
 SHARED_LIBADD=
 SHARED_DEPENDENCIES=
 if test "$enable_shared" = "yes"; then
+# When building a shared libopcodes, link against the pic version of libiberty
+# so that apps that use libopcodes won't need libiberty just to satisfy any
+# libopcodes references.
+# We can't do that if a pic libiberty is unavailable since including non-pic
+# code would insert text relocations into libopcodes.
+# Note that linking against libbfd as we do here, which is itself linked
+# against libiberty, may not satisfy all the libopcodes libiberty references
+# since libbfd may not pull in the entirety of libiberty.
+changequote(,)dnl
+  x=`sed -n -e 's/^[   ]*PICFLAG[      ]*=[    ]*//p' < ../libiberty/Makefile | sed -n '$p'`
+changequote([,])dnl
+  if test -n "$x"; then
+    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
+  fi
+
   case "${host}" in
     *-*-cygwin*)
       SHARED_LDFLAGS="-no-undefined"
       SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
       ;;
    *-*-darwin*)
-     SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib"
+     SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}"
      SHARED_DEPENDENCIES="../bfd/libbfd.la"
      ;;
     *)
       case "$host_vendor" in
         hp)
-          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl"
+          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}"
          ;;
        *)
-         # It is tempting to include libiberty here as well, but
-         # that library is only built as a static version.
-         # Including it here would insert text relocations into
-         # the opcodes library, which is undesirable.
-          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
+          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}"
          ;;
       esac
       SHARED_DEPENDENCIES="../bfd/libbfd.la"
       ;;
   esac
+
+  if test -n "$SHARED_LIBADD"; then
+    if test -n "$LIBM"; then
+      if test x"$bfd_cv_ld_as_needed" = xyes; then
+       # Link against libm only when needed.  Put -lc, -lm inside -Wl
+       # to stop libtool reordering these options.
+       SHARED_LIBADD="$SHARED_LIBADD -Wl,-lc,--as-needed,`echo $LIBM | sed 's/ /,/g'`,--no-as-needed"
+      else
+       SHARED_LIBADD="$SHARED_LIBADD $LIBM"
+      fi
+    fi
+  fi
 fi
 AC_SUBST(SHARED_LDFLAGS)
 AC_SUBST(SHARED_LIBADD)
@@ -190,11 +232,13 @@ if test x${all_targets} = xfalse ; then
        bfd_dlx_arch)           ta="$ta dlx-dis.lo" ;;
        bfd_fr30_arch)          ta="$ta fr30-asm.lo fr30-desc.lo fr30-dis.lo fr30-ibld.lo fr30-opc.lo" using_cgen=yes ;;
        bfd_frv_arch)           ta="$ta frv-asm.lo frv-desc.lo frv-dis.lo frv-ibld.lo frv-opc.lo" using_cgen=yes ;;
+       bfd_moxie_arch)         ta="$ta moxie-dis.lo moxie-opc.lo" ;;
        bfd_h8300_arch)         ta="$ta h8300-dis.lo" ;;
        bfd_h8500_arch)         ta="$ta h8500-dis.lo" ;;
        bfd_hppa_arch)          ta="$ta hppa-dis.lo" ;;
        bfd_i370_arch)          ta="$ta i370-dis.lo i370-opc.lo" ;;
-       bfd_i386_arch)          ta="$ta i386-dis.lo i386-opc.lo" ;;
+       bfd_i386_arch|bfd_l1om_arch)
+                               ta="$ta i386-dis.lo i386-opc.lo" ;;
        bfd_i860_arch)          ta="$ta i860-dis.lo" ;;
        bfd_i960_arch)          ta="$ta i960-dis.lo" ;;
        bfd_ia64_arch)          ta="$ta ia64-dis.lo ia64-opc.lo" ;;
@@ -210,6 +254,7 @@ if test x${all_targets} = xfalse ; then
        bfd_maxq_arch)          ta="$ta maxq-dis.lo" ;;
        bfd_mcore_arch)         ta="$ta mcore-dis.lo" ;;
        bfd_mep_arch)           ta="$ta mep-asm.lo mep-desc.lo mep-dis.lo mep-ibld.lo mep-opc.lo" using_cgen=yes ;;
+       bfd_microblaze_arch)    ta="$ta microblaze-dis.lo" ;;
        bfd_mips_arch)          ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;;
        bfd_mmix_arch)          ta="$ta mmix-dis.lo mmix-opc.lo" ;;
        bfd_mn10200_arch)       ta="$ta m10200-dis.lo m10200-opc.lo" ;;
@@ -226,8 +271,9 @@ if test x${all_targets} = xfalse ; then
        bfd_pyramid_arch)       ;;
        bfd_romp_arch)          ;;
        bfd_rs6000_arch)        ta="$ta ppc-dis.lo ppc-opc.lo" ;;
+       bfd_rx_arch)            ta="$ta rx-dis.lo rx-decode.lo";;
        bfd_s390_arch)          ta="$ta s390-dis.lo s390-opc.lo" ;;
-       bfd_score_arch)         ta="$ta score-dis.lo" ;;
+       bfd_score_arch)         ta="$ta score-dis.lo score7-dis.lo" ;;
        bfd_sh_arch)
          # We can't decide what we want just from the CPU family.
          # We want SH5 support unless a specific version of sh is
This page took 0.025462 seconds and 4 git commands to generate.