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 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
295 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
296 echo "Setting alignment flags = $sim_alignment" 6>&1
297 fi],[sim_alignment=""])dnl
299 AC_ARG_ENABLE(sim-trace,
300 [ --enable-sim-trace Specify whether tracing is supported.],
301 [case "${enableval}" in
302 yes) sim_trace="-DWITH_TRACE=1";;
303 no) sim_trace="-DWITH_TRACE=0";;
304 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
306 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
307 echo "Setting trace flags = $sim_trace" 6>&1
308 fi],[sim_trace=""])dnl
310 AC_ARG_ENABLE(sim-assert,
311 [ --enable-sim-assert Specify whether to perform random assertions.],
312 [case "${enableval}" in
313 yes) sim_assert="-DWITH_ASSERT=1";;
314 no) sim_assert="-DWITH_ASSERT=0";;
315 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
317 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
318 echo "Setting assert flags = $sim_assert" 6>&1
319 fi],[sim_assert=""])dnl
321 AC_ARG_ENABLE(sim-reserved-bits,
322 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
323 [case "${enableval}" in
324 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
325 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
326 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
328 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
329 echo "Setting reserved flags = $sim_reserved" 6>&1
330 fi],[sim_reserved=""])dnl
332 AC_ARG_ENABLE(sim-float,
333 [ --enable-sim-float Specify whether to use host floating point or simulate.],
334 [case "${enableval}" in
335 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
336 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
337 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
339 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
340 echo "Setting float flags = $sim_float" 6>&1
341 fi],[sim_float=""])dnl
343 AC_ARG_ENABLE(sim-monitor,
344 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
345 [case "${enableval}" in
346 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
347 no) sim_monitor="-DWITH_MON=0";;
348 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
349 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
350 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
352 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
353 echo "Setting monitor flags = $sim_monitor" 6>&1
354 fi],[sim_monitor=""])dnl
356 AC_ARG_ENABLE(sim-model,
357 [ --enable-sim-model=which Specify PowerPC to model.],
358 [case "${enableval}" in
359 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
360 *) sim_model="-DWITH_MODEL=${enableval}";;
362 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
363 echo "Setting model flags = $sim_model" 6>&1
364 fi],[sim_model=""])dnl
366 AC_ARG_ENABLE(sim-default-model,
367 [ --enable-sim-default-model=which Specify default PowerPC to model.],
368 [case "${enableval}" in
369 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
370 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
372 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
373 echo "Setting default-model flags = $sim_default_model" 6>&1
374 fi],[sim_model=""])dnl
376 AC_ARG_ENABLE(sim-model-issue,
377 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
378 [case "${enableval}" in
379 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
380 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
381 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
383 if test x"$silent" != x"yes"; then
384 echo "Setting model-issue flags = $sim_model_issue" 6>&1
385 fi],[sim_model_issue=""])dnl
387 AC_ARG_ENABLE(sim-stdio,
388 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
389 [case "${enableval}" in
390 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
391 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
392 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
394 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
395 echo "Setting stdio flags = $sim_stdio" 6>&1
396 fi],[sim_stdio=""])dnl
398 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
402 . ${srcdir}/../../bfd/configure.host
404 AC_CONFIG_HEADER(config.h:config.in)
406 AC_SUBST(CC_FOR_BUILD)
413 AC_SUBST(sim_warnings)
423 AC_SUBST(sim_xor_endian)
424 AC_SUBST(sim_hostendian)
426 AC_SUBST(sim_bitsize)
427 AC_SUBST(sim_hostbitsize)
429 AC_SUBST(sim_timebase)
430 AC_SUBST(sim_alignment)
434 AC_SUBST(sim_reserved)
435 AC_SUBST(sim_monitor)
437 AC_SUBST(sim_default_model)
438 AC_SUBST(sim_model_issue)
446 AC_CHECK_FUNCS(dup dup2 fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getrusage gettimeofday getuid ioctl kill lseek lstat sigprocmask stat umask)
448 AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h sys/ioctl.h)
452 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])