* configure.in: Use $ac_config_sub, not $configsub.
[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 # target stuff:
54
55 # Canonicalize the secondary target names.
56 if test -n "$enable_targets" ; then
57 for targ in `echo $enable_targets | sed 's/,/ /g'`
58 do
59 result=`$ac_config_sub $targ 2>/dev/null`
60 if test -n "$result" ; then
61 canon_targets="$canon_targets $result"
62 else
63 # Allow targets that config.sub doesn't recognize, like "all".
64 canon_targets="$canon_targets $targ"
65 fi
66 done
67 fi
68
69 all_targets=false
70
71 for targ in $target $canon_targets
72 do
73 bfd_target=`${config_shell} $srcdir/config.bfd $targ`
74
75 if test "x$bfd_target" = "xall" ; then
76 all_targets=true
77 else
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.)
82 exit 1
83 fi
84
85 if test "x$targ" = "x$target" ; then
86 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
87 else
88 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
89 fi
90 fi
91 done
92
93 frags=$target_makefile_frag
94 if test $host_makefile_frag != /dev/null ; then
95 frags="$frags $host_makefile_frag"
96 fi
97 AC_SUBST_FILE(target_makefile_frag)
98 AC_SUBST(frags)
99
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
105 # used.
106
107 changequote(,)dnl
108 # The default vector in the primary target.
109 DEFAULT_VECTOR=`sed -n '
110 s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
111 ' $target_makefile_frag`
112
113 allfrags="$target_makefile_frag $target_extra_frags"
114
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
119 ' $allfrags`
120 # uniq the list.
121 f=""
122 for i in $SELECT_VECS ; do
123 case " $f " in
124 *" $i "*) ;;
125 *) f="$f $i" ;;
126 esac
127 done
128 SELECT_VECS="$f"
129
130 # The architectures in all the configured targets.
131 SELECT_ARCHITECTURES=`sed -n '
132 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
133 ' $allfrags`
134 # uniq the list.
135 f=""
136 for i in $SELECT_ARCHITECTURES ; do
137 case " $f " in
138 *" $i "*) ;;
139 *) f="$f $i" ;;
140 esac
141 done
142 SELECT_ARCHITECTURES="$f"
143 changequote([,])dnl
144
145 # Target backend .o files.
146 tb=
147
148 for vec in $SELECT_VECS
149 do
150 case "$vec" in
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" ;;
165 # start-sanitize-arc
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" ;;
168 # end-sanitize-arc
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"
182 target64=true ;;
183 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
184 target64=true ;;
185 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o"
186 target64=true ;;
187 cisco_core_vec) tb="$tb cisco-core.o" ;;
188 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
189 target64=true ;;
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"
193 target64=true ;;
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"
225 target64=true ;;
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" ;;
232 # start-sanitize-rce
233 rce_aout_vec) tb="$tb aout-rce.o aout32.o stab-syms.o" ;;
234 # end-sanitize-rce
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" ;;
249
250 "") ;;
251 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
252 esac
253 done
254
255 # Target architecture .o files.
256 ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
257
258 # Weed out duplicate .o files.
259 f=""
260 for i in $tb ; do
261 case " $f " in
262 *" $i "*) ;;
263 *) f="$f $i" ;;
264 esac
265 done
266 tb="$f"
267
268 f=""
269 for i in $ta ; do
270 case " $f " in
271 *" $i "*) ;;
272 *) f="$f $i" ;;
273 esac
274 done
275 ta="$f"
276
277 bfd_backends="$tb"
278 bfd_machines="$ta"
279
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
290
291 case ${host64}-${target64}-${want64} in
292 *true*)
293 wordsize=64
294 all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)'
295 ;;
296 false-false-false)
297 wordsize=32
298 all_backends='$(BFD32_BACKENDS)'
299 ;;
300 esac
301
302 AC_SUBST(wordsize)
303 AC_SUBST(all_backends)
304 AC_SUBST(bfd_backends)
305 AC_SUBST(bfd_machines)
306
307 test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
308
309 tdefaults=""
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}'"
313 AC_SUBST(tdefaults)
314
315 rm -f doc/config.status
316 AC_OUTPUT(Makefile doc/Makefile)
This page took 0.045182 seconds and 5 git commands to generate.