* srconv.c (wr_tr): Write out handcrafted tr block.
[deliverable/binutils-gdb.git] / bfd / configure.in
CommitLineData
8c693660
KR
1AC_PREREQ(2.3)
2AC_INIT(libbfd.c)
3
4AC_ARG_ENABLE(64-bit-bfd,
e818c22e 5[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
8c693660
KR
6[case "{$enableval}" in
7 yes) want64=true ;;
8 no) want64=false ;;
9 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
10esac],[want64=false])dnl
11AC_ARG_ENABLE(targets,
e818c22e 12[ --enable-targets alternative target configurations],
8c693660
KR
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 ;;
18esac])dnl
19
20AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
21AC_CANONICAL_SYSTEM
22if test -z "$target" ; then
23 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
24fi
25AC_ARG_PROGRAM
26
b32ae8e2
JK
27host64=false
28target64=false
21c9f626 29
8c693660 30# host stuff:
21c9f626 31
5a5fa368 32. ${srcdir}/configure.host
4dfe09da 33
8c693660
KR
34AC_PROG_RANLIB
35
5b2765bf 36# Set up to make a link between the host's include file and "sysdep.h".
8c693660 37files=hosts/${my_host}.h
5b2765bf 38
8c693660 39if test ! -f ${srcdir}/${files} ; then
0e238aa7 40 files=../bfd/hosts/std-host.h
8c693660 41 AC_MSG_WARN(BFD has no specific support for host ${host} -- using std-host)
21c9f626
RP
42fi
43
8c693660
KR
44AC_LINK_FILES($files, sysdep.h)
45
46if test -f ${srcdir}/config/${my_host}.mh ; then
47 host_makefile_frag=$srcdir/config/${my_host}.mh
48else
49 host_makefile_frag=/dev/null
5b2765bf 50fi
8c693660 51AC_SUBST_FILE(host_makefile_frag)
4dfe09da 52
8c693660 53# target stuff:
21c9f626 54
180acef5 55# Canonicalize the secondary target names.
8c693660 56if test -n "$enable_targets" ; then
318b02b6 57 for targ in `echo $enable_targets | sed 's/,/ /g'`
180acef5 58 do
9525b61b 59 result=`$ac_config_sub $targ 2>/dev/null`
8c693660 60 if test -n "$result" ; then
180acef5
DM
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
67fi
5f9a2245
DM
68
69all_targets=false
180acef5
DM
70
71for targ in $target $canon_targets
5f9a2245 72do
ec35a1c2 73 bfd_target=`${config_shell} $srcdir/config.bfd $targ`
180acef5 74
8c693660 75 if test "x$bfd_target" = "xall" ; then
5f9a2245
DM
76 all_targets=true
77 else
8c693660
KR
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.)
5f9a2245 82 exit 1
5b2765bf 83 fi
4dfe09da 84
8c693660 85 if test "x$targ" = "x$target" ; then
180acef5 86 target_makefile_frag=${srcdir}/config/${bfd_target}.mt
5f9a2245 87 else
180acef5 88 target_extra_frags="$target_extra_frags ${srcdir}/config/${bfd_target}.mt"
5f9a2245
DM
89 fi
90 fi
91done
92
8c693660
KR
93frags=$target_makefile_frag
94if test $host_makefile_frag != /dev/null ; then
95 frags="$frags $host_makefile_frag"
96fi
97AC_SUBST_FILE(target_makefile_frag)
98AC_SUBST(frags)
b32ae8e2 99
ffe26398
KR
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
8c693660 107changequote(,)dnl
5f9a2245
DM
108# The default vector in the primary target.
109DEFAULT_VECTOR=`sed -n '
110s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
111' $target_makefile_frag`
112
ffe26398 113allfrags="$target_makefile_frag $target_extra_frags"
5f9a2245 114
ffe26398
KR
115# The default and selected vectors in all the configured targets.
116SELECT_VECS=`sed -n '
117s/DEFAULT_VECTOR[ ]*=[ ]*\([^ ]*\)/\1/p
118s/SELECT_VECS[ ]*=[ ]*\([^ ]*\)/\1/p
119' $allfrags`
120# uniq the list.
121f=""
122for i in $SELECT_VECS ; do
123 case " $f " in
124 *" $i "*) ;;
125 *) f="$f $i" ;;
126 esac
127done
128SELECT_VECS="$f"
129
130# The architectures in all the configured targets.
131SELECT_ARCHITECTURES=`sed -n '
132s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
133' $allfrags`
134# uniq the list.
135f=""
136for i in $SELECT_ARCHITECTURES ; do
137 case " $f " in
138 *" $i "*) ;;
139 *) f="$f $i" ;;
140 esac
141done
142SELECT_ARCHITECTURES="$f"
8c693660 143changequote([,])dnl
5f9a2245 144
ffe26398
KR
145# Target backend .o files.
146tb=
147
148for vec in $SELECT_VECS
149do
150 case "$vec" in
151 # This list is alphabetized to make it easy to compare
152 # with the two vector lists in targets.c.
69645d10 153 a29kcoff_big_vec) tb="$tb coff-a29k.o cofflink.o" ;;
ffe26398 154 a_out_adobe_vec) tb="$tb aout-adobe.o aout32.o stab-syms.o" ;;
8c693660
KR
155 armpe_vec) tb="$tb pe-arm.o cofflink.o " ;;
156 armpei_vec) tb="$tb pei-arm.o cofflink.o " ;;
4f9617ca 157 aout0_big_vec) tb="$tb aout0.o aout32.o stab-syms.o" ;;
8c693660
KR
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" ;;
ffe26398
KR
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" ;;
2487f88f 162 apollocoff_vec) tb="$tb coff-apollo.o" ;;
ffe26398
KR
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" ;;
c7b44b04
MM
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
ffe26398 169 bfd_elf32_big_generic_vec) tb="$tb elf32-gen.o elf32.o elf.o" ;;
c7b44b04 170 bfd_elf32_bigmips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecofflink.o" ;;
ffe26398
KR
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" ;;
c7b44b04 175 bfd_elf32_littlemips_vec) tb="$tb elf32-mips.o elf32.o elf.o ecofflink.o" ;;
ffe26398
KR
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" ;;
4f9617ca 178 bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.o elf32.o elf.o" ;;
c7b44b04 179 bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.o elf32.o elf.o" ;;
ffe26398
KR
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"
7adbe989 182 target64=true ;;
ffe26398 183 bfd_elf64_little_generic_vec) tb="$tb elf64-gen.o elf64.o elf.o"
7adbe989 184 target64=true ;;
ffe26398 185 bfd_elf64_sparc_vec) tb="$tb elf64-sparc.o elf64.o elf.o"
7adbe989 186 target64=true ;;
4f9617ca 187 cisco_core_vec) tb="$tb cisco-core.o" ;;
ffe26398 188 demo_64_vec) tb="$tb demo64.o aout64.o stab-syms.o"
7adbe989 189 target64=true ;;
318b02b6
KR
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"
5dac2dd5 193 target64=true ;;
ffe26398
KR
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" ;;
ffe26398
KR
199 i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;;
200 i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;;
4f9617ca 201 i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;;
bd23b552 202 i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;;
c7b44b04 203 i386msdos_vec) tb="$tb i386msdos.o" ;;
8c693660
KR
204 i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;;
205 i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;;
ffe26398 206 i386linux_vec) tb="$tb i386linux.o aout32.o stab-syms.o" ;;
48ee0757 207 i386lynx_aout_vec) tb="$tb i386lynx.o lynx-core.o aout32.o stab-syms.o" ;;
bd23b552 208 i386lynx_coff_vec) tb="$tb cf-i386lynx.o cofflink.o lynx-core.o stab-syms.o" ;;
5dac2dd5 209 i386mach3_vec) tb="$tb i386mach3.o aout32.o stab-syms.o" ;;
a3f7a777 210 i386netbsd_vec) tb="$tb i386netbsd.o aout32.o stab-syms.o" ;;
85cc33c7 211 i386os9k_vec) tb="$tb i386os9k.o aout32.o stab-syms.o" ;;
ffe26398
KR
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" ;;
bd23b552
ILT
215 m68kcoff_vec) tb="$tb coff-m68k.o cofflink.o" ;;
216 m68kcoffun_vec) tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
48ee0757 217 m68klynx_aout_vec) tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
bd23b552 218 m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
ec35a1c2 219 m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
ffe26398
KR
220 m88kbcs_vec) tb="$tb coff-m88k.o" ;;
221 newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;;
ffe26398 222 nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;;
5dac2dd5 223 nlm32_sparc_vec) tb="$tb nlm32-sparc.o nlm32.o nlm.o" ;;
85cc33c7 224 nlm32_alpha_vec) tb="$tb nlm32-alpha.o nlm32.o nlm.o"
7adbe989 225 target64=true ;;
318b02b6 226 riscix_vec) tb="$tb aout32.o riscix.o stab-syms.o" ;;
4f9617ca 227 nlm32_powerpc_vec) tb="$tb nlm32-ppc.o nlm32.o nlm.o" ;;
7a1d4567 228 pc532netbsd_vec) tb="$tb ns32knetbsd.o aout-ns32k.o stab-syms.o" ;;
318b02b6 229 pc532machaout_vec) tb="$tb pc532-mach.o aout-ns32k.o stab-syms.o" ;;
ffe26398 230 rs6000coff_vec) tb="$tb coff-rs6000.o" ;;
ec35a1c2 231 shcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
03c4ce2f 232# start-sanitize-rce
fb870b50 233 rce_aout_vec) tb="$tb aout-rce.o aout32.o stab-syms.o" ;;
03c4ce2f 234# end-sanitize-rce
7a1d4567 235 shlcoff_vec) tb="$tb coff-sh.o cofflink.o" ;;
318b02b6 236 som_vec) tb="$tb som.o" ;;
c9368a3b
SS
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" ;;
a3f7a777 239 sparcnetbsd_vec) tb="$tb sparcnetbsd.o aout32.o stab-syms.o" ;;
6a6676fb 240 sparccoff_vec) tb="$tb coff-sparc.o" ;;
318b02b6 241 srec_vec) tb="$tb srec.o" ;;
ffe26398 242 sunos_big_vec) tb="$tb sunos.o aout32.o stab-syms.o" ;;
318b02b6 243 symbolsrec_vec) tb="$tb srec.o" ;;
ffe26398
KR
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" ;;
c7b44b04 247 w65_vec) tb="$tb coff-w65.o reloc16.o" ;;
8c693660 248 versados_vec) tb="$tb versados.o" ;;
ffe26398 249
ffe26398 250 "") ;;
8c693660 251 *) AC_MSG_ERROR(*** unknown target vector $vec) ;;
ffe26398
KR
252 esac
253done
5f9a2245 254
ffe26398
KR
255# Target architecture .o files.
256ta=`echo $SELECT_ARCHITECTURES | sed -e s/bfd_/cpu-/g -e s/_arch/.o/g`
5f9a2245 257
ffe26398
KR
258# Weed out duplicate .o files.
259f=""
260for i in $tb ; do
261 case " $f " in
262 *" $i "*) ;;
263 *) f="$f $i" ;;
264 esac
265done
266tb="$f"
267
268f=""
269for i in $ta ; do
270 case " $f " in
271 *" $i "*) ;;
272 *) f="$f $i" ;;
273 esac
274done
275ta="$f"
5f9a2245 276
ffe26398
KR
277bfd_backends="$tb"
278bfd_machines="$ta"
5f9a2245 279
8c693660 280if test x${all_targets} = xtrue ; then
ffe26398
KR
281 bfd_backends="${bfd_backends}"' $(ALL_BACKENDS)'
282 bfd_machines="${bfd_machines}"' $(ALL_MACHINES)'
cede9731
PS
283else # 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'`
5f9a2245
DM
289fi # all_targets is true
290
7adbe989
KR
291case ${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 ;;
300esac
301
8c693660
KR
302AC_SUBST(wordsize)
303AC_SUBST(all_backends)
304AC_SUBST(bfd_backends)
305AC_SUBST(bfd_machines)
7adbe989 306
5f9a2245
DM
307test -n "$DEFAULT_VECTOR" && defvec="$DEFAULT_VECTOR"
308
8c693660 309tdefaults=""
c7b44b04
MM
310test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}"
311test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'"
312test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'"
8c693660 313AC_SUBST(tdefaults)
c812942f 314
8c693660
KR
315rm -f doc/config.status
316AC_OUTPUT(Makefile doc/Makefile)
This page took 0.149107 seconds and 4 git commands to generate.