Synchronize sourceware version of the libiberty sources with the master gcc versions.
[binutils-gdb.git] / sim / configure.ac
blobf475ab22dfd68b3faf549288c3e04f72dede2d93
1 dnl Process this file with autoconf to produce a configure script.
2 dnl NB: The version here is not used.  If gdb ever changes from generating its
3 dnl version at build time to autoconf time (like bfd et al do), we can switch.
4 AC_INIT([sim], [0],
5   [https://sourceware.org/bugzilla/enter_bug.cgi?product=gdb&component=sim],
6   [], [https://sourceware.org/gdb/wiki/Sim/])
8 dnl Probably should unify PKGVERSION with PACKAGE_* settings from AC_INIT.
9 ACX_PKGVERSION([SIM])
10 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
11 dnl PACKAGE_BUGREPORT is provided by AC_INIT.
12 ACX_BUGURL([$PACKAGE_BUGREPORT])
13 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
15 AC_CONFIG_HEADERS([config.h])
17 dnl Set the 'development' global before loading the SIM macros.
18 . $srcdir/../bfd/development.sh
20 SIM_AC_TOOLCHAIN
21 SIM_AC_PLATFORM
23 AM_MAINTAINER_MODE
24 AM_INIT_AUTOMAKE
25 AM_SILENT_RULES([yes])
27 # If a cpu ever has more than one simulator to choose from, use
28 # --enable-sim=... to choose.
29 AC_ARG_ENABLE(sim,
30 [AS_HELP_STRING([--enable-sim], [Enable the GNU simulator])],
31 [case "${enableval}" in
32 yes | no) ;;
33 *)      AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
34 esac])
36 AC_ARG_ENABLE([example-sims],
37               [AC_HELP_STRING([--enable-example-sims],
38                               [enable example GNU simulators])])
40 AC_ARG_ENABLE(targets,
41 [  --enable-targets        alternative target configurations],
42 [case "${enableval}" in
43   yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
44             ;;
45   no)       enable_targets= ;;
46   *)        enable_targets=$enableval ;;
47 esac])
49 dnl Used to keep track of which target (if any) is the default one.  This is
50 dnl used when installing files to see if they need to be suffixed.
51 SIM_PRIMARY_TARGET=
52 AC_SUBST(SIM_PRIMARY_TARGET)
54 dnl List of enabled arch backends.
55 SIM_ENABLED_ARCHES=
56 AC_SUBST(SIM_ENABLED_ARCHES)
58 ENABLE_SIM=no
59 dnl Build a particular arch subdir.
60 dnl arg[1] is the arch subdir name.
61 m4_define([SIM_BUILD_TARGET], [dnl
62   ENABLE_SIM=yes
63   AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"])
64   AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in)
66 dnl Enable a particular arch subdir.
67 dnl arg[1] is the matching target triple.
68 dnl arg[2] is the arch subdir name.
69 m4_define([SIM_TARGET], [dnl
70   sim_enable_arch_$2=false
71   case "${targ}" in
72     all|$1)
73       if test "${targ}" = "${target}"; then
74         SIM_PRIMARY_TARGET=$2
75       fi
76       SIM_BUILD_TARGET($2)
77       sim_enable_arch_$2=true
78       ;;
79   esac
80   SIM_AC_TOOLCHAIN_FOR_TARGET($2)
81   AM_CONDITIONAL([SIM_ENABLE_ARCH_$2], [${sim_enable_arch_$2}])
84 dnl WHEN ADDING ENTRIES TO THIS MATRIX:
85 dnl Make sure that the left side always has two dashes.  Otherwise you can get
86 dnl spurious matches.  Even for unambiguous cases, do this as a convention, else
87 dnl the table becomes a real mess to understand and maintain.
88 dnl
89 dnl NB: Target matching is aligned with gdb/configure.tgt.  Changes must be kept
90 dnl in sync with that file.
91 if test "${enable_sim}" != no; then
92   for targ in `echo $target $enable_targets | sed 's/,/ /g'`
93   do
94     m4_map([SIM_TARGET], [
95       [[aarch64*-*-*], [aarch64]],
96       [[arm*-*-*], [arm]],
97       [[avr*-*-*], [avr]],
98       [[bfin-*-*], [bfin]],
99       [[bpf-*-*], [bpf]],
100       [[cr16*-*-*], [cr16]],
101       [[cris-*-* | crisv32-*-*], [cris]],
102       [[d10v-*-*], [d10v]],
103       [[frv-*-*], [frv]],
104       [[ft32-*-*], [ft32]],
105       [[h8300*-*-*], [h8300]],
106       [[iq2000-*-*], [iq2000]],
107       [[lm32-*-*], [lm32]],
108       [[m32c-*-*], [m32c]],
109       [[m32r-*-*], [m32r]],
110       [[m68hc11-*-*|m6811-*-*], [m68hc11]],
111       [[mcore-*-*], [mcore]],
112       [[microblaze*-*-*], [microblaze]],
113       [[mips*-*-*], [mips]],
114       [[mn10300*-*-*], [mn10300]],
115       [[moxie-*-*], [moxie]],
116       [[msp430*-*-*], [msp430]],
117       [[or1k*-*-*], [or1k]],
118       [[powerpc*-*-*], [ppc]],
119       [[pru*-*-*], [pru]],
120       [[riscv*-*-*], [riscv]],
121       [[rl78-*-*], [rl78]],
122       [[rx-*-*], [rx]],
123       [[sh*-*-*], [sh]],
124       [[sparc-*-*], [erc32]],
125       [[v850*-*-*], [v850]],
126     ])
127   done
129   if test "x${enable_example_sims}" = xyes; then
130     SIM_AC_TOOLCHAIN_FOR_TARGET(example-synacor)
131     SIM_BUILD_TARGET([example-synacor])
132   fi
133   AM_CONDITIONAL([SIM_ENABLE_ARCH_examples], [test "${enable_example_sims}" = "yes"])
135 AM_CONDITIONAL([ENABLE_SIM], [test "$ENABLE_SIM" = "yes"])
137 dnl Standard (and optional) simulator options.
138 dnl Eventually all simulators will support these.
139 SIM_AC_OPTION_ALIGNMENT
140 SIM_AC_OPTION_ASSERT
141 SIM_AC_OPTION_CGEN_MAINT
142 SIM_AC_OPTION_DEBUG
143 SIM_AC_OPTION_ENDIAN
144 SIM_AC_OPTION_ENVIRONMENT
145 SIM_AC_OPTION_HARDWARE
146 SIM_AC_OPTION_INLINE
147 SIM_AC_OPTION_PROFILE
148 SIM_AC_OPTION_RESERVED_BITS
149 SIM_AC_OPTION_SCACHE
150 SIM_AC_OPTION_SMP
151 SIM_AC_OPTION_STDIO
152 SIM_AC_OPTION_TRACE
153 SIM_AC_OPTION_WARNINGS
155 dnl Some arches have unique configure flags.
156 m4_include([frv/acinclude.m4])
157 m4_include([mips/acinclude.m4])
158 m4_include([ppc/acinclude.m4])
159 m4_include([riscv/acinclude.m4])
160 m4_include([rx/acinclude.m4])
162 AC_CONFIG_FILES([Makefile .gdbinit:gdbinit.in])
163 AC_OUTPUT