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 | ||
8 | AC_CANONICAL_SYSTEM | |
9 | ||
10 | AM_INIT_AUTOMAKE | |
b7026657 AC |
11 | |
12 | AC_PROG_CC | |
13 | AC_PROG_INSTALL | |
14 | AC_CHECK_TOOL(AR, ar) | |
15 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
16 | ||
b7026657 AC |
17 | AC_ARG_PROGRAM |
18 | AC_PROG_CC | |
5e25901f | 19 | AC_PROG_CPP |
b7026657 | 20 | AC_SUBST(CFLAGS) |
b7026657 AC |
21 | AR=${AR-ar} |
22 | AC_SUBST(AR) | |
23 | AC_PROG_RANLIB | |
24 | ||
25 | # Put a plausible default for CC_FOR_BUILD in Makefile. | |
5c887dd5 JB |
26 | if test -z "$CC_FOR_BUILD"; then |
27 | if test "x$cross_compiling" = "xno"; then | |
28 | CC_FOR_BUILD='$(CC)' | |
29 | else | |
30 | CC_FOR_BUILD=gcc | |
31 | fi | |
b7026657 AC |
32 | fi |
33 | AC_SUBST(CC_FOR_BUILD) | |
4b164edf AS |
34 | CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} |
35 | AC_SUBST(CFLAGS_FOR_BUILD) | |
b7026657 AC |
36 | |
37 | # If a cpu ever has more than one simulator to choose from, use | |
38 | # --enable-sim=... to choose. | |
39 | AC_ARG_ENABLE(sim, | |
8d0978fb | 40 | [AS_HELP_STRING([--enable-sim], [Enable the GNU simulator])], |
b7026657 AC |
41 | [case "${enableval}" in |
42 | yes | no) ;; | |
43 | *) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;; | |
44 | esac]) | |
45 | ||
3e8bb3e9 MF |
46 | dnl WHEN ADDING ENTRIES TO THIS MATRIX: |
47 | dnl Make sure that the left side always has two dashes. Otherwise you can get | |
48 | dnl spurious matches. Even for unambiguous cases, do this as a convention, else | |
49 | dnl the table becomes a real mess to understand and maintain. | |
b7026657 | 50 | if test "${enable_sim}" != no; then |
3e8bb3e9 MF |
51 | sim_igen=no |
52 | case "${target}" in | |
53 | aarch64*-*-*) | |
54 | AC_CONFIG_SUBDIRS(aarch64) | |
55 | ;; | |
56 | arm*-*-*) | |
57 | AC_CONFIG_SUBDIRS(arm) | |
58 | ;; | |
59 | avr*-*-*) | |
60 | AC_CONFIG_SUBDIRS(avr) | |
61 | ;; | |
62 | bfin-*-*) | |
63 | AC_CONFIG_SUBDIRS(bfin) | |
64 | ;; | |
65 | bpf-*-*) | |
66 | AC_CONFIG_SUBDIRS(bpf) | |
67 | ;; | |
68 | cr16*-*-*) | |
69 | AC_CONFIG_SUBDIRS(cr16) | |
70 | ;; | |
71 | cris-*-* | crisv32-*-*) | |
72 | AC_CONFIG_SUBDIRS(cris) | |
73 | ;; | |
74 | d10v-*-*) | |
75 | AC_CONFIG_SUBDIRS(d10v) | |
76 | ;; | |
77 | frv-*-*) | |
78 | AC_CONFIG_SUBDIRS(frv) | |
79 | ;; | |
80 | h8300*-*-*) | |
81 | AC_CONFIG_SUBDIRS(h8300) | |
82 | ;; | |
83 | iq2000-*-*) | |
84 | AC_CONFIG_SUBDIRS(iq2000) | |
85 | ;; | |
86 | lm32-*-*) | |
87 | AC_CONFIG_SUBDIRS(lm32) | |
88 | ;; | |
89 | m32c-*-*) | |
90 | AC_CONFIG_SUBDIRS(m32c) | |
91 | ;; | |
92 | m32r-*-*) | |
93 | AC_CONFIG_SUBDIRS(m32r) | |
94 | ;; | |
95 | m68hc11-*-*|m6811-*-*) | |
96 | AC_CONFIG_SUBDIRS(m68hc11) | |
97 | ;; | |
98 | mcore-*-*) | |
99 | AC_CONFIG_SUBDIRS(mcore) | |
100 | ;; | |
101 | microblaze-*-*) | |
102 | AC_CONFIG_SUBDIRS(microblaze) | |
103 | ;; | |
104 | mips*-*-*) | |
105 | AC_CONFIG_SUBDIRS(mips) | |
106 | sim_igen=yes | |
107 | ;; | |
108 | mn10300*-*-*) | |
109 | AC_CONFIG_SUBDIRS(mn10300) | |
110 | sim_igen=yes | |
111 | ;; | |
112 | moxie-*-*) | |
113 | AC_CONFIG_SUBDIRS(moxie) | |
114 | ;; | |
115 | msp430*-*-*) | |
116 | AC_CONFIG_SUBDIRS(msp430) | |
117 | ;; | |
118 | or1k-*-* | or1knd-*-*) | |
119 | AC_CONFIG_SUBDIRS(or1k) | |
120 | ;; | |
121 | pru*-*-*) | |
122 | AC_CONFIG_SUBDIRS(pru) | |
123 | ;; | |
124 | riscv*-*-*) | |
125 | AC_CONFIG_SUBDIRS(riscv) | |
126 | ;; | |
127 | rl78-*-*) | |
128 | AC_CONFIG_SUBDIRS(rl78) | |
129 | ;; | |
130 | rx-*-*) | |
131 | AC_CONFIG_SUBDIRS(rx) | |
132 | ;; | |
133 | sh*-*-*) | |
134 | AC_CONFIG_SUBDIRS(sh) | |
135 | ;; | |
136 | sparc-*-rtems*|sparc-*-elf*) | |
137 | AC_CONFIG_SUBDIRS(erc32) | |
138 | ;; | |
139 | powerpc*-*-*) | |
140 | AC_CONFIG_SUBDIRS(ppc) | |
141 | ;; | |
142 | ft32-*-*) | |
143 | AC_CONFIG_SUBDIRS(ft32) | |
144 | ;; | |
145 | v850*-*-*) | |
146 | AC_CONFIG_SUBDIRS(v850) | |
147 | sim_igen=yes | |
148 | ;; | |
149 | esac | |
bb3eddb5 MF |
150 | if test "$sim_igen" = yes; then |
151 | AC_CONFIG_SUBDIRS(igen) | |
152 | fi | |
b7026657 AC |
153 | fi |
154 | ||
bb3eddb5 MF |
155 | AC_CONFIG_FILES([Makefile testsuite/Makefile]) |
156 | AC_OUTPUT |