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.
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.
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
23 m4_include([../gdbsupport/libiberty.m4])
28 AM_SILENT_RULES([yes])
30 # If a cpu ever has more than one simulator to choose from, use
31 # --enable-sim=... to choose.
33 [AS_HELP_STRING([--enable-sim], [Enable the GNU simulator])],
34 [case "${enableval}" in
36 *) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
39 AC_ARG_ENABLE([example-sims],
40 [AC_HELP_STRING([--enable-example-sims],
41 [enable example GNU simulators])])
43 AC_ARG_ENABLE(targets,
44 [ --enable-targets alternative target configurations],
45 [case "${enableval}" in
46 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
48 no) enable_targets= ;;
49 *) enable_targets=$enableval ;;
52 dnl Used to keep track of which target (if any) is the default one. This is
53 dnl used when installing files to see if they need to be suffixed.
55 AC_SUBST(SIM_PRIMARY_TARGET)
57 dnl List of enabled arch backends.
59 AC_SUBST(SIM_ENABLED_ARCHES)
62 dnl Build a particular arch subdir.
63 dnl arg[1] is the arch subdir name.
64 m4_define([SIM_BUILD_TARGET], [dnl
66 AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"])
67 AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in)
69 dnl Enable a particular arch subdir.
70 dnl arg[1] is the matching target triple.
71 dnl arg[2] is the arch subdir name.
72 m4_define([SIM_TARGET], [dnl
73 sim_enable_arch_$2=false
76 if test "${targ}" = "${target}"; then
80 sim_enable_arch_$2=true
83 SIM_AC_TOOLCHAIN_FOR_TARGET($2)
84 AM_CONDITIONAL([SIM_ENABLE_ARCH_$2], [${sim_enable_arch_$2}])
87 dnl WHEN ADDING ENTRIES TO THIS MATRIX:
88 dnl Make sure that the left side always has two dashes. Otherwise you can get
89 dnl spurious matches. Even for unambiguous cases, do this as a convention, else
90 dnl the table becomes a real mess to understand and maintain.
92 dnl NB: Target matching is aligned with gdb/configure.tgt. Changes must be kept
93 dnl in sync with that file.
94 if test "${enable_sim}" != no; then
95 for targ in `echo $target $enable_targets | sed 's/,/ /g'`
97 m4_map([SIM_TARGET], [
98 [[aarch64*-*-*], [aarch64]],
101 [[bfin-*-*], [bfin]],
103 [[cr16*-*-*], [cr16]],
104 [[cris-*-* | crisv32-*-*], [cris]],
105 [[d10v-*-*], [d10v]],
107 [[ft32-*-*], [ft32]],
108 [[h8300*-*-*], [h8300]],
109 [[iq2000-*-*], [iq2000]],
110 [[lm32-*-*], [lm32]],
111 [[m32c-*-*], [m32c]],
112 [[m32r-*-*], [m32r]],
113 [[m68hc11-*-*|m6811-*-*], [m68hc11]],
114 [[mcore-*-*], [mcore]],
115 [[microblaze*-*-*], [microblaze]],
116 [[mips*-*-*], [mips]],
117 [[mn10300*-*-*], [mn10300]],
118 [[moxie-*-*], [moxie]],
119 [[msp430*-*-*], [msp430]],
120 [[or1k*-*-*], [or1k]],
121 [[powerpc*-*-*], [ppc]],
123 [[riscv*-*-*], [riscv]],
124 [[rl78-*-*], [rl78]],
127 [[sparc-*-*], [erc32]],
128 [[v850*-*-*], [v850]],
132 if test "x${enable_example_sims}" = xyes; then
133 SIM_AC_TOOLCHAIN_FOR_TARGET(example-synacor)
134 SIM_BUILD_TARGET([example-synacor])
136 AM_CONDITIONAL([SIM_ENABLE_ARCH_examples], [test "${enable_example_sims}" = "yes"])
138 AM_CONDITIONAL([ENABLE_SIM], [test "$ENABLE_SIM" = "yes"])
140 dnl Standard (and optional) simulator options.
141 dnl Eventually all simulators will support these.
142 SIM_AC_OPTION_ALIGNMENT
144 SIM_AC_OPTION_CGEN_MAINT
147 SIM_AC_OPTION_ENVIRONMENT
148 SIM_AC_OPTION_HARDWARE
150 SIM_AC_OPTION_PROFILE
151 SIM_AC_OPTION_RESERVED_BITS
156 SIM_AC_OPTION_WARNINGS
158 dnl Some arches have unique configure flags.
159 m4_include([frv/acinclude.m4])
160 m4_include([mips/acinclude.m4])
161 m4_include([ppc/acinclude.m4])
162 m4_include([riscv/acinclude.m4])
163 m4_include([rx/acinclude.m4])
165 AC_CONFIG_FILES([Makefile .gdbinit:gdbinit.in])