Commit | Line | Data |
---|---|---|
b7026657 | 1 | dnl Process this file with autoconf to produce a configure script. |
6bddc3e8 MF |
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 | ||
6dd65fc0 MF |
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 | ||
b15c5d7a MF |
15 | AC_CONFIG_HEADERS([config.h]) |
16 | ||
c2783492 | 17 | SIM_AC_TOOLCHAIN |
b15c5d7a | 18 | SIM_AC_PLATFORM |
6bddc3e8 | 19 | |
8c379db2 | 20 | AM_MAINTAINER_MODE |
6bddc3e8 | 21 | AM_INIT_AUTOMAKE |
fbe8d1cf | 22 | AM_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. | |
26 | AC_ARG_ENABLE(sim, | |
8d0978fb | 27 | [AS_HELP_STRING([--enable-sim], [Enable the GNU simulator])], |
b7026657 AC |
28 | [case "${enableval}" in |
29 | yes | no) ;; | |
30 | *) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;; | |
31 | esac]) | |
32 | ||
26da232c MF |
33 | AC_ARG_ENABLE([example-sims], |
34 | [AC_HELP_STRING([--enable-example-sims], | |
35 | [enable example GNU simulators])]) | |
36 | ||
a0e674c1 MF |
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 | m4_define([SIM_TARGET], [ | |
52 | case "${targ}" in | |
53 | all|$1) | |
54 | if test "${targ}" = "${target}"; then | |
55 | SIM_PRIMARY_TARGET=$2 | |
56 | fi | |
57 | AC_CONFIG_SUBDIRS($2) | |
58 | $3 | |
59 | ;; | |
60 | esac | |
61 | ]) | |
62 | ||
3e8bb3e9 MF |
63 | dnl WHEN ADDING ENTRIES TO THIS MATRIX: |
64 | dnl Make sure that the left side always has two dashes. Otherwise you can get | |
65 | dnl spurious matches. Even for unambiguous cases, do this as a convention, else | |
66 | dnl the table becomes a real mess to understand and maintain. | |
b7026657 | 67 | if test "${enable_sim}" != no; then |
3e8bb3e9 | 68 | sim_igen=no |
a0e674c1 MF |
69 | for targ in `echo $target $enable_targets | sed 's/,/ /g'` |
70 | do | |
71 | SIM_TARGET([aarch64*-*-*], [aarch64]) | |
72 | SIM_TARGET([arm*-*-*], [arm]) | |
73 | SIM_TARGET([avr*-*-*], [avr]) | |
74 | SIM_TARGET([bfin-*-*], [bfin]) | |
75 | SIM_TARGET([bpf-*-*], [bpf]) | |
76 | SIM_TARGET([cr16*-*-*], [cr16]) | |
77 | SIM_TARGET([cris-*-* | crisv32-*-*], [cris]) | |
78 | SIM_TARGET([d10v-*-*], [d10v]) | |
79 | SIM_TARGET([frv-*-*], [frv]) | |
80 | SIM_TARGET([h8300*-*-*], [h8300]) | |
81 | SIM_TARGET([iq2000-*-*], [iq2000]) | |
82 | SIM_TARGET([lm32-*-*], [lm32]) | |
83 | SIM_TARGET([m32c-*-*], [m32c]) | |
84 | SIM_TARGET([m32r-*-*], [m32r]) | |
85 | SIM_TARGET([m68hc11-*-*|m6811-*-*], [m68hc11]) | |
86 | SIM_TARGET([mcore-*-*], [mcore]) | |
87 | SIM_TARGET([microblaze-*-*], [microblaze]) | |
88 | SIM_TARGET([mips*-*-*], [mips], [sim_igen=yes]) | |
89 | SIM_TARGET([mn10300*-*-*], [mn10300], [sim_igen=yes]) | |
90 | SIM_TARGET([moxie-*-*], [moxie]) | |
91 | SIM_TARGET([msp430*-*-*], [msp430]) | |
92 | SIM_TARGET([or1k-*-* | or1knd-*-*], [or1k]) | |
93 | SIM_TARGET([pru*-*-*], [pru]) | |
94 | SIM_TARGET([riscv*-*-*], [riscv]) | |
95 | SIM_TARGET([rl78-*-*], [rl78]) | |
96 | SIM_TARGET([rx-*-*], [rx]) | |
97 | SIM_TARGET([sh*-*-*], [sh]) | |
98 | SIM_TARGET([sparc-*-rtems*|sparc-*-elf*], [erc32]) | |
99 | SIM_TARGET([powerpc*-*-*], [ppc]) | |
100 | SIM_TARGET([ft32-*-*], [ft32]) | |
101 | SIM_TARGET([v850*-*-*], [v850], [sim_igen=yes]) | |
102 | done | |
26da232c MF |
103 | |
104 | if test "x${enable_example_sims}" = xyes; then | |
105 | AC_CONFIG_SUBDIRS(example-synacor) | |
106 | fi | |
b7026657 | 107 | fi |
b6b1c790 | 108 | AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"]) |
b7026657 | 109 | |
04381273 MF |
110 | dnl Standard (and optional) simulator options. |
111 | dnl Eventually all simulators will support these. | |
ba307cdd | 112 | SIM_AC_OPTION_ALIGNMENT |
dba333c1 | 113 | SIM_AC_OPTION_ASSERT |
04381273 | 114 | SIM_AC_OPTION_DEBUG |
f9a4d543 | 115 | SIM_AC_OPTION_ENDIAN |
5ea45474 | 116 | SIM_AC_OPTION_ENVIRONMENT |
04381273 MF |
117 | SIM_AC_OPTION_PROFILE |
118 | SIM_AC_OPTION_STDIO | |
119 | SIM_AC_OPTION_TRACE | |
dba333c1 | 120 | |
3f8414df | 121 | AC_CONFIG_FILES([arch-subdir.mk Makefile]) |
bb3eddb5 | 122 | AC_OUTPUT |