| 1 | # This file is a shell script that supplies the information necessary |
| 2 | # to tailor a template configure script into the configure script |
| 3 | # appropriate for this directory. For more information, check any |
| 4 | # existing configure script. |
| 5 | |
| 6 | configdirs="doc" |
| 7 | srctrigger=libbfd.c |
| 8 | srcname="BFD" |
| 9 | target_dependent=true |
| 10 | host64=false |
| 11 | target64=false |
| 12 | want64=false |
| 13 | |
| 14 | # per-host: |
| 15 | |
| 16 | . ${srcdir}/configure.host |
| 17 | |
| 18 | # Set up to make a link between the host's include file and "sysdep.h". |
| 19 | files="hosts/${my_host}.h" |
| 20 | links="sysdep.h" |
| 21 | |
| 22 | if [ ! -f ${srcdir}/${files} ] ; then |
| 23 | files=../bfd/hosts/std-host.h |
| 24 | echo "[${srcname} has no specific support for host ${host} -- using std-host]" |
| 25 | fi |
| 26 | |
| 27 | host_makefile_frag= |
| 28 | if [ -f ${srcdir}/config/${my_host}.mh ] ; then |
| 29 | host_makefile_frag=config/${my_host}.mh |
| 30 | fi |
| 31 | |
| 32 | # per-target: |
| 33 | |
| 34 | # Canonicalize the secondary target names. |
| 35 | if [ -n "$enable_targets" ]; then |
| 36 | for targ in `echo $enable_targets | sed 's/,/ /g'` |
| 37 | do |
| 38 | result=`$configsub $targ 2>/dev/null` |
| 39 | if [ -n "$result" ]; then |
| 40 | canon_targets="$canon_targets $result" |
| 41 | else |
| 42 | # Allow targets that config.sub doesn't recognize, like "all". |
| 43 | canon_targets="$canon_targets $targ" |
| 44 | fi |
| 45 | done |
| 46 | fi |
| 47 | |
| 48 | all_targets=false |
| 49 | |
| 50 | for targ in $target $canon_targets |
| 51 | do |
| 52 | bfd_target=`${config_shell} $srcdir/config.bfd $targ` |
| 53 | |
| 54 | if [ "x$bfd_target" = "xall" ]; then |
| 55 | all_targets=true |
| 56 | else |
| 57 | if [ ! -f ${srcdir}/config/${bfd_target}.mt ] ; then |
| 58 | echo '***' No file ${srcdir}/config/${bfd_target}.mt 1>&2 |
| 59 | echo '***' BFD does not support target ${bfd_target} 1>&2 |
| 60 | echo '***' Look in bfd/config.bfd for supported targets 1>&2 |
| 61 | exit 1 |
| 62 | fi |
| 63 | |
| 64 | if [ "x$targ" = "x$target" ]; then |
| 65 | target_makefile_frag=${srcdir}/config/${bfd_target}.mt |
| 66 | else |
| 67 | target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt" |
| 68 | fi |
| 69 | fi |
| 70 | done |
| 71 | |
| 72 | # We don't do any links based on the target system, just makefile config. |
| 73 | |
| 74 | # post-target: |
| 75 | |
| 76 | rm -f Makefile.tmp Makefile.2 |
| 77 | mv Makefile Makefile.tmp |
| 78 | |
| 79 | case ${enable_64_bit_bfd} in |
| 80 | yes) want64=true ;; |
| 81 | no | "") want64=false ;; |
| 82 | *) |
| 83 | echo "*** bad value \"${enable_64_bit_bfd}\" for 64-bit-bfd flag; ignored" 1>&2 |
| 84 | ;; |
| 85 | esac |
| 86 | |
| 87 | # This processing still needs to be done if we're to decide properly whether |
| 88 | # 64-bit support needs to be compiled in. Currently, it will be included if |
| 89 | # the default or any other explicitly requested target requires it; it |
| 90 | # will not be included on a 32-bit host if no 64-bit target is requested, and |
| 91 | # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is |
| 92 | # used. |
| 93 | |
| 94 | # The default vector in the primary target. |
| 95 | DEFAULT_VECTOR=`sed -n ' |
| 96 | s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p |
| 97 | ' $target_makefile_frag` |
| 98 | |
| 99 | allfrags="$target_makefile_frag $target_extra_frags" |
| 100 | |
| 101 | # The default and selected vectors in all the configured targets. |
| 102 | SELECT_VECS=`sed -n ' |
| 103 | s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p |
| 104 | s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p |
| 105 | ' $allfrags` |
| 106 | # uniq the list. |
| 107 | f="" |
| 108 | for i in $SELECT_VECS ; do |
| 109 | case " $f " in |
| 110 | *" $i "*) ;; |
| 111 | *) f="$f $i" ;; |
| 112 | esac |
| 113 | done |
| 114 | SELECT_VECS="$f" |
| 115 | |
| 116 | # The architectures in all the configured targets. |
| 117 | SELECT_ARCHITECTURES=`sed -n ' |
| 118 | s/SELECT_ARCHITECTURES[ ]*=[ ]*//p |
| 119 | ' $allfrags` |
| 120 | # uniq the list. |
| 121 | f="" |
| 122 | for i in $SELECT_ARCHITECTURES ; do |
| 123 | case " $f " in |
| 124 | *" $i "*) ;; |
| 125 | *) f="$f $i" ;; |
| 126 | esac |
| 127 | done |
| 128 | SELECT_ARCHITECTURES="$f" |
| 129 | |
| 130 | # Target backend .o files. |
| 131 | tb= |
| 132 | |
| 133 | for vec in $SELECT_VECS |
| 134 | do |
| 135 | case "$vec" in |
| 136 | # This list is alphabetized to make it easy to compare |
| 137 | # with the two vector lists in targets.c. |
| 138 | a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;; |
| 139 | a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;; |
| 140 | aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;; |
| 141 | aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;; |
| 142 | aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;; |
| 143 | apollocoff_vec) tb="$tb coff-apollo.o" ;; |
| 144 | b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;; |
| 145 | b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;; |
| 146 | # start-sanitize-arc |
| 147 | bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o elf.o" ;; |
| 148 | bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o elf.o" ;; |
| 149 | # end-sanitize-arc |
| 150 | bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;; |
| 151 | bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecofflink.o" ;; |
| 152 | bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;; |
| 153 | bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;; |
| 154 | bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;; |
| 155 | bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;; |
| 156 | bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecofflink.o" ;; |
| 157 | bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;; |
| 158 | bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o elf.o" ;; |
| 159 | bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o elf.o" ;; |
| 160 | bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o elf.o" ;; |
| 161 | bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;; |
| 162 | bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" |
| 163 | target64=true ;; |
| 164 | bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o" |
| 165 | target64=true ;; |
| 166 | bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o" |
| 167 | target64=true ;; |
| 168 | cisco_core_vec) tb="$tb cisco-core.o" ;; |
| 169 | demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o" |
| 170 | target64=true ;; |
| 171 | ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;; |
| 172 | ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;; |
| 173 | ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o" |
| 174 | target64=true ;; |
| 175 | h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;; |
| 176 | h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;; |
| 177 | host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;; |
| 178 | hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;; |
| 179 | hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;; |
| 180 | i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;; |
| 181 | i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;; |
| 182 | i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;; |
| 183 | i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;; |
| 184 | i386msdos_vec) tb="$tb i386msdos.o" ;; |
| 185 | i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;; |
| 186 | i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;; |
| 187 | i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;; |
| 188 | i386mach3_vec) tb="$tb i386mach3.o aout32.o stab-syms.o" ;; |
| 189 | i386netbsd_vec) tb="$tb i386netbsd.o aout32.o stab-syms.o" ;; |
| 190 | i386os9k_vec) tb="$tb i386os9k.o aout32.o stab-syms.o" ;; |
| 191 | icoff_big_vec) tb="$tb coff-i960.o" ;; |
| 192 | icoff_little_vec) tb="$tb coff-i960.o" ;; |
| 193 | ieee_vec) tb="$tb ieee.o" ;; |
| 194 | m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;; |
| 195 | m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;; |
| 196 | m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;; |
| 197 | m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;; |
| 198 | m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;; |
| 199 | m88kbcs_vec) tb="$tb coff-m88k.o" ;; |
| 200 | newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;; |
| 201 | nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;; |
| 202 | nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;; |
| 203 | nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o" |
| 204 | target64=true ;; |
| 205 | riscix_vec) tb="$tb aout32.o riscix.o stab-syms.o" ;; |
| 206 | nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;; |
| 207 | pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;; |
| 208 | pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;; |
| 209 | rs6000coff_vec) tb="$tb coff-rs6000.o" ;; |
| 210 | shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;; |
| 211 | # start-sanitize-rce |
| 212 | rce_aout_vec) tb="$tb aout-rce.o aout32.o stab-syms.o" ;; |
| 213 | # end-sanitize-rce |
| 214 | shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;; |
| 215 | som_vec) tb="$tb som.o" ;; |
| 216 | sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;; |
| 217 | sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;; |
| 218 | sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;; |
| 219 | sparccoff_vec) tb="$tb coff-sparc.o" ;; |
| 220 | srec_vec) tb="$tb srec.o" ;; |
| 221 | sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;; |
| 222 | symbolsrec_vec) tb="$tb srec.o" ;; |
| 223 | tekhex_vec) tb="$tb tekhex.o" ;; |
| 224 | we32kcoff_vec) tb="$tb coff-we32k.o" ;; |
| 225 | z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;; |
| 226 | w65_vec) tb="$tb coff-w65.o reloc16.o" ;; |
| 227 | |
| 228 | "") ;; |
| 229 | *) echo "*** unknown target vector $vec" 1>&2; exit 1 ;; |
| 230 | esac |
| 231 | done |
| 232 | |
| 233 | # Target architecture .o files. |
| 234 | ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g` |
| 235 | |
| 236 | # Weed out duplicate .o files. |
| 237 | f="" |
| 238 | for i in $tb ; do |
| 239 | case " $f " in |
| 240 | *" $i "*) ;; |
| 241 | *) f="$f $i" ;; |
| 242 | esac |
| 243 | done |
| 244 | tb="$f" |
| 245 | |
| 246 | f="" |
| 247 | for i in $ta ; do |
| 248 | case " $f " in |
| 249 | *" $i "*) ;; |
| 250 | *) f="$f $i" ;; |
| 251 | esac |
| 252 | done |
| 253 | ta="$f" |
| 254 | |
| 255 | bfd_backends="$tb" |
| 256 | bfd_machines="$ta" |
| 257 | |
| 258 | if [ x${all_targets} = xtrue ]; then |
| 259 | bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)' |
| 260 | bfd_machines="${bfd_machines}"' $(ALL_MACHINES)' |
| 261 | else # all_targets is true |
| 262 | # Only set these if they will be nonempty, for the clever echo. |
| 263 | test -n "$SELECT_VECS" && |
| 264 | selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` |
| 265 | test -n "SELECT_ARCHITECTURES" && |
| 266 | selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'` |
| 267 | fi # all_targets is true |
| 268 | |
| 269 | case ${host64}-${target64}-${want64} in |
| 270 | *true*) |
| 271 | wordsize=64 |
| 272 | all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' |
| 273 | ;; |
| 274 | false-false-false) |
| 275 | wordsize=32 |
| 276 | all_backends='$(BFD32_BACKENDS)' |
| 277 | ;; |
| 278 | esac |
| 279 | |
| 280 | echo WORDSIZE=${wordsize} >> Makefile.2 |
| 281 | echo ALL_BACKENDS=${all_backends} >> Makefile.2 |
| 282 | echo BFD_BACKENDS=${bfd_backends} >> Makefile.2 |
| 283 | echo BFD_MACHINES=${bfd_machines} >> Makefile.2 |
| 284 | |
| 285 | test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR" |
| 286 | |
| 287 | tdefaults="TDEFAULTS =" |
| 288 | test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" |
| 289 | test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" |
| 290 | test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" |
| 291 | echo "${tdefaults}" >> Makefile.2 |
| 292 | |
| 293 | cat Makefile.tmp >> Makefile.2 |
| 294 | rm -f Makefile.tmp |
| 295 | mv Makefile.2 Makefile |