first stage in function unit support; add new switches & latest code from andrew
[deliverable/binutils-gdb.git] / sim / ppc / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.3)dnl
3 AC_INIT(Makefile.in)
4
5 AC_ARG_ENABLE(sim-cflags,
6 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
7 [case "${enableval}" in
8 yes) sim_cflags="-O2 -fomit-frame-pointer";;
9 no) sim_cflags="";;
10 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
11 esac],[sim_cflags=""])dnl
12
13 AC_ARG_ENABLE(sim-warnings,
14 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o and semantics.o],
15 [case "${enableval}" in
16 yes) sim_warnings="-Wall";;
17 no) sim_warnings="-w";;
18 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
19 esac],[sim_warnings=""])dnl
20
21 AC_ARG_ENABLE(sim-config,
22 [ --enable-sim-config=file Override default config file],
23 [case "${enableval}" in
24 yes) sim_config="std-config.h";;
25 no) sim_config="std-config.h";;
26 *) sim_config="${enableval}";;
27 esac],[sim_config="std-config.h]")dnl
28
29 AC_ARG_ENABLE(sim-opcode,
30 [ --enable-sim-opcode=which Override default opcode lookup.],
31 [case "${enableval}" in
32 yes) sim_opcode="ppc-opcode-simple";;
33 no) sim_opcode="ppc-opcode-simple";;
34 *) sim_opcode="ppc-opcode-${enableval}";;
35 esac],[sim_opcode="ppc-opcode-simple"])dnl
36
37 AC_ARG_ENABLE(sim-switch,
38 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
39 [case "${enableval}" in
40 yes) sim_switch="-s";;
41 *) sim_switch="";;
42 esac],[sim_switch=""])dnl
43
44 AC_ARG_ENABLE(sim-duplicate,
45 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
46 [case "${enableval}" in
47 yes) sim_dup="-e";;
48 *) sim_dup="";;
49 esac],[sim_dup=""])dnl
50
51 AC_ARG_ENABLE(sim-filter,
52 [ --enable-sim-filter=rule Specify filter rules.],
53 [case "${enableval}" in
54 yes) sim_filter="";;
55 *) sim_filter="-f $enableval";;
56 esac],[sim_filter="-f 64"])dnl
57
58 AC_ARG_ENABLE(sim-icache,
59 [ --enable-sim-icache=size Specify instruction cache size.],
60 [case "${enableval}" in
61 yes) sim_icache="-r 1024";;
62 *) sim_icache="";;
63 esac],[sim_icache=""])dnl
64
65 AC_ARG_ENABLE(sim-inline,
66 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
67 [sim_inline=""
68 case "$enableval" in
69 no) sim_inline="";;
70 0) sim_inline="-DDEFAULT_INLINE=0";;
71 yes | 2) sim_inline="-DDEFAULT_INLINE=2";;
72 1) sim_inline="-DDEFAULT_INLINE=1";;
73 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
74 new_flag=""
75 case "$x" in
76 *_INLINE=*) new_flag="-D$x";;
77 *_INLINE) new_flag="-D$x=2";;
78 *=*) new_flag=`sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
79 *) new_flag="-D$x""_INLINE=2";;
80 esac
81 if x"$sim_inline" = x""; then
82 sim_inline="$new_flag"
83 else
84 sim_inline="$flags $new_flag"
85 fi
86 done;;
87 esac],[sim_inline=""])dnl
88
89 AC_ARG_ENABLE(sim-bswap,
90 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
91 [case "${enableval}" in
92 yes) sim_bswap="-DWITH_BSWAP=1";;
93 no) sim_bswap="-DWITH_BSWAP=0";;
94 *) sim_bswap="";;
95 esac],[sim_bswap=""])dnl
96
97 AC_ARG_ENABLE(sim-endian,
98 [ --enable-sim-endian=endian Specify target byte endian orientation.],
99 [case "${enableval}" in
100 yes) case "$target" in
101 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
102 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
103 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
104 esac;;
105 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
106 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
107 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
108 *) sim_endian="";;
109 esac],[sim_endian=""])dnl
110
111 AC_ARG_ENABLE(sim-hostendian,
112 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
113 [case "${enableval}" in
114 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
115 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
116 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
117 *) sim_hostendian="";;
118 esac],[sim_hostendian=""])dnl
119
120 AC_ARG_ENABLE(sim-smp,
121 [ --enable-sim-smp=n Specify number of processors to configure for.],
122 [case "${enableval}" in
123 yes) sim_smp="-DWITH_SMP=2";;
124 no) sim_smp="-DWITH_SMP=0";;
125 *) sim_smp="-DWITH_SMP=$enableval";;
126 esac],[sim_smp=""])dnl
127
128 AC_ARG_ENABLE(sim-bitsize,
129 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
130 [case "${enableval}" in
131 yes) sim_bitsize="";;
132 no) sim_bitsize="";;
133 *) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
134 esac],[sim_bitsize=""])dnl
135
136 AC_ARG_ENABLE(sim-hostbitsize,
137 [ --enable-sim-hostbitsize=n Specify host bitsize (32 or 64).],
138 [case "${enableval}" in
139 yes) sim_hostbitsize="";;
140 no) sim_hostbitsize="";;
141 *) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
142 esac],[sim_hostbitsize=""])dnl
143
144 AC_ARG_ENABLE(sim-env,
145 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
146 [case "${enableval}" in
147 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
148 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
149 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
150 *) sim_env="";;
151 esac],[sim_env=""])dnl
152
153 AC_ARG_ENABLE(sim-timebase,
154 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
155 [case "${enableval}" in
156 yes) sim_timebase="-DWITH_TIME_BASE=1";;
157 no) sim_timebase="-DWITH_TIME_BASE=0";;
158 *) sim_timebase="";;
159 esac],[sim_timebase=""])dnl
160
161 AC_ARG_ENABLE(sim-alignment,
162 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
163 [case "${enableval}" in
164 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
165 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NOSTRICT_ALIGNMENT";;
166 *) sim_alignment="-DWITH_ALIGNMENT=$enableval";;
167 esac],[sim_alignment=""])dnl
168
169 AC_ARG_ENABLE(sim-trace,
170 [ --enable-sim-trace Specify whether tracing is supported.],
171 [case "${enableval}" in
172 yes) sim_trace="-DWITH_TRACE=1";;
173 no) sim_trace="-DWITH_TRACE=0";;
174 *) sim_trace="";;
175 esac],[sim_trace=""])dnl
176
177 AC_ARG_ENABLE(sim-assert,
178 [ --enable-sim-assert Specify whether to perform random assertions.],
179 [case "${enableval}" in
180 yes) sim_assert="-DWITH_ASSERT=1";;
181 no) sim_assert="-DWITH_ASSERT=0";;
182 *) sim_assert="";;
183 esac],[sim_assert=""])dnl
184
185 AC_ARG_ENABLE(sim-float,
186 [ --enable-sim-float Specify whether to use host floating point or simulate.],
187 [case "${enableval}" in
188 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
189 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
190 *) sim_float="";;
191 esac],[sim_float=""])dnl
192
193 AC_ARG_ENABLE(sim-monitor,
194 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
195 [case "${enableval}" in
196 yes) sim_mon="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
197 no) sim_mon="-DWITH_MON=0";;
198 instruction) sim_mon="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
199 memory) sim_mon="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
200 *) sim_mon="-DWITH_MON='$enableval'";;
201 esac],[sim_float=""])dnl
202
203 AC_ARG_ENABLE(sim-function-unit,
204 [ --enable-sim-function-unit Specify whether detailed functional unit support is built.],
205 [case "${enableval}" in
206 yes) sim_func="-DWITH_FUNCTION_UNIT=1";;
207 no) sim_func="-DWITH_FUNCTION_UNIT=0";;
208 *) sim_func="";;
209 esac],[sim_func=""])dnl
210
211 AC_ARG_ENABLE(sim-model,
212 [ --enable-sim-model=which Specify PowerPC to model.],
213 [case "${enableval}" in
214 yes) sim_model="";;
215 no) sim_model="";;
216 *) sim_model="-DWITH_PPC_MODEL=${enableval}";;
217 esac],[sim_model=""])dnl
218
219 AC_ARG_ENABLE(sim-default-model,
220 [ --enable-sim-default-model=which Specify default PowerPC to model.],
221 [case "${enableval}" in
222 yes) sim_default_model="";;
223 no) sim_default_model="";;
224 *) sim_default_model="-DWITH_DEFAULT_PPC_MODEL=${enableval}";;
225 esac],[sim_model=""])dnl
226
227 AC_CONFIG_HEADER(config.h:config.in)
228
229 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
230 AC_CANONICAL_SYSTEM
231 AC_ARG_PROGRAM
232
233 . ${srcdir}/../../bfd/configure.host
234
235 AC_PROG_CC
236 AC_SUBST(CFLAGS)
237 AC_SUBST(HDEFINES)
238 AR=${AR-ar}
239 AC_SUBST(AR)
240 AC_PROG_RANLIB
241 AC_SUBST(sim_cflags)
242 AC_SUBST(sim_warnings)
243 AC_SUBST(sim_config)
244 AC_SUBST(sim_opcode)
245 AC_SUBST(sim_switch)
246 AC_SUBST(sim_dup)
247 AC_SUBST(sim_filter)
248 AC_SUBST(sim_icache)
249 AC_SUBST(sim_inline)
250 AC_SUBST(sim_bswap)
251 AC_SUBST(sim_endian)
252 AC_SUBST(sim_hostendian)
253 AC_SUBST(sim_smp)
254 AC_SUBST(sim_bitsize)
255 AC_SUBST(sim_hostbitsize)
256 AC_SUBST(sim_env)
257 AC_SUBST(sim_timebase)
258 AC_SUBST(sim_alignment)
259 AC_SUBST(sim_float)
260 AC_SUBST(sim_trace)
261 AC_SUBST(sim_assert)
262 AC_SUBST(sim_monitor)
263 AC_SUBST(sim_func)
264 AC_SUBST(sim_model)
265 AC_SUBST(sim_default_model)
266
267 AC_CHECK_FUNCS(getrusage)
268
269 # Put a plausible default for CC_FOR_BUILD in Makefile.
270 AC_C_CROSS
271 if test "x$cross_compiling" = "xno"; then
272 CC_FOR_BUILD='$(CC)'
273 else
274 CC_FOR_BUILD=gcc
275 fi
276 AC_SUBST(CC_FOR_BUILD)
277
278 AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h unistd.h sys/resource.h)
279
280 AC_OUTPUT(Makefile,
281 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.052858 seconds and 5 git commands to generate.