4 AC_ARG_ENABLE(64-bit-bfd,
5 [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
6 [case "{$enableval}" in
9 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
10 esac],[want64=false])dnl
11 AC_ARG_ENABLE(targets,
12 [ --enable-targets alternative target configurations],
13 [case "${enableval}" in
14 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
16 no) enable_targets= ;;
17 *) enable_targets=$enableval ;;
20 AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
22 if test -z "$target" ; then
23 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
32 . ${srcdir}/configure.host
36 # Set up to make a link between the host's include file and "sysdep.h".
37 files=hosts/${my_host}.h
39 if test ! -f ${srcdir}/${files} ; then
40 files=../bfd/hosts/std-host.h
41 AC_MSG_WARN(BFD has no specific support for host ${host} -- using std-host)
44 AC_LINK_FILES($files, sysdep.h)
46 if test -f ${srcdir}/config/${my_host}.mh ; then
47 host_makefile_frag=$srcdir/config/${my_host}.mh
49 host_makefile_frag=/dev/null
51 AC_SUBST_FILE(host_makefile_frag)
55 # Canonicalize the secondary target names.
56 if test -n "$enable_targets" ; then
57 for targ in `echo $enable_targets | sed 's/,/ /g'`
59 result=`$ac_config_sub $targ 2>/dev/null`
60 if test -n "$result" ; then
61 canon_targets="$canon_targets $result"
63 # Allow targets that config.sub doesn't recognize, like "all".
64 canon_targets="$canon_targets $targ"
71 for targ in $target $canon_targets
73 bfd_target=`${config_shell} $srcdir/config.bfd $targ`
75 if test "x$bfd_target" = "xall" ; then
78 if test ! -f ${srcdir}/config/${bfd_target}.mt ; then
79 AC_MSG_ERROR(*** No file ${srcdir}/config/${bfd_target}.mt.
80 *** BFD does not support target ${bfd_target}.
81 *** Look in bfd/config.bfd for supported targets.)
85 if test "x$targ" = "x$target" ; then
86 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
88 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
93 frags=$target_makefile_frag
94 if test $host_makefile_frag != /dev/null ; then
95 frags="$frags $host_makefile_frag"
97 AC_SUBST_FILE(target_makefile_frag)
100 # This processing still needs to be done if we're to decide properly whether
101 # 64-bit support needs to be compiled in. Currently, it will be included if
102 # the default or any other explicitly requested target requires it; it
103 # will not be included on a 32-bit host if no 64-bit target is requested, and
104 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
108 # The default vector in the primary target.
109 DEFAULT_VECTOR=`sed -n '
110 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
111 ' $target_makefile_frag`
113 allfrags="$target_makefile_frag $target_extra_frags"
115 # The default and selected vectors in all the configured targets.
116 SELECT_VECS=`sed -n '
117 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
118 s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
122 for i in $SELECT_VECS ; do
130 # The architectures in all the configured targets.
131 SELECT_ARCHITECTURES=`sed -n '
132 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
136 for i in $SELECT_ARCHITECTURES ; do
142 SELECT_ARCHITECTURES="$f"
145 # Target backend .o files.
148 for vec in $SELECT_VECS
151 # This list is alphabetized to make it easy to compare
152 # with the two vector lists in targets.c.
153 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
154 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
155 armpe_vec) tb="$tb pe-arm.o cofflink.o " ;;
156 armpei_vec) tb="$tb pei-arm.o cofflink.o " ;;
157 aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;;
158 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
159 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
160 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
161 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
162 apollocoff_vec) tb="$tb coff-apollo.o" ;;
163 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
164 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
166 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o elf.o" ;;
167 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o elf.o" ;;
169 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
170 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecofflink.o" ;;
171 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o elf.o" ;;
172 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o elf.o" ;;
173 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o elf.o" ;;
174 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
175 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecofflink.o" ;;
176 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o elf.o" ;;
177 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o elf.o" ;;
178 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o elf.o" ;;
179 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o elf.o" ;;
180 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o elf.o" ;;
181 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
183 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
185 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o"
187 cisco_core_vec) tb="$tb cisco-core.o" ;;
188 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
190 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
191 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
192 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
194 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
195 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
196 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
197 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
198 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
199 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
200 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
201 i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;;
202 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
203 i386msdos_vec) tb="$tb i386msdos.o" ;;
204 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
205 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
206 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
207 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;;
208 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;;
209 i386mach3_vec) tb="$tb i386mach3.o aout32.o stab-syms.o" ;;
210 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o stab-syms.o" ;;
211 i386os9k_vec) tb="$tb i386os9k.o aout32.o stab-syms.o" ;;
212 icoff_big_vec) tb="$tb coff-i960.o" ;;
213 icoff_little_vec) tb="$tb coff-i960.o" ;;
214 ieee_vec) tb="$tb ieee.o" ;;
215 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
216 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
217 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
218 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
219 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
220 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
221 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
222 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
223 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
224 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
226 riscix_vec) tb="$tb aout32.o riscix.o stab-syms.o" ;;
227 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
228 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;;
229 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;;
230 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
231 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
233 rce_aout_vec) tb="$tb aout-rce.o aout32.o stab-syms.o" ;;
235 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
236 som_vec) tb="$tb som.o" ;;
237 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;;
238 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;;
239 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;;
240 sparccoff_vec) tb="$tb coff-sparc.o" ;;
241 srec_vec) tb="$tb srec.o" ;;
242 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
243 symbolsrec_vec) tb="$tb srec.o" ;;
244 tekhex_vec) tb="$tb tekhex.o" ;;
245 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
246 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
247 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
248 versados_vec) tb="$tb versados.o" ;;
251 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
255 # Target architecture .o files.
256 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
258 # Weed out duplicate .o files.
280 if test x${all_targets} = xtrue ; then
281 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
282 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
283 else # all_targets is true
284 # Only set these if they will be nonempty, for the clever echo.
285 test -n "$SELECT_VECS" &&
286 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
287 test -n "SELECT_ARCHITECTURES" &&
288 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
289 fi # all_targets is true
291 case ${host64}-${target64}-${want64} in
294 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
298 all_backends='$(BFD32_BACKENDS)'
303 AC_SUBST(all_backends)
304 AC_SUBST(bfd_backends)
305 AC_SUBST(bfd_machines)
307 test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
310 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
311 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
312 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
315 rm -f doc/config.status
316 AC_OUTPUT(Makefile doc/Makefile)