]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/configure.ac
sim: split debug/stdio/trace/profile options into dedicated m4 files
[thirdparty/binutils-gdb.git] / sim / configure.ac
CommitLineData
b7026657 1dnl Process this file with autoconf to produce a configure script.
6bddc3e8
MF
2dnl NB: The version here is not used. If gdb ever changes from generating its
3dnl version at build time to autoconf time (like bfd et al do), we can switch.
4AC_INIT([sim], [0],
5 [https://sourceware.org/bugzilla/enter_bug.cgi?product=gdb&component=sim],
6 [], [https://sourceware.org/gdb/wiki/Sim/])
7
b15c5d7a
MF
8AC_CONFIG_HEADERS([config.h])
9
c2783492 10SIM_AC_TOOLCHAIN
b15c5d7a 11SIM_AC_PLATFORM
6bddc3e8 12
8c379db2 13AM_MAINTAINER_MODE
6bddc3e8 14AM_INIT_AUTOMAKE
b7026657 15
b7026657
AC
16# If a cpu ever has more than one simulator to choose from, use
17# --enable-sim=... to choose.
18AC_ARG_ENABLE(sim,
8d0978fb 19[AS_HELP_STRING([--enable-sim], [Enable the GNU simulator])],
b7026657
AC
20[case "${enableval}" in
21yes | no) ;;
22*) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
23esac])
24
26da232c
MF
25AC_ARG_ENABLE([example-sims],
26 [AC_HELP_STRING([--enable-example-sims],
27 [enable example GNU simulators])])
28
a0e674c1
MF
29AC_ARG_ENABLE(targets,
30[ --enable-targets alternative target configurations],
31[case "${enableval}" in
32 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
33 ;;
34 no) enable_targets= ;;
35 *) enable_targets=$enableval ;;
36esac])
37
38dnl Used to keep track of which target (if any) is the default one. This is
39dnl used when installing files to see if they need to be suffixed.
40SIM_PRIMARY_TARGET=
41AC_SUBST(SIM_PRIMARY_TARGET)
42
43m4_define([SIM_TARGET], [
44 case "${targ}" in
45 all|$1)
46 if test "${targ}" = "${target}"; then
47 SIM_PRIMARY_TARGET=$2
48 fi
49 AC_CONFIG_SUBDIRS($2)
50 $3
51 ;;
52 esac
53])
54
3e8bb3e9
MF
55dnl WHEN ADDING ENTRIES TO THIS MATRIX:
56dnl Make sure that the left side always has two dashes. Otherwise you can get
57dnl spurious matches. Even for unambiguous cases, do this as a convention, else
58dnl the table becomes a real mess to understand and maintain.
b7026657 59if test "${enable_sim}" != no; then
3e8bb3e9 60 sim_igen=no
a0e674c1
MF
61 for targ in `echo $target $enable_targets | sed 's/,/ /g'`
62 do
63 SIM_TARGET([aarch64*-*-*], [aarch64])
64 SIM_TARGET([arm*-*-*], [arm])
65 SIM_TARGET([avr*-*-*], [avr])
66 SIM_TARGET([bfin-*-*], [bfin])
67 SIM_TARGET([bpf-*-*], [bpf])
68 SIM_TARGET([cr16*-*-*], [cr16])
69 SIM_TARGET([cris-*-* | crisv32-*-*], [cris])
70 SIM_TARGET([d10v-*-*], [d10v])
71 SIM_TARGET([frv-*-*], [frv])
72 SIM_TARGET([h8300*-*-*], [h8300])
73 SIM_TARGET([iq2000-*-*], [iq2000])
74 SIM_TARGET([lm32-*-*], [lm32])
75 SIM_TARGET([m32c-*-*], [m32c])
76 SIM_TARGET([m32r-*-*], [m32r])
77 SIM_TARGET([m68hc11-*-*|m6811-*-*], [m68hc11])
78 SIM_TARGET([mcore-*-*], [mcore])
79 SIM_TARGET([microblaze-*-*], [microblaze])
80 SIM_TARGET([mips*-*-*], [mips], [sim_igen=yes])
81 SIM_TARGET([mn10300*-*-*], [mn10300], [sim_igen=yes])
82 SIM_TARGET([moxie-*-*], [moxie])
83 SIM_TARGET([msp430*-*-*], [msp430])
84 SIM_TARGET([or1k-*-* | or1knd-*-*], [or1k])
85 SIM_TARGET([pru*-*-*], [pru])
86 SIM_TARGET([riscv*-*-*], [riscv])
87 SIM_TARGET([rl78-*-*], [rl78])
88 SIM_TARGET([rx-*-*], [rx])
89 SIM_TARGET([sh*-*-*], [sh])
90 SIM_TARGET([sparc-*-rtems*|sparc-*-elf*], [erc32])
91 SIM_TARGET([powerpc*-*-*], [ppc])
92 SIM_TARGET([ft32-*-*], [ft32])
93 SIM_TARGET([v850*-*-*], [v850], [sim_igen=yes])
94 done
26da232c
MF
95
96 if test "x${enable_example_sims}" = xyes; then
97 AC_CONFIG_SUBDIRS(example-synacor)
98 fi
b7026657 99fi
b6b1c790 100AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"])
b7026657 101
dba333c1 102SIM_AC_OPTION_ASSERT
5ea45474 103SIM_AC_OPTION_ENVIRONMENT
dba333c1 104
6c57b87f 105AC_CONFIG_FILES([Makefile])
bb3eddb5 106AC_OUTPUT