* aclocal.m4: Check for stdlib.h, string.h, strings.h, unistd.h.
[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.
24AC_CONFIG_HEADER(config.h:config.in)
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.
33AC_C_CROSS
34if test "x$cross_compiling" = "xno"; then
35 CC_FOR_BUILD='$(CC)'
36else
37 CC_FOR_BUILD=gcc
38fi
39AC_SUBST(CC_FOR_BUILD)
40
41AC_SUBST(CFLAGS)
42AC_SUBST(HDEFINES)
43AR=${AR-ar}
44AC_SUBST(AR)
45AC_PROG_RANLIB
46
fbda74b1
DE
47# Check for common headers.
48AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h)
49
80b7b3a5
SG
50. ${srcdir}/../../bfd/configure.host
51
a77aa7ec 52dnl Standard (and optional) simulator options.
80b7b3a5
SG
53dnl Eventually all simulators will support these.
54dnl Do not add any here that cannot be supported by all simulators.
55dnl Do not add similar but different options to a particular simulator,
56dnl all shall eventually behave the same way.
57
f2de7dfd
AC
58
59dnl This is a generic option to enable special byte swapping
60dnl insns on *any* cpu.
61AC_ARG_ENABLE(sim-bswap,
62[ --enable-sim-bswap Use Host specific BSWAP instruction.],
63[case "${enableval}" in
a77aa7ec 64 yes) sim_bswap="-DWITH_BSWAP=1 -DUSE_BSWAP=1";;
f2de7dfd
AC
65 no) sim_bswap="-DWITH_BSWAP=0";;
66 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
67esac
68if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
69 echo "Setting bswap flags = $sim_bswap" 6>&1
70fi],[sim_bswap=""])dnl
71AC_SUBST(sim_bswap)
72
73
80b7b3a5
SG
74AC_ARG_ENABLE(sim-cflags,
75[ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
76[case "${enableval}" in
77 yes) sim_cflags="-O2";;
78 trace) AC_MSG_ERROR("Please use --enable-sim-debug instead."); sim_cflags="";;
79 no) sim_cflags="";;
80 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
81esac
82if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
83 echo "Setting sim cflags = $sim_cflags" 6>&1
84fi],[sim_cflags=""])dnl
85AC_SUBST(sim_cflags)
86
f2de7dfd 87
80b7b3a5
SG
88dnl --enable-sim-debug is for developers of the simulator
89dnl the allowable values are work-in-progress
90AC_ARG_ENABLE(sim-debug,
91[ --enable-sim-debug=opts Enable debugging flags],
92[case "${enableval}" in
fbda74b1
DE
93 yes) sim_debug="-DDEBUG=7 -DWITH_DEBUG=7";;
94 no) sim_debug="-DDEBUG=0 -DWITH_DEBUG=0";;
95 *) sim_debug="-DDEBUG='(${enableval})' -DWITH_DEBUG='(${enableval})'";;
80b7b3a5
SG
96esac
97if test x"$silent" != x"yes" && test x"$sim_debug" != x""; then
98 echo "Setting sim debug = $sim_debug" 6>&1
99fi],[sim_debug=""])dnl
100AC_SUBST(sim_debug)
101
f2de7dfd 102
a35e91c3
AC
103dnl --enable-sim-stdio is for users of the simulator
104dnl It determines if IO from the program is routed through STDIO (buffered)
105AC_ARG_ENABLE(sim-stdio,
106[ --enable-sim-stdio Specify whether to use stdio for console input/output.],
107[case "${enableval}" in
108 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
109 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
110 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
111esac
112if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
113 echo "Setting stdio flags = $sim_stdio" 6>&1
114fi],[sim_stdio=""])dnl
115AC_SUBST(sim_stdio)
116
117
118dnl --enable-sim-trace is for users of the simulator
119dnl the allowable values are work-in-progress
120AC_ARG_ENABLE(sim-trace,
121[ --enable-sim-trace=opts Enable tracing flags],
122[case "${enableval}" in
123 yes) sim_trace="-DTRACE=1 -DWITH_TRACE=1";;
124 no) sim_trace="-DTRACE=0 -DWITH_TRACE=0";;
125 *) sim_trace="-DTRACE='(${enableval})' -DWITH_TRACE='(${enableval})'";;
126esac
127if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
128 echo "Setting sim trace = $sim_trace" 6>&1
129fi],[sim_trace=""])dnl
130AC_SUBST(sim_trace)
131
132
133dnl These are available to append to as desired.
134sim_link_files=
135sim_link_links=
136
137dnl Create tconfig.h either from simulator's tconfig.in or default one
138dnl in common.
139sim_link_links=tconfig.h
140if test -f ${srcdir}/tconfig.in
141then
142 sim_link_files=tconfig.in
143else
144 sim_link_files=../common/tconfig.in
145fi
146
147# targ-vals.def points to the libc macro description file.
148case "${target}" in
149*-*-*) TARG_VALS_DEF=../common/nltvals.def ;;
150esac
151sim_link_files="${sim_link_files} ${TARG_VALS_DEF}"
152sim_link_links="${sim_link_links} targ-vals.def"
153
154]) dnl End of SIM_AC_COMMON
155
156
157dnl Additional SIM options that can (optionally) be configured
158dnl For optional simulator options, a macro SIM_AC_OPTION_* is defined.
159dnl Simulators that wish to use the relevant option specify the macro
160dnl in the simulator specific configure.in file between the SIM_AC_COMMON
161dnl and SIM_AC_OUTPUT lines.
162
163
164dnl Specify the alignment restrictions of the target architecture.
165dnl Without this option all possible alignment restrictions are accomidated.
166AC_DEFUN(SIM_AC_OPTION_ALIGNMENT,
167[
168AC_ARG_ENABLE(sim-alignment,
169[ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
170[case "${enableval}" in
171 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
172 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
173 0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
174 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
175esac
176if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
177 echo "Setting alignment flags = $sim_alignment" 6>&1
178fi],[sim_alignment=""])dnl
179AC_SUBST(sim_alignment)
180])dnl
181
182
183dnl Conditionally compile in assertion statements.
184AC_DEFUN(SIM_AC_OPTION_ASSERT,
185[
186AC_ARG_ENABLE(sim-assert,
187[ --enable-sim-assert Specify whether to perform random assertions.],
188[case "${enableval}" in
189 yes) sim_assert="-DWITH_ASSERT=1";;
190 no) sim_assert="-DWITH_ASSERT=0";;
191 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
192esac
193if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
194 echo "Setting assert flags = $sim_assert" 6>&1
195fi],[sim_assert=""])dnl
196AC_SUBST(sim_assert)
197])
198
199
f2de7dfd
AC
200dnl --enable-sim-endian={yes,no,big,little} is for simulators
201dnl that support both big and little endian targets.
202AC_DEFUN(SIM_AC_OPTION_ENDIAN,
8cd89e77 203[
f2de7dfd
AC
204default_sim_endian="ifelse([$1],,,-DWITH_TARGET_BYTE_ORDER=[$1])"
205AC_ARG_ENABLE(sim-endian,
206[ --enable-sim-endian=endian Specify target byte endian orientation.],
207[case "${enableval}" in
208 yes) case "$target" in
209 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
210 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
211 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
212 esac;;
213 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
214 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
215 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
216 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
217esac
218if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
219 echo "Setting endian flags = $sim_endian" 6>&1
220fi],[sim_endian="${default_sim_endian}"])dnl
a77aa7ec 221AC_SUBST(sim_endian)
f2de7dfd 222])
8cd89e77 223
80b7b3a5 224
f2de7dfd
AC
225dnl --enable-sim-hostendian is for users of the simulator when
226dnl they find that AC_C_BIGENDIAN does not function correctly
227dnl (for instance in a canadian cross)
228AC_DEFUN(SIM_AC_OPTION_HOSTENDIAN,
229[
230AC_ARG_ENABLE(sim-hostendian,
231[ --enable-sim-hostendain=end Specify host byte endian orientation.],
232[case "${enableval}" in
233 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
234 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
235 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
236 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
237esac
238if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
239 echo "Setting hostendian flags = $sim_hostendian" 6>&1
240fi],[
241if test "x$cross_compiling" = "xno"; then
242 AC_C_BIGENDIAN
243 if test $ac_cv_c_bigendian = yes; then
244 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
245 else
246 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
247 fi
248else
249 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
250fi])dnl
a77aa7ec
AC
251AC_SUBST(sim_hostendian)
252])
253
254
255AC_DEFUN(SIM_AC_OPTION_FLOAT,
256[
a35e91c3 257default_sim_floating_point="ifelse([$1],,0,[$1])"
a77aa7ec 258AC_ARG_ENABLE(sim-float,
a35e91c3 259[ --enable-sim-float Specify that the target processor has floating point hardware.],
a77aa7ec
AC
260[case "${enableval}" in
261 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
262 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
263 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
264esac
265if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
266 echo "Setting float flags = $sim_float" 6>&1
a35e91c3 267fi],[sim_float="-DWITH_FLOATING_POINT=${default_sim_floating_point}"])dnl
a77aa7ec
AC
268AC_SUBST(sim_float)
269])
270
271
272AC_DEFUN(SIM_AC_OPTION_HARDWARE,
273[
274AC_ARG_ENABLE(sim-hardware,
275[ --enable-sim-hardware=list Specify the hardware to be included in the build.],
276[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
277case "${enableval}" in
278 yes) ;;
279 no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
280 ,*) hardware="${hardware}${enableval}";;
281 *,) hardware="${enableval}${hardware}";;
282 *) hardware="${enableval}"'';;
283esac
284sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
285sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
286if test x"$silent" != x"yes" && test x"$hardware" != x""; then
287 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
288fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
289sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
290sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
291if test x"$silent" != x"yes"; then
292 echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
293fi])dnl
294AC_SUBST(sim_hardware)
f2de7dfd
AC
295])
296
80b7b3a5 297
f2de7dfd
AC
298dnl --enable-sim-inline is for users that wish to ramp up the simulator's
299dnl performance by inlining functions.
300AC_DEFUN(SIM_AC_OPTION_INLINE,
301[
302default_sim_inline="ifelse([$1],,,-DDEFAULT_INLINE=[$1])"
303AC_ARG_ENABLE(sim-inline,
304[ --enable-sim-inline=inlines Specify which functions should be inlined.],
305[sim_inline=""
306case "$enableval" in
307 no) sim_inline="-DDEFAULT_INLINE=0";;
308 0) sim_inline="-DDEFAULT_INLINE=0";;
309 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
310 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
311 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
312 new_flag=""
313 case "$x" in
314 *_INLINE=*) new_flag="-D$x";;
315 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
316 *_INLINE) new_flag="-D$x=ALL_INLINE";;
317 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
318 esac
319 if test x"$sim_inline" = x""; then
320 sim_inline="$new_flag"
321 else
322 sim_inline="$sim_inline $new_flag"
323 fi
324 done;;
325esac
326if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
327 echo "Setting inline flags = $sim_inline" 6>&1
328fi],[if test x"$GCC" != "x" -a x"${default_sim_inline}" != "x" ; then
329 sim_inline="${default_sim_inline}"
330 if test x"$silent" != x"yes"; then
331 echo "Setting inline flags = $sim_inline" 6>&1
332 fi
333else
334 sim_inline=""
335fi])dnl
a77aa7ec
AC
336AC_SUBST(sim_inline)
337])
338
339
340AC_DEFUN(SIM_AC_OPTION_PACKAGES,
341[
342AC_ARG_ENABLE(sim-packages,
343[ --enable-sim-packages=list Specify the packages to be included in the build.],
344[packages=disklabel
345case "${enableval}" in
346 yes) ;;
347 no) AC_MSG_ERROR("List of packages must be specified for --enable-sim-packages"); packages="";;
348 ,*) packages="${packages}${enableval}";;
349 *,) packages="${enableval}${packages}";;
350 *) packages="${enableval}"'';;
351esac
352sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
353sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
354if test x"$silent" != x"yes" && test x"$packages" != x""; then
355 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
356fi],[packages=disklabel
357sim_pk_src=`echo $packages | sed -e 's/,/.c pk_/g' -e 's/^/pk_/' -e 's/$/.c/'`
358sim_pk_obj=`echo $sim_pk_src | sed -e 's/\.c/.o/g'`
359if test x"$silent" != x"yes"; then
360 echo "Setting packages to $sim_pk_src, $sim_pk_obj"
361fi])dnl
362AC_SUBST(sim_packages)
363])
364
365
366AC_DEFUN(SIM_AC_OPTION_REGPARM,
367[
368AC_ARG_ENABLE(sim-regparm,
369[ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
370[case "${enableval}" in
371 0*|1*|2*|3*|4*|5*|6*|7*|8*|9*) sim_regparm="-DWITH_REGPARM=${enableval}";;
372 no) sim_regparm="" ;;
373 yes) sim_regparm="-DWITH_REGPARM=3";;
374 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-regparm"); sim_regparm="";;
375esac
376if test x"$silent" != x"yes" && test x"$sim_regparm" != x""; then
377 echo "Setting regparm flags = $sim_regparm" 6>&1
378fi],[sim_regparm=""])dnl
379AC_SUBST(sim_regparm)
380])
381
382
383AC_DEFUN(SIM_AC_OPTION_RESERVED_BITS,
384[
a35e91c3 385default_sim_reserved_bits="ifelse([$1],,1,[$1])"
a77aa7ec
AC
386AC_ARG_ENABLE(sim-reserved-bits,
387[ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
388[case "${enableval}" in
389 yes) sim_reserved_bits="-DWITH_RESERVED_BITS=1";;
390 no) sim_reserved_bits="-DWITH_RESERVED_BITS=0";;
391 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved_bits="";;
392esac
393if test x"$silent" != x"yes" && test x"$sim_reserved_bits" != x""; then
394 echo "Setting reserved flags = $sim_reserved_bits" 6>&1
a35e91c3 395fi],[sim_reserved_bits="-DWITH_RESERVED_BITS=${default_sim_reserved_bits}"])dnl
a77aa7ec
AC
396AC_SUBST(sim_reserved_bits)
397])
398
399
400AC_DEFUN(SIM_AC_OPTION_SMP,
401[
a35e91c3 402default_sim_smp="ifelse([$1],,5,[$1])"
a77aa7ec 403AC_ARG_ENABLE(sim-smp,
a35e91c3 404[ --enable-sim-smp=n Specify number of processors to configure for (default ${default_sim_smp}).],
a77aa7ec
AC
405[case "${enableval}" in
406 yes) sim_smp="-DWITH_SMP=5" ; sim_igen_smp="-N 5";;
407 no) sim_smp="-DWITH_SMP=0" ; sim_igen_smp="-N 0";;
408 *) sim_smp="-DWITH_SMP=$enableval" ; sim_igen_smp="-N $enableval";;
409esac
410if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
411 echo "Setting smp flags = $sim_smp" 6>&1
a35e91c3 412fi],[sim_smp="-DWITH_SMP=${default_sim_smp}" ; sim_igen_smp="-N ${default_sim_smp}"
a77aa7ec
AC
413if test x"$silent" != x"yes"; then
414 echo "Setting smp flags = $sim_smp" 6>&1
415fi])dnl
416AC_SUBST(sim_smp)
f2de7dfd 417])
80b7b3a5 418
80b7b3a5 419
a77aa7ec
AC
420AC_DEFUN(SIM_AC_OPTION_STDCALL,
421[
422AC_ARG_ENABLE(sim-stdcall,
423[ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
424[case "${enableval}" in
425 no) sim_stdcall="" ;;
426 std*) sim_stdcall="-DWITH_STDCALL=1";;
427 yes) sim_stdcall="-DWITH_STDCALL=1";;
428 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-stdcall"); sim_stdcall="";;
429esac
430if test x"$silent" != x"yes" && test x"$sim_stdcall" != x""; then
431 echo "Setting function call flags = $sim_stdcall" 6>&1
432fi],[sim_stdcall=""])dnl
433AC_SUBST(sim_stdcall)
434])
435
436
a35e91c3
AC
437AC_DEFUN(SIM_AC_OPTION_XOR_ENDIAN,
438[
439default_sim_xor_endian="ifelse([$1],,8,[$1])"
440AC_ARG_ENABLE(sim-xor-endian,
441[ --enable-sim-xor-endian=n Specify number bytes involved in XOR bi-endian mode (default ${default_sim_xor_endian}).],
a77aa7ec 442[case "${enableval}" in
a35e91c3
AC
443 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
444 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
445 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
a77aa7ec 446esac
a35e91c3
AC
447if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
448 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
449fi],[sim_xor_endian="-DWITH_XOR_ENDIAN=${default_sim_xor_endian}"])dnl
450AC_SUBST(sim_xor_endian)
451])
a77aa7ec
AC
452
453
f2de7dfd
AC
454dnl --enable-sim-warnings is for developers of the simulator.
455dnl it enables extra GCC specific warnings.
456AC_DEFUN(SIM_AC_OPTION_WARNINGS,
457[
458AC_ARG_ENABLE(sim-warnings,
459[ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
460[case "${enableval}" in
461 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations ";;
462 no) sim_warnings="-w";;
463 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
464esac
465if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
466 echo "Setting warning flags = $sim_warnings" 6>&1
467fi],[sim_warnings=""])dnl
a77aa7ec 468AC_SUBST(sim_warnings)
f2de7dfd 469])
80b7b3a5 470
80b7b3a5 471
f2de7dfd
AC
472dnl Generate the Makefile in a target specific directory.
473dnl Substitutions aren't performed on the file in AC_SUBST_FILE,
474dnl so this is a cover macro to tuck the details away of how we cope.
475dnl We cope by having autoconf generate two files and then merge them into
476dnl one afterwards. The two pieces of the common fragment are inserted into
477dnl the target's fragment at the appropriate points.
80b7b3a5 478
f2de7dfd
AC
479AC_DEFUN(SIM_AC_OUTPUT,
480[
80b7b3a5 481AC_LINK_FILES($sim_link_files, $sim_link_links)
f2de7dfd
AC
482AC_OUTPUT(Makefile.sim:Makefile.in Make-common.sim:../common/Make-common.in,
483[case "x$CONFIG_FILES" in xMakefile*)
484 echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
485 rm -f Makesim1.tmp Makesim2.tmp Makefile
486 sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
487 sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
488 sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
489 -e '/^## COMMON_POST_/ r Makesim2.tmp' \
490 <Makefile.sim >Makefile
491 rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
492 ;;
493 esac
80b7b3a5 494 case "x$CONFIG_HEADERS" in xconfig.h:config.in) echo > stamp-h ;; esac
f2de7dfd
AC
495])
496])
This page took 0.054143 seconds and 4 git commands to generate.