mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
fbaf61ad52
We have not only removed all unsupported and obsolete code, but also supported lost of new features, including better link-time relaxations and TLS implementations. Besides, the files generated by the newly assembler and linker usually get higher performance and more optimized code size. ld * emultempl/nds32elf.em (hyper_relax): New variable. (nds32_elf_create_output_section_statements): the parameters of bfd_elf32_nds32_set_target_option (PARSE_AND_LIST_PROLOGUE, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Add new option --mhyper-relax. * emultempl/nds32elf.em (nds32_elf_after_open): Updated. * emultempl/nds32elf.em (tls_desc_trampoline): New variable. * (nds32_elf_create_output_section_statements): Updated. * (nds32_elf_after_parse): Disable relaxations when PIC is enable. * (PARSE_AND_LIST_PROLOGUE, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Add new option --m[no-]tlsdesc-trampoline. include * elf/nds32.h: Remove the unused target features. * dis-asm.h (disassemble_init_nds32): Declared. * elf/nds32.h (E_NDS32_NULL): Removed. (E_NDS32_HAS_DSP_INST, E_NDS32_HAS_ZOL): New. * opcode/nds32.h: Ident. (N32_SUB6, INSN_LW): New macros. (enum n32_opcodes): Updated. * elf/nds32.h: Doc fixes. * elf/nds32.h: Add R_NDS32_LSI. * elf/nds32.h: Add new relocations for TLS. gas * config/tc-nds32.c: Remove the unused target features. (nds32_relax_relocs, md_pseudo_table, nds32_elf_record_fixup_exp, nds32_set_elf_flags_by_insn, nds32_insert_relax_entry, nds32_apply_fix): Likewise. (nds32_no_ex9_begin): Removed. * config/tc-nds32.c (add_mapping_symbol_for_align, make_mapping_symbol, add_mapping_symbol): New functions. * config/tc-nds32.h (enum mstate): New. (nds32_segment_info_type): Likewise. * configure.ac (--enable-dsp-ext, --enable-zol-ext): New options. * config.in: Regenerated. * configure: Regenerated. * config/tc-nds32.c (nds32_dx_regs): Set the value according to the configuration. (nds32_perf_ext, nds32_perf_ext2, nds32_string_ext, nds32_audio_ext): Likewise. (nds32_dsp_ext): New variable. Set the value according to the configuration. (nds32_zol_ext): Likewise. (asm_desc, nds32_pseudo_opcode_table): Make them static. (nds32_set_elf_flags_by_insn): Updated. (nds32_check_insn_available): Updated. (nds32_str_tolower): New function. * config/tc-nds32.c (relax_table): Updated. (md_begin): Updated. (md_assemble): Use XNEW macro to allocate space for `insn.info', and then remember to free it. (md_section_align): Cast (-1) to ValueT. (nds32_get_align): Cast (~0U) to addressT. (nds32_relax_branch_instructions): Updated. (md_convert_frag): Add new local variable `final_r_type'. (invalid_prev_frag): Add new bfd_boolean parameter `relax'. All callers changed. * config/tc-nds32.c (struct nds32_relocs_pattern): Add `insn' field. (struct nds32_hint_map): Add `option_list' field. (struct suffix_name, suffix_table): Remove the unused `pic' field. (do_pseudo_b, do_pseudo_bal): Remove the suffix checking. (do_pseudo_la_internal, do_pseudo_pushpopm): Indent. (relax_hint_bias, relax_hint_id_current): New static variables. (reset_bias, relax_hint_begin): New variables. (nds_itoa): New function. (CLEAN_REG, GET_OPCODE): New macros. (struct relax_hint_id): New. (nds32_relax_hint): For .relax_hint directive, we can use `begin' and `end' to mark the relax pattern without giving exactly id number. (nds32_elf_append_relax_relocs): Handle the case that the .relax_hint directives are attached to pseudo instruction. (nds32_elf_save_pseudo_pattern): Change the second parameter from instruction's opcode to byte code. (nds32_elf_build_relax_relation): Add new bfd_boolean parameter `pseudo_hint'. (nds32_lookup_pseudo_opcode): Fix the overflow issue. (enum nds32_insn_type): Add N32_RELAX_ALU1 and N32_RELAX_16BIT. (nds32_elf_record_fixup_exp, relax_ls_table, hint_map, nds32_find_reloc_table, nds32_match_hint_insn, nds32_parse_name): Updated. * config/tc-nds32.h (MAX_RELAX_NUM): Extend it to 6. (enum nds32_relax_hint_type): Merge NDS32_RELAX_HINT_LA and NDS32_RELAX_HINT_LS into NDS32_RELAX_HINT_LALS. Add NDS32_RELAX_HINT_LA_PLT, NDS32_RELAX_HINT_LA_GOT and NDS32_RELAX_HINT_LA_GOTOFF. * config/tc-nds32.h (relax_ls_table): Add floating load/store to gp relax pattern. (hint_map, nds32_find_reloc_table): Likewise. * configure.ac: Define NDS32_LINUX_TOOLCHAIN. * configure: Regenerated. * config.in: Regenerated. * config/tc-nds32.h (enum nds32_ramp): Updated. (enum nds32_relax_hint_type): Likewise. * config/tc-nds32.c: Include "errno.h" and "limits.h". (relax_ls_table): Add TLS relax patterns. (nds32_elf_append_relax_relocs): Attach BFD_RELOC_NDS32_GROUP on each instructions of TLS patterns. (nds32_elf_record_fixup_exp): Updated. (nds32_apply_fix): Likewise. (suffix_table): Add TLSDESC suffix. binutils* testsuite/binutils-all/objcopy.exp: Set the unsupported reloc number from 215 to 255 for NDS32. bfd * elf32-nds32.c (nds32_elf_relax_loadstore): Remove the unused target features. (bfd_elf32_nds32_set_target_option): Remove the unused parameters. (nds32_elf_relax_piclo12, nds32_elf_relax_letlslo12, nds32_elf_relax_letlsadd, nds32_elf_relax_letlsls, nds32_elf_relax_pltgot_suff, nds32_elf_relax_got_suff nds32_elf_relax_gotoff_suff, calculate_plt_memory_address, calculate_plt_offset, calculate_got_memory_address, nds32_elf_check_dup_relocs): Removed. All callers changed. * elf32-nds32.h: Remove the unused macros and defines. (elf_nds32_link_hash_table): Remove the unused variable. (bfd_elf32_nds32_set_target_option): Update prototype. (nds32_elf_ex9_init): Removed. * elf32-nds32.c (nds32_convert_32_to_16): Updated. * elf32-nds32.c (HOWTO2, HOWTO3): Define new HOWTO macros to initialize array nds32_elf_howto_table in any order without lots of EMPTY_HOWTO. (nds32_reloc_map): Updated. * reloc.c: Add BFD_RELOC_NDS32_LSI. * bfd-in2.h: Regenerated. * bfd/libbfd.h: Regenerated. * elf32-nds32.c (nds32_elf_relax_howto_table): Add R_NDS32_LSI. (nds32_reloc_map): Likewise. (nds32_elf_relax_flsi): New function. (nds32_elf_relax_section): Support floating load/store relaxation. * elf32-nds32.c (NDS32_GUARD_SEC_P, elf32_nds32_local_gp_offset): New macro. (struct elf_nds32_link_hash_entry): New `offset_to_gp' field. (struct elf_nds32_obj_tdata): New `offset_to_gp' and `hdr_size' fields. (elf32_nds32_allocate_local_sym_info, nds32_elf_relax_guard, nds32_elf_is_target_special_symbol, nds32_elf_maybe_function_sym): New functions. (nds32_info_to_howto_rel): Add BFD_ASSERT. (bfd_elf32_bfd_reloc_type_table_lookup, nds32_elf_link_hash_newfunc, nds32_elf_link_hash_table_create, nds32_elf_relocate_section, nds32_elf_relax_loadstore, nds32_elf_relax_lo12, nds32_relax_adjust_label, bfd_elf32_nds32_set_target_option, nds32_fag_mark_relax): Updated. (nds32_elf_final_sda_base): Improve it to find the better gp value. (insert_nds32_elf_blank): Must consider `len' when inserting blanks. * elf32-nds32.h (bfd_elf32_nds32_set_target_option): Update prototype. (struct elf_nds32_link_hash_table): Add new variable `hyper_relax'. * elf32-nds32.c (elf32_nds32_allocate_dynrelocs): New function. (create_got_section): Likewise. (allocate_dynrelocs, nds32_elf_size_dynamic_sections, nds32_elf_relocate_section, nds32_elf_finish_dynamic_symbol): Updated. (nds32_elf_check_relocs): Fix the issue that the shared library may has TEXTREL entry in the dynamic section. (nds32_elf_create_dynamic_sections): Enable to call readonly_dynrelocs since the TEXTREL issue is fixed in the nds32_elf_check_relocs. (nds32_elf_finish_dynamic_sections): Update and add DT_RELASZ dynamic entry. (calculate_offset): Remove the unused parameter `pic_ext_target' and related codes. All callers changed. (elf_backend_dtrel_excludes_plt): Disable it temporarily since it will cause some errors for our test cases. * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Allow to link the generic object. * reloc.c: Add TLS relocations. * libbfd.h: Regenerated. * bfd-in2.h: Regenerated. * elf32-nds32.h (struct section_id_list_t): New. (elf32_nds32_lookup_section_id, elf32_nds32_check_relax_group, elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model): New prototypes. (elf32_nds32_compute_jump_table_size, elf32_nds32_local_tlsdesc_gotent): New macro. (nds32_insertion_sort, bfd_elf32_nds32_set_target_option, elf_nds32_link_hash_table): Updated. * elf32-nds32.c (enum elf_nds32_tls_type): New. (struct elf32_nds32_relax_group_t, struct relax_group_list_t): New. (elf32_nds32_add_dynreloc, patch_tls_desc_to_ie, get_tls_type, fls, ones32, list_insert, list_insert_sibling, dump_chain, elf32_nds32_check_relax_group, elf32_nds32_lookup_section_id, elf32_nds32_unify_relax_group, nds32_elf_unify_tls_model): New functions. (elf_nds32_obj_tdata): Add new fields. (elf32_nds32_relax_group_ptr, nds32_elf_local_tlsdesc_gotent): New macros. (nds32_elf_howto_table): Add TLS relocations. (nds32_reloc_map): Likewise. (nds32_elf_copy_indirect_symbol, nds32_elf_size_dynamic_sections, nds32_elf_finish_dynamic_symbol, elf32_nds32_allocate_local_sym_info, nds32_elf_relocate_section, bfd_elf32_nds32_set_target_option, nds32_elf_check_relocs, allocate_dynrelocs): Updated. (nds32_elf_relax_section): Call nds32_elf_unify_tls_model. (dtpoff_base): Rename it to `gottpof' and then update it. opcodes * nds32-asm.c (operand_fields): Remove the unused fields. (nds32_opcodes): Remove the unused instructions. * nds32-dis.c (nds32_ex9_info): Removed. (nds32_parse_opcode): Updated. (print_insn_nds32): Likewise. * nds32-asm.c (config.h, stdlib.h, string.h): New includes. (LEX_SET_FIELD, LEX_GET_FIELD): Update defines. (nds32_asm_init, build_operand_hash_table, build_keyword_hash_table, build_opcode_hash_table): New functions. (nds32_keyword_table, nds32_keyword_count_table, nds32_field_table, nds32_opcode_table): New. (hw_ktabs): Declare it to a pointer rather than an array. (build_hash_table): Removed. * nds32-asm.h (enum): Add SYN_INPUT, SYN_OUTPUT, SYN_LOPT, SYN_ROPT and upadte HW_GPR and HW_INT. * nds32-dis.c (keywords): Remove const. (match_field): New function. (nds32_parse_opcode): Updated. * disassemble.c (disassemble_init_for_target): Add disassemble_init_nds32. * nds32-dis.c (eum map_type): New. (nds32_private_data): Likewise. (get_mapping_symbol_type, is_mapping_symbol, nds32_symbol_is_valid, nds32_add_opcode_hash_table, disassemble_init_nds32): New functions. (print_insn_nds32): Updated. * nds32-asm.c (parse_aext_reg): Add new parameter. (parse_re, parse_re2, parse_aext_reg): Only reduced registers are allowed to use. All callers changed. * nds32-asm.c (keyword_usr, keyword_sr): Updated. (operand_fields): Add new fields. (nds32_opcodes): Add new instructions. (keyword_aridxi_mx): New keyword. * nds32-asm.h (enum): Add NASM_ATTR_DSP_ISAEXT, HW_AEXT_ARIDXI_MX and NASM_ATTR_ZOL. (ALU2_1, ALU2_2, ALU2_3): New macros. * nds32-dis.c (nds32_filter_unknown_insn): Updated.
993 lines
27 KiB
Plaintext
993 lines
27 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
dnl
|
|
dnl And be careful when changing it! If you must add tests with square
|
|
dnl brackets, be sure changequote invocations surround it.
|
|
dnl
|
|
dnl Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
|
dnl
|
|
dnl This file is free software; you can redistribute it and/or modify
|
|
dnl it under the terms of the GNU General Public License as published by
|
|
dnl the Free Software Foundation; either version 3 of the License, or
|
|
dnl (at your option) any later version.
|
|
dnl
|
|
dnl This program is distributed in the hope that it will be useful,
|
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
dnl GNU General Public License for more details.
|
|
dnl
|
|
dnl You should have received a copy of the GNU General Public License
|
|
dnl along with this program; see the file COPYING3. If not see
|
|
dnl <http://www.gnu.org/licenses/>.
|
|
dnl
|
|
dnl v2.5 needed for --bindir et al
|
|
m4_include([../bfd/version.m4])
|
|
AC_INIT([gas], BFD_VERSION)
|
|
AC_CONFIG_SRCDIR(as.h)
|
|
|
|
dnl Autoconf 2.57 will find the aux dir without this. However, unless
|
|
dnl we specify this explicitly, automake-1.7 will assume that ylwrap is in
|
|
dnl gas/ instead of gas/../.
|
|
AC_CONFIG_AUX_DIR(..)
|
|
AC_CANONICAL_TARGET
|
|
AC_ISC_POSIX
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AC_PROG_CC
|
|
AC_GNU_SOURCE
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
LT_INIT
|
|
ACX_LARGEFILE
|
|
ACX_PROG_CMP_IGNORE_INITIAL
|
|
|
|
AC_ARG_ENABLE(targets,
|
|
[ --enable-targets alternative target configurations besides the primary],
|
|
[case "${enableval}" in
|
|
yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
|
|
;;
|
|
no) enable_targets= ;;
|
|
*) enable_targets=$enableval ;;
|
|
esac])dnl
|
|
|
|
ac_checking=yes
|
|
if grep '^RELEASE=y' ${srcdir}/../bfd/Makefile.am >/dev/null 2>/dev/null ; then
|
|
ac_checking=
|
|
fi
|
|
AC_ARG_ENABLE(checking,
|
|
[ --enable-checking enable run-time checks],
|
|
[case "${enableval}" in
|
|
no|none) ac_checking= ;;
|
|
*) ac_checking=yes ;;
|
|
esac])dnl
|
|
if test x$ac_checking != x ; then
|
|
AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.])
|
|
fi
|
|
|
|
# PR gas/19109
|
|
# Decide the default method for compressing debug sections.
|
|
ac_default_compressed_debug_sections=unset
|
|
# Provide a configure time option to override our default.
|
|
AC_ARG_ENABLE(compressed_debug_sections,
|
|
AS_HELP_STRING([--enable-compressed-debug-sections={all,gas,none}],
|
|
[compress debug sections by default]),
|
|
[case ,"${enableval}", in
|
|
,yes, | ,all, | *,gas,*) ac_default_compressed_debug_sections=yes ;;
|
|
,no, | ,none,) ac_default_compressed_debug_sections=no ;;
|
|
*) ac_default_compressed_debug_sections=unset ;;
|
|
esac])dnl
|
|
|
|
# PR gas/19520
|
|
# Decide if x86 assembler should generate relax relocations.
|
|
ac_default_x86_relax_relocations=unset
|
|
# Provide a configure time option to override our default.
|
|
AC_ARG_ENABLE(x86_relax_relocations,
|
|
AS_HELP_STRING([--enable-x86-relax-relocations],
|
|
[generate x86 relax relocations by default]),
|
|
[case "${enableval}" in
|
|
no) ac_default_x86_relax_relocations=0 ;;
|
|
esac])dnl
|
|
|
|
# Decide if ELF assembler should generate common symbols with the
|
|
# STT_COMMON type.
|
|
ac_default_elf_stt_common=unset
|
|
# Provide a configure time option to override our default.
|
|
AC_ARG_ENABLE(elf_stt_common,
|
|
AS_HELP_STRING([--enable-elf-stt-common],
|
|
[generate ELF common symbols with STT_COMMON type by default]),
|
|
[case "${enableval}" in
|
|
yes) ac_default_elf_stt_common=1 ;;
|
|
esac])dnl
|
|
|
|
|
|
# Decide if the ELF assembler should default to generating
|
|
# GNU Build notes if none are provided by the input.
|
|
ac_default_generate_build_notes=0
|
|
# Provide a configuration option to override the default.
|
|
AC_ARG_ENABLE(generate_build_notes,
|
|
AS_HELP_STRING([--enable-generate-build-notes],
|
|
[generate GNU Build notes if none are provided by the input]),
|
|
[case "${enableval}" in
|
|
yes) ac_default_generate_build_notes=1 ;;
|
|
no) ac_default_generate_build_notes=0 ;;
|
|
esac])dnl
|
|
|
|
|
|
# Decide if the x86 ELF assembler should default to generating GNU x86
|
|
# used ISA and feature properties.
|
|
ac_default_generate_x86_used_note=unset
|
|
# Provide a configuration option to override the default.
|
|
AC_ARG_ENABLE(x86-used-note,
|
|
AS_HELP_STRING([--enable-x86-used-note],
|
|
[generate GNU x86 used ISA and feature properties]),
|
|
[case "${enableval}" in
|
|
yes) ac_default_generate_x86_used_note=1 ;;
|
|
no) ac_default_generate_x86_used_note=0 ;;
|
|
esac])dnl
|
|
|
|
|
|
using_cgen=no
|
|
|
|
AM_BINUTILS_WARNINGS
|
|
|
|
# Generate a header file
|
|
AC_CONFIG_HEADERS(config.h:config.in)
|
|
|
|
dnl Option --with-cpu=TYPE allows configure type control of the default
|
|
dnl cpu type within the assembler. Currently only the ARC target
|
|
dnl supports this feature, but others may be added in the future.
|
|
AC_ARG_WITH(cpu,
|
|
AS_HELP_STRING([--with-cpu=CPU],
|
|
[default cpu variant is CPU (currently only supported on ARC)]),
|
|
[AC_DEFINE_UNQUOTED(TARGET_WITH_CPU,
|
|
"${with_cpu}",
|
|
[Target specific CPU.])],
|
|
[])
|
|
|
|
# PR 14072
|
|
AH_VERBATIM([00_CONFIG_H_CHECK],
|
|
[/* Check that config.h is #included before system headers
|
|
(this works only for glibc, but that should be enough). */
|
|
#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
|
|
# error config.h must be #included before system headers
|
|
#endif
|
|
#define __CONFIG_H__ 1])
|
|
|
|
# If we are on a DOS filesystem, we must use gdb.ini rather than
|
|
# .gdbinit.
|
|
case "${host}" in
|
|
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-windows*)
|
|
GDBINIT="gdb.ini"
|
|
AC_CONFIG_FILES(gdb.ini:gdbinit.in)
|
|
;;
|
|
*)
|
|
GDBINIT=".gdbinit"
|
|
AC_CONFIG_FILES(.gdbinit:gdbinit.in)
|
|
;;
|
|
esac
|
|
AC_SUBST(GDBINIT)
|
|
|
|
#We need this for the host.
|
|
AC_C_BIGENDIAN
|
|
|
|
te_file=generic
|
|
|
|
# Makefile target for installing gas in $(tooldir)/bin.
|
|
install_tooldir=install-exec-tooldir
|
|
|
|
canon_targets=""
|
|
all_targets=no
|
|
if test -n "$enable_targets" ; then
|
|
for t in `echo $enable_targets | sed 's/,/ /g'`; do
|
|
if test $t = "all"; then
|
|
all_targets=yes
|
|
continue
|
|
fi
|
|
result=`$ac_config_sub $t 2>/dev/null`
|
|
if test -n "$result" ; then
|
|
canon_targets="$canon_targets $result"
|
|
# else
|
|
# # Permit "all", etc. We don't support it yet though.
|
|
# canon_targets="$canon_targets $t"
|
|
fi
|
|
done
|
|
GAS_UNIQ(canon_targets)
|
|
fi
|
|
|
|
emulations=""
|
|
|
|
for this_target in $target $canon_targets ; do
|
|
|
|
targ=${this_target}
|
|
. ${srcdir}/configure.tgt
|
|
|
|
case ${target_cpu} in
|
|
crisv32)
|
|
AC_DEFINE_UNQUOTED(DEFAULT_CRIS_ARCH, $arch,
|
|
[Default CRIS architecture.])
|
|
;;
|
|
esac
|
|
|
|
if test ${this_target} = $target ; then
|
|
target_cpu_type=${cpu_type}
|
|
elif test ${target_cpu_type} != ${cpu_type} ; then
|
|
continue
|
|
fi
|
|
|
|
generic_target=${cpu_type}-${target_vendor}-${target_os}
|
|
case ${generic_target} in
|
|
i386-*-msdosdjgpp* \
|
|
| i386-*-go32* \
|
|
| i386-go32-rtems*)
|
|
AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?])
|
|
;;
|
|
|
|
i386-*-solaris2 \
|
|
| x86_64-*-solaris2 \
|
|
| i386-*-solaris2.[[0-9]] \
|
|
| i386-*-solaris2.1[[01]] \
|
|
| x86_64-*-solaris2.1[[01]])
|
|
if test ${this_target} = $target \
|
|
&& test ${ac_default_x86_relax_relocations} = unset; then
|
|
ac_default_x86_relax_relocations=0
|
|
fi
|
|
;;
|
|
|
|
microblaze*)
|
|
;;
|
|
|
|
changequote(,)dnl
|
|
ppc-*-aix[5-9].*)
|
|
changequote([,])dnl
|
|
AC_DEFINE(AIX_WEAK_SUPPORT, 1,
|
|
[Define if using AIX 5.2 value for C_WEAKEXT.])
|
|
;;
|
|
ppc-*-solaris*)
|
|
if test ${this_target} = $target; then
|
|
AC_DEFINE(TARGET_SOLARIS_COMMENT, 1,
|
|
[Define if default target is PowerPC Solaris.])
|
|
fi
|
|
if test x${endian} = xbig; then
|
|
AC_MSG_ERROR(Solaris must be configured little endian)
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
if test ${this_target} = $target ; then
|
|
endian_def=
|
|
if test x${endian} = xbig; then
|
|
endian_def=1
|
|
elif test x${endian} = xlittle; then
|
|
endian_def=0
|
|
fi
|
|
if test x${endian_def} != x; then
|
|
AC_DEFINE_UNQUOTED(TARGET_BYTES_BIG_ENDIAN, $endian_def,
|
|
[Define as 1 if big endian.])
|
|
fi
|
|
fi
|
|
|
|
# Other random stuff.
|
|
|
|
case ${cpu_type} in
|
|
mips)
|
|
# Set mips_cpu to the name of the default CPU.
|
|
case ${target_cpu} in
|
|
mips | mipsbe | mipseb | mipsle | mipsel | mips64 | mips64el)
|
|
mips_cpu=from-abi
|
|
;;
|
|
mipsisa32 | mipsisa32el)
|
|
mips_cpu=mips32
|
|
;;
|
|
mipsisa32r2 | mipsisa32r2el)
|
|
mips_cpu=mips32r2
|
|
;;
|
|
mipsisa32r3 | mipsisa32r3el)
|
|
mips_cpu=mips32r3
|
|
;;
|
|
mipsisa32r5 | mipsisa32r5el)
|
|
mips_cpu=mips32r5
|
|
;;
|
|
mipsisa32r6 | mipsisa32r6el)
|
|
mips_cpu=mips32r6
|
|
;;
|
|
mipsisa64 | mipsisa64el)
|
|
mips_cpu=mips64
|
|
;;
|
|
mipsisa64r2 | mipsisa64r2el)
|
|
mips_cpu=mips64r2
|
|
;;
|
|
mipsisa64r3 | mipsisa64r3el)
|
|
mips_cpu=mips64r3
|
|
;;
|
|
mipsisa64r5 | mipsisa64r5el)
|
|
mips_cpu=mips64r5
|
|
;;
|
|
mipsisa64r6 | mipsisa64r6el)
|
|
mips_cpu=mips64r6
|
|
;;
|
|
mipstx39 | mipstx39el)
|
|
mips_cpu=r3900
|
|
;;
|
|
mips64vr | mips64vrel)
|
|
mips_cpu=vr4100
|
|
;;
|
|
mipsisa32r2* | mipsisa64r2*)
|
|
changequote(,)dnl
|
|
mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'`
|
|
changequote([,])dnl
|
|
;;
|
|
mipsisa32r6* | mipsisa64r6*)
|
|
changequote(,)dnl
|
|
mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r6//' -e 's/el$//'`
|
|
changequote([,])dnl
|
|
;;
|
|
mips64* | mipsisa64* | mipsisa32*)
|
|
changequote(,)dnl
|
|
mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..//' -e 's/el$//'`
|
|
changequote([,])dnl
|
|
;;
|
|
mips*)
|
|
changequote(,)dnl
|
|
mips_cpu=`echo $target_cpu | sed -e 's/^mips//' -e 's/el$//'`
|
|
changequote([,])dnl
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR($target_cpu isn't a supported MIPS CPU name)
|
|
;;
|
|
esac
|
|
# See whether it's appropriate to set E_MIPS_ABI_O32 for o32
|
|
# binaries. It's a GNU extension that some OSes don't understand.
|
|
case ${target} in
|
|
*-*-irix*)
|
|
use_e_mips_abi_o32=0
|
|
;;
|
|
*)
|
|
use_e_mips_abi_o32=1
|
|
;;
|
|
esac
|
|
# Decide whether to generate 32-bit or 64-bit code by default.
|
|
# Used to resolve -march=from-abi when an embedded ABI is selected.
|
|
case ${target} in
|
|
mips64*-*-* | mipsisa64*-*-*)
|
|
mips_default_64bit=1
|
|
;;
|
|
*)
|
|
mips_default_64bit=0
|
|
;;
|
|
esac
|
|
# Decide which ABI to target by default.
|
|
case ${target} in
|
|
mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
|
|
| mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
|
|
mips_default_abi=N32_ABI
|
|
;;
|
|
mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
|
|
mips_default_abi=O32_ABI
|
|
;;
|
|
mips64*-openbsd*)
|
|
mips_default_abi=N64_ABI
|
|
;;
|
|
*)
|
|
mips_default_abi=NO_ABI
|
|
;;
|
|
esac
|
|
AC_DEFINE_UNQUOTED(MIPS_CPU_STRING_DEFAULT, "$mips_cpu",
|
|
[Default CPU for MIPS targets. ])
|
|
AC_DEFINE_UNQUOTED(USE_E_MIPS_ABI_O32, $use_e_mips_abi_o32,
|
|
[Allow use of E_MIPS_ABI_O32 on MIPS targets. ])
|
|
AC_DEFINE_UNQUOTED(MIPS_DEFAULT_64BIT, $mips_default_64bit,
|
|
[Generate 64-bit code by default on MIPS targets. ])
|
|
AC_DEFINE_UNQUOTED(MIPS_DEFAULT_ABI, $mips_default_abi,
|
|
[Choose a default ABI for MIPS targets. ])
|
|
;;
|
|
esac
|
|
|
|
# Do we need the opcodes library?
|
|
case ${cpu_type} in
|
|
vax | tic30)
|
|
;;
|
|
|
|
*)
|
|
need_opcodes=yes
|
|
|
|
case "${enable_shared}" in
|
|
yes) shared_opcodes=true ;;
|
|
*opcodes*) shared_opcodes=true ;;
|
|
*) shared_opcodes=false ;;
|
|
esac
|
|
;;
|
|
esac
|
|
|
|
# Any other special object files needed ?
|
|
case ${cpu_type} in
|
|
|
|
bfin)
|
|
for f in bfin-parse.o bfin-lex-wrapper.o; do
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac
|
|
done
|
|
;;
|
|
|
|
epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | or1k)
|
|
using_cgen=yes
|
|
;;
|
|
|
|
m32c)
|
|
using_cgen=yes
|
|
;;
|
|
frv)
|
|
using_cgen=yes
|
|
;;
|
|
m68k)
|
|
f=m68k-parse.o
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac
|
|
;;
|
|
|
|
mep)
|
|
using_cgen=yes
|
|
;;
|
|
|
|
mips)
|
|
for f in itbl-parse.o itbl-lex-wrapper.o itbl-ops.o; do
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac
|
|
done
|
|
;;
|
|
|
|
mt)
|
|
using_cgen=yes
|
|
;;
|
|
|
|
nds32)
|
|
# setup NDS32_LINUX_TOOLCHAIN definition
|
|
if test "linux" = $em; then
|
|
AC_DEFINE(NDS32_LINUX_TOOLCHAIN, 1,
|
|
[Define value for nds32_linux_toolchain])
|
|
else
|
|
AC_DEFINE(NDS32_LINUX_TOOLCHAIN, 0,
|
|
[Define default value for nds32_linux_toolchain])
|
|
fi
|
|
|
|
# Decide BASELINE, REDUCED_REGS, FPU_DP_EXT, FPU_SP_EXT features
|
|
# based on arch_name.
|
|
AC_MSG_CHECKING(for default configuration of --with-arch)
|
|
if test "x${with_arch}" != x; then
|
|
case ${with_arch} in
|
|
v2j | v2s | v2f | v2 | v3m | v3j | v3s | v3f | v3 )
|
|
AC_DEFINE_UNQUOTED(NDS32_DEFAULT_ARCH_NAME, "$with_arch",
|
|
[Define value for nds32_arch_name])
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR(This kind of arch name does *NOT* exist!)
|
|
;;
|
|
esac
|
|
fi
|
|
AC_MSG_RESULT($with_arch)
|
|
|
|
# Decide features one by one.
|
|
AC_MSG_CHECKING(for default configuration of --enable-dx-regs)
|
|
if test "x${enable_dx_regs}" = xyes; then
|
|
AC_DEFINE(NDS32_DEFAULT_DX_REGS, 1,
|
|
[Define value for nds32_dx_regs])
|
|
else
|
|
AC_DEFINE(NDS32_DEFAULT_DX_REGS, 0,
|
|
[Define default value for nds32_dx_regs])
|
|
fi
|
|
AC_MSG_RESULT($enable_dx_regs)
|
|
|
|
AC_MSG_CHECKING(for default configuration of --enable-perf-ext)
|
|
if test "x${enable_perf_ext}" = xno; then
|
|
AC_DEFINE(NDS32_DEFAULT_PERF_EXT, 0,
|
|
[Define value for nds32_perf_ext])
|
|
else
|
|
AC_DEFINE(NDS32_DEFAULT_PERF_EXT, 1,
|
|
[Define default value for nds32_perf_ext])
|
|
fi
|
|
AC_MSG_RESULT($enable_perf_ext)
|
|
|
|
AC_MSG_CHECKING(for default configuration of --enable-perf-ext2)
|
|
if test "x${enable_perf_ext2}" = xno; then
|
|
AC_DEFINE(NDS32_DEFAULT_PERF_EXT2, 0,
|
|
[Define value for nds32_perf_ext2])
|
|
else
|
|
AC_DEFINE(NDS32_DEFAULT_PERF_EXT2, 1,
|
|
[Define default value for nds32_perf_ext2])
|
|
fi
|
|
AC_MSG_RESULT($enable_perf_ext2)
|
|
|
|
AC_MSG_CHECKING(for default configuration of --enable-string-ext)
|
|
if test "x${enable_string_ext}" = xno; then
|
|
AC_DEFINE(NDS32_DEFAULT_STRING_EXT, 0,
|
|
[Define value for nds32_string_ext])
|
|
else
|
|
AC_DEFINE(NDS32_DEFAULT_STRING_EXT, 1,
|
|
[Define default value for nds32_string_ext])
|
|
fi
|
|
AC_MSG_RESULT($enable_string_ext)
|
|
|
|
AC_MSG_CHECKING(for default configuration of --enable-audio-ext)
|
|
if test "x${enable_audio_ext}" = xno; then
|
|
AC_DEFINE(NDS32_DEFAULT_AUDIO_EXT, 0,
|
|
[Define value for nds32_audio_ext])
|
|
else
|
|
AC_DEFINE(NDS32_DEFAULT_AUDIO_EXT, 1,
|
|
[Define default value for nds32_audio_ext])
|
|
fi
|
|
AC_MSG_RESULT($enable_audio_ext)
|
|
|
|
AC_MSG_CHECKING(for default configuration of --enable-dsp-ext)
|
|
if test "x${enable_dsp_ext}" = xno; then
|
|
AC_DEFINE(NDS32_DEFAULT_DSP_EXT, 0,
|
|
[Define value for nds32_dsp_ext])
|
|
else
|
|
AC_DEFINE(NDS32_DEFAULT_DSP_EXT, 1,
|
|
[Define default value for nds32_dsp_ext])
|
|
fi
|
|
AC_MSG_RESULT($enable_dsp_ext)
|
|
|
|
AC_MSG_CHECKING(for default configuration of --enable-zol-ext)
|
|
if test "x${enable_zol_ext}" = xno; then
|
|
AC_DEFINE(NDS32_DEFAULT_ZOL_EXT, 0,
|
|
[Define value for nds32_zol_ext])
|
|
else
|
|
AC_DEFINE(NDS32_DEFAULT_ZOL_EXT, 1,
|
|
[Define default value for nds32_zol_ext])
|
|
fi
|
|
AC_MSG_RESULT($enable_zol_ext)
|
|
;;
|
|
|
|
aarch64 | i386 | riscv | s390 | sparc)
|
|
if test $this_target = $target ; then
|
|
AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
|
|
fi
|
|
;;
|
|
|
|
rl78)
|
|
f=rl78-parse.o
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac
|
|
;;
|
|
|
|
rx)
|
|
f=rx-parse.o
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac
|
|
;;
|
|
|
|
xstormy16)
|
|
using_cgen=yes
|
|
;;
|
|
|
|
xc16x)
|
|
using_cgen=yes
|
|
;;
|
|
|
|
xtensa)
|
|
f=config/xtensa-relax.o
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac
|
|
;;
|
|
|
|
*)
|
|
;;
|
|
esac
|
|
|
|
if test $using_cgen = yes ; then
|
|
f=cgen.o
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac
|
|
fi
|
|
|
|
# See if we really can support this configuration with the emulation code.
|
|
|
|
if test $this_target = $target ; then
|
|
obj_format=$fmt
|
|
te_file=$em
|
|
fi
|
|
|
|
case ${te_file} in
|
|
vms)
|
|
f=config/te-vms.o
|
|
case " $extra_objects " in
|
|
*" $f "*) ;;
|
|
*) extra_objects="$extra_objects $f" ;;
|
|
esac ;;
|
|
esac
|
|
|
|
# From target name and format, produce a list of supported emulations.
|
|
|
|
case ${generic_target}-${fmt} in
|
|
mips-*-*-*) case "$endian" in
|
|
big) emulation="mipsbelf mipslelf mipself" ;;
|
|
*) emulation="mipslelf mipsbelf mipself" ;;
|
|
esac ;;
|
|
# i386-pc-pe-coff != i386-pc-coff.
|
|
i386-*-pe-coff) ;;
|
|
# Uncommenting the next line will turn on support for i386 AOUT
|
|
# for the default linux configuration
|
|
# i386-*-linux*-elf) emulation="i386elf i386aout" ;;
|
|
#
|
|
i386-*-aout) emulation="i386aout" ;;
|
|
i386-*-coff) emulation="i386coff" ;;
|
|
i386-*-elf) emulation="i386elf" ;;
|
|
|
|
# Always all formats. The first stated emulation becomes the default.
|
|
cris-*-*aout*) emulation="crisaout criself" ;;
|
|
cris-*-*) emulation="criself crisaout" ;;
|
|
esac
|
|
|
|
emulations="$emulations $emulation"
|
|
|
|
done
|
|
|
|
if test ${ac_default_x86_relax_relocations} = unset; then
|
|
ac_default_x86_relax_relocations=1
|
|
fi
|
|
AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_X86_RELAX_RELOCATIONS,
|
|
$ac_default_x86_relax_relocations,
|
|
[Define to 1 if you want to generate x86 relax relocations by default.])
|
|
|
|
if test ${ac_default_elf_stt_common} = unset; then
|
|
ac_default_elf_stt_common=0
|
|
fi
|
|
AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_ELF_STT_COMMON,
|
|
$ac_default_elf_stt_common,
|
|
[Define to 1 if you want to generate ELF common symbols with the
|
|
STT_COMMON type by default.])
|
|
|
|
AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_BUILD_NOTES,
|
|
$ac_default_generate_build_notes,
|
|
[Define to 1 if you want to generate GNU Build attribute notes
|
|
by default, if none are contained in the input.])
|
|
|
|
if test ${ac_default_generate_x86_used_note} = unset; then
|
|
ac_default_generate_x86_used_note=0
|
|
fi
|
|
AC_DEFINE_UNQUOTED(DEFAULT_X86_USED_NOTE,
|
|
$ac_default_generate_x86_used_note,
|
|
[Define to 1 if you want to generate GNU x86 used ISA and feature
|
|
properties by default.])
|
|
|
|
if test x$ac_default_compressed_debug_sections = xyes ; then
|
|
AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
|
|
fi
|
|
|
|
# Turn on all targets if possible
|
|
if test ${all_targets} = "yes"; then
|
|
case ${target_cpu_type} in
|
|
i386)
|
|
case ${obj_format} in
|
|
aout)
|
|
emulations="$emulations i386coff i386elf"
|
|
;;
|
|
coff)
|
|
emulations="$emulations i386aout i386elf"
|
|
;;
|
|
elf)
|
|
emulations="$emulations i386aout i386coff"
|
|
;;
|
|
esac
|
|
;;
|
|
x86_64)
|
|
case ${obj_format} in
|
|
aout)
|
|
emulations="$emulations i386coff i386elf"
|
|
;;
|
|
coff)
|
|
emulations="$emulations i386aout i386elf"
|
|
;;
|
|
elf)
|
|
emulations="$emulations i386aout i386coff"
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
# PE code has way too many macros tweaking behaviour
|
|
case ${te_file} in
|
|
pe*) emulations="" ;;
|
|
esac
|
|
|
|
# Assign floating point type. Most processors with FP support
|
|
# IEEE FP. On those that don't support FP at all, usually IEEE
|
|
# is emulated.
|
|
case ${target_cpu} in
|
|
vax | pdp11 ) atof=vax ;;
|
|
*) atof=ieee ;;
|
|
esac
|
|
|
|
case "${obj_format}" in
|
|
"") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
|
|
esac
|
|
|
|
# Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU).
|
|
cgen_cpu_prefix=""
|
|
if test $using_cgen = yes ; then
|
|
case ${target_cpu} in
|
|
or1knd)
|
|
cgen_cpu_prefix=or1k ;;
|
|
*) cgen_cpu_prefix=${target_cpu} ;;
|
|
esac
|
|
AC_SUBST(cgen_cpu_prefix)
|
|
AC_DEFINE(USING_CGEN, 1, [Using cgen code?])
|
|
fi
|
|
|
|
dnl
|
|
dnl Make sure the desired support files exist.
|
|
dnl
|
|
|
|
if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
|
|
AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
|
|
fi
|
|
|
|
if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
|
|
AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
|
|
fi
|
|
|
|
# Some COFF configurations want these random other flags set.
|
|
case ${obj_format} in
|
|
coff)
|
|
case ${target_cpu_type} in
|
|
i386) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;;
|
|
x86_64) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;;
|
|
esac
|
|
;;
|
|
esac
|
|
|
|
# Getting this done right is going to be a bitch. Each configuration specified
|
|
# with --enable-targets=... should be checked for environment, format, cpu
|
|
# setting.
|
|
#
|
|
# For each configuration, the necessary object file support code must be linked
|
|
# in. This might be only one, it might be up to four. The necessary emulation
|
|
# code needs to be provided, too.
|
|
#
|
|
# And then there's "--enable-targets=all"....
|
|
#
|
|
# For now, just always do it for MIPS ELF configurations. Sigh.
|
|
|
|
formats="${obj_format}"
|
|
emfiles=""
|
|
EMULATIONS=""
|
|
GAS_UNIQ(emulations)
|
|
for em in . $emulations ; do
|
|
case $em in
|
|
.) continue ;;
|
|
mipsbelf | mipslelf | mipself)
|
|
fmt=elf file=mipself ;;
|
|
*coff)
|
|
fmt=coff file=$em ;;
|
|
*aout)
|
|
fmt=aout file=$em ;;
|
|
*elf)
|
|
fmt=elf file=$em ;;
|
|
esac
|
|
formats="$formats $fmt"
|
|
emfiles="$emfiles config/e-$file.o"
|
|
EMULATIONS="$EMULATIONS &$em,"
|
|
done
|
|
GAS_UNIQ(formats)
|
|
GAS_UNIQ(emfiles)
|
|
if test `set . $formats ; shift ; echo $#` -gt 1 ; then
|
|
for fmt in $formats ; do
|
|
case $fmt in
|
|
aout) AC_DEFINE(OBJ_MAYBE_AOUT, 1, [a.out support?]) ;;
|
|
coff) AC_DEFINE(OBJ_MAYBE_COFF, 1, [COFF support?]) ;;
|
|
ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF, 1, [ECOFF support?]) ;;
|
|
elf) AC_DEFINE(OBJ_MAYBE_ELF, 1, [ELF support?]) ;;
|
|
generic) AC_DEFINE(OBJ_MAYBE_GENERIC, 1, [generic support?]) ;;
|
|
som) AC_DEFINE(OBJ_MAYBE_SOM, 1, [SOM support?]) ;;
|
|
esac
|
|
extra_objects="$extra_objects config/obj-$fmt.o"
|
|
done
|
|
obj_format=multi
|
|
fi
|
|
if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
|
|
DEFAULT_EMULATION=`set . $emulations ; echo $2`
|
|
# e-mipself has more than one emulation per file, e-i386* has just one at the
|
|
# moment. If only one emulation is specified, then don't define
|
|
# USE_EMULATIONS or include any of the e-files as they will only be bloat.
|
|
case "${obj_format}${emfiles}" in
|
|
multi* | *mipself*)
|
|
extra_objects="$extra_objects $emfiles"
|
|
AC_DEFINE(USE_EMULATIONS, 1, [Use emulation support?]) ;;
|
|
esac
|
|
fi
|
|
AC_SUBST(extra_objects)
|
|
AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS, [Supported emulations.])
|
|
AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION",
|
|
[Default emulation.])
|
|
|
|
reject_dev_configs=yes
|
|
|
|
case ${reject_dev_configs}-${dev} in
|
|
yes-yes) # Oops.
|
|
AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
|
|
;;
|
|
esac
|
|
|
|
AC_SUBST(target_cpu_type)
|
|
AC_SUBST(obj_format)
|
|
AC_SUBST(te_file)
|
|
AC_SUBST(install_tooldir)
|
|
AC_SUBST(atof)
|
|
dnl AC_SUBST(emulation)
|
|
|
|
# do we need the opcodes library?
|
|
case "${need_opcodes}" in
|
|
yes)
|
|
OPCODES_LIB=../opcodes/libopcodes.la
|
|
;;
|
|
esac
|
|
|
|
AC_SUBST(OPCODES_LIB)
|
|
|
|
AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}", [Target alias.])
|
|
AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}", [Canonical target.])
|
|
AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", [Target CPU.])
|
|
AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}", [Target vendor.])
|
|
AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.])
|
|
|
|
AC_PROG_YACC
|
|
AM_PROG_LEX
|
|
|
|
ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
|
|
ZW_GNU_GETTEXT_SISTER_DIR
|
|
AM_PO_SUBDIRS
|
|
|
|
AM_MAINTAINER_MODE
|
|
AM_CONDITIONAL(GENINSRC_NEVER, false)
|
|
AC_EXEEXT
|
|
|
|
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)
|
|
ACX_HEADER_STRING
|
|
|
|
# Put this here so that autoconf's "cross-compiling" message doesn't confuse
|
|
# people who are not cross-compiling but are compiling cross-assemblers.
|
|
AC_MSG_CHECKING(whether compiling a cross-assembler)
|
|
if test "${host}" = "${target}"; then
|
|
cross_gas=no
|
|
else
|
|
cross_gas=yes
|
|
AC_DEFINE(CROSS_COMPILE, 1, [Compiling cross-assembler?])
|
|
fi
|
|
AC_MSG_RESULT($cross_gas)
|
|
|
|
dnl ansidecl.h will deal with const
|
|
dnl AC_C_CONST
|
|
AC_FUNC_ALLOCA
|
|
AC_C_INLINE
|
|
|
|
# VMS doesn't have unlink.
|
|
AC_CHECK_FUNCS(unlink remove, break)
|
|
AC_CHECK_FUNCS(sbrk setlocale)
|
|
AC_CHECK_FUNCS(strsignal)
|
|
|
|
AM_LC_MESSAGES
|
|
|
|
# do we need the math library?
|
|
case "${need_libm}" in
|
|
yes)
|
|
LT_LIB_M
|
|
AC_SUBST(LIBM)
|
|
;;
|
|
esac
|
|
|
|
# Some non-ANSI preprocessors botch requoting inside strings. That's bad
|
|
# enough, but on some of those systems, the assert macro relies on requoting
|
|
# working properly!
|
|
GAS_WORKING_ASSERT
|
|
|
|
# On some systems, the system header files may not declare malloc, realloc,
|
|
# and free. There are places where gas needs these functions to have been
|
|
# declared -- such as when taking their addresses.
|
|
gas_test_headers="
|
|
#ifdef HAVE_MEMORY_H
|
|
#include <memory.h>
|
|
#endif
|
|
#ifdef HAVE_STRING_H
|
|
#include <string.h>
|
|
#else
|
|
#ifdef HAVE_STRINGS_H
|
|
#include <strings.h>
|
|
#endif
|
|
#endif
|
|
#ifdef HAVE_STDLIB_H
|
|
#include <stdlib.h>
|
|
#endif
|
|
#ifdef HAVE_UNISTD_H
|
|
#include <unistd.h>
|
|
#endif
|
|
"
|
|
|
|
# Does errno.h declare errno, or do we have to add a separate declaration
|
|
# for it?
|
|
GAS_CHECK_DECL_NEEDED(errno, f, int f, [
|
|
#ifdef HAVE_ERRNO_H
|
|
#include <errno.h>
|
|
#endif
|
|
])
|
|
|
|
AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
|
|
AC_CACHE_VAL(gas_cv_decl_getopt_unistd_h,
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
|
|
gas_cv_decl_getopt_unistd_h=yes, gas_cv_decl_getopt_unistd_h=no)])
|
|
AC_MSG_RESULT($gas_cv_decl_getopt_unistd_h)
|
|
if test $gas_cv_decl_getopt_unistd_h = yes; then
|
|
AC_DEFINE([HAVE_DECL_GETOPT], 1,
|
|
[Is the prototype for getopt in <unistd.h> in the expected format?])
|
|
fi
|
|
|
|
GAS_CHECK_DECL_NEEDED(environ, f, char **f, $gas_test_headers)
|
|
GAS_CHECK_DECL_NEEDED(ffs, f, int (*f)(int), $gas_test_headers)
|
|
GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
|
|
GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
|
|
GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers)
|
|
GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
|
|
|
|
AC_CHECK_DECLS([free, getenv, malloc, mempcpy, realloc, stpcpy, strstr, vsnprintf, asprintf])
|
|
|
|
BFD_BINARY_FOPEN
|
|
|
|
# Link in zlib if we can. This allows us to write compressed debug sections.
|
|
AM_ZLIB
|
|
|
|
# Support for VMS timestamps via cross compile
|
|
|
|
if test "$ac_cv_header_time_h" = yes; then
|
|
GAS_HAVE_TIME_TYPE_MEMBER(struct tm, tm_gmtoff)
|
|
fi
|
|
|
|
if test "$ac_cv_header_sys_stat_h" = yes; then
|
|
GAS_HAVE_SYS_STAT_TYPE_MEMBER(struct stat, st_mtim, tv_sec)
|
|
GAS_HAVE_SYS_STAT_TYPE_MEMBER(struct stat, st_mtim, tv_nsec)
|
|
fi
|
|
|
|
|
|
dnl Required for html, pdf, install-pdf and install-html targets.
|
|
AC_SUBST(datarootdir)
|
|
AC_SUBST(docdir)
|
|
AC_SUBST(htmldir)
|
|
AC_SUBST(pdfdir)
|
|
|
|
dnl This must come last.
|
|
|
|
dnl We used to make symlinks to files in the source directory, but now
|
|
dnl we just use the right name for .c files, and create .h files in
|
|
dnl the build directory which include the right .h file. Make sure
|
|
dnl the old symlinks don't exist, so that a reconfigure in an existing
|
|
dnl directory behaves reasonably.
|
|
|
|
AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
|
|
AC_CONFIG_COMMANDS([default],
|
|
[rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
|
|
echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
|
|
echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
|
|
echo '#include "te-'"${te_file}"'.h"' > targ-env.h
|
|
echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h
|
|
if test "x$cgen_cpu_prefix" != x ; then
|
|
echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h
|
|
fi],
|
|
[target_cpu_type=${target_cpu_type}
|
|
cgen_cpu_prefix=${cgen_cpu_prefix}
|
|
obj_format=${obj_format}
|
|
te_file=${te_file}])
|
|
|
|
AC_OUTPUT
|