Remove path name from test case
[binutils-gdb.git] / sim / configure.ac
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/])
7
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])
14
15 AC_CONFIG_HEADERS([config.h])
16
17 SIM_AC_TOOLCHAIN
18 SIM_AC_PLATFORM
19
20 AM_MAINTAINER_MODE
21 AM_INIT_AUTOMAKE
22 AM_SILENT_RULES([yes])
23
24 # If a cpu ever has more than one simulator to choose from, use
25 # --enable-sim=... to choose.
26 AC_ARG_ENABLE(sim,
27 [AS_HELP_STRING([--enable-sim], [Enable the GNU simulator])],
28 [case "${enableval}" in
29 yes | no) ;;
30 *) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
31 esac])
32
33 AC_ARG_ENABLE([example-sims],
34 [AC_HELP_STRING([--enable-example-sims],
35 [enable example GNU simulators])])
36
37 AC_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 ;;
44 esac])
45
46 dnl Used to keep track of which target (if any) is the default one. This is
47 dnl used when installing files to see if they need to be suffixed.
48 SIM_PRIMARY_TARGET=
49 AC_SUBST(SIM_PRIMARY_TARGET)
50
51 dnl List of enabled arch backends.
52 SIM_ENABLED_ARCHES=
53 AC_SUBST(SIM_ENABLED_ARCHES)
54
55 ENABLE_SIM=no
56 dnl Build a particular arch subdir.
57 dnl arg[1] is the arch subdir name.
58 dnl arg[2] is whether the arch has a dedicated configure script.
59 m4_define([SIM_BUILD_TARGET], [dnl
60 ENABLE_SIM=yes
61 AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"])
62 m4_if($2, [true], [dnl
63 AC_CONFIG_SUBDIRS($1)
64 ])
65 AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in)
66 ])
67 dnl Enable a particular arch subdir.
68 dnl arg[1] is the matching target triple.
69 dnl arg[2] is the arch subdir name.
70 dnl arg[3] is whether the arch has a dedicated configure script.
71 m4_define([SIM_TARGET], [dnl
72 sim_enable_arch_$2=false
73 case "${targ}" in
74 all|$1)
75 if test "${targ}" = "${target}"; then
76 SIM_PRIMARY_TARGET=$2
77 fi
78 SIM_BUILD_TARGET($2, $3)
79 sim_enable_arch_$2=true
80 ;;
81 esac
82 SIM_AC_TOOLCHAIN_FOR_TARGET($2)
83 AM_CONDITIONAL([SIM_ENABLE_ARCH_$2], [${sim_enable_arch_$2}])
84 ])
85
86 dnl WHEN ADDING ENTRIES TO THIS MATRIX:
87 dnl Make sure that the left side always has two dashes. Otherwise you can get
88 dnl spurious matches. Even for unambiguous cases, do this as a convention, else
89 dnl the table becomes a real mess to understand and maintain.
90 dnl
91 dnl NB: Target matching is aligned with gdb/configure.tgt. Changes must be kept
92 dnl in sync with that file.
93 if test "${enable_sim}" != no; then
94 for targ in `echo $target $enable_targets | sed 's/,/ /g'`
95 do
96 SIM_TARGET([aarch64*-*-*], [aarch64])
97 SIM_TARGET([arm*-*-*], [arm])
98 SIM_TARGET([avr*-*-*], [avr])
99 SIM_TARGET([bfin-*-*], [bfin])
100 SIM_TARGET([bpf-*-*], [bpf])
101 SIM_TARGET([cr16*-*-*], [cr16])
102 SIM_TARGET([cris-*-* | crisv32-*-*], [cris])
103 SIM_TARGET([d10v-*-*], [d10v])
104 SIM_TARGET([frv-*-*], [frv])
105 SIM_TARGET([ft32-*-*], [ft32])
106 SIM_TARGET([h8300*-*-*], [h8300])
107 SIM_TARGET([iq2000-*-*], [iq2000])
108 SIM_TARGET([lm32-*-*], [lm32])
109 SIM_TARGET([m32c-*-*], [m32c])
110 SIM_TARGET([m32r-*-*], [m32r])
111 SIM_TARGET([m68hc11-*-*|m6811-*-*], [m68hc11])
112 SIM_TARGET([mcore-*-*], [mcore])
113 SIM_TARGET([microblaze*-*-*], [microblaze])
114 SIM_TARGET([mips*-*-*], [mips])
115 SIM_TARGET([mn10300*-*-*], [mn10300])
116 SIM_TARGET([moxie-*-*], [moxie])
117 SIM_TARGET([msp430*-*-*], [msp430])
118 SIM_TARGET([or1k*-*-*], [or1k])
119 SIM_TARGET([powerpc*-*-*], [ppc], [true])
120 SIM_TARGET([pru*-*-*], [pru])
121 SIM_TARGET([riscv*-*-*], [riscv])
122 SIM_TARGET([rl78-*-*], [rl78])
123 SIM_TARGET([rx-*-*], [rx])
124 SIM_TARGET([sh*-*-*], [sh])
125 SIM_TARGET([sparc-*-*], [erc32])
126 SIM_TARGET([v850*-*-*], [v850])
127 done
128
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"])
134 fi
135 AM_CONDITIONAL([ENABLE_SIM], [test "$ENABLE_SIM" = "yes"])
136
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
154
155 dnl Some arches have unique configure flags.
156 m4_include([frv/acinclude.m4])
157 m4_include([mips/acinclude.m4])
158 m4_include([riscv/acinclude.m4])
159 m4_include([rx/acinclude.m4])
160
161 AC_CONFIG_FILES([arch-subdir.mk Makefile .gdbinit:gdbinit.in])
162 AC_OUTPUT