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