* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[deliverable/binutils-gdb.git] / sim / ppc / configure.in
CommitLineData
cb7a6892 1dnl Process this file with autoconf to produce a configure script.
59fb3497 2sinclude(../common/aclocal.m4)
30c87b55 3AC_PREREQ(2.5)dnl
cb7a6892
MM
4AC_INIT(Makefile.in)
5
30c87b55 6AC_PROG_INSTALL
a72d2509
MM
7AC_PROG_CC
8
9# Put a plausible default for CC_FOR_BUILD in Makefile.
a72d2509
MM
10if test "x$cross_compiling" = "xno"; then
11 CC_FOR_BUILD='$(CC)'
12else
13 CC_FOR_BUILD=gcc
14fi
15
a2eb9d27
TT
16dnl We don't use gettext, but bfd does. So we do the appropriate checks
17dnl to see if there are intl libraries we should link against.
18ALL_LINGUAS=
19CY_GNU_GETTEXT
20
3fbe0641
MM
21
22AC_ARG_ENABLE(sim-alignment,
23[ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
24[case "${enableval}" in
25 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
26 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
27 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
28 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
29esac
30if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
31 echo "Setting alignment flags = $sim_alignment" 6>&1
32fi],[sim_alignment=""])dnl
33
34
35AC_ARG_ENABLE(sim-assert,
36[ --enable-sim-assert Specify whether to perform random assertions.],
37[case "${enableval}" in
38 yes) sim_assert="-DWITH_ASSERT=1";;
39 no) sim_assert="-DWITH_ASSERT=0";;
40 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
41esac
42if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
43 echo "Setting assert flags = $sim_assert" 6>&1
44fi],[sim_assert=""])dnl
45
46
47AC_ARG_ENABLE(sim-bitsize,
48[ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
49[case "${enableval}" in
50 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
51 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval. Expected 32 or 64"); sim_bitsize="";;
52esac
53if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
54 echo "Setting bitsize flags = $sim_bitsize" 6>&1
55fi],[sim_bitsize=""])dnl
56
57
58AC_ARG_ENABLE(sim-bswap,
59[ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
60[case "${enableval}" in
61 yes) sim_bswap="-DWITH_BSWAP=1";;
62 no) sim_bswap="-DWITH_BSWAP=0";;
63 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
64esac
65if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
66 echo "Setting bswap flags = $sim_bswap" 6>&1
67fi],[sim_bswap=""])dnl
68
69
c494cadd 70AC_ARG_ENABLE(sim-cflags,
73c4941b 71[ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
c494cadd
MM
72[case "${enableval}" in
73 yes) sim_cflags="-O2 -fomit-frame-pointer";;
74 no) sim_cflags="";;
e61900e6 75 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
ba62bb1c 76esac
2bc7869d 77if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
ba62bb1c
MM
78 echo "Setting sim cflags = $sim_cflags" 6>&1
79fi],[sim_cflags=""])dnl
c494cadd 80
30c87b55 81
c494cadd 82AC_ARG_ENABLE(sim-config,
73c4941b 83[ --enable-sim-config=file Override default config file],
c494cadd 84[case "${enableval}" in
a3114052 85 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
813ad010 86 *) if test -f "${srcdir}/${enableval}"; then
a3114052 87 sim_config="${enableval}";
813ad010 88 elif test -f "${srcdir}/${enableval}-config.h"; then
a3114052
MM
89 sim_config="${enableval}-config.h"
90 else
91 AC_MSG_ERROR("Config file $enableval was not found");
92 sim_config=std-config.h
93 fi;;
ba62bb1c 94esac
2bc7869d 95if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
ba62bb1c 96 echo "Setting config flags = $sim_config" 6>&1
a3114052
MM
97fi],[sim_config="std-config.h"
98if test x"$silent" != x"yes"; then
99 echo "Setting config flags = $sim_config" 6>&1
100fi])dnl
c494cadd 101
c494cadd 102
cdd31203
AC
103AC_ARG_ENABLE(sim-decode-mechanism,
104[ --enable-sim-decode-mechanism=which Specify the instruction decode mechanism.],
105[case "${enableval}" in
106 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-decode-mechanism=file");;
107 array|switch|padded-switch|goto-switch) sim_decode_mechanism="-T ${enableval}";;
108 *) AC_MSG_ERROR("File $enableval is not an opcode rules file");
109 sim_decode_mechanism="switch";;
110esac
111if test x"$silent" != x"yes" && test x"$sim_decode_mechanism" != x""; then
112 echo "Setting decode mechanism flags = $sim_decode_mechanism" 6>&1
113fi],[sim_decode_mechanism=""
114if test x"$silent" != x"yes"; then
115 echo "Setting decode mechanism flags = $sim_decode_mechanism"
116fi])dnl
117
118
3fbe0641
MM
119AC_ARG_ENABLE(sim-default-model,
120[ --enable-sim-default-model=which Specify default PowerPC to model.],
c494cadd 121[case "${enableval}" in
3fbe0641
MM
122 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
123 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
ba62bb1c 124esac
3fbe0641
MM
125if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
126 echo "Setting default-model flags = $sim_default_model" 6>&1
0f552ea0 127fi],[sim_default_model=""])dnl
3fbe0641 128
c494cadd
MM
129
130AC_ARG_ENABLE(sim-duplicate,
73c4941b 131[ --enable-sim-duplicate Expand (duplicate) semantic functions.],
c494cadd 132[case "${enableval}" in
30c87b55 133 yes) sim_dup="-E";;
a3114052
MM
134 no) sim_dup="";;
135 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
ba62bb1c 136esac
2bc7869d 137if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
ba62bb1c 138 echo "Setting duplicate flags = $sim_dup" 6>&1
30c87b55 139fi],[sim_dup="-E"
2bc7869d
MM
140if test x"$silent" != x"yes"; then
141 echo "Setting duplicate flags = $sim_dup" 6>&1
142fi])dnl
c494cadd 143
3fbe0641
MM
144
145AC_ARG_ENABLE(sim-endian,
146[ --enable-sim-endian=endian Specify target byte endian orientation.],
30c87b55 147[case "${enableval}" in
3fbe0641
MM
148 yes) case "$target" in
149 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
150 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
151 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
152 esac;;
153 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
154 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
155 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
156 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
30c87b55 157esac
3fbe0641
MM
158if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
159 echo "Setting endian flags = $sim_endian" 6>&1
160fi],[sim_endian=""])dnl
161
162
163AC_ARG_ENABLE(sim-env,
164[ --enable-sim-env=env Specify target environment (operating, virtual, user).],
165[case "${enableval}" in
166 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
167 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
168 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
169 no) sim_env="-DWITH_ENVIRONMENT=0";;
170 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
171esac
172if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
173 echo "Setting env flags = $sim_env" 6>&1
174fi],[sim_env=""])dnl
175
30c87b55 176
c494cadd 177AC_ARG_ENABLE(sim-filter,
73c4941b 178[ --enable-sim-filter=rule Specify filter rules.],
c494cadd 179[case "${enableval}" in
a3114052
MM
180 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
181 no) sim_filter="";;
30c87b55 182 *) sim_filter="-F $enableval";;
ba62bb1c 183esac
2bc7869d 184if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
ba62bb1c 185 echo "Setting filter flags = $sim_filter" 6>&1
c7f6f399 186fi],[sim_filter="-F 32,f,o"
2bc7869d
MM
187if test x"$silent" != x"yes"; then
188 echo "Setting filter flags = $sim_filter" 6>&1
189fi])dnl
c494cadd 190
3fbe0641
MM
191
192AC_ARG_ENABLE(sim-float,
193[ --enable-sim-float Specify whether to use host floating point or simulate.],
194[case "${enableval}" in
195 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
196 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
197 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
198esac
199if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
200 echo "Setting float flags = $sim_float" 6>&1
201fi],[sim_float=""])dnl
202
203
204AC_ARG_ENABLE(sim-hardware,
205[ --enable-sim-hardware=list Specify the hardware to be included in the build.],
206[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
207case "${enableval}" in
208 yes) ;;
209 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
210 ,*) hardware="${hardware}${enableval}";;
211 *,) hardware="${enableval}${hardware}";;
212 *) hardware="${enableval}"'';;
213esac
214sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
215sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
216if test x"$silent" != x"yes" && test x"$hardware" != x""; then
217 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
218fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
219sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
220sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
221if test x"$silent" != x"yes"; then
222 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
223fi])dnl
224
225
226AC_ARG_ENABLE(sim-hostbitsize,
227[ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
228[case "${enableval}" in
229 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
230 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval. Expected 32 or 64"); sim_hostbitsize="";;
231esac
232if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
233 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
234fi],[sim_hostbitsize=""])dnl
235
236
237AC_ARG_ENABLE(sim-hostendian,
332cb0a7 238[ --enable-sim-hostendian=end Specify host byte endian orientation.],
3fbe0641
MM
239[case "${enableval}" in
240 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
241 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
242 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
243 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
244esac
245if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
246 echo "Setting hostendian flags = $sim_hostendian" 6>&1
247fi],[
248if test "x$cross_compiling" = "xno"; then
249 AC_C_BIGENDIAN
250 if test $ac_cv_c_bigendian = yes; then
251 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
252 else
253 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
254 fi
255else
256 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
257fi])dnl
258
259
c494cadd 260AC_ARG_ENABLE(sim-icache,
5c04f4f7
MM
261[ --enable-sim-icache=size Specify instruction-decode cache size and type.],
262[icache="-R"
2e913166 263 case "${enableval}" in
30c87b55 264 yes) icache="1024"; sim_icache="-I $icache";;
5c04f4f7 265 no) sim_icache="-R";;
30c87b55
MM
266 *) icache=1024
267 sim_icache="-"
268 for x in `echo "${enableval}" | sed -e "s/,/ /g"`; do
269 case "$x" in
270 define) sim_icache="${sim_icache}R";;
271 semantic) sim_icache="${sim_icache}C";;
2e913166 272 insn) sim_icache="${sim_icache}S";;
30c87b55
MM
273 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) icache=$x;;
274 *) AC_MSG_ERROR("Unknown value $x for --enable-sim-icache"); sim_icache="";;
275 esac
276 done
277 sim_icache="${sim_icache}I $icache";;
c05c182d
MM
278esac
279if test x"$silent" != x"yes" && test x"$icache" != x""; then
30c87b55 280 echo "Setting instruction cache size to $icache ($sim_icache)"
5c04f4f7 281fi],[sim_icache="-CSRI 1024"
c05c182d 282if test x"$silent" != x"yes"; then
30c87b55 283 echo "Setting instruction cache size to 1024 ($sim_icache)"
c05c182d 284fi])dnl
c494cadd 285
2e913166 286
c494cadd 287AC_ARG_ENABLE(sim-inline,
73c4941b 288[ --enable-sim-inline=inlines Specify which functions should be inlined.],
c494cadd
MM
289[sim_inline=""
290case "$enableval" in
a9ddbbf5 291 no) sim_inline="-DDEFAULT_INLINE=0";;
b3737d33 292 0) sim_inline="-DDEFAULT_INLINE=0";;
93fac324
MM
293 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
294 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
c494cadd
MM
295 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
296 new_flag=""
297 case "$x" in
298 *_INLINE=*) new_flag="-D$x";;
c05c182d 299 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
2e913166 300 *_INLINE) new_flag="-D$x=ALL_INLINE";;
93fac324 301 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
c494cadd 302 esac
c05c182d 303 if test x"$sim_inline" = x""; then
c494cadd
MM
304 sim_inline="$new_flag"
305 else
c05c182d 306 sim_inline="$sim_inline $new_flag"
c494cadd
MM
307 fi
308 done;;
ba62bb1c 309esac
2bc7869d 310if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
ba62bb1c
MM
311 echo "Setting inline flags = $sim_inline" 6>&1
312fi],[if test x"$GCC" != ""; then
93fac324 313 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
2bc7869d
MM
314 if test x"$silent" != x"yes"; then
315 echo "Setting inline flags = $sim_inline" 6>&1
316 fi
ba62bb1c
MM
317else
318 sim_inline=""
319fi])dnl
c494cadd 320
3fbe0641
MM
321
322AC_ARG_ENABLE(sim-jump,
323[ --enable-sim-jump Jump between semantic code (instead of call/return).],
c494cadd 324[case "${enableval}" in
3fbe0641
MM
325 yes) sim_jump="-J";;
326 no) sim_jump="";;
327 *) AC_MSG_ERROR("--enable-sim-jump does not take a value"); sim_jump="";;
328esac
329if test x"$silent" != x"yes" && test x"$sim_jump" != x""; then
330 echo "Setting jump flag = $sim_jump" 6>&1
5c04f4f7 331fi],[sim_jump=""
3fbe0641
MM
332if test x"$silent" != x"yes"; then
333 echo "Setting jump flag = $sim_jump" 6>&1
334fi])dnl
c494cadd 335
3fbe0641
MM
336
337AC_ARG_ENABLE(sim-line-nr,
338[ --enable-sim-line-nr=opts Generate extra CPP code that references source rather than generated code],
c494cadd 339[case "${enableval}" in
3fbe0641
MM
340 yes) sim_line_nr="";;
341 no) sim_line_nr="-L";;
342 *) AC_MSG_ERROR("--enable-sim-line-nr does not take a value"); sim_line_nr="";;
ba62bb1c 343esac
3fbe0641
MM
344if test x"$silent" != x"yes" && test x"$sim_line_nr" != x""; then
345 echo "Setting warning flags = $sim_line_nr" 6>&1
346fi],[sim_line_nr=""])dnl
347
348
349AC_ARG_ENABLE(sim-model,
350[ --enable-sim-model=which Specify PowerPC to model.],
351[case "${enableval}" in
352 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
353 *) sim_model="-DWITH_MODEL=${enableval}";;
354esac
355if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
356 echo "Setting model flags = $sim_model" 6>&1
357fi],[sim_model=""])dnl
358
359
360AC_ARG_ENABLE(sim-model-issue,
361[ --enable-sim-model-issue Specify whether to simulate model specific actions],
362[case "${enableval}" in
363 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
364 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
365 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
366esac
367if test x"$silent" != x"yes"; then
368 echo "Setting model-issue flags = $sim_model_issue" 6>&1
369fi],[sim_model_issue=""])dnl
370
371
372AC_ARG_ENABLE(sim-monitor,
373[ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
374[case "${enableval}" in
375 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
376 no) sim_monitor="-DWITH_MON=0";;
377 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
378 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
379 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
380esac
381if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
382 echo "Setting monitor flags = $sim_monitor" 6>&1
383fi],[sim_monitor=""])dnl
384
385
386AC_ARG_ENABLE(sim-opcode,
387[ --enable-sim-opcode=which Override default opcode lookup.],
388[case "${enableval}" in
389 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
390 *) if test -f "${srcdir}/${enableval}"; then
391 sim_opcode="${enableval}"
cdd31203
AC
392 elif test -f "${srcdir}/dc-${enableval}"; then
393 sim_opcode="dc-${enableval}"
3fbe0641
MM
394 else
395 AC_MSG_ERROR("File $enableval is not an opcode rules file");
cdd31203 396 sim_opcode="dc-complex"
3fbe0641
MM
397 fi;;
398esac
399if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
400 echo "Setting opcode flags = $sim_opcode" 6>&1
cdd31203 401fi],[sim_opcode="dc-complex"
3fbe0641
MM
402if test x"$silent" != x"yes"; then
403 echo "Setting opcode flags = $sim_opcode"
404fi])dnl
405
406
407AC_ARG_ENABLE(sim-packages,
408[ --enable-sim-packages=list Specify the packages to be included in the build.],
409[packages=disklabel
410case "${enableval}" in
411 yes) ;;
412 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
413 ,*) packages="${packages}${enableval}";;
414 *,) packages="${enableval}${packages}";;
415 *) packages="${enableval}"'';;
416esac
417sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
418sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
419if test x"$silent" != x"yes" && test x"$packages" != x""; then
420 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
421fi],[packages=disklabel
422sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
423sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
424if test x"$silent" != x"yes"; then
425 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
426fi])dnl
427
c494cadd 428
2e913166
MM
429AC_ARG_ENABLE(sim-regparm,
430[ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
431[case "${enableval}" in
432 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
433 no) sim_regparm="" ;;
434 yes) sim_regparm="-DWITH_REGPARM=3";;
435 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
436esac
437if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
438 echo "Setting regparm flags = $sim_regparm" 6>&1
439fi],[sim_regparm=""])dnl
440
2e913166 441
3fbe0641
MM
442AC_ARG_ENABLE(sim-reserved-bits,
443[ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
c494cadd 444[case "${enableval}" in
3fbe0641
MM
445 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
446 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
447 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
ba62bb1c 448esac
3fbe0641
MM
449if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
450 echo "Setting reserved flags = $sim_reserved" 6>&1
451fi],[sim_reserved=""])dnl
452
c494cadd
MM
453
454AC_ARG_ENABLE(sim-smp,
73c4941b 455[ --enable-sim-smp=n Specify number of processors to configure for.],
c494cadd 456[case "${enableval}" in
30c87b55
MM
457 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
458 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
459 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
ba62bb1c 460esac
2bc7869d 461if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
ba62bb1c 462 echo "Setting smp flags = $sim_smp" 6>&1
30c87b55 463fi],[sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5"
2bc7869d
MM
464if test x"$silent" != x"yes"; then
465 echo "Setting smp flags = $sim_smp" 6>&1
466fi])dnl
c494cadd 467
1dc7c0ed 468
3fbe0641
MM
469AC_ARG_ENABLE(sim-stdcall,
470[ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
c494cadd 471[case "${enableval}" in
3fbe0641
MM
472 no) sim_stdcall="" ;;
473 std*) sim_stdcall="-DWITH_STDCALL=1";;
474 yes) sim_stdcall="-DWITH_STDCALL=1";;
475 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
ba62bb1c 476esac
3fbe0641
MM
477if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
478 echo "Setting function call flags = $sim_stdcall" 6>&1
479fi],[sim_stdcall=""])dnl
c494cadd 480
3fbe0641
MM
481
482AC_ARG_ENABLE(sim-stdio,
483[ --enable-sim-stdio Specify whether to use stdio for console input/output.],
c494cadd 484[case "${enableval}" in
3fbe0641
MM
485 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
486 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
487 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
ba62bb1c 488esac
3fbe0641
MM
489if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
490 echo "Setting stdio flags = $sim_stdio" 6>&1
491fi],[sim_stdio=""])dnl
c494cadd 492
3fbe0641
MM
493
494AC_ARG_ENABLE(sim-switch,
495[ --enable-sim-switch Use a switch instead of a table for instruction call.],
c494cadd 496[case "${enableval}" in
3fbe0641
MM
497 yes) sim_switch="-s";;
498 no) sim_switch="";;
499 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
ba62bb1c 500esac
3fbe0641
MM
501if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
502 echo "Setting switch flags = $sim_switch" 6>&1
503fi],[sim_switch="";
504if test x"$silent" != x"yes"; then
505 echo "Setting switch flags = $sim_switch" 6>&1
506fi])dnl
507
c494cadd
MM
508
509AC_ARG_ENABLE(sim-timebase,
73c4941b 510[ --enable-sim-timebase Specify whether the PPC timebase is supported.],
c494cadd
MM
511[case "${enableval}" in
512 yes) sim_timebase="-DWITH_TIME_BASE=1";;
513 no) sim_timebase="-DWITH_TIME_BASE=0";;
a3114052 514 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
ba62bb1c 515esac
2bc7869d 516if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
ba62bb1c
MM
517 echo "Setting timebase flags = $sim_timebase" 6>&1
518fi],[sim_timebase=""])dnl
c494cadd 519
c494cadd
MM
520
521AC_ARG_ENABLE(sim-trace,
73c4941b 522[ --enable-sim-trace Specify whether tracing is supported.],
c494cadd
MM
523[case "${enableval}" in
524 yes) sim_trace="-DWITH_TRACE=1";;
525 no) sim_trace="-DWITH_TRACE=0";;
a3114052 526 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
ba62bb1c 527esac
2bc7869d 528if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
ba62bb1c
MM
529 echo "Setting trace flags = $sim_trace" 6>&1
530fi],[sim_trace=""])dnl
c494cadd 531
c494cadd 532
3fbe0641
MM
533AC_ARG_ENABLE(sim-warnings,
534[ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
73c4941b 535[case "${enableval}" in
3fbe0641
MM
536 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
537 no) sim_warnings="-w";;
538 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
ba62bb1c 539esac
3fbe0641
MM
540if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
541 echo "Setting warning flags = $sim_warnings" 6>&1
542fi],[sim_warnings=""])dnl
73c4941b 543
8b3797aa 544
3fbe0641
MM
545AC_ARG_ENABLE(sim-xor-endian,
546[ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
84bbbc35 547[case "${enableval}" in
3fbe0641
MM
548 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
549 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
550 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
84bbbc35 551esac
3fbe0641
MM
552if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
553 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
554fi],[sim_xor_endian=""])dnl
84bbbc35 555
d6103e8e 556
cb7a6892
MM
557AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
558AC_CANONICAL_SYSTEM
559AC_ARG_PROGRAM
560
561. ${srcdir}/../../bfd/configure.host
562
ba62bb1c
MM
563AC_CONFIG_HEADER(config.h:config.in)
564
ed451ff7
MM
565AC_STRUCT_ST_BLKSIZE
566AC_STRUCT_ST_BLOCKS
567AC_STRUCT_ST_RDEV
568AC_STRUCT_TIMEZONE
569
570AC_TYPE_GETGROUPS
571AC_TYPE_MODE_T
572AC_TYPE_OFF_T
573AC_TYPE_PID_T
574AC_TYPE_SIGNAL
575AC_TYPE_SIZE_T
576AC_TYPE_UID_T
577
b9f74e0b 578AC_CHECK_FUNCS(access 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)
ed451ff7 579
16a88df7 580AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.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)
ed451ff7
MM
581AC_HEADER_DIRENT
582
583dnl Figure out what type of termio/termios support there is
584sim_termio=""
585AC_MSG_CHECKING(for struct termios)
586AC_CACHE_VAL(ac_cv_termios_struct,
587[AC_TRY_COMPILE([#include <sys/types.h>
588#include <sys/termios.h>],
589[static struct termios x;
590 x.c_iflag = 0;
591 x.c_oflag = 0;
592 x.c_cflag = 0;
593 x.c_lflag = 0;
594 x.c_cc[NCCS] = 0;],
595ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
596AC_MSG_RESULT($ac_cv_termios_struct)
597if test $ac_cv_termios_struct = yes; then
598 sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
599fi
600
601if test "$ac_cv_termios_struct" = "yes"; then
602 AC_MSG_CHECKING(for c_line field in struct termios)
603 AC_CACHE_VAL(ac_cv_termios_cline,
604 [AC_TRY_COMPILE([#include <sys/types.h>
605#include <sys/termios.h>],
606[static struct termios x; x.c_line = 0;],
607 ac_cv_termios_cline=yes, ac_cv_termios_cline=no)])
608
609 AC_MSG_RESULT($ac_cv_termios_cline)
610 if test $ac_cv_termios_cline = yes; then
611 sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
612 fi
613else
614 ac_cv_termios_cline=no
615fi
616
617if test "$ac_cv_termios_struct" != "yes"; then
618 AC_MSG_CHECKING(for struct termio)
619 AC_CACHE_VAL(ac_cv_termio_struct,
620 [AC_TRY_COMPILE([#include <sys/types.h>
621#include <sys/termio.h>],
622[static struct termio x;
623 x.c_iflag = 0;
624 x.c_oflag = 0;
625 x.c_cflag = 0;
626 x.c_lflag = 0;
627 x.c_cc[NCC] = 0;],
628ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
629 AC_MSG_RESULT($ac_cv_termio_struct)
630 if test $ac_cv_termio_struct = yes; then
631 sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
632 fi
633else
634 ac_cv_termio_struct=no
635fi
636
637if test "$ac_cv_termio_struct" = "yes"; then
638 AC_MSG_CHECKING(for c_line field in struct termio)
639 AC_CACHE_VAL(ac_cv_termio_cline,
640 [AC_TRY_COMPILE([#include <sys/types.h>
641#include <sys/termio.h>],
642[static struct termio x; x.c_line = 0;],
643 ac_cv_termio_cline=yes, ac_cv_termio_cline=no)])
644
645 AC_MSG_RESULT($ac_cv_termio_cline)
646 if test $ac_cv_termio_cline = yes; then
647 sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
648 fi
649else
650 ac_cv_termio_cline=no
651fi
652
9aecf50d
MM
653dnl Figure out if /dev/zero exists or not
654sim_devzero=""
655AC_MSG_CHECKING(for /dev/zero)
656AC_CACHE_VAL(ac_cv_devzero,
657[AC_TRY_RUN([#include <fcntl.h>
658main () {
659 char buf[2048];
660 int i;
661 int fd = open ("/dev/zero", O_RDONLY);
662 if (fd < 0)
663 return 1;
664 for (i = 0; i < sizeof (buf); i++)
665 buf[i] = 1;
666 if (read (fd, buf, sizeof (buf)) != sizeof (buf))
667 return 1;
668 for (i = 0; i < sizeof (buf); i++)
669 if (buf[i])
670 return 1;
671 return 0;
672}],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
673AC_MSG_RESULT($ac_cv_devzero)
674if test $ac_cv_devzero = yes; then
675 sim_devzero="-DHAVE_DEVZERO"
676else
677 sim_devzero=""
678fi
679
d2e3d3af
MM
680dnl Figure out if we are in the new Cygnus tree with a common directory or not
681AC_MSG_CHECKING(for common simulator directory)
cef84fb3 682if test -f "${srcdir}/../common/callback.c"; then
d2e3d3af
MM
683 AC_MSG_RESULT(yes)
684 sim_callback="callback.o targ-map.o"
54973b80 685 sim_targ_vals="targ-vals.h targ-map.c targ-vals.def"
d2e3d3af
MM
686else
687 AC_MSG_RESULT(no)
688 sim_callback=""
54973b80 689 sim_targ_vals=""
d2e3d3af
MM
690fi
691
8c59a22d
GN
692dnl Check for exe extension
693AM_EXEEXT
694
a72d2509 695AC_SUBST(CC_FOR_BUILD)
8b3797aa
MM
696AC_SUBST(CFLAGS)
697AC_SUBST(HDEFINES)
698AR=${AR-ar}
699AC_SUBST(AR)
700AC_PROG_RANLIB
c494cadd 701AC_SUBST(sim_cflags)
73c4941b 702AC_SUBST(sim_warnings)
30c87b55 703AC_SUBST(sim_line_nr)
c494cadd
MM
704AC_SUBST(sim_config)
705AC_SUBST(sim_opcode)
706AC_SUBST(sim_switch)
707AC_SUBST(sim_dup)
cdd31203 708AC_SUBST(sim_decode_mechanism)
30c87b55 709AC_SUBST(sim_jump)
c494cadd
MM
710AC_SUBST(sim_filter)
711AC_SUBST(sim_icache)
2e913166
MM
712AC_SUBST(sim_hw_src)
713AC_SUBST(sim_hw_obj)
714AC_SUBST(sim_pk_src)
715AC_SUBST(sim_pk_obj)
c494cadd
MM
716AC_SUBST(sim_inline)
717AC_SUBST(sim_bswap)
718AC_SUBST(sim_endian)
2e913166
MM
719AC_SUBST(sim_regparm)
720AC_SUBST(sim_stdcall)
1dc7c0ed 721AC_SUBST(sim_xor_endian)
c494cadd
MM
722AC_SUBST(sim_hostendian)
723AC_SUBST(sim_smp)
30c87b55 724AC_SUBST(sim_igen_smp)
c494cadd
MM
725AC_SUBST(sim_bitsize)
726AC_SUBST(sim_hostbitsize)
727AC_SUBST(sim_env)
728AC_SUBST(sim_timebase)
729AC_SUBST(sim_alignment)
730AC_SUBST(sim_float)
731AC_SUBST(sim_trace)
732AC_SUBST(sim_assert)
a3114052 733AC_SUBST(sim_reserved)
c494cadd 734AC_SUBST(sim_monitor)
73c4941b
MM
735AC_SUBST(sim_model)
736AC_SUBST(sim_default_model)
84bbbc35 737AC_SUBST(sim_model_issue)
d6103e8e 738AC_SUBST(sim_stdio)
ed451ff7 739AC_SUBST(sim_termio)
9aecf50d 740AC_SUBST(sim_devzero)
d2e3d3af 741AC_SUBST(sim_callback)
54973b80 742AC_SUBST(sim_targ_vals)
cb7a6892 743
8b3797aa
MM
744AC_OUTPUT(Makefile,
745[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.173376 seconds and 4 git commands to generate.