* stabsread.h, symtab.h, dbxread.c, symtab.c, stabsread.c:
[deliverable/binutils-gdb.git] / sim / common / aclocal.m4
CommitLineData
80b7b3a5 1# This file contains common code used by all simulators.
8cd89e77
DE
2#
3# SIM_AC_COMMON invokes AC macros used by all simulators and by the common
4# directory. It is intended to be invoked before any target specific stuff.
5# SIM_AC_OUTPUT is a cover function to AC_OUTPUT to generate the Makefile.
6# It is intended to be invoked last.
7#
8# The simulator's configure.in should look like:
9#
f2de7dfd
AC
10# dnl Process this file with autoconf to produce a configure script.
11# sinclude(../common/aclocal.m4)
8cd89e77
DE
12# AC_PREREQ(2.5)dnl
13# AC_INIT(Makefile.in)
f2de7dfd 14#
8cd89e77
DE
15# SIM_AC_COMMON
16#
17# ... target specific stuff ...
18#
19# SIM_AC_OUTPUT
80b7b3a5
SG
20
21AC_DEFUN(SIM_AC_COMMON,
22[
23# autoconf.info says this should be called right after AC_INIT.
b45caf05 24AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in)
80b7b3a5
SG
25
26AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
27AC_CANONICAL_SYSTEM
28AC_ARG_PROGRAM
29AC_PROG_CC
30AC_PROG_INSTALL
80b7b3a5
SG
31
32# Put a plausible default for CC_FOR_BUILD in Makefile.
80b7b3a5
SG
33if test "x$cross_compiling" = "xno"; then
34 CC_FOR_BUILD='$(CC)'
35else
36 CC_FOR_BUILD=gcc
37fi
38AC_SUBST(CC_FOR_BUILD)
39
40AC_SUBST(CFLAGS)
41AC_SUBST(HDEFINES)
42AR=${AR-ar}
43AC_SUBST(AR)
44AC_PROG_RANLIB
45
fbda74b1 46# Check for common headers.
63ddb6bd
DE
47# FIXME: Seems to me this can cause problems for i386-windows hosts.
48# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
49AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h)
50AC_CHECK_FUNCS(getrusage time)
fbda74b1 51
80b7b3a5
SG
52. ${srcdir}/../../bfd/configure.host
53
a77aa7ec 54dnl Standard (and optional) simulator options.
80b7b3a5
SG
55dnl Eventually all simulators will support these.
56dnl Do not add any here that cannot be supported by all simulators.
57dnl Do not add similar but different options to a particular simulator,
58dnl all shall eventually behave the same way.
59
f2de7dfd
AC
60
61dnl This is a generic option to enable special byte swapping
62dnl insns on *any* cpu.
63AC_ARG_ENABLE(sim-bswap,
64[ --enable-sim-bswap Use Host specific BSWAP instruction.],
65[case "${enableval}" in
a77aa7ec 66 yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
f2de7dfd
AC
67 no) sim_bswap="-DWITH_BSWAP=0";;
68 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
69esac
70if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
71 echo "Setting bswap flags = $sim_bswap" 6>&1
72fi],[sim_bswap=""])dnl
73AC_SUBST(sim_bswap)
74
75
80b7b3a5
SG
76AC_ARG_ENABLE(sim-cflags,
77[ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
78[case "${enableval}" in
79 yes) sim_cflags="-O2";;
80 trace) AC_MSG_ERROR("Please use --enable-sim-debug instead."); sim_cflags="";;
81 no) sim_cflags="";;
82 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
83esac
84if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
85 echo "Setting sim cflags = $sim_cflags" 6>&1
86fi],[sim_cflags=""])dnl
87AC_SUBST(sim_cflags)
88
f2de7dfd 89
80b7b3a5
SG
90dnl --enable-sim-debug is for developers of the simulator
91dnl the allowable values are work-in-progress
92AC_ARG_ENABLE(sim-debug,
93[ --enable-sim-debug=opts Enable debugging flags],
94[case "${enableval}" in
fbda74b1
DE
95 yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
96 no) sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
97 *) sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
80b7b3a5
SG
98esac
99if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
100 echo "Setting sim debug = $sim_debug" 6>&1
101fi],[sim_debug=""])dnl
102AC_SUBST(sim_debug)
103
f2de7dfd 104
a35e91c3
AC
105dnl --enable-sim-stdio is for users of the simulator
106dnl It determines if IO from the program is routed through STDIO (buffered)
107AC_ARG_ENABLE(sim-stdio,
108[ --enable-sim-stdio Specify whether to use stdio for console input/output.],
109[case "${enableval}" in
110 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
111 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
112 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
113esac
114if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
115 echo "Setting stdio flags = $sim_stdio" 6>&1
116fi],[sim_stdio=""])dnl
117AC_SUBST(sim_stdio)
118
119
120dnl --enable-sim-trace is for users of the simulator
247fccde
AC
121dnl The argument is either a bitmask of things to enable [exactly what is
122dnl up to the simulator], or is a comma separated list of names of tracing
123dnl elements to enable. The latter is only supported on simulators that
124dnl use WITH_TRACE.
a35e91c3
AC
125AC_ARG_ENABLE(sim-trace,
126[ --enable-sim-trace=opts Enable tracing flags],
127[case "${enableval}" in
247fccde 128 yes) sim_trace="-DTRACE=1 -DWITH_TRACE=-1";;
a35e91c3 129 no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
247fccde
AC
130 [[-0-9]]*)
131 sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
132 [[a-z]]*)
133 sim_trace=""
134 for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
135 if test x"$sim_trace" = x; then
136 sim_trace="-DWITH_TRACE='(TRACE_$x"
137 else
138 sim_trace="${sim_trace}|TRACE_$x"
139 fi
140 done
141 sim_trace="$sim_trace)'" ;;
a35e91c3
AC
142esac
143if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
144 echo "Setting sim trace = $sim_trace" 6>&1
145fi],[sim_trace=""])dnl
146AC_SUBST(sim_trace)
147
148
247fccde
AC
149dnl --enable-sim-profile
150dnl The argument is either a bitmask of things to enable [exactly what is
151dnl up to the simulator], or is a comma separated list of names of profiling
152dnl elements to enable. The latter is only supported on simulators that
153dnl use WITH_PROFILE.
154AC_ARG_ENABLE(sim-profile,
155[ --enable-sim-profile=opts Enable profiling flags],
156[case "${enableval}" in
157 yes) sim_profile="-DPROFILE=1 -DWITH_PROFILE=-1";;
158 no) sim_profile="-DPROFILE=0 -DWITH_PROFILE=0";;
159 [[-0-9]]*)
160 sim_profile="-DPROFILE='(${enableval})' -DWITH_PROFILE='(${enableval})'";;
161 [[a-z]]*)
162 sim_profile=""
163 for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
164 if test x"$sim_profile" = x; then
165 sim_profile="-DWITH_PROFILE='(PROFILE_$x"
166 else
167 sim_profile="${sim_profile}|PROFILE_$x"
168 fi
169 done
170 sim_profile="$sim_profile)'" ;;
171esac
172if test x"$silent" != x"yes" && test x"$sim_profile" != x""; then
173 echo "Setting sim profile = $sim_profile" 6>&1
174fi],[sim_profile=""])dnl
175AC_SUBST(sim_profile)
176
177
63ddb6bd
DE
178dnl Types used by common code
179AC_TYPE_SIGNAL
180
181
a35e91c3
AC
182dnl These are available to append to as desired.
183sim_link_files=
184sim_link_links=
185
186dnl Create tconfig.h either from simulator's tconfig.in or default one
187dnl in common.
188sim_link_links=tconfig.h
189if test -f ${srcdir}/tconfig.in
190then
191 sim_link_files=tconfig.in
192else
193 sim_link_files=../common/tconfig.in
194fi
195
196# targ-vals.def points to the libc macro description file.
197case "${target}" in
198*-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
199esac
200sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
201sim_link_links="${sim_link_links} targ-vals.def"
202
203]) dnl End of SIM_AC_COMMON
204
205
206dnl Additional SIM options that can (optionally) be configured
207dnl For optional simulator options, a macro SIM_AC_OPTION_* is defined.
208dnl Simulators that wish to use the relevant option specify the macro
209dnl in the simulator specific configure.in file between the SIM_AC_COMMON
210dnl and SIM_AC_OUTPUT lines.
211
212
213dnl Specify the alignment restrictions of the target architecture.
794e9ac9 214dnl Without this option all possible alignment restrictions are accommodated.
b45caf05
AC
215dnl arg[1] is hardwired target alignment
216dnl arg[2] is default target alignment
a35e91c3 217AC_DEFUN(SIM_AC_OPTION_ALIGNMENT,
794e9ac9
AC
218wire_alignment="[$1]"
219default_alignment="[$2]"
a35e91c3
AC
220[
221AC_ARG_ENABLE(sim-alignment,
b45caf05 222[ --enable-sim-alignment=align Specify strict, nonstrict or forced alignment of memory accesses.],
a35e91c3 223[case "${enableval}" in
b45caf05
AC
224 strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
225 nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
226 forced | FORCED) sim_alignment="-DWITH_ALIGNMENT=FORCED_ALIGNMENT";;
227 yes) if test x"$wire_alignment" != x; then
228 sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
229 else
794e9ac9
AC
230 if test x"$default_alignment" != x; then
231 sim_alignment="-DWITH_ALIGNMENT=${default_alignment}"
232 else
233 echo "No hard-wired alignment for target $target" 1>&6
234 sim_alignment="-DWITH_ALIGNMENT=0"
235 fi
b45caf05
AC
236 fi;;
237 no) if test x"$default_alignment" != x; then
238 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
239 else
794e9ac9
AC
240 if test x"$wire_alignment" != x; then
241 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${wire_alignment}"
242 else
243 echo "No default alignment for target $target" 1>&6
244 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=0"
245 fi
b45caf05
AC
246 fi;;
247 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
a35e91c3
AC
248esac
249if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
250 echo "Setting alignment flags = $sim_alignment" 6>&1
794e9ac9
AC
251fi],
252[if test x"$default_alignment" != x; then
253 sim_alignment="-DWITH_DEFAULT_ALIGNMENT=${default_alignment}"
254else
255 if test x"$wire_alignment" != x; then
256 sim_alignment="-DWITH_ALIGNMENT=${wire_alignment}"
257 else
258 sim_alignment=
259 fi
260fi])dnl
a35e91c3
AC
261AC_SUBST(sim_alignment)
262])dnl
263
264
265dnl Conditionally compile in assertion statements.
266AC_DEFUN(SIM_AC_OPTION_ASSERT,
267[
268AC_ARG_ENABLE(sim-assert,
269[ --enable-sim-assert Specify whether to perform random assertions.],
270[case "${enableval}" in
271 yes) sim_assert="-DWITH_ASSERT=1";;
272 no) sim_assert="-DWITH_ASSERT=0";;
273 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
274esac
275if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
276 echo "Setting assert flags = $sim_assert" 6>&1
277fi],[sim_assert=""])dnl
278AC_SUBST(sim_assert)
279])
280
281
f2de7dfd
AC
282dnl --enable-sim-endian={yes,no,big,little} is for simulators
283dnl that support both big and little endian targets.
247fccde
AC
284dnl arg[1] is hardwired target endianness.
285dnl arg[2] is default target endianness.
f2de7dfd 286AC_DEFUN(SIM_AC_OPTION_ENDIAN,
8cd89e77 287[
247fccde
AC
288wire_endian="ifelse([$1],,ifelse([$2],,,[$2]),[$1])"
289default_endian="ifelse([$2],,ifelse([$1],,,[$1]),[$2])"
290default_sim_endian="ifelse([$1],,ifelse([$2],,,-DWITH_DEFAULT_TARGET_BYTE_ORDER=[$2]),-DWITH_TARGET_BYTE_ORDER=[$1])"
f2de7dfd
AC
291AC_ARG_ENABLE(sim-endian,
292[ --enable-sim-endian=endian Specify target byte endian orientation.],
293[case "${enableval}" in
f2de7dfd
AC
294 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
295 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
247fccde
AC
296 yes) if test x"$wire_endian" != x; then
297 sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}"
298 else
299 echo "No hard-wired endian for target $target" 1>&6
300 sim_endian="-DWITH_TARGET_BYTE_ORDER=0"
301 fi;;
302 no) if test x"$default_endian" != x; then
303 sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}"
304 else
305 echo "No default endian for target $target" 1>&6
306 sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0"
307 fi;;
f2de7dfd
AC
308 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
309esac
310if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
311 echo "Setting endian flags = $sim_endian" 6>&1
312fi],[sim_endian="${default_sim_endian}"])dnl
a77aa7ec 313AC_SUBST(sim_endian)
f2de7dfd 314])
8cd89e77 315
80b7b3a5 316
f2de7dfd
AC
317dnl --enable-sim-hostendian is for users of the simulator when
318dnl they find that AC_C_BIGENDIAN does not function correctly
319dnl (for instance in a canadian cross)
320AC_DEFUN(SIM_AC_OPTION_HOSTENDIAN,
321[
322AC_ARG_ENABLE(sim-hostendian,
323[ --enable-sim-hostendain=end Specify host byte endian orientation.],
324[case "${enableval}" in
325 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
326 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
327 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
328 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
329esac
330if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
331 echo "Setting hostendian flags = $sim_hostendian" 6>&1
332fi],[
333if test "x$cross_compiling" = "xno"; then
334 AC_C_BIGENDIAN
335 if test $ac_cv_c_bigendian = yes; then
336 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
337 else
338 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
339 fi
340else
341 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
342fi])dnl
a77aa7ec
AC
343AC_SUBST(sim_hostendian)
344])
345
346
347AC_DEFUN(SIM_AC_OPTION_FLOAT,
348[
a35e91c3 349default_sim_floating_point="ifelse([$1],,0,[$1])"
a77aa7ec 350AC_ARG_ENABLE(sim-float,
a35e91c3 351[ --enable-sim-float Specify that the target processor has floating point hardware.],
a77aa7ec
AC
352[case "${enableval}" in
353 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
354 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
355 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
356esac
357if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
358 echo "Setting float flags = $sim_float" 6>&1
a35e91c3 359fi],[sim_float="-DWITH_FLOATING_POINT=${default_sim_floating_point}"])dnl
a77aa7ec
AC
360AC_SUBST(sim_float)
361])
362
363
247fccde
AC
364dnl The argument is the default cache size if none is specified.
365AC_DEFUN(SIM_AC_OPTION_SCACHE,
366[
367default_sim_scache="ifelse([$1],,0,[$1])"
368AC_ARG_ENABLE(sim-scache,
369[ --enable-sim-scache=size Specify simulator execution cache size.],
370[case "${enableval}" in
371 yes) sim_scache="-DWITH_SCACHE=${default_sim_scache}";;
372 no) sim_scace= ;;
373 [[0-9]]*) sim_cache=${enableval};;
374 *) AC_MSG_ERROR("Bad value $enableval passed to --enable-sim-scache");
375 sim_scache="";;
376esac
377if test x"$silent" != x"yes" && test x"$sim_scache" != x""; then
378 echo "Setting scache size = $sim_scache" 6>&1
379fi],[sim_scache="-DWITH_SCACHE=${default_sim_scache}"])
380AC_SUBST(sim_scache)
381])
382
383
384dnl The argument is the default model if none is specified.
385AC_DEFUN(SIM_AC_OPTION_DEFAULT_MODEL,
386[
387default_sim_default_model="ifelse([$1],,0,[$1])"
388AC_ARG_ENABLE(sim-default-model,
389[ --enable-sim-default-model=model Specify default model to simulate.],
390[case "${enableval}" in
391 yes|no) AC_MSG_ERROR("Missing argument to --enable-sim-default-model");;
392 *) sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";;
393esac
394if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
395 echo "Setting default model = $sim_default_model" 6>&1
396fi],[sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'"])
397AC_SUBST(sim_default_model)
398])
399
400
a77aa7ec
AC
401AC_DEFUN(SIM_AC_OPTION_HARDWARE,
402[
403AC_ARG_ENABLE(sim-hardware,
404[ --enable-sim-hardware=list Specify the hardware to be included in the build.],
405[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
406case "${enableval}" in
407 yes) ;;
408 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
409 ,*) hardware="${hardware}${enableval}";;
410 *,) hardware="${enableval}${hardware}";;
411 *) hardware="${enableval}"'';;
412esac
413sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
414sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
415if test x"$silent" != x"yes" && test x"$hardware" != x""; then
416 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
417fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
418sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
419sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
420if test x"$silent" != x"yes"; then
421 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
422fi])dnl
423AC_SUBST(sim_hardware)
f2de7dfd
AC
424])
425
80b7b3a5 426
f2de7dfd
AC
427dnl --enable-sim-inline is for users that wish to ramp up the simulator's
428dnl performance by inlining functions.
429AC_DEFUN(SIM_AC_OPTION_INLINE,
430[
431default_sim_inline="ifelse([$1],,,-DDEFAULT_INLINE=[$1])"
432AC_ARG_ENABLE(sim-inline,
433[ --enable-sim-inline=inlines Specify which functions should be inlined.],
434[sim_inline=""
435case "$enableval" in
436 no) sim_inline="-DDEFAULT_INLINE=0";;
437 0) sim_inline="-DDEFAULT_INLINE=0";;
438 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
439 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
440 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
441 new_flag=""
442 case "$x" in
443 *_INLINE=*) new_flag="-D$x";;
444 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
445 *_INLINE) new_flag="-D$x=ALL_INLINE";;
446 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
447 esac
448 if test x"$sim_inline" = x""; then
449 sim_inline="$new_flag"
450 else
451 sim_inline="$sim_inline $new_flag"
452 fi
453 done;;
454esac
455if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
456 echo "Setting inline flags = $sim_inline" 6>&1
457fi],[if test x"$GCC" != "x" -a x"${default_sim_inline}" != "x" ; then
458 sim_inline="${default_sim_inline}"
459 if test x"$silent" != x"yes"; then
460 echo "Setting inline flags = $sim_inline" 6>&1
461 fi
462else
463 sim_inline=""
464fi])dnl
a77aa7ec
AC
465AC_SUBST(sim_inline)
466])
467
468
469AC_DEFUN(SIM_AC_OPTION_PACKAGES,
470[
471AC_ARG_ENABLE(sim-packages,
472[ --enable-sim-packages=list Specify the packages to be included in the build.],
473[packages=disklabel
474case "${enableval}" in
475 yes) ;;
476 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
477 ,*) packages="${packages}${enableval}";;
478 *,) packages="${enableval}${packages}";;
479 *) packages="${enableval}"'';;
480esac
481sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
482sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
483if test x"$silent" != x"yes" && test x"$packages" != x""; then
484 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
485fi],[packages=disklabel
486sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
487sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
488if test x"$silent" != x"yes"; then
489 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
490fi])dnl
491AC_SUBST(sim_packages)
492])
493
494
495AC_DEFUN(SIM_AC_OPTION_REGPARM,
496[
497AC_ARG_ENABLE(sim-regparm,
498[ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
499[case "${enableval}" in
500 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
501 no) sim_regparm="" ;;
502 yes) sim_regparm="-DWITH_REGPARM=3";;
503 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
504esac
505if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
506 echo "Setting regparm flags = $sim_regparm" 6>&1
507fi],[sim_regparm=""])dnl
508AC_SUBST(sim_regparm)
509])
510
511
512AC_DEFUN(SIM_AC_OPTION_RESERVED_BITS,
513[
a35e91c3 514default_sim_reserved_bits="ifelse([$1],,1,[$1])"
a77aa7ec
AC
515AC_ARG_ENABLE(sim-reserved-bits,
516[ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
517[case "${enableval}" in
518 yes) sim_reserved_bits="-DWITH_RESERVED_BITS=1";;
519 no) sim_reserved_bits="-DWITH_RESERVED_BITS=0";;
520 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved_bits="";;
521esac
522if test x"$silent" != x"yes" && test x"$sim_reserved_bits" != x""; then
523 echo "Setting reserved flags = $sim_reserved_bits" 6>&1
a35e91c3 524fi],[sim_reserved_bits="-DWITH_RESERVED_BITS=${default_sim_reserved_bits}"])dnl
a77aa7ec
AC
525AC_SUBST(sim_reserved_bits)
526])
527
528
529AC_DEFUN(SIM_AC_OPTION_SMP,
530[
a35e91c3 531default_sim_smp="ifelse([$1],,5,[$1])"
a77aa7ec 532AC_ARG_ENABLE(sim-smp,
a35e91c3 533[ --enable-sim-smp=n Specify number of processors to configure for (default ${default_sim_smp}).],
a77aa7ec
AC
534[case "${enableval}" in
535 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
536 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
537 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
538esac
539if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
540 echo "Setting smp flags = $sim_smp" 6>&1
a35e91c3 541fi],[sim_smp="-DWITH_SMP=${default_sim_smp}" ; sim_igen_smp="-N ${default_sim_smp}"
a77aa7ec
AC
542if test x"$silent" != x"yes"; then
543 echo "Setting smp flags = $sim_smp" 6>&1
544fi])dnl
545AC_SUBST(sim_smp)
f2de7dfd 546])
80b7b3a5 547
80b7b3a5 548
a77aa7ec
AC
549AC_DEFUN(SIM_AC_OPTION_STDCALL,
550[
551AC_ARG_ENABLE(sim-stdcall,
552[ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
553[case "${enableval}" in
554 no) sim_stdcall="" ;;
555 std*) sim_stdcall="-DWITH_STDCALL=1";;
556 yes) sim_stdcall="-DWITH_STDCALL=1";;
557 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
558esac
559if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
560 echo "Setting function call flags = $sim_stdcall" 6>&1
561fi],[sim_stdcall=""])dnl
562AC_SUBST(sim_stdcall)
563])
564
565
a35e91c3
AC
566AC_DEFUN(SIM_AC_OPTION_XOR_ENDIAN,
567[
568default_sim_xor_endian="ifelse([$1],,8,[$1])"
569AC_ARG_ENABLE(sim-xor-endian,
570[ --enable-sim-xor-endian=n Specify number bytes involved in XOR bi-endian mode (default ${default_sim_xor_endian}).],
a77aa7ec 571[case "${enableval}" in
a35e91c3
AC
572 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
573 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
574 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
a77aa7ec 575esac
a35e91c3
AC
576if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
577 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
578fi],[sim_xor_endian="-DWITH_XOR_ENDIAN=${default_sim_xor_endian}"])dnl
579AC_SUBST(sim_xor_endian)
580])
a77aa7ec
AC
581
582
f2de7dfd
AC
583dnl --enable-sim-warnings is for developers of the simulator.
584dnl it enables extra GCC specific warnings.
585AC_DEFUN(SIM_AC_OPTION_WARNINGS,
586[
587AC_ARG_ENABLE(sim-warnings,
88117054 588[ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings],
f2de7dfd
AC
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
a77aa7ec 597AC_SUBST(sim_warnings)
f2de7dfd 598])
80b7b3a5 599
80b7b3a5 600
f2de7dfd
AC
601dnl Generate the Makefile in a target specific directory.
602dnl Substitutions aren't performed on the file in AC_SUBST_FILE,
603dnl so this is a cover macro to tuck the details away of how we cope.
604dnl We cope by having autoconf generate two files and then merge them into
605dnl one afterwards. The two pieces of the common fragment are inserted into
606dnl the target's fragment at the appropriate points.
80b7b3a5 607
f2de7dfd
AC
608AC_DEFUN(SIM_AC_OUTPUT,
609[
80b7b3a5 610AC_LINK_FILES($sim_link_files, $sim_link_links)
88d5f8e8
DE
611AC_OUTPUT(Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in .gdbinit:../common/gdbinit.in,
612[case "x$CONFIG_FILES" in
613 xMakefile*)
f2de7dfd
AC
614 echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
615 rm -f Makesim1.tmp Makesim2.tmp Makefile
616 sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
617 sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
618 sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
619 -e '/^## COMMON_POST_/ r Makesim2.tmp' \
620 <Makefile.sim >Makefile
621 rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
622 ;;
623 esac
80b7b3a5 624 case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac
f2de7dfd
AC
625])
626])
This page took 0.068356 seconds and 4 git commands to generate.