Wrap "i[345]86" patterns in changequote lines.
[deliverable/binutils-gdb.git] / bfd / configure.in
1 AC_PREREQ(2.3)
2 AC_INIT(libbfd.c)
3
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
7 yes) want64=true ;;
8 no) want64=false ;;
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')
15 ;;
16 no) enable_targets= ;;
17 *) enable_targets=$enableval ;;
18 esac])dnl
19
20 AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
21 AC_CANONICAL_SYSTEM
22 if test -z "$target" ; then
23 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
24 fi
25 AC_ARG_PROGRAM
26
27 host64=false
28 target64=false
29
30 # host stuff:
31
32 . ${srcdir}/configure.host
33
34 AC_PROG_RANLIB
35
36 # Set up to make a link between the host's include file and "sysdep.h".
37 files=hosts/${my_host}.h
38
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)
42 fi
43
44 AC_LINK_FILES($files, sysdep.h)
45
46 if test -f ${srcdir}/config/${my_host}.mh ; then
47 host_makefile_frag=$srcdir/config/${my_host}.mh
48 else
49 host_makefile_frag=/dev/null
50 fi
51 AC_SUBST_FILE(host_makefile_frag)
52
53 # If we are configured native, pick a core file support file.
54 COREFILE=
55 COREFLAG=
56 if test "${target}" = "${host}"; then
57 case "${host}" in
58 alpha-*-*) COREFILE=osf-core.o ;;
59 arm-*-riscix) COREFILE=trad-core.o ;;
60 hppa*-*-hpux*) COREFILE=hpux-core.o ;;
61 hppa*-*-hiux*) COREFILE=hpux-core.o ;;
62 hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
63 COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
64 changequote(,)dnl
65 i[345]86-sequent-bsd*) COREFILE=trad-core.o ;;
66 i[345]86-sequent-sysv4*) ;;
67 i[345]86-sequent-sysv*) COREFILE=trad-core.o ;;
68 i[345]86-*-bsd*) COREFILE=trad-core.o ;;
69 i[345]86-*-freebsd*) COREFILE=trad-core.o ;;
70 i[345]86-*-netbsd*) COREFILE=trad-core.o ;;
71 i[345]86-esix-sysv3*) COREFILE=trad-core.o ;;
72 i[345]86-*-sco*) COREFILE=trad-core.o ;;
73 i[345]86-*-mach3*) COREFILE=trad-core.o ;;
74 i[345]86-*-linux*) COREFILE=trad-core.o ;;
75 i[345]86-*-isc*) COREFILE=trad-core.o ;;
76 i[345]86-*-aix*) COREFILE=aix386-core.o ;;
77 changequote([,])dnl
78 mips-dec-bsd*) COREFILE=trad-core.o ;;
79 mips-dec-mach3*) COREFILE=trad-core.o ;;
80 mips-dec-*) COREFILE=trad-core.o ;;
81 mips-sgi-irix4*) COREFILE=irix-core.o ;;
82 mips-sgi-irix5*) COREFILE=irix-core.o ;;
83 mips-*-mach3*) COREFILE=trad-core.o ;;
84 mips-*-sysv4*) ;;
85 mips-*-sysv*) COREFILE=trad-core.o ;;
86 mips-*-riscos*) COREFILE=trad-core.o ;;
87 mips-sony-bsd*) COREFILE=trad-core.o ;;
88 m68*-bull*-sysv*) COREFILE=trad-core.o ;;
89 m68*-hp-hpux*) COREFILE=hpux-core.o ;;
90 m68*-hp-bsd*) COREFILE=trad-core.o ;;
91 m68*-motorola-sysv*) COREFILE=ptrace-core.o ;;
92 m68*-sony-*) COREFILE=trad-core.o ;;
93 m88*-*-sysv4*) ;;
94 m88*-motorola-sysv*) COREFILE=trad-core.o ;;
95 m88*-*-mach3*) COREFILE=trad-core.o ;;
96 ns32k-pc532-mach) COREFILE=trad-core.o ;;
97 rs6000-*-lynx*) COREFILE=lynx-core.o ;;
98 rs6000-*-aix4*) COREFILE=rs6000-core.o
99 COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
100 rs6000-*-*) COREFILE=rs6000-core.o ;;
101 powerpc-*-aix4*) COREFILE=rs6000-core.o
102 COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
103 powerpc-*-aix*) COREFILE=rs6000-core.o ;;
104 tahoe-*-*) COREFILE=trad-core.o ;;
105 vax-*-ultrix2*) COREFILE=trad-core.o ;;
106 vax-*-ultrix*) COREFILE=trad-core.o ;;
107 vax-*-*) COREFILE=trad-core.o ;;
108 esac
109
110 case "$COREFILE" in
111 aix386-core.o) COREFLAG=-DAIX386_CORE ;;
112 hppabsd-core.o) COREFLAG=-DHPPABSD_CORE ;;
113 hpux-core.o) COREFLAG=-DHPUX_CORE ;;
114 irix-core.o) COREFLAG=-DIRIX_CORE ;;
115 lynx-core.o) COREFLAG=-DLYNX_CORE ;;
116 osf-core.o) COREFLAG=-DOSF_CORE ;;
117 ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
118 rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
119 trad-core.o) COREFLAG=-DTRAD_CORE ;;
120 esac
121 fi
122 AC_SUBST(COREFILE)
123 AC_SUBST(COREFLAG)
124
125 # target stuff:
126
127 # Canonicalize the secondary target names.
128 if test -n "$enable_targets" ; then
129 for targ in `echo $enable_targets | sed 's/,/ /g'`
130 do
131 result=`$ac_config_sub $targ 2>/dev/null`
132 if test -n "$result" ; then
133 canon_targets="$canon_targets $result"
134 else
135 # Allow targets that config.sub doesn't recognize, like "all".
136 canon_targets="$canon_targets $targ"
137 fi
138 done
139 fi
140
141 all_targets=false
142
143 for targ in $target $canon_targets
144 do
145 bfd_target=`${config_shell} $srcdir/config.bfd $targ`
146
147 if test "x$bfd_target" = "xall" ; then
148 all_targets=true
149 else
150 if test ! -f ${srcdir}/config/${bfd_target}.mt ; then
151 AC_MSG_ERROR(*** No file ${srcdir}/config/${bfd_target}.mt.
152 *** BFD does not support target ${bfd_target}.
153 *** Look in bfd/config.bfd for supported targets.)
154 exit 1
155 fi
156
157 if test "x$targ" = "x$target" ; then
158 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
159 else
160 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
161 fi
162 fi
163 done
164
165 frags=$target_makefile_frag
166 if test $host_makefile_frag != /dev/null ; then
167 frags="$frags $host_makefile_frag"
168 fi
169 AC_SUBST_FILE(target_makefile_frag)
170 AC_SUBST(frags)
171
172 # This processing still needs to be done if we're to decide properly whether
173 # 64-bit support needs to be compiled in. Currently, it will be included if
174 # the default or any other explicitly requested target requires it; it
175 # will not be included on a 32-bit host if no 64-bit target is requested, and
176 # no "--with-64-bit-bfd" option is given, even if "--with-targets=all" is
177 # used.
178
179 changequote(,)dnl
180 # The default vector in the primary target.
181 DEFAULT_VECTOR=`sed -n '
182 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
183 ' $target_makefile_frag`
184
185 allfrags="$target_makefile_frag $target_extra_frags"
186
187 # The default and selected vectors in all the configured targets.
188 SELECT_VECS=`sed -n '
189 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
190 s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
191 ' $allfrags`
192 # uniq the list.
193 f=""
194 for i in $SELECT_VECS ; do
195 case " $f " in
196 *" $i "*) ;;
197 *) f="$f $i" ;;
198 esac
199 done
200 SELECT_VECS="$f"
201
202 # The architectures in all the configured targets.
203 SELECT_ARCHITECTURES=`sed -n '
204 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
205 ' $allfrags`
206 # uniq the list.
207 f=""
208 for i in $SELECT_ARCHITECTURES ; do
209 case " $f " in
210 *" $i "*) ;;
211 *) f="$f $i" ;;
212 esac
213 done
214 SELECT_ARCHITECTURES="$f"
215 changequote([,])dnl
216
217 # Target backend .o files.
218 tb=
219
220 elf="elf.o elflink.o"
221
222 for vec in $SELECT_VECS
223 do
224 case "$vec" in
225 # This list is alphabetized to make it easy to compare
226 # with the two vector lists in targets.c.
227 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
228 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
229 armpe_little_vec) tb="$tb pe-arm.o cofflink.o " ;;
230 armpe_big_vec) tb="$tb pe-arm.o cofflink.o " ;;
231 armpei_little_vec) tb="$tb pei-arm.o cofflink.o " ;;
232 armpei_big_vec) tb="$tb pei-arm.o cofflink.o " ;;
233 aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;;
234 aout_arm_big_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
235 aout_arm_little_vec) tb="$tb aout-arm.o aout32.o stab-syms.o" ;;
236 aout_mips_big_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
237 aout_mips_little_vec) tb="$tb mipsbsd.o aout32.o stab-syms.o" ;;
238 apollocoff_vec) tb="$tb coff-apollo.o" ;;
239 b_out_vec_big_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
240 b_out_vec_little_host) tb="$tb bout.o aout32.o stab-syms.o" ;;
241 # start-sanitize-arc
242 bfd_elf32_littlearc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
243 bfd_elf32_bigarc_vec) tb="$tb elf32-arc.o elf32.o $elf" ;;
244 # end-sanitize-arc
245 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
246 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
247 bfd_elf32_hppa_vec) tb="$tb elf32-hppa.o elf32.o $elf" ;;
248 bfd_elf32_i386_vec) tb="$tb elf32-i386.o elf32.o $elf" ;;
249 bfd_elf32_i860_vec) tb="$tb elf32-i860.o elf32.o $elf" ;;
250 bfd_elf32_little_generic_vec) tb="$tb elf32-gen.o elf32.o $elf" ;;
251 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o $elf ecofflink.o" ;;
252 bfd_elf32_m68k_vec) tb="$tb elf32-m68k.o elf32.o $elf" ;;
253 bfd_elf32_m88k_vec) tb="$tb elf32-m88k.o elf32.o $elf" ;;
254 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
255 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o $elf" ;;
256 bfd_elf32_sparc_vec) tb="$tb elf32-sparc.o elf32.o $elf" ;;
257 bfd_elf64_big_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
258 target64=true ;;
259 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o $elf"
260 target64=true ;;
261 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o $elf"
262 target64=true ;;
263 cisco_core_vec) tb="$tb cisco-core.o" ;;
264 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
265 target64=true ;;
266 ecoff_big_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
267 ecoff_little_vec) tb="$tb coff-mips.o ecoff.o ecofflink.o" ;;
268 ecoffalpha_little_vec) tb="$tb coff-alpha.o ecoff.o ecofflink.o"
269 target64=true ;;
270 h8300coff_vec) tb="$tb coff-h8300.o reloc16.o" ;;
271 h8500coff_vec) tb="$tb coff-h8500.o reloc16.o" ;;
272 host_aout_vec) tb="$tb host-aout.o aout32.o stab-syms.o" ;;
273 hp300bsd_vec) tb="$tb hp300bsd.o aout32.o stab-syms.o" ;;
274 hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;;
275 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
276 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
277 i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;;
278 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
279 i386msdos_vec) tb="$tb i386msdos.o" ;;
280 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
281 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
282 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
283 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;;
284 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;;
285 i386mach3_vec) tb="$tb i386mach3.o aout32.o stab-syms.o" ;;
286 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o stab-syms.o" ;;
287 i386os9k_vec) tb="$tb i386os9k.o aout32.o stab-syms.o" ;;
288 icoff_big_vec) tb="$tb coff-i960.o" ;;
289 icoff_little_vec) tb="$tb coff-i960.o" ;;
290 ieee_vec) tb="$tb ieee.o" ;;
291 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
292 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
293 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
294 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
295 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
296 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
297 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
298 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
299 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
300 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
301 target64=true ;;
302 riscix_vec) tb="$tb aout32.o riscix.o stab-syms.o" ;;
303 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
304 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;;
305 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;;
306 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
307 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
308 # start-sanitize-rce
309 rce_aout_vec) tb="$tb aout-rce.o aout32.o stab-syms.o" ;;
310 # end-sanitize-rce
311 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
312 som_vec) tb="$tb som.o" ;;
313 sparclynx_aout_vec) tb="$tb sparclynx.o lynx-core.o aout32.o stab-syms.o" ;;
314 sparclynx_coff_vec) tb="$tb cf-sparclynx.o lynx-core.o stab-syms.o" ;;
315 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;;
316 sparccoff_vec) tb="$tb coff-sparc.o" ;;
317 srec_vec) tb="$tb srec.o" ;;
318 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
319 symbolsrec_vec) tb="$tb srec.o" ;;
320 tekhex_vec) tb="$tb tekhex.o" ;;
321 we32kcoff_vec) tb="$tb coff-we32k.o" ;;
322 z8kcoff_vec) tb="$tb coff-z8k.o reloc16.o" ;;
323 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
324 versados_vec) tb="$tb versados.o" ;;
325
326 "") ;;
327 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
328 esac
329 done
330
331 # Target architecture .o files.
332 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
333
334 # Weed out duplicate .o files.
335 f=""
336 for i in $tb ; do
337 case " $f " in
338 *" $i "*) ;;
339 *) f="$f $i" ;;
340 esac
341 done
342 tb="$f"
343
344 f=""
345 for i in $ta ; do
346 case " $f " in
347 *" $i "*) ;;
348 *) f="$f $i" ;;
349 esac
350 done
351 ta="$f"
352
353 bfd_backends="$tb"
354 bfd_machines="$ta"
355
356 if test x${all_targets} = xtrue ; then
357 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
358 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
359 else # all_targets is true
360 # Only set these if they will be nonempty, for the clever echo.
361 test -n "$SELECT_VECS" &&
362 selvecs=`echo $SELECT_VECS | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'`
363 test -n "SELECT_ARCHITECTURES" &&
364 selarchs=`echo $SELECT_ARCHITECTURES | sed -e 's/ \(.\)/,\1/g'`
365 fi # all_targets is true
366
367 case ${host64}-${target64}-${want64} in
368 *true*)
369 wordsize=64
370 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
371 ;;
372 false-false-false)
373 wordsize=32
374 all_backends='$(BFD32_BACKENDS)'
375 ;;
376 esac
377
378 AC_SUBST(wordsize)
379 AC_SUBST(all_backends)
380 AC_SUBST(bfd_backends)
381 AC_SUBST(bfd_machines)
382
383 test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
384
385 tdefaults=""
386 test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
387 test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
388 test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
389 AC_SUBST(tdefaults)
390
391 rm -f doc/config.status
392 AC_OUTPUT(Makefile doc/Makefile)
This page took 0.041947 seconds and 5 git commands to generate.