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