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