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