]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/configure.ac
sim: unify scache settings
[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
6dd65fc0
MF
8dnl Probably should unify PKGVERSION with PACKAGE_* settings from AC_INIT.
9ACX_PKGVERSION([SIM])
10AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
11dnl PACKAGE_BUGREPORT is provided by AC_INIT.
12ACX_BUGURL([$PACKAGE_BUGREPORT])
13AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
14
b15c5d7a
MF
15AC_CONFIG_HEADERS([config.h])
16
c2783492 17SIM_AC_TOOLCHAIN
b15c5d7a 18SIM_AC_PLATFORM
6bddc3e8 19
8c379db2 20AM_MAINTAINER_MODE
6bddc3e8 21AM_INIT_AUTOMAKE
fbe8d1cf 22AM_SILENT_RULES([yes])
b7026657 23
b7026657
AC
24# If a cpu ever has more than one simulator to choose from, use
25# --enable-sim=... to choose.
26AC_ARG_ENABLE(sim,
8d0978fb 27[AS_HELP_STRING([--enable-sim], [Enable the GNU simulator])],
b7026657
AC
28[case "${enableval}" in
29yes | no) ;;
30*) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
31esac])
32
26da232c
MF
33AC_ARG_ENABLE([example-sims],
34 [AC_HELP_STRING([--enable-example-sims],
35 [enable example GNU simulators])])
36
a0e674c1
MF
37AC_ARG_ENABLE(targets,
38[ --enable-targets alternative target configurations],
39[case "${enableval}" in
40 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
41 ;;
42 no) enable_targets= ;;
43 *) enable_targets=$enableval ;;
44esac])
45
46dnl Used to keep track of which target (if any) is the default one. This is
47dnl used when installing files to see if they need to be suffixed.
48SIM_PRIMARY_TARGET=
49AC_SUBST(SIM_PRIMARY_TARGET)
50
36bb57e4
MF
51SIM_SUBDIRS=
52AC_SUBST(SIM_SUBDIRS)
53
54dnl Used by common/Make-common.in to see which configure script created it.
55SIM_COMMON_BUILD_TRUE=
56SIM_COMMON_BUILD_FALSE='#'
57AC_SUBST(SIM_COMMON_BUILD_TRUE)
58AC_SUBST(SIM_COMMON_BUILD_FALSE)
59
60AC_CONFIG_FILES(Make-common.sim:common/Make-common.in)
61dnl Build a particular arch subdir.
62dnl arg[1] is the arch subdir name.
63dnl arg[2] is whether the arch has a dedicated configure script.
bc56166f 64m4_define([SIM_BUILD_TARGET], [dnl
36bb57e4
MF
65 m4_if($2, [true], [dnl
66 AC_CONFIG_SUBDIRS($1)
67 ], [dnl
68 AC_CONFIG_FILES($1/Makefile.sim:$1/Makefile.in)
69 AC_CONFIG_COMMANDS([$1/Makefile],
70[sed -n \
71 -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ {
b3408412 72 /^srcdir = / s:$:/$1:
36bb57e4
MF
73 p
74 }' \
75 <Make-common.sim >$1/Makesim1.tmp
76 sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >$1/Makesim2.tmp
77 sed -e '/^## COMMON_PRE_/ r $1/Makesim1.tmp' \
78 -e '/^## COMMON_POST_/ r $1/Makesim2.tmp' \
79 <$1/Makefile.sim >$1/Makefile
80 rm -f $1/Makesim1.tmp $1/Makesim2.tmp
81])
82 AS_VAR_APPEND([SIM_SUBDIRS], [" $1"])
83 ])
bc56166f
MF
84 dnl Create the depdirs for ports until we can convert them to automake.
85 AC_CONFIG_COMMANDS([depdir-$1],
86 [$SHELL $ac_aux_dir/mkinstalldirs $1/$DEPDIR],
87 [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR])
88])
36bb57e4
MF
89dnl Enable a particular arch subdir.
90dnl arg[1] is the matching target triple.
91dnl arg[2] is the arch subdir name.
92dnl arg[3] is whether the arch has a dedicated configure script.
93dnl arg[4] is any additional shell code to run for this arch.
bc56166f 94m4_define([SIM_TARGET], [dnl
a0e674c1
MF
95 case "${targ}" in
96 all|$1)
97 if test "${targ}" = "${target}"; then
98 SIM_PRIMARY_TARGET=$2
99 fi
36bb57e4
MF
100 SIM_BUILD_TARGET($2, $3)
101 $4
a0e674c1
MF
102 ;;
103 esac
104])
105
3e8bb3e9
MF
106dnl WHEN ADDING ENTRIES TO THIS MATRIX:
107dnl Make sure that the left side always has two dashes. Otherwise you can get
108dnl spurious matches. Even for unambiguous cases, do this as a convention, else
109dnl the table becomes a real mess to understand and maintain.
b7026657 110if test "${enable_sim}" != no; then
3e8bb3e9 111 sim_igen=no
a0e674c1
MF
112 for targ in `echo $target $enable_targets | sed 's/,/ /g'`
113 do
114 SIM_TARGET([aarch64*-*-*], [aarch64])
115 SIM_TARGET([arm*-*-*], [arm])
116 SIM_TARGET([avr*-*-*], [avr])
d8b04da7 117 SIM_TARGET([bfin-*-*], [bfin])
36bb57e4 118 SIM_TARGET([bpf-*-*], [bpf], [true])
a0e674c1 119 SIM_TARGET([cr16*-*-*], [cr16])
36bb57e4 120 SIM_TARGET([cris-*-* | crisv32-*-*], [cris], [true])
a0e674c1 121 SIM_TARGET([d10v-*-*], [d10v])
36bb57e4
MF
122 SIM_TARGET([frv-*-*], [frv], [true])
123 SIM_TARGET([ft32-*-*], [ft32])
a0e674c1 124 SIM_TARGET([h8300*-*-*], [h8300])
36bb57e4
MF
125 SIM_TARGET([iq2000-*-*], [iq2000], [true])
126 SIM_TARGET([lm32-*-*], [lm32], [true])
a0e674c1 127 SIM_TARGET([m32c-*-*], [m32c])
36bb57e4 128 SIM_TARGET([m32r-*-*], [m32r], [true])
a0e674c1
MF
129 SIM_TARGET([m68hc11-*-*|m6811-*-*], [m68hc11])
130 SIM_TARGET([mcore-*-*], [mcore])
131 SIM_TARGET([microblaze-*-*], [microblaze])
36bb57e4
MF
132 SIM_TARGET([mips*-*-*], [mips], [true], [sim_igen=yes])
133 SIM_TARGET([mn10300*-*-*], [mn10300], [true], [sim_igen=yes])
a0e674c1
MF
134 SIM_TARGET([moxie-*-*], [moxie])
135 SIM_TARGET([msp430*-*-*], [msp430])
36bb57e4 136 SIM_TARGET([or1k-*-* | or1knd-*-*], [or1k], [true])
a0e674c1 137 SIM_TARGET([pru*-*-*], [pru])
36bb57e4 138 SIM_TARGET([riscv*-*-*], [riscv], [true])
a0e674c1 139 SIM_TARGET([rl78-*-*], [rl78])
e173c80f 140 SIM_TARGET([rx-*-*], [rx])
a0e674c1 141 SIM_TARGET([sh*-*-*], [sh])
5d0b3088 142 SIM_TARGET([sparc-*-rtems*|sparc-*-elf*], [erc32])
36bb57e4
MF
143 SIM_TARGET([powerpc*-*-*], [ppc], [true])
144 SIM_TARGET([v850*-*-*], [v850], [true], [sim_igen=yes])
a0e674c1 145 done
26da232c
MF
146
147 if test "x${enable_example_sims}" = xyes; then
bc56166f 148 SIM_BUILD_TARGET([example-synacor])
26da232c 149 fi
b7026657 150fi
b6b1c790 151AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"])
b7026657 152
04381273
MF
153dnl Standard (and optional) simulator options.
154dnl Eventually all simulators will support these.
ba307cdd 155SIM_AC_OPTION_ALIGNMENT
dba333c1 156SIM_AC_OPTION_ASSERT
1bf5c342 157SIM_AC_OPTION_CGEN_MAINT
04381273 158SIM_AC_OPTION_DEBUG
f9a4d543 159SIM_AC_OPTION_ENDIAN
5ea45474 160SIM_AC_OPTION_ENVIRONMENT
456ef1c1 161SIM_AC_OPTION_HARDWARE
d73f39ee 162SIM_AC_OPTION_INLINE
04381273 163SIM_AC_OPTION_PROFILE
b79efe26 164SIM_AC_OPTION_SCACHE
04381273
MF
165SIM_AC_OPTION_STDIO
166SIM_AC_OPTION_TRACE
47ce766a 167SIM_AC_OPTION_WARNINGS
dba333c1 168
36bb57e4
MF
169dnl These are unfortunate. They are conditionally called by other sim macros
170dnl but always used by common/Make-common.in. So we have to subst here even
171dnl when the rest of the code is in the respective macros. Once we merge the
172dnl respective SIM_AC_OPTION_xxx call above, we can drop these.
173AC_SUBST(sim_bitsize)
174AC_SUBST(sim_float)
36bb57e4
MF
175AC_SUBST(sim_reserved_bits)
176
e173c80f
MF
177dnl Some arches have unique configure flags.
178m4_include([rx/acinclude.m4])
179
3f8414df 180AC_CONFIG_FILES([arch-subdir.mk Makefile])
bb3eddb5 181AC_OUTPUT