]> Git Repo - binutils.git/blobdiff - bfd/configure.in
* config.bfd: Rewrite to incorporate the contents of the Makefile
[binutils.git] / bfd / configure.in
index 83acbea1741a146fe1c1e677afed4d8a66b17976..42af6b92ded372b2ebb5079fe7da5c6df1c9e8f5 100644 (file)
@@ -49,6 +49,11 @@ else
        host_makefile_frag=/dev/null
 fi
 AC_SUBST_FILE(host_makefile_frag)
+frags=
+if test $host_makefile_frag != /dev/null ; then
+    frags="$host_makefile_frag"
+fi
+AC_SUBST(frags)
 
 # If we are configured native, pick a core file support file.
 COREFILE=
@@ -139,35 +144,25 @@ if test -n "$enable_targets" ; then
 fi
 
 all_targets=false
-
+defvec=
+selvecs=
+selarchs=
+TDEFINES=
 for targ in $target $canon_targets
 do
-    bfd_target=`${config_shell} $srcdir/config.bfd $targ`
-
-    if test "x$bfd_target" = "xall" ; then
+    if test "x$targ" = "xall"; then
         all_targets=true
     else
-       if test ! -f ${srcdir}/config/${bfd_target}.mt ; then
-           AC_MSG_ERROR(*** No file ${srcdir}/config/${bfd_target}.mt.
-*** BFD does not support target ${bfd_target}.
-*** Look in bfd/config.bfd for supported targets.)
-           exit 1
-       fi
-
-       if test "x$targ" = "x$target" ; then
-           target_makefile_frag=${srcdir}/config/${bfd_target}.mt
-       else
-           target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
+       . $srcdir/config.bfd
+       if test "x$targ" = "x$target"; then
+           defvec=$targ_defvec
        fi
+       selvecs="$selvecs $targ_defvec $targ_selvecs"
+       selarchs="$selarchs $targ_archs"
+       TDEFINES="$TDEFINES $targ_cflags"
     fi
 done
-
-frags=$target_makefile_frag
-if test $host_makefile_frag != /dev/null ; then
-    frags="$frags $host_makefile_frag"
-fi
-AC_SUBST_FILE(target_makefile_frag)
-AC_SUBST(frags)
+AC_SUBST(TDEFINES)
 
 # This processing still needs to be done if we're to decide properly whether
 # 64-bit support needs to be compiled in.  Currently, it will be included if
@@ -176,50 +171,32 @@ AC_SUBST(frags)
 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
 # used.
 
-changequote(,)dnl
-# The default vector in the primary target.
-DEFAULT_VECTOR=`sed -n '
-s/DEFAULT_VECTOR[      ]*=[    ]*\([^  ]*\)/\1/p
-' $target_makefile_frag`
-
-allfrags="$target_makefile_frag $target_extra_frags"
-
-# The default and selected vectors in all the configured targets.
-SELECT_VECS=`sed -n '
-s/DEFAULT_VECTOR[      ]*=[    ]*\([^  ]*\)/\1/p
-s/SELECT_VECS[         ]*=[    ]*\([^  ]*\)/\1/p
-' $allfrags`
-# uniq the list.
+# uniq the default and selected vectors in all the configured targets.
 f=""
-for i in $SELECT_VECS ; do
+for i in $selvecs ; do
     case " $f " in
     *" $i "*) ;;
     *) f="$f $i" ;;
     esac
 done
-SELECT_VECS="$f"
+selvecs="$f"
 
-# The architectures in all the configured targets.
-SELECT_ARCHITECTURES=`sed -n '
-s/SELECT_ARCHITECTURES[        ]*=[    ]*//p
-' $allfrags`
-# uniq the list.
+# uniq the architectures in all the configured targets.
 f=""
-for i in $SELECT_ARCHITECTURES ; do
+for i in $selarchs ; do
     case " $f " in
     *" $i "*) ;;
     *) f="$f $i" ;;
     esac
 done
-SELECT_ARCHITECTURES="$f"
-changequote([,])dnl
+selarchs="$f"
 
 # Target backend .o files.
 tb=
 
 elf="elf.o elflink.o"
 
-for vec in $SELECT_VECS
+for vec in $selvecs
 do
     case "$vec" in
     # This list is alphabetized to make it easy to compare
@@ -329,7 +306,7 @@ do
 done
 
 # Target architecture .o files.
-ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
+ta=`echo $selarchs | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
 
 # Weed out duplicate .o files.
 f=""
@@ -356,12 +333,14 @@ bfd_machines="$ta"
 if test x${all_targets} = xtrue ; then
   bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
   bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
+  selvecs=
+  selarchs=
 else   # all_targets is true
   # Only set these if they will be nonempty, for the clever echo.
-  test -n "$SELECT_VECS" &&
-    selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
-  test -n "SELECT_ARCHITECTURES" &&
-    selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
+  test -n "$selvecs" &&
+    selvecs=`echo $selvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
+  test -n "$selarchs" &&
+    selarchs=`echo $selarchs | sed -e 's/ \(.\)/,\1/g'`
 fi     # all_targets is true
 
 case ${host64}-${target64}-${want64} in
@@ -380,8 +359,6 @@ AC_SUBST(all_backends)
 AC_SUBST(bfd_backends)
 AC_SUBST(bfd_machines)
 
-test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
-
 tdefaults=""
 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
This page took 0.031938 seconds and 4 git commands to generate.