1 dnl Process this file with autoconf to produce a configure script.
8 # Put a plausible default for CC_FOR_BUILD in Makefile.
10 if test "x$cross_compiling" = "xno"; then
16 AC_ARG_ENABLE(sim-cflags,
17 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
18 [case "${enableval}" in
19 yes) sim_cflags="-O2 -fomit-frame-pointer";;
21 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
23 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
24 echo "Setting sim cflags = $sim_cflags" 6>&1
25 fi],[sim_cflags=""])dnl
27 AC_ARG_ENABLE(sim-warnings,
28 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
29 [case "${enableval}" in
30 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes";;
31 no) sim_warnings="-w";;
32 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
34 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
35 echo "Setting warning flags = $sim_warnings" 6>&1
36 fi],[sim_warnings=""])dnl
38 AC_ARG_ENABLE(sim-config,
39 [ --enable-sim-config=file Override default config file],
40 [case "${enableval}" in
41 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
42 *) if test -f "${srcdir}/${enableval}"; then
43 sim_config="${enableval}";
44 elif test -f "${srcdir}/${enableval}-config.h"; then
45 sim_config="${enableval}-config.h"
47 AC_MSG_ERROR("Config file $enableval was not found");
48 sim_config=std-config.h
51 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
52 echo "Setting config flags = $sim_config" 6>&1
53 fi],[sim_config="std-config.h"
54 if test x"$silent" != x"yes"; then
55 echo "Setting config flags = $sim_config" 6>&1
58 AC_ARG_ENABLE(sim-opcode,
59 [ --enable-sim-opcode=which Override default opcode lookup.],
60 [case "${enableval}" in
61 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
62 *) if test -f "${srcdir}/${enableval}"; then
63 sim_opcode="${enableval}"
64 elif test -f "${srcdir}/ppc-opcode-${enableval}"; then
65 sim_opcode="ppc-opcode-${enableval}"
67 AC_MSG_ERROR("File $enableval is not an opcode rules file");
68 sim_opcode="ppc-opcode-complex"
71 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
72 echo "Setting opcode flags = $sim_opcode" 6>&1
73 fi],[sim_opcode="ppc-opcode-complex"
74 if test x"$silent" != x"yes"; then
75 echo "Setting opcode flags = $sim_opcode"
78 AC_ARG_ENABLE(sim-switch,
79 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
80 [case "${enableval}" in
81 yes) sim_switch="-s";;
83 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
85 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
86 echo "Setting switch flags = $sim_switch" 6>&1
88 if test x"$silent" != x"yes"; then
89 echo "Setting switch flags = $sim_switch" 6>&1
92 AC_ARG_ENABLE(sim-duplicate,
93 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
94 [case "${enableval}" in
97 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
99 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
100 echo "Setting duplicate flags = $sim_dup" 6>&1
102 if test x"$silent" != x"yes"; then
103 echo "Setting duplicate flags = $sim_dup" 6>&1
106 AC_ARG_ENABLE(sim-filter,
107 [ --enable-sim-filter=rule Specify filter rules.],
108 [case "${enableval}" in
109 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
111 *) sim_filter="-f $enableval";;
113 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
114 echo "Setting filter flags = $sim_filter" 6>&1
115 fi],[sim_filter="-f 64"
116 if test x"$silent" != x"yes"; then
117 echo "Setting filter flags = $sim_filter" 6>&1
120 AC_ARG_ENABLE(sim-icache,
121 [ --enable-sim-icache=size Specify instruction cache size.],
123 [case "${enableval}" in
124 yes) sim_icache="-r 1024"; icache="1024";;
125 define) sim_icache="-r 1024 -R"; icache="1024";;
127 *) sim_icache="-r ${enableval}"; icache="${enableval}";;
129 if test x"$silent" != x"yes" && test x"$icache" != x""; then
130 echo "Setting instruction cache size to $icache"
131 fi],[sim_icache="-r 1024"
132 if test x"$silent" != x"yes"; then
133 echo "Setting instruction cache size to 1024"
136 AC_ARG_ENABLE(sim-inline,
137 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
140 no) sim_inline="-DDEFAULT_INLINE=0";;
141 0) sim_inline="-DDEFAULT_INLINE=0";;
142 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
143 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
144 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
147 *_INLINE=*) new_flag="-D$x";;
148 *_INLINE) new_flag="-D$x=ALL_INLINE";;
149 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
150 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
152 if test x"$sim_inline" = x""; then
153 sim_inline="$new_flag"
155 sim_inline="$sim_inline $new_flag"
159 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
160 echo "Setting inline flags = $sim_inline" 6>&1
161 fi],[if test x"$GCC" != ""; then
162 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
163 if test x"$silent" != x"yes"; then
164 echo "Setting inline flags = $sim_inline" 6>&1
170 AC_ARG_ENABLE(sim-bswap,
171 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
172 [case "${enableval}" in
173 yes) sim_bswap="-DWITH_BSWAP=1";;
174 no) sim_bswap="-DWITH_BSWAP=0";;
175 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
177 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
178 echo "Setting bswap flags = $sim_bswap" 6>&1
179 fi],[sim_bswap=""])dnl
181 AC_ARG_ENABLE(sim-endian,
182 [ --enable-sim-endian=endian Specify target byte endian orientation.],
183 [case "${enableval}" in
184 yes) case "$target" in
185 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
186 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
187 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
189 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
190 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
191 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
192 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
194 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
195 echo "Setting endian flags = $sim_endian" 6>&1
196 fi],[sim_endian=""])dnl
198 AC_ARG_ENABLE(sim-hostendian,
199 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
200 [case "${enableval}" in
201 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
202 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
203 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
204 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
206 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
207 echo "Setting hostendian flags = $sim_hostendian" 6>&1
209 if test "x$cross_compiling" = "xno"; then
211 if test $ac_cv_c_bigendian = yes; then
212 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
214 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
217 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
220 AC_ARG_ENABLE(sim-smp,
221 [ --enable-sim-smp=n Specify number of processors to configure for.],
222 [case "${enableval}" in
223 yes) sim_smp="-DWITH_SMP=5";;
224 no) sim_smp="-DWITH_SMP=0";;
225 *) sim_smp="-DWITH_SMP=$enableval";;
227 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
228 echo "Setting smp flags = $sim_smp" 6>&1
229 fi],[sim_smp="-DWITH_SMP=5"
230 if test x"$silent" != x"yes"; then
231 echo "Setting smp flags = $sim_smp" 6>&1
234 AC_ARG_ENABLE(sim-xor-endian,
235 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
236 [case "${enableval}" in
237 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
238 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
239 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
241 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
242 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
243 fi],[sim_xor_endian=""])dnl
245 AC_ARG_ENABLE(sim-bitsize,
246 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
247 [case "${enableval}" in
248 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
249 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval, expected 32 or 64"); sim_bitsize="";;
251 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
252 echo "Setting bitsize flags = $sim_bitsize" 6>&1
253 fi],[sim_bitsize=""])dnl
255 AC_ARG_ENABLE(sim-hostbitsize,
256 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
257 [case "${enableval}" in
258 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
259 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval, expected 32 or 64"); sim_hostbitsize="";;
261 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
262 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
263 fi],[sim_hostbitsize=""])dnl
265 AC_ARG_ENABLE(sim-env,
266 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
267 [case "${enableval}" in
268 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
269 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
270 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
271 no) sim_env="-DWITH_ENVIRONMENT=0";;
272 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
274 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
275 echo "Setting env flags = $sim_env" 6>&1
278 AC_ARG_ENABLE(sim-timebase,
279 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
280 [case "${enableval}" in
281 yes) sim_timebase="-DWITH_TIME_BASE=1";;
282 no) sim_timebase="-DWITH_TIME_BASE=0";;
283 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
285 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
286 echo "Setting timebase flags = $sim_timebase" 6>&1
287 fi],[sim_timebase=""])dnl
289 AC_ARG_ENABLE(sim-alignment,
290 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
291 [case "${enableval}" in
292 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
293 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
294 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
295 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
297 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
298 echo "Setting alignment flags = $sim_alignment" 6>&1
299 fi],[sim_alignment=""])dnl
301 AC_ARG_ENABLE(sim-trace,
302 [ --enable-sim-trace Specify whether tracing is supported.],
303 [case "${enableval}" in
304 yes) sim_trace="-DWITH_TRACE=1";;
305 no) sim_trace="-DWITH_TRACE=0";;
306 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
308 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
309 echo "Setting trace flags = $sim_trace" 6>&1
310 fi],[sim_trace=""])dnl
312 AC_ARG_ENABLE(sim-assert,
313 [ --enable-sim-assert Specify whether to perform random assertions.],
314 [case "${enableval}" in
315 yes) sim_assert="-DWITH_ASSERT=1";;
316 no) sim_assert="-DWITH_ASSERT=0";;
317 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
319 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
320 echo "Setting assert flags = $sim_assert" 6>&1
321 fi],[sim_assert=""])dnl
323 AC_ARG_ENABLE(sim-reserved-bits,
324 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
325 [case "${enableval}" in
326 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
327 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
328 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
330 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
331 echo "Setting reserved flags = $sim_reserved" 6>&1
332 fi],[sim_reserved=""])dnl
334 AC_ARG_ENABLE(sim-float,
335 [ --enable-sim-float Specify whether to use host floating point or simulate.],
336 [case "${enableval}" in
337 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
338 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
339 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
341 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
342 echo "Setting float flags = $sim_float" 6>&1
343 fi],[sim_float=""])dnl
345 AC_ARG_ENABLE(sim-monitor,
346 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
347 [case "${enableval}" in
348 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
349 no) sim_monitor="-DWITH_MON=0";;
350 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
351 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
352 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
354 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
355 echo "Setting monitor flags = $sim_monitor" 6>&1
356 fi],[sim_monitor=""])dnl
358 AC_ARG_ENABLE(sim-model,
359 [ --enable-sim-model=which Specify PowerPC to model.],
360 [case "${enableval}" in
361 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
362 *) sim_model="-DWITH_MODEL=${enableval}";;
364 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
365 echo "Setting model flags = $sim_model" 6>&1
366 fi],[sim_model=""])dnl
368 AC_ARG_ENABLE(sim-default-model,
369 [ --enable-sim-default-model=which Specify default PowerPC to model.],
370 [case "${enableval}" in
371 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
372 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
374 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
375 echo "Setting default-model flags = $sim_default_model" 6>&1
376 fi],[sim_model=""])dnl
378 AC_ARG_ENABLE(sim-model-issue,
379 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
380 [case "${enableval}" in
381 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
382 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
383 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
385 if test x"$silent" != x"yes"; then
386 echo "Setting model-issue flags = $sim_model_issue" 6>&1
387 fi],[sim_model_issue=""])dnl
389 AC_ARG_ENABLE(sim-stdio,
390 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
391 [case "${enableval}" in
392 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
393 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
394 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
396 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
397 echo "Setting stdio flags = $sim_stdio" 6>&1
398 fi],[sim_stdio=""])dnl
400 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
404 . ${srcdir}/../../bfd/configure.host
406 AC_CONFIG_HEADER(config.h:config.in)
408 AC_SUBST(CC_FOR_BUILD)
415 AC_SUBST(sim_warnings)
425 AC_SUBST(sim_xor_endian)
426 AC_SUBST(sim_hostendian)
428 AC_SUBST(sim_bitsize)
429 AC_SUBST(sim_hostbitsize)
431 AC_SUBST(sim_timebase)
432 AC_SUBST(sim_alignment)
436 AC_SUBST(sim_reserved)
437 AC_SUBST(sim_monitor)
439 AC_SUBST(sim_default_model)
440 AC_SUBST(sim_model_issue)
456 AC_CHECK_FUNCS(cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink)
458 AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h)
462 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])