1 dnl Process this file with autoconf to produce a configure script.
7 # Put a plausible default for CC_FOR_BUILD in Makefile.
9 if test "x$cross_compiling" = "xno"; then
15 AC_ARG_ENABLE(sim-cflags,
16 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
17 [case "${enableval}" in
18 yes) sim_cflags="-O2 -fomit-frame-pointer";;
20 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
22 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
23 echo "Setting sim cflags = $sim_cflags" 6>&1
24 fi],[sim_cflags=""])dnl
26 AC_ARG_ENABLE(sim-warnings,
27 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
28 [case "${enableval}" in
29 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes";;
30 no) sim_warnings="-w";;
31 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
33 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
34 echo "Setting warning flags = $sim_warnings" 6>&1
35 fi],[sim_warnings=""])dnl
37 AC_ARG_ENABLE(sim-config,
38 [ --enable-sim-config=file Override default config file],
39 [case "${enableval}" in
40 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
41 *) if test -f "${srcdir}/${enableval}"; then
42 sim_config="${enableval}";
43 elif test -f "${srcdir}/${enableval}-config.h"; then
44 sim_config="${enableval}-config.h"
46 AC_MSG_ERROR("Config file $enableval was not found");
47 sim_config=std-config.h
50 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
51 echo "Setting config flags = $sim_config" 6>&1
52 fi],[sim_config="std-config.h"
53 if test x"$silent" != x"yes"; then
54 echo "Setting config flags = $sim_config" 6>&1
57 AC_ARG_ENABLE(sim-opcode,
58 [ --enable-sim-opcode=which Override default opcode lookup.],
59 [case "${enableval}" in
60 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
61 *) if test -f "${srcdir}/${enableval}"; then
62 sim_opcode="${enableval}"
63 elif test -f "${srcdir}/ppc-opcode-${enableval}"; then
64 sim_opcode="ppc-opcode-${enableval}"
66 AC_MSG_ERROR("File $enableval is not an opcode rules file");
67 sim_opcode="ppc-opcode-complex"
70 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
71 echo "Setting opcode flags = $sim_opcode" 6>&1
72 fi],[sim_opcode="ppc-opcode-complex"
73 if test x"$silent" != x"yes"; then
74 echo "Setting opcode flags = $sim_opcode"
77 AC_ARG_ENABLE(sim-switch,
78 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
79 [case "${enableval}" in
80 yes) sim_switch="-s";;
82 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
84 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
85 echo "Setting switch flags = $sim_switch" 6>&1
87 if test x"$silent" != x"yes"; then
88 echo "Setting switch flags = $sim_switch" 6>&1
91 AC_ARG_ENABLE(sim-duplicate,
92 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
93 [case "${enableval}" in
96 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
98 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
99 echo "Setting duplicate flags = $sim_dup" 6>&1
101 if test x"$silent" != x"yes"; then
102 echo "Setting duplicate flags = $sim_dup" 6>&1
105 AC_ARG_ENABLE(sim-filter,
106 [ --enable-sim-filter=rule Specify filter rules.],
107 [case "${enableval}" in
108 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
110 *) sim_filter="-f $enableval";;
112 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
113 echo "Setting filter flags = $sim_filter" 6>&1
114 fi],[sim_filter="-f 64"
115 if test x"$silent" != x"yes"; then
116 echo "Setting filter flags = $sim_filter" 6>&1
119 AC_ARG_ENABLE(sim-icache,
120 [ --enable-sim-icache=size Specify instruction cache size.],
122 [case "${enableval}" in
123 yes) sim_icache="-r 1024"; icache="1024";;
124 define) sim_icache="-r 1024 -R"; icache="1024";;
126 *) sim_icache="-r ${enableval}"; icache="${enableval}";;
128 if test x"$silent" != x"yes" && test x"$icache" != x""; then
129 echo "Setting instruction cache size to $icache"
130 fi],[sim_icache="-r 1024"
131 if test x"$silent" != x"yes"; then
132 echo "Setting instruction cache size to 1024"
135 AC_ARG_ENABLE(sim-inline,
136 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
139 no) sim_inline="-DDEFAULT_INLINE=0";;
140 0) sim_inline="-DDEFAULT_INLINE=0";;
141 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
142 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
143 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
146 *_INLINE=*) new_flag="-D$x";;
147 *_INLINE) new_flag="-D$x=ALL_INLINE";;
148 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
149 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
151 if test x"$sim_inline" = x""; then
152 sim_inline="$new_flag"
154 sim_inline="$sim_inline $new_flag"
158 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
159 echo "Setting inline flags = $sim_inline" 6>&1
160 fi],[if test x"$GCC" != ""; then
161 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
162 if test x"$silent" != x"yes"; then
163 echo "Setting inline flags = $sim_inline" 6>&1
169 AC_ARG_ENABLE(sim-bswap,
170 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
171 [case "${enableval}" in
172 yes) sim_bswap="-DWITH_BSWAP=1";;
173 no) sim_bswap="-DWITH_BSWAP=0";;
174 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
176 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
177 echo "Setting bswap flags = $sim_bswap" 6>&1
178 fi],[sim_bswap=""])dnl
180 AC_ARG_ENABLE(sim-endian,
181 [ --enable-sim-endian=endian Specify target byte endian orientation.],
182 [case "${enableval}" in
183 yes) case "$target" in
184 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
185 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
186 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
188 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
189 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
190 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
191 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
193 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
194 echo "Setting endian flags = $sim_endian" 6>&1
195 fi],[sim_endian=""])dnl
197 AC_ARG_ENABLE(sim-hostendian,
198 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
199 [case "${enableval}" in
200 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
201 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
202 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
203 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
205 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
206 echo "Setting hostendian flags = $sim_hostendian" 6>&1
208 if test "x$cross_compiling" = "xno"; then
210 if test $ac_cv_c_bigendian = yes; then
211 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
213 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
216 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
219 AC_ARG_ENABLE(sim-smp,
220 [ --enable-sim-smp=n Specify number of processors to configure for.],
221 [case "${enableval}" in
222 yes) sim_smp="-DWITH_SMP=5";;
223 no) sim_smp="-DWITH_SMP=0";;
224 *) sim_smp="-DWITH_SMP=$enableval";;
226 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
227 echo "Setting smp flags = $sim_smp" 6>&1
228 fi],[sim_smp="-DWITH_SMP=5"
229 if test x"$silent" != x"yes"; then
230 echo "Setting smp flags = $sim_smp" 6>&1
233 AC_ARG_ENABLE(sim-xor-endian,
234 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
235 [case "${enableval}" in
236 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
237 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
238 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
240 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
241 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
242 fi],[sim_xor_endian=""])dnl
244 AC_ARG_ENABLE(sim-bitsize,
245 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
246 [case "${enableval}" in
247 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
248 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval, expected 32 or 64"); sim_bitsize="";;
250 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
251 echo "Setting bitsize flags = $sim_bitsize" 6>&1
252 fi],[sim_bitsize=""])dnl
254 AC_ARG_ENABLE(sim-hostbitsize,
255 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
256 [case "${enableval}" in
257 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
258 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval, expected 32 or 64"); sim_hostbitsize="";;
260 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
261 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
262 fi],[sim_hostbitsize=""])dnl
264 AC_ARG_ENABLE(sim-env,
265 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
266 [case "${enableval}" in
267 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
268 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
269 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
270 no) sim_env="-DWITH_ENVIRONMENT=0";;
271 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
273 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
274 echo "Setting env flags = $sim_env" 6>&1
277 AC_ARG_ENABLE(sim-timebase,
278 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
279 [case "${enableval}" in
280 yes) sim_timebase="-DWITH_TIME_BASE=1";;
281 no) sim_timebase="-DWITH_TIME_BASE=0";;
282 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
284 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
285 echo "Setting timebase flags = $sim_timebase" 6>&1
286 fi],[sim_timebase=""])dnl
288 AC_ARG_ENABLE(sim-alignment,
289 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
290 [case "${enableval}" in
291 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
292 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
293 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
294 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
296 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
297 echo "Setting alignment flags = $sim_alignment" 6>&1
298 fi],[sim_alignment=""])dnl
300 AC_ARG_ENABLE(sim-trace,
301 [ --enable-sim-trace Specify whether tracing is supported.],
302 [case "${enableval}" in
303 yes) sim_trace="-DWITH_TRACE=1";;
304 no) sim_trace="-DWITH_TRACE=0";;
305 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
307 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
308 echo "Setting trace flags = $sim_trace" 6>&1
309 fi],[sim_trace=""])dnl
311 AC_ARG_ENABLE(sim-assert,
312 [ --enable-sim-assert Specify whether to perform random assertions.],
313 [case "${enableval}" in
314 yes) sim_assert="-DWITH_ASSERT=1";;
315 no) sim_assert="-DWITH_ASSERT=0";;
316 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
318 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
319 echo "Setting assert flags = $sim_assert" 6>&1
320 fi],[sim_assert=""])dnl
322 AC_ARG_ENABLE(sim-reserved-bits,
323 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
324 [case "${enableval}" in
325 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
326 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
327 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
329 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
330 echo "Setting reserved flags = $sim_reserved" 6>&1
331 fi],[sim_reserved=""])dnl
333 AC_ARG_ENABLE(sim-float,
334 [ --enable-sim-float Specify whether to use host floating point or simulate.],
335 [case "${enableval}" in
336 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
337 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
338 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
340 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
341 echo "Setting float flags = $sim_float" 6>&1
342 fi],[sim_float=""])dnl
344 AC_ARG_ENABLE(sim-monitor,
345 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
346 [case "${enableval}" in
347 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
348 no) sim_monitor="-DWITH_MON=0";;
349 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
350 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
351 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
353 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
354 echo "Setting monitor flags = $sim_monitor" 6>&1
355 fi],[sim_monitor=""])dnl
357 AC_ARG_ENABLE(sim-model,
358 [ --enable-sim-model=which Specify PowerPC to model.],
359 [case "${enableval}" in
360 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
361 *) sim_model="-DWITH_MODEL=${enableval}";;
363 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
364 echo "Setting model flags = $sim_model" 6>&1
365 fi],[sim_model=""])dnl
367 AC_ARG_ENABLE(sim-default-model,
368 [ --enable-sim-default-model=which Specify default PowerPC to model.],
369 [case "${enableval}" in
370 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
371 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
373 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
374 echo "Setting default-model flags = $sim_default_model" 6>&1
375 fi],[sim_model=""])dnl
377 AC_ARG_ENABLE(sim-model-issue,
378 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
379 [case "${enableval}" in
380 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
381 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
382 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
384 if test x"$silent" != x"yes"; then
385 echo "Setting model-issue flags = $sim_model_issue" 6>&1
386 fi],[sim_model_issue=""])dnl
388 AC_ARG_ENABLE(sim-stdio,
389 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
390 [case "${enableval}" in
391 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
392 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
393 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
395 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
396 echo "Setting stdio flags = $sim_stdio" 6>&1
397 fi],[sim_stdio=""])dnl
399 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
403 . ${srcdir}/../../bfd/configure.host
405 AC_CONFIG_HEADER(config.h:config.in)
407 AC_SUBST(CC_FOR_BUILD)
414 AC_SUBST(sim_warnings)
424 AC_SUBST(sim_xor_endian)
425 AC_SUBST(sim_hostendian)
427 AC_SUBST(sim_bitsize)
428 AC_SUBST(sim_hostbitsize)
430 AC_SUBST(sim_timebase)
431 AC_SUBST(sim_alignment)
435 AC_SUBST(sim_reserved)
436 AC_SUBST(sim_monitor)
438 AC_SUBST(sim_default_model)
439 AC_SUBST(sim_model_issue)
447 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)
449 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)
453 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])