]>
Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl | |
3 | dnl And be careful when changing it! If you must add tests with square | |
4 | dnl brackets, be sure changequote invocations surround it. | |
5 | dnl | |
b90efa5b | 6 | dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. |
5bf135a7 NC |
7 | dnl |
8 | dnl This file is free software; you can redistribute it and/or modify | |
9 | dnl it under the terms of the GNU General Public License as published by | |
10 | dnl the Free Software Foundation; either version 3 of the License, or | |
11 | dnl (at your option) any later version. | |
3739860c | 12 | dnl |
5bf135a7 NC |
13 | dnl This program is distributed in the hope that it will be useful, |
14 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | dnl GNU General Public License for more details. | |
3739860c | 17 | dnl |
5bf135a7 NC |
18 | dnl You should have received a copy of the GNU General Public License |
19 | dnl along with this program; see the file COPYING3. If not see | |
20 | dnl <http://www.gnu.org/licenses/>. | |
252b5132 RH |
21 | dnl |
22 | dnl v2.5 needed for --bindir et al | |
da594c4a | 23 | AC_PREREQ(2.59) |
2e98a7bd AM |
24 | m4_include([../bfd/version.m4]) |
25 | AC_INIT([gas], BFD_VERSION) | |
da594c4a | 26 | AC_CONFIG_SRCDIR(as.h) |
252b5132 | 27 | |
13b2be9c DJ |
28 | dnl Autoconf 2.57 will find the aux dir without this. However, unless |
29 | dnl we specify this explicitly, automake-1.7 will assume that ylwrap is in | |
30 | dnl gas/ instead of gas/../. | |
31 | AC_CONFIG_AUX_DIR(..) | |
da594c4a | 32 | AC_CANONICAL_TARGET |
5d64ca4e | 33 | AC_ISC_POSIX |
252b5132 | 34 | |
2e98a7bd | 35 | AM_INIT_AUTOMAKE |
252b5132 | 36 | |
ce2cded5 L |
37 | AC_PROG_CC |
38 | AC_GNU_SOURCE | |
7357c5b6 | 39 | AC_USE_SYSTEM_EXTENSIONS |
ce2cded5 | 40 | |
da594c4a | 41 | LT_INIT |
b879806f | 42 | ACX_LARGEFILE |
252b5132 | 43 | |
252b5132 | 44 | AC_ARG_ENABLE(targets, |
241a6c40 | 45 | [ --enable-targets alternative target configurations besides the primary], |
252b5132 | 46 | [case "${enableval}" in |
da594c4a | 47 | yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all') |
252b5132 RH |
48 | ;; |
49 | no) enable_targets= ;; | |
50 | *) enable_targets=$enableval ;; | |
51 | esac])dnl | |
c43a438d | 52 | |
c43a438d AM |
53 | ac_checking=yes |
54 | if grep '^RELEASE=y' ${srcdir}/../bfd/Makefile.am >/dev/null 2>/dev/null ; then | |
55 | ac_checking= | |
56 | fi | |
57 | AC_ARG_ENABLE(checking, | |
58 | [ --enable-checking enable run-time checks], | |
59 | [case "${enableval}" in | |
60 | no|none) ac_checking= ;; | |
61 | *) ac_checking=yes ;; | |
62 | esac])dnl | |
63 | if test x$ac_checking != x ; then | |
64 | AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.]) | |
65 | fi | |
66 | ||
e12fe555 NC |
67 | # PR gas/19109 |
68 | # Decide the default method for compressing debug sections. | |
69 | ac_default_compressed_debug_sections=unset | |
70 | # Provide a configure time option to override our default. | |
71 | AC_ARG_ENABLE(compressed_debug_sections, | |
72 | [ --enable-compressed-debug-sections compress debug sections by default], | |
73 | [case "${enableval}" in | |
74 | yes) ac_default_compressed_debug_sections=yes ;; | |
75 | no) ac_default_compressed_debug_sections=no ;; | |
76 | *) ac_default_compressed_debug_sections=unset ;; | |
77 | esac])dnl | |
78 | ||
252b5132 RH |
79 | using_cgen=no |
80 | ||
9e9b66a9 | 81 | AM_BINUTILS_WARNINGS |
a2d91340 | 82 | |
252b5132 | 83 | # Generate a header file |
da594c4a | 84 | AC_CONFIG_HEADERS(config.h:config.in) |
252b5132 | 85 | |
df7b86aa NC |
86 | # PR 14072 |
87 | AH_VERBATIM([00_CONFIG_H_CHECK], | |
88 | [/* Check that config.h is #included before system headers | |
89 | (this works only for glibc, but that should be enough). */ | |
d17dce55 | 90 | #if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) |
df7b86aa NC |
91 | # error config.h must be #included before system headers |
92 | #endif | |
93 | #define __CONFIG_H__ 1]) | |
94 | ||
76a27922 ILT |
95 | # If we are on a DOS filesystem, we must use gdb.ini rather than |
96 | # .gdbinit. | |
76a27922 | 97 | case "${host}" in |
591d4689 | 98 | *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-windows*) |
76a27922 | 99 | GDBINIT="gdb.ini" |
13b2be9c DJ |
100 | AC_CONFIG_FILES(gdb.ini:gdbinit.in) |
101 | ;; | |
102 | *) | |
103 | GDBINIT=".gdbinit" | |
104 | AC_CONFIG_FILES(.gdbinit:gdbinit.in) | |
76a27922 ILT |
105 | ;; |
106 | esac | |
107 | AC_SUBST(GDBINIT) | |
108 | ||
44f2f9d2 AM |
109 | #We need this for the host. BOUT header is in host order. |
110 | AC_C_BIGENDIAN | |
111 | ||
252b5132 RH |
112 | te_file=generic |
113 | ||
114 | # Makefile target for installing gas in $(tooldir)/bin. | |
115 | install_tooldir=install-exec-tooldir | |
116 | ||
117 | canon_targets="" | |
15886821 | 118 | all_targets=no |
252b5132 RH |
119 | if test -n "$enable_targets" ; then |
120 | for t in `echo $enable_targets | sed 's/,/ /g'`; do | |
15886821 L |
121 | if test $t = "all"; then |
122 | all_targets=yes | |
123 | continue | |
124 | fi | |
6d83c84b | 125 | result=`$ac_config_sub $t 2>/dev/null` |
252b5132 RH |
126 | if test -n "$result" ; then |
127 | canon_targets="$canon_targets $result" | |
128 | # else | |
129 | # # Permit "all", etc. We don't support it yet though. | |
130 | # canon_targets="$canon_targets $t" | |
131 | fi | |
132 | done | |
133 | GAS_UNIQ(canon_targets) | |
134 | fi | |
135 | ||
136 | emulations="" | |
137 | ||
138 | for this_target in $target $canon_targets ; do | |
139 | ||
14ee9f48 ILT |
140 | targ=${this_target} |
141 | . ${srcdir}/configure.tgt | |
142 | ||
143 | case ${target_cpu} in | |
144 | crisv32) | |
145 | AC_DEFINE_UNQUOTED(DEFAULT_CRIS_ARCH, $arch, | |
146 | [Default CRIS architecture.]) | |
147 | ;; | |
252b5132 RH |
148 | esac |
149 | ||
150 | if test ${this_target} = $target ; then | |
151 | target_cpu_type=${cpu_type} | |
152 | elif test ${target_cpu_type} != ${cpu_type} ; then | |
153 | continue | |
154 | fi | |
155 | ||
14ee9f48 | 156 | generic_target=${cpu_type}-${target_vendor}-${target_os} |
252b5132 | 157 | case ${generic_target} in |
14ee9f48 ILT |
158 | i386-*-sco3.2v5*) |
159 | if test ${this_target} = $target; then | |
160 | AC_DEFINE(SCO_ELF, 1, [Define if defaulting to ELF on SCO 5.]) | |
161 | fi | |
162 | ;; | |
1fe1f39c | 163 | |
79500683 AM |
164 | i386-*-msdosdjgpp* \ |
165 | | i386-*-go32* \ | |
14ee9f48 ILT |
166 | | i386-go32-rtems*) |
167 | AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?]) | |
168 | ;; | |
79500683 | 169 | |
14ee9f48 ILT |
170 | i860-*-*) |
171 | AC_MSG_WARN(GAS support for ${generic_target} is preliminary and a work in progress) | |
172 | ;; | |
79500683 | 173 | |
7ba29e2a NC |
174 | microblaze*) |
175 | ;; | |
176 | ||
e5231592 RS |
177 | changequote(,)dnl |
178 | ppc-*-aix[5-9].*) | |
179 | changequote([,])dnl | |
14ee9f48 | 180 | AC_DEFINE(AIX_WEAK_SUPPORT, 1, |
f8fc3443 | 181 | [Define if using AIX 5.2 value for C_WEAKEXT.]) |
14ee9f48 | 182 | ;; |
14ee9f48 ILT |
183 | ppc-*-solaris*) |
184 | if test ${this_target} = $target; then | |
185 | AC_DEFINE(TARGET_SOLARIS_COMMENT, 1, | |
186 | [Define if default target is PowerPC Solaris.]) | |
187 | fi | |
188 | if test x${endian} = xbig; then | |
189 | AC_MSG_ERROR(Solaris must be configured little endian) | |
190 | fi | |
191 | ;; | |
192 | ||
193 | sh*-*-symbianelf*) | |
194 | AC_DEFINE(TARGET_SYMBIAN, 1, [Define if target is Symbian OS.]) | |
195 | ;; | |
252b5132 RH |
196 | esac |
197 | ||
198 | if test ${this_target} = $target ; then | |
199 | endian_def= | |
200 | if test x${endian} = xbig; then | |
201 | endian_def=1 | |
202 | elif test x${endian} = xlittle; then | |
203 | endian_def=0 | |
204 | fi | |
205 | if test x${endian_def} != x; then | |
206 | AC_DEFINE_UNQUOTED(TARGET_BYTES_BIG_ENDIAN, $endian_def, | |
207 | [Define as 1 if big endian.]) | |
208 | fi | |
209 | fi | |
210 | ||
252b5132 RH |
211 | # Other random stuff. |
212 | ||
316f5878 RS |
213 | case ${cpu_type} in |
214 | mips) | |
215 | # Set mips_cpu to the name of the default CPU. | |
216 | case ${target_cpu} in | |
217 | mips | mipsbe | mipseb | mipsle | mipsel | mips64 | mips64el) | |
218 | mips_cpu=from-abi | |
219 | ;; | |
220 | mipsisa32 | mipsisa32el) | |
221 | mips_cpu=mips32 | |
222 | ;; | |
af7ee8bf CD |
223 | mipsisa32r2 | mipsisa32r2el) |
224 | mips_cpu=mips32r2 | |
225 | ;; | |
ae52f483 AB |
226 | mipsisa32r3 | mipsisa32r3el) |
227 | mips_cpu=mips32r3 | |
228 | ;; | |
229 | mipsisa32r5 | mipsisa32r5el) | |
230 | mips_cpu=mips32r5 | |
231 | ;; | |
7361da2c AB |
232 | mipsisa32r6 | mipsisa32r6el) |
233 | mips_cpu=mips32r6 | |
234 | ;; | |
316f5878 RS |
235 | mipsisa64 | mipsisa64el) |
236 | mips_cpu=mips64 | |
237 | ;; | |
5f74bc13 CD |
238 | mipsisa64r2 | mipsisa64r2el) |
239 | mips_cpu=mips64r2 | |
240 | ;; | |
ae52f483 AB |
241 | mipsisa64r3 | mipsisa64r3el) |
242 | mips_cpu=mips64r3 | |
243 | ;; | |
244 | mipsisa64r5 | mipsisa64r5el) | |
245 | mips_cpu=mips64r5 | |
246 | ;; | |
7361da2c AB |
247 | mipsisa64r6 | mipsisa64r6el) |
248 | mips_cpu=mips64r6 | |
249 | ;; | |
316f5878 RS |
250 | mipstx39 | mipstx39el) |
251 | mips_cpu=r3900 | |
252 | ;; | |
8f6847cb RS |
253 | mips64vr | mips64vrel) |
254 | mips_cpu=vr4100 | |
255 | ;; | |
5f74bc13 | 256 | mipsisa32r2* | mipsisa64r2*) |
af7ee8bf CD |
257 | changequote(,)dnl |
258 | mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` | |
7361da2c AB |
259 | changequote([,])dnl |
260 | ;; | |
261 | mipsisa32r6* | mipsisa64r6*) | |
262 | changequote(,)dnl | |
263 | mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r6//' -e 's/el$//'` | |
af7ee8bf CD |
264 | changequote([,])dnl |
265 | ;; | |
316f5878 RS |
266 | mips64* | mipsisa64* | mipsisa32*) |
267 | changequote(,)dnl | |
268 | mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..//' -e 's/el$//'` | |
e407c74b NC |
269 | changequote([,])dnl |
270 | ;; | |
271 | mips*) | |
272 | changequote(,)dnl | |
273 | mips_cpu=`echo $target_cpu | sed -e 's/^mips//' -e 's/el$//'` | |
316f5878 RS |
274 | changequote([,])dnl |
275 | ;; | |
276 | *) | |
da594c4a | 277 | AC_MSG_ERROR($target_cpu isn't a supported MIPS CPU name) |
316f5878 RS |
278 | ;; |
279 | esac | |
280 | # See whether it's appropriate to set E_MIPS_ABI_O32 for o32 | |
281 | # binaries. It's a GNU extension that some OSes don't understand. | |
316f5878 RS |
282 | case ${target} in |
283 | *-*-irix*) | |
284 | use_e_mips_abi_o32=0 | |
285 | ;; | |
286 | *) | |
287 | use_e_mips_abi_o32=1 | |
288 | ;; | |
289 | esac | |
290 | # Decide whether to generate 32-bit or 64-bit code by default. | |
291 | # Used to resolve -march=from-abi when an embedded ABI is selected. | |
292 | case ${target} in | |
293 | mips64*-*-* | mipsisa64*-*-*) | |
294 | mips_default_64bit=1 | |
295 | ;; | |
296 | *) | |
297 | mips_default_64bit=0 | |
298 | ;; | |
299 | esac | |
cac012d6 AO |
300 | # Decide which ABI to target by default. |
301 | case ${target} in | |
aeffff67 | 302 | mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* | mips64*-kfreebsd*-gnu) |
cac012d6 AO |
303 | mips_default_abi=N32_ABI |
304 | ;; | |
aeffff67 | 305 | mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu) |
cac012d6 AO |
306 | mips_default_abi=O32_ABI |
307 | ;; | |
26eebcf5 MK |
308 | mips64*-openbsd*) |
309 | mips_default_abi=N64_ABI | |
310 | ;; | |
cac012d6 AO |
311 | *) |
312 | mips_default_abi=NO_ABI | |
313 | ;; | |
314 | esac | |
316f5878 RS |
315 | AC_DEFINE_UNQUOTED(MIPS_CPU_STRING_DEFAULT, "$mips_cpu", |
316 | [Default CPU for MIPS targets. ]) | |
317 | AC_DEFINE_UNQUOTED(USE_E_MIPS_ABI_O32, $use_e_mips_abi_o32, | |
318 | [Allow use of E_MIPS_ABI_O32 on MIPS targets. ]) | |
319 | AC_DEFINE_UNQUOTED(MIPS_DEFAULT_64BIT, $mips_default_64bit, | |
320 | [Generate 64-bit code by default on MIPS targets. ]) | |
cac012d6 AO |
321 | AC_DEFINE_UNQUOTED(MIPS_DEFAULT_ABI, $mips_default_abi, |
322 | [Choose a default ABI for MIPS targets. ]) | |
316f5878 RS |
323 | ;; |
324 | esac | |
325 | ||
252b5132 RH |
326 | # Do we need the opcodes library? |
327 | case ${cpu_type} in | |
0b1cf022 | 328 | vax | tic30) |
252b5132 RH |
329 | ;; |
330 | ||
331 | *) | |
332 | need_opcodes=yes | |
333 | ||
334 | case "${enable_shared}" in | |
335 | yes) shared_opcodes=true ;; | |
336 | *opcodes*) shared_opcodes=true ;; | |
337 | *) shared_opcodes=false ;; | |
338 | esac | |
252b5132 RH |
339 | ;; |
340 | esac | |
341 | ||
342 | # Any other special object files needed ? | |
343 | case ${cpu_type} in | |
07c1b327 CM |
344 | |
345 | bfin) | |
346 | echo ${extra_objects} | grep -s "bfin-parse.o" | |
347 | if test $? -ne 0 ; then | |
348 | extra_objects="$extra_objects bfin-parse.o" | |
349 | fi | |
350 | ||
df7b86aa | 351 | echo ${extra_objects} | grep -s "bfin-lex-wrapper.o" |
07c1b327 | 352 | if test $? -ne 0 ; then |
df7b86aa | 353 | extra_objects="$extra_objects bfin-lex-wrapper.o" |
07c1b327 CM |
354 | fi |
355 | ;; | |
356 | ||
73589c9d | 357 | epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | or1k) |
252b5132 RH |
358 | using_cgen=yes |
359 | ;; | |
360 | ||
49f58d10 JB |
361 | m32c) |
362 | using_cgen=yes | |
363 | ;; | |
0ebb9a87 DB |
364 | frv) |
365 | using_cgen=yes | |
366 | ;; | |
252b5132 RH |
367 | m68k) |
368 | case ${extra_objects} in | |
369 | *m68k-parse.o*) ;; | |
370 | *) extra_objects="$extra_objects m68k-parse.o" ;; | |
371 | esac | |
372 | ;; | |
373 | ||
280d71bf DB |
374 | mep) |
375 | using_cgen=yes | |
376 | ;; | |
377 | ||
252b5132 | 378 | mips) |
12e64c2c | 379 | echo ${extra_objects} | grep -s "itbl-parse.o" |
252b5132 RH |
380 | if test $? -ne 0 ; then |
381 | extra_objects="$extra_objects itbl-parse.o" | |
382 | fi | |
383 | ||
df7b86aa | 384 | echo ${extra_objects} | grep -s "itbl-lex-wrapper.o" |
252b5132 | 385 | if test $? -ne 0 ; then |
df7b86aa | 386 | extra_objects="$extra_objects itbl-lex-wrapper.o" |
252b5132 RH |
387 | fi |
388 | ||
12e64c2c | 389 | echo ${extra_objects} | grep -s "itbl-ops.o" |
252b5132 RH |
390 | if test $? -ne 0 ; then |
391 | extra_objects="$extra_objects itbl-ops.o" | |
392 | fi | |
393 | ;; | |
394 | ||
4970f871 | 395 | mt) |
047af9ef AH |
396 | using_cgen=yes |
397 | ;; | |
398 | ||
35c08157 KLC |
399 | nds32) |
400 | # Decide BASELINE, REDUCED_REGS, FPU_DP_EXT, FPU_SP_EXT features | |
401 | # based on arch_name. | |
402 | AC_MSG_CHECKING(for default configuration of --with-arch) | |
403 | if test "x${with_arch}" != x; then | |
404 | case ${with_arch} in | |
405 | v2j | v2s | v2f | v2 | v3m | v3j | v3s | v3f | v3 ) | |
406 | AC_DEFINE_UNQUOTED(NDS32_DEFAULT_ARCH_NAME, "$with_arch", | |
407 | [Define value for nds32_arch_name]) | |
408 | ;; | |
409 | *) | |
410 | AC_MSG_ERROR(This kind of arch name does *NOT* exist!) | |
411 | ;; | |
412 | esac | |
413 | fi | |
414 | AC_MSG_RESULT($with_arch) | |
415 | ||
416 | # Decide features one by one. | |
417 | AC_MSG_CHECKING(for default configuration of --enable-dx-regs) | |
6cd8405e | 418 | if test "x${enable_dx_regs}" = xyes; then |
35c08157 KLC |
419 | AC_DEFINE(NDS32_DEFAULT_DX_REGS, 1, |
420 | [Define value for nds32_dx_regs]) | |
421 | else | |
422 | AC_DEFINE(NDS32_DEFAULT_DX_REGS, 0, | |
423 | [Define default value for nds32_dx_regs]) | |
424 | fi | |
425 | AC_MSG_RESULT($enable_dx_regs) | |
426 | ||
427 | AC_MSG_CHECKING(for default configuration of --enable-perf-ext) | |
6cd8405e | 428 | if test "x${enable_perf_ext}" = xno; then |
35c08157 KLC |
429 | AC_DEFINE(NDS32_DEFAULT_PERF_EXT, 0, |
430 | [Define value for nds32_perf_ext]) | |
431 | else | |
432 | AC_DEFINE(NDS32_DEFAULT_PERF_EXT, 1, | |
433 | [Define default value for nds32_perf_ext]) | |
434 | fi | |
435 | AC_MSG_RESULT($enable_perf_ext) | |
436 | ||
437 | AC_MSG_CHECKING(for default configuration of --enable-perf-ext2) | |
6cd8405e | 438 | if test "x${enable_perf_ext2}" = xno; then |
35c08157 KLC |
439 | AC_DEFINE(NDS32_DEFAULT_PERF_EXT2, 0, |
440 | [Define value for nds32_perf_ext2]) | |
441 | else | |
442 | AC_DEFINE(NDS32_DEFAULT_PERF_EXT2, 1, | |
443 | [Define default value for nds32_perf_ext2]) | |
444 | fi | |
445 | AC_MSG_RESULT($enable_perf_ext2) | |
446 | ||
447 | AC_MSG_CHECKING(for default configuration of --enable-string-ext) | |
6cd8405e | 448 | if test "x${enable_string_ext}" = xno; then |
35c08157 KLC |
449 | AC_DEFINE(NDS32_DEFAULT_STRING_EXT, 0, |
450 | [Define value for nds32_string_ext]) | |
451 | else | |
452 | AC_DEFINE(NDS32_DEFAULT_STRING_EXT, 1, | |
453 | [Define default value for nds32_string_ext]) | |
454 | fi | |
455 | AC_MSG_RESULT($enable_string_ext) | |
456 | ||
457 | AC_MSG_CHECKING(for default configuration of --enable-audio-ext) | |
6cd8405e | 458 | if test "x${enable_audio_ext}" = xno; then |
35c08157 KLC |
459 | AC_DEFINE(NDS32_DEFAULT_AUDIO_EXT, 0, |
460 | [Define value for nds32_audio_ext]) | |
461 | else | |
462 | AC_DEFINE(NDS32_DEFAULT_AUDIO_EXT, 1, | |
463 | [Define default value for nds32_audio_ext]) | |
464 | fi | |
465 | AC_MSG_RESULT($enable_audio_ext) | |
466 | ;; | |
467 | ||
c1e4eef7 | 468 | i386 | s390 | sparc) |
252b5132 RH |
469 | if test $this_target = $target ; then |
470 | AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.]) | |
471 | fi | |
472 | ;; | |
93fbbb04 | 473 | |
99c513f6 DD |
474 | rl78) |
475 | echo ${extra_objects} | grep -s "rl78-parse.o" | |
476 | if test $? -ne 0 ; then | |
477 | extra_objects="$extra_objects rl78-parse.o" | |
478 | fi | |
479 | ;; | |
480 | ||
c7927a3c NC |
481 | rx) |
482 | echo ${extra_objects} | grep -s "rx-parse.o" | |
483 | if test $? -ne 0 ; then | |
484 | extra_objects="$extra_objects rx-parse.o" | |
485 | fi | |
486 | ;; | |
487 | ||
93fbbb04 GK |
488 | xstormy16) |
489 | using_cgen=yes | |
490 | ;; | |
491 | ||
d70c5fc7 NC |
492 | xc16x) |
493 | using_cgen=yes | |
494 | ;; | |
495 | ||
e0001a05 NC |
496 | xtensa) |
497 | echo ${extra_objects} | grep -s "xtensa-relax.o" | |
498 | if test $? -ne 0 ; then | |
499 | extra_objects="$extra_objects xtensa-relax.o" | |
500 | fi | |
501 | ;; | |
502 | ||
252b5132 RH |
503 | *) |
504 | ;; | |
505 | esac | |
506 | ||
507 | if test $using_cgen = yes ; then | |
508 | case "x${extra_objects}" in | |
509 | *cgen.o*) ;; | |
510 | *) extra_objects="$extra_objects cgen.o" ;; | |
511 | esac | |
512 | fi | |
513 | ||
514 | # See if we really can support this configuration with the emulation code. | |
515 | ||
516 | if test $this_target = $target ; then | |
252b5132 RH |
517 | obj_format=$fmt |
518 | te_file=$em | |
252b5132 RH |
519 | fi |
520 | ||
b11d79f2 TG |
521 | case ${te_file} in |
522 | vms) extra_objects="$extra_objects te-vms.o" ;; | |
523 | esac | |
58797674 | 524 | |
252b5132 RH |
525 | # From target name and format, produce a list of supported emulations. |
526 | ||
527 | case ${generic_target}-${fmt} in | |
e8044f35 | 528 | mips-*-*-*) case "$endian" in |
252b5132 RH |
529 | big) emulation="mipsbelf mipslelf mipself" ;; |
530 | *) emulation="mipslelf mipsbelf mipself" ;; | |
252b5132 | 531 | esac ;; |
119caedd L |
532 | # i386-pc-pe-coff != i386-pc-coff. |
533 | i386-*-pe-coff) ;; | |
4c63da97 AM |
534 | # Uncommenting the next line will turn on support for i386 AOUT |
535 | # for the default linux configuration | |
536 | # i386-*-linux*-elf) emulation="i386elf i386aout" ;; | |
537 | # | |
538 | i386-*-aout) emulation="i386aout" ;; | |
4ca72d38 | 539 | i386-*-coff) emulation="i386coff" ;; |
4c63da97 | 540 | i386-*-elf) emulation="i386elf" ;; |
3bcbcc3d | 541 | |
f9c19112 HPN |
542 | # Always all formats. The first stated emulation becomes the default. |
543 | cris-*-*aout*) emulation="crisaout criself" ;; | |
544 | cris-*-*) emulation="criself crisaout" ;; | |
252b5132 RH |
545 | esac |
546 | ||
547 | emulations="$emulations $emulation" | |
548 | ||
549 | done | |
550 | ||
e12fe555 NC |
551 | if test x$ac_default_compressed_debug_sections == xyes ; then |
552 | AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.]) | |
553 | fi | |
554 | ||
15886821 L |
555 | # Turn on all targets if possible |
556 | if test ${all_targets} = "yes"; then | |
557 | case ${target_cpu_type} in | |
558 | i386) | |
559 | case ${obj_format} in | |
560 | aout) | |
561 | emulations="$emulations i386coff i386elf" | |
562 | ;; | |
563 | coff) | |
564 | emulations="$emulations i386aout i386elf" | |
565 | ;; | |
566 | elf) | |
567 | emulations="$emulations i386aout i386coff" | |
568 | ;; | |
569 | esac | |
570 | ;; | |
99ad8390 NC |
571 | x86_64) |
572 | case ${obj_format} in | |
573 | aout) | |
574 | emulations="$emulations i386coff i386elf" | |
575 | ;; | |
576 | coff) | |
577 | emulations="$emulations i386aout i386elf" | |
578 | ;; | |
579 | elf) | |
580 | emulations="$emulations i386aout i386coff" | |
581 | ;; | |
582 | esac | |
583 | ;; | |
15886821 L |
584 | esac |
585 | fi | |
586 | ||
39871c07 AM |
587 | # PE code has way too many macros tweaking behaviour |
588 | case ${te_file} in | |
589 | pe*) emulations="" ;; | |
590 | esac | |
591 | ||
252b5132 RH |
592 | # Assign floating point type. Most processors with FP support |
593 | # IEEE FP. On those that don't support FP at all, usually IEEE | |
594 | # is emulated. | |
595 | case ${target_cpu} in | |
12e64c2c | 596 | vax | pdp11 ) atof=vax ;; |
252b5132 RH |
597 | *) atof=ieee ;; |
598 | esac | |
599 | ||
600 | case "${obj_format}" in | |
601 | "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;; | |
602 | esac | |
603 | ||
604 | # Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU). | |
605 | cgen_cpu_prefix="" | |
606 | if test $using_cgen = yes ; then | |
607 | case ${target_cpu} in | |
73589c9d CS |
608 | or1knd) |
609 | cgen_cpu_prefix=or1k ;; | |
252b5132 RH |
610 | *) cgen_cpu_prefix=${target_cpu} ;; |
611 | esac | |
612 | AC_SUBST(cgen_cpu_prefix) | |
613 | AC_DEFINE(USING_CGEN, 1, [Using cgen code?]) | |
614 | fi | |
615 | ||
616 | dnl | |
617 | dnl Make sure the desired support files exist. | |
618 | dnl | |
619 | ||
620 | if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then | |
621 | AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type}) | |
622 | fi | |
623 | ||
624 | if test ! -r ${srcdir}/config/obj-${obj_format}.c; then | |
625 | AC_MSG_ERROR(GAS does not have support for object file format ${obj_format}) | |
626 | fi | |
627 | ||
252b5132 RH |
628 | # Some COFF configurations want these random other flags set. |
629 | case ${obj_format} in | |
630 | coff) | |
631 | case ${target_cpu_type} in | |
632 | i386) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;; | |
633 | m68k) AC_DEFINE(M68KCOFF, 1, [Using m68k COFF?]) ;; | |
634 | m88k) AC_DEFINE(M88KCOFF, 1, [Using m88k COFF?]) ;; | |
99ad8390 | 635 | x86_64) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;; |
252b5132 RH |
636 | esac |
637 | ;; | |
638 | esac | |
639 | ||
640 | # Getting this done right is going to be a bitch. Each configuration specified | |
7be1c489 AM |
641 | # with --enable-targets=... should be checked for environment, format, cpu |
642 | # setting. | |
252b5132 RH |
643 | # |
644 | # For each configuration, the necessary object file support code must be linked | |
645 | # in. This might be only one, it might be up to four. The necessary emulation | |
646 | # code needs to be provided, too. | |
647 | # | |
648 | # And then there's "--enable-targets=all".... | |
649 | # | |
e8044f35 | 650 | # For now, just always do it for MIPS ELF configurations. Sigh. |
252b5132 RH |
651 | |
652 | formats="${obj_format}" | |
653 | emfiles="" | |
654 | EMULATIONS="" | |
655 | GAS_UNIQ(emulations) | |
656 | for em in . $emulations ; do | |
657 | case $em in | |
658 | .) continue ;; | |
97238fbd | 659 | mipsbelf | mipslelf | mipself) |
252b5132 | 660 | fmt=elf file=mipself ;; |
0aa5d426 HPN |
661 | *coff) |
662 | fmt=coff file=$em ;; | |
663 | *aout) | |
664 | fmt=aout file=$em ;; | |
665 | *elf) | |
666 | fmt=elf file=$em ;; | |
252b5132 RH |
667 | esac |
668 | formats="$formats $fmt" | |
669 | emfiles="$emfiles e-$file.o" | |
670 | EMULATIONS="$EMULATIONS &$em," | |
671 | done | |
672 | GAS_UNIQ(formats) | |
673 | GAS_UNIQ(emfiles) | |
674 | if test `set . $formats ; shift ; echo $#` -gt 1 ; then | |
675 | for fmt in $formats ; do | |
676 | case $fmt in | |
677 | aout) AC_DEFINE(OBJ_MAYBE_AOUT, 1, [a.out support?]) ;; | |
678 | bout) AC_DEFINE(OBJ_MAYBE_BOUT, 1, [b.out support?]) ;; | |
679 | coff) AC_DEFINE(OBJ_MAYBE_COFF, 1, [COFF support?]) ;; | |
680 | ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF, 1, [ECOFF support?]) ;; | |
681 | elf) AC_DEFINE(OBJ_MAYBE_ELF, 1, [ELF support?]) ;; | |
682 | generic) AC_DEFINE(OBJ_MAYBE_GENERIC, 1, [generic support?]) ;; | |
252b5132 | 683 | som) AC_DEFINE(OBJ_MAYBE_SOM, 1, [SOM support?]) ;; |
252b5132 RH |
684 | esac |
685 | extra_objects="$extra_objects obj-$fmt.o" | |
686 | done | |
687 | obj_format=multi | |
688 | fi | |
689 | if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then | |
252b5132 | 690 | DEFAULT_EMULATION=`set . $emulations ; echo $2` |
e8044f35 | 691 | # e-mipself has more than one emulation per file, e-i386* has just one at the |
4ca72d38 AM |
692 | # moment. If only one emulation is specified, then don't define |
693 | # USE_EMULATIONS or include any of the e-files as they will only be bloat. | |
694 | case "${obj_format}${emfiles}" in | |
e8044f35 | 695 | multi* | *mipself*) |
4ca72d38 AM |
696 | extra_objects="$extra_objects $emfiles" |
697 | AC_DEFINE(USE_EMULATIONS, 1, [Use emulation support?]) ;; | |
698 | esac | |
252b5132 RH |
699 | fi |
700 | AC_SUBST(extra_objects) | |
701 | AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS, [Supported emulations.]) | |
702 | AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION", | |
703 | [Default emulation.]) | |
704 | ||
252b5132 RH |
705 | reject_dev_configs=yes |
706 | ||
707 | case ${reject_dev_configs}-${dev} in | |
708 | yes-yes) # Oops. | |
709 | AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.) | |
710 | ;; | |
711 | esac | |
712 | ||
713 | AC_SUBST(target_cpu_type) | |
714 | AC_SUBST(obj_format) | |
715 | AC_SUBST(te_file) | |
716 | AC_SUBST(install_tooldir) | |
717 | AC_SUBST(atof) | |
718 | dnl AC_SUBST(emulation) | |
719 | ||
252b5132 RH |
720 | # do we need the opcodes library? |
721 | case "${need_opcodes}" in | |
722 | yes) | |
723 | OPCODES_LIB=../opcodes/libopcodes.la | |
724 | ;; | |
725 | esac | |
726 | ||
252b5132 RH |
727 | AC_SUBST(OPCODES_LIB) |
728 | ||
252b5132 RH |
729 | AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}", [Target alias.]) |
730 | AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}", [Canonical target.]) | |
731 | AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", [Target CPU.]) | |
732 | AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}", [Target vendor.]) | |
733 | AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.]) | |
734 | ||
252b5132 RH |
735 | AC_PROG_YACC |
736 | AM_PROG_LEX | |
737 | ||
006ad0a1 | 738 | ALL_LINGUAS="fr tr es rw id ru fi ja" |
20e95c23 DJ |
739 | ZW_GNU_GETTEXT_SISTER_DIR |
740 | AM_PO_SUBDIRS | |
252b5132 RH |
741 | |
742 | AM_MAINTAINER_MODE | |
d5fbea21 | 743 | AM_CONDITIONAL(GENINSRC_NEVER, false) |
252b5132 RH |
744 | AC_EXEEXT |
745 | ||
58797674 | 746 | AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h errno.h sys/types.h limits.h locale.h time.h sys/stat.h) |
208a4923 | 747 | ACX_HEADER_STRING |
252b5132 RH |
748 | |
749 | # Put this here so that autoconf's "cross-compiling" message doesn't confuse | |
750 | # people who are not cross-compiling but are compiling cross-assemblers. | |
751 | AC_MSG_CHECKING(whether compiling a cross-assembler) | |
752 | if test "${host}" = "${target}"; then | |
753 | cross_gas=no | |
754 | else | |
755 | cross_gas=yes | |
756 | AC_DEFINE(CROSS_COMPILE, 1, [Compiling cross-assembler?]) | |
757 | fi | |
758 | AC_MSG_RESULT($cross_gas) | |
759 | ||
760 | dnl ansidecl.h will deal with const | |
da594c4a | 761 | dnl AC_C_CONST |
252b5132 RH |
762 | AC_FUNC_ALLOCA |
763 | AC_C_INLINE | |
764 | ||
765 | # VMS doesn't have unlink. | |
766 | AC_CHECK_FUNCS(unlink remove, break) | |
4b0296ce | 767 | AC_CHECK_FUNCS(sbrk setlocale) |
252b5132 | 768 | |
44350750 NC |
769 | AM_LC_MESSAGES |
770 | ||
39bec121 TW |
771 | # do we need the math library? |
772 | case "${need_libm}" in | |
12e64c2c | 773 | yes) |
da594c4a | 774 | LT_LIB_M |
39bec121 TW |
775 | AC_SUBST(LIBM) |
776 | ;; | |
777 | esac | |
778 | ||
252b5132 RH |
779 | # Some non-ANSI preprocessors botch requoting inside strings. That's bad |
780 | # enough, but on some of those systems, the assert macro relies on requoting | |
781 | # working properly! | |
782 | GAS_WORKING_ASSERT | |
783 | ||
784 | # On some systems, the system header files may not declare malloc, realloc, | |
785 | # and free. There are places where gas needs these functions to have been | |
786 | # declared -- such as when taking their addresses. | |
787 | gas_test_headers=" | |
788 | #ifdef HAVE_MEMORY_H | |
789 | #include <memory.h> | |
790 | #endif | |
791 | #ifdef HAVE_STRING_H | |
792 | #include <string.h> | |
793 | #else | |
794 | #ifdef HAVE_STRINGS_H | |
795 | #include <strings.h> | |
796 | #endif | |
797 | #endif | |
798 | #ifdef HAVE_STDLIB_H | |
799 | #include <stdlib.h> | |
800 | #endif | |
801 | #ifdef HAVE_UNISTD_H | |
802 | #include <unistd.h> | |
803 | #endif | |
804 | " | |
252b5132 RH |
805 | |
806 | # Does errno.h declare errno, or do we have to add a separate declaration | |
807 | # for it? | |
808 | GAS_CHECK_DECL_NEEDED(errno, f, int f, [ | |
809 | #ifdef HAVE_ERRNO_H | |
810 | #include <errno.h> | |
811 | #endif | |
812 | ]) | |
813 | ||
56f36663 NC |
814 | AC_MSG_CHECKING(for a known getopt prototype in unistd.h) |
815 | AC_CACHE_VAL(gas_cv_decl_getopt_unistd_h, | |
da594c4a | 816 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])], |
56f36663 NC |
817 | gas_cv_decl_getopt_unistd_h=yes, gas_cv_decl_getopt_unistd_h=no)]) |
818 | AC_MSG_RESULT($gas_cv_decl_getopt_unistd_h) | |
819 | if test $gas_cv_decl_getopt_unistd_h = yes; then | |
820 | AC_DEFINE([HAVE_DECL_GETOPT], 1, | |
821 | [Is the prototype for getopt in <unistd.h> in the expected format?]) | |
822 | fi | |
823 | ||
e8a38df5 AL |
824 | GAS_CHECK_DECL_NEEDED(environ, f, char **f, $gas_test_headers) |
825 | GAS_CHECK_DECL_NEEDED(ffs, f, int (*f)(int), $gas_test_headers) | |
826 | GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers) | |
827 | GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers) | |
828 | GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers) | |
829 | GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers) | |
830 | ||
2a7f4fa9 | 831 | AC_CHECK_DECLS([free, getenv, malloc, mempcpy, realloc, stpcpy, strstr, vsnprintf, asprintf]) |
6d74f28b | 832 | |
c973bc5c NC |
833 | BFD_BINARY_FOPEN |
834 | ||
543b7933 L |
835 | # Link in zlib if we can. This allows us to write compressed debug sections. |
836 | AM_ZLIB | |
0acf065b | 837 | |
b11d79f2 TG |
838 | # Support for VMS timestamps via cross compile |
839 | ||
840 | if test "$ac_cv_header_time_h" = yes; then | |
841 | GAS_HAVE_TIME_TYPE_MEMBER(struct tm, tm_gmtoff) | |
842 | fi | |
843 | ||
844 | if test "$ac_cv_header_sys_stat_h" = yes; then | |
845 | GAS_HAVE_SYS_STAT_TYPE_MEMBER(struct stat, st_mtim, tv_sec) | |
846 | GAS_HAVE_SYS_STAT_TYPE_MEMBER(struct stat, st_mtim, tv_nsec) | |
847 | fi | |
848 | ||
849 | ||
31dd3154 | 850 | dnl Required for html, pdf, install-pdf and install-html targets. |
108a6f8e CD |
851 | AC_SUBST(datarootdir) |
852 | AC_SUBST(docdir) | |
853 | AC_SUBST(htmldir) | |
31dd3154 | 854 | AC_SUBST(pdfdir) |
108a6f8e | 855 | |
252b5132 RH |
856 | dnl This must come last. |
857 | ||
858 | dnl We used to make symlinks to files in the source directory, but now | |
859 | dnl we just use the right name for .c files, and create .h files in | |
860 | dnl the build directory which include the right .h file. Make sure | |
861 | dnl the old symlinks don't exist, so that a reconfigure in an existing | |
862 | dnl directory behaves reasonably. | |
863 | ||
13b2be9c DJ |
864 | AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in) |
865 | AC_CONFIG_COMMANDS([default], | |
252b5132 RH |
866 | [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h |
867 | echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h | |
868 | echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h | |
869 | echo '#include "te-'"${te_file}"'.h"' > targ-env.h | |
870 | echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h | |
871 | if test "x$cgen_cpu_prefix" != x ; then | |
872 | echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h | |
20e95c23 | 873 | fi], |
252b5132 RH |
874 | [target_cpu_type=${target_cpu_type} |
875 | cgen_cpu_prefix=${cgen_cpu_prefix} | |
876 | obj_format=${obj_format} | |
877 | te_file=${te_file}]) | |
13b2be9c DJ |
878 | |
879 | AC_OUTPUT |