]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/ppc/configure.in
If --enable-sim-inline is not specified, default to DEFAULT_INLINE=1, not 2.
[thirdparty/binutils-gdb.git] / sim / ppc / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.3)dnl
3 AC_INIT(Makefile.in)
4
5 AC_ARG_ENABLE(sim-cflags,
6 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
7 [case "${enableval}" in
8 yes) sim_cflags="-O2 -fomit-frame-pointer";;
9 no) sim_cflags="";;
10 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
11 esac
12 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
13 echo "Setting sim cflags = $sim_cflags" 6>&1
14 fi],[sim_cflags=""])dnl
15
16 AC_ARG_ENABLE(sim-warnings,
17 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
18 [case "${enableval}" in
19 yes) sim_warnings="-Wall -Wpointer-arith -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations";;
20 no) sim_warnings="-w";;
21 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
22 esac
23 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
24 echo "Setting warning flags = $sim_warnings" 6>&1
25 fi],[sim_warnings=""])dnl
26
27 AC_ARG_ENABLE(sim-config,
28 [ --enable-sim-config=file Override default config file],
29 [case "${enableval}" in
30 yes) sim_config="std-config.h";;
31 no) sim_config="std-config.h";;
32 *) sim_config="${enableval}";;
33 esac
34 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
35 echo "Setting config flags = $sim_config" 6>&1
36 fi],[sim_config="std-config.h"; echo "Setting config flags = $sim_config" 6>&1])dnl
37
38 AC_ARG_ENABLE(sim-opcode,
39 [ --enable-sim-opcode=which Override default opcode lookup.],
40 [case "${enableval}" in
41 yes) sim_opcode="ppc-opcode-simple";;
42 no) sim_opcode="ppc-opcode-simple";;
43 *) sim_opcode="ppc-opcode-${enableval}";;
44 esac
45 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
46 echo "Setting opcode flags = $sim_opcode" 6>&1
47 fi],[sim_opcode="ppc-opcode-simple"; echo "Setting opcode flags = $sim_opcode"])dnl
48
49 AC_ARG_ENABLE(sim-switch,
50 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
51 [case "${enableval}" in
52 yes) sim_switch="-s";;
53 *) sim_switch="";;
54 esac
55 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
56 echo "Setting switch flags = $sim_switch" 6>&1
57 fi],[sim_switch="-s";
58 if test x"$silent" != x"yes"; then
59 echo "Setting switch flags = $sim_switch" 6>&1
60 fi])dnl
61
62 AC_ARG_ENABLE(sim-duplicate,
63 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
64 [case "${enableval}" in
65 yes) sim_dup="-e";;
66 *) sim_dup="";;
67 esac
68 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
69 echo "Setting duplicate flags = $sim_dup" 6>&1
70 fi],[sim_dup="-e"
71 if test x"$silent" != x"yes"; then
72 echo "Setting duplicate flags = $sim_dup" 6>&1
73 fi])dnl
74
75 AC_ARG_ENABLE(sim-filter,
76 [ --enable-sim-filter=rule Specify filter rules.],
77 [case "${enableval}" in
78 yes) sim_filter="";;
79 *) sim_filter="-f $enableval";;
80 esac
81 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
82 echo "Setting filter flags = $sim_filter" 6>&1
83 fi],[sim_filter="-f 64"
84 if test x"$silent" != x"yes"; then
85 echo "Setting filter flags = $sim_filter" 6>&1
86 fi])dnl
87
88 AC_ARG_ENABLE(sim-icache,
89 [ --enable-sim-icache=size Specify instruction cache size.],
90 [case "${enableval}" in
91 yes) sim_icache="-r 1024";;
92 *) sim_icache="";;
93 esac],[sim_icache=""])dnl
94
95 AC_ARG_ENABLE(sim-inline,
96 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
97 [sim_inline=""
98 case "$enableval" in
99 no) sim_inline="";;
100 0) sim_inline="-DDEFAULT_INLINE=0";;
101 yes | 2) sim_inline="-DDEFAULT_INLINE=2";;
102 1) sim_inline="-DDEFAULT_INLINE=1";;
103 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
104 new_flag=""
105 case "$x" in
106 *_INLINE=*) new_flag="-D$x";;
107 *_INLINE) new_flag="-D$x=2";;
108 *=*) new_flag=`sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
109 *) new_flag="-D$x""_INLINE=2";;
110 esac
111 if x"$sim_inline" = x""; then
112 sim_inline="$new_flag"
113 else
114 sim_inline="$flags $new_flag"
115 fi
116 done;;
117 esac
118 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
119 echo "Setting inline flags = $sim_inline" 6>&1
120 fi],[if test x"$GCC" != ""; then
121 sim_inline="-DDEFAULT_INLINE=1"
122 if test x"$silent" != x"yes"; then
123 echo "Setting inline flags = $sim_inline" 6>&1
124 fi
125 else
126 sim_inline=""
127 fi])dnl
128
129 AC_ARG_ENABLE(sim-bswap,
130 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
131 [case "${enableval}" in
132 yes) sim_bswap="-DWITH_BSWAP=1";;
133 no) sim_bswap="-DWITH_BSWAP=0";;
134 *) sim_bswap="";;
135 esac
136 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
137 echo "Setting bswap flags = $sim_bswap" 6>&1
138 fi],[sim_bswap=""])dnl
139
140 AC_ARG_ENABLE(sim-endian,
141 [ --enable-sim-endian=endian Specify target byte endian orientation.],
142 [case "${enableval}" in
143 yes) case "$target" in
144 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
145 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
146 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
147 esac;;
148 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
149 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
150 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
151 *) sim_endian="";;
152 esac
153 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
154 echo "Setting endian flags = $sim_endian" 6>&1
155 fi],[sim_endian=""])dnl
156
157 AC_ARG_ENABLE(sim-hostendian,
158 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
159 [case "${enableval}" in
160 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
161 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
162 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
163 *) sim_hostendian="";;
164 esac
165 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
166 echo "Setting hostendian flags = $sim_hostendian" 6>&1
167 fi],[sim_hostendian=""])dnl
168
169 AC_ARG_ENABLE(sim-smp,
170 [ --enable-sim-smp=n Specify number of processors to configure for.],
171 [case "${enableval}" in
172 yes) sim_smp="-DWITH_SMP=2";;
173 no) sim_smp="-DWITH_SMP=0";;
174 *) sim_smp="-DWITH_SMP=$enableval";;
175 esac
176 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
177 echo "Setting smp flags = $sim_smp" 6>&1
178 fi],[sim_smp="-DWITH_SMP=0"
179 if test x"$silent" != x"yes"; then
180 echo "Setting smp flags = $sim_smp" 6>&1
181 fi])dnl
182
183 AC_ARG_ENABLE(sim-bitsize,
184 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
185 [case "${enableval}" in
186 yes) sim_bitsize="";;
187 no) sim_bitsize="";;
188 *) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
189 esac
190 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
191 echo "Setting bitsize flags = $sim_bitsize" 6>&1
192 fi],[sim_bitsize=""])dnl
193
194 AC_ARG_ENABLE(sim-hostbitsize,
195 [ --enable-sim-hostbitsize=n Specify host bitsize (32 or 64).],
196 [case "${enableval}" in
197 yes) sim_hostbitsize="";;
198 no) sim_hostbitsize="";;
199 *) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
200 esac
201 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
202 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
203 fi],[sim_hostbitsize=""])dnl
204
205 AC_ARG_ENABLE(sim-env,
206 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
207 [case "${enableval}" in
208 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
209 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
210 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
211 *) sim_env="";;
212 esac
213 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
214 echo "Setting env flags = $sim_env" 6>&1
215 fi],[sim_env=""])dnl
216
217 AC_ARG_ENABLE(sim-timebase,
218 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
219 [case "${enableval}" in
220 yes) sim_timebase="-DWITH_TIME_BASE=1";;
221 no) sim_timebase="-DWITH_TIME_BASE=0";;
222 *) sim_timebase="";;
223 esac
224 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
225 echo "Setting timebase flags = $sim_timebase" 6>&1
226 fi],[sim_timebase=""])dnl
227
228 AC_ARG_ENABLE(sim-alignment,
229 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
230 [case "${enableval}" in
231 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
232 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
233 *) sim_alignment="-DWITH_ALIGNMENT=$enableval";;
234 esac
235 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
236 echo "Setting alignment flags = $sim_alignment" 6>&1
237 fi],[sim_alignment=""])dnl
238
239 AC_ARG_ENABLE(sim-trace,
240 [ --enable-sim-trace Specify whether tracing is supported.],
241 [case "${enableval}" in
242 yes) sim_trace="-DWITH_TRACE=1";;
243 no) sim_trace="-DWITH_TRACE=0";;
244 *) sim_trace="";;
245 esac
246 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
247 echo "Setting trace flags = $sim_trace" 6>&1
248 fi],[sim_trace=""])dnl
249
250 AC_ARG_ENABLE(sim-assert,
251 [ --enable-sim-assert Specify whether to perform random assertions.],
252 [case "${enableval}" in
253 yes) sim_assert="-DWITH_ASSERT=1";;
254 no) sim_assert="-DWITH_ASSERT=0";;
255 *) sim_assert="";;
256 esac
257 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
258 echo "Setting assert flags = $sim_assert" 6>&1
259 fi],[sim_assert=""])dnl
260
261 AC_ARG_ENABLE(sim-float,
262 [ --enable-sim-float Specify whether to use host floating point or simulate.],
263 [case "${enableval}" in
264 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
265 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
266 *) sim_float="";;
267 esac
268 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
269 echo "Setting float flags = $sim_float" 6>&1
270 fi],[sim_float=""])dnl
271
272 AC_ARG_ENABLE(sim-monitor,
273 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
274 [case "${enableval}" in
275 yes) sim_mon="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
276 no) sim_mon="-DWITH_MON=0";;
277 instruction) sim_mon="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
278 memory) sim_mon="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
279 *) sim_mon="-DWITH_MON='$enableval'";;
280 esac
281 if test x"$silent" != x"yes" && test x"$sim_mon" != x""; then
282 echo "Setting monitor flags = $sim_mon" 6>&1
283 fi],[sim_mon=""])dnl
284
285 AC_ARG_ENABLE(sim-function-unit,
286 [ --enable-sim-function-unit Specify whether detailed functional unit support is built.],
287 [case "${enableval}" in
288 yes) sim_func="-DWITH_FUNCTION_UNIT=1";;
289 no) sim_func="-DWITH_FUNCTION_UNIT=0";;
290 *) sim_func="";;
291 esac
292 if test x"$silent" != x"yes" && test x"$sim_func" != x""; then
293 echo "Setting function-unit flags = $sim_func" 6>&1
294 fi],[sim_func=""])dnl
295
296 AC_ARG_ENABLE(sim-model,
297 [ --enable-sim-model=which Specify PowerPC to model.],
298 [case "${enableval}" in
299 yes) sim_model="";;
300 no) sim_model="";;
301 *) sim_model="-DWITH_PPC_MODEL=${enableval}";;
302 esac
303 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
304 echo "Setting model flags = $sim_model" 6>&1
305 fi],[sim_model=""])dnl
306
307 AC_ARG_ENABLE(sim-default-model,
308 [ --enable-sim-default-model=which Specify default PowerPC to model.],
309 [case "${enableval}" in
310 yes) sim_default_model="";;
311 no) sim_default_model="";;
312 *) sim_default_model="-DWITH_DEFAULT_PPC_MODEL=${enableval}";;
313 esac
314 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
315 echo "Setting default-model flags = $sim_default_model" 6>&1
316 fi],[sim_model=""])dnl
317
318 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
319 AC_CANONICAL_SYSTEM
320 AC_ARG_PROGRAM
321
322 . ${srcdir}/../../bfd/configure.host
323
324 AC_CONFIG_HEADER(config.h:config.in)
325
326 AC_PROG_CC
327 AC_SUBST(CFLAGS)
328 AC_SUBST(HDEFINES)
329 AR=${AR-ar}
330 AC_SUBST(AR)
331 AC_PROG_RANLIB
332 AC_SUBST(sim_cflags)
333 AC_SUBST(sim_warnings)
334 AC_SUBST(sim_config)
335 AC_SUBST(sim_opcode)
336 AC_SUBST(sim_switch)
337 AC_SUBST(sim_dup)
338 AC_SUBST(sim_filter)
339 AC_SUBST(sim_icache)
340 AC_SUBST(sim_inline)
341 AC_SUBST(sim_bswap)
342 AC_SUBST(sim_endian)
343 AC_SUBST(sim_hostendian)
344 AC_SUBST(sim_smp)
345 AC_SUBST(sim_bitsize)
346 AC_SUBST(sim_hostbitsize)
347 AC_SUBST(sim_env)
348 AC_SUBST(sim_timebase)
349 AC_SUBST(sim_alignment)
350 AC_SUBST(sim_float)
351 AC_SUBST(sim_trace)
352 AC_SUBST(sim_assert)
353 AC_SUBST(sim_monitor)
354 AC_SUBST(sim_func)
355 AC_SUBST(sim_model)
356 AC_SUBST(sim_default_model)
357
358 AC_CHECK_FUNCS(getrusage)
359
360 # Put a plausible default for CC_FOR_BUILD in Makefile.
361 AC_C_CROSS
362 if test "x$cross_compiling" = "xno"; then
363 CC_FOR_BUILD='$(CC)'
364 else
365 CC_FOR_BUILD=gcc
366 fi
367 AC_SUBST(CC_FOR_BUILD)
368
369 AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h unistd.h sys/resource.h)
370
371 AC_OUTPUT(Makefile,
372 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])