Check for sys/ioctl.h
[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_PROG_CC
6
7 # Put a plausible default for CC_FOR_BUILD in Makefile.
8 AC_C_CROSS
9 if test "x$cross_compiling" = "xno"; then
10 CC_FOR_BUILD='$(CC)'
11 else
12 CC_FOR_BUILD=gcc
13 fi
14
15 AC_ARG_ENABLE(sim-cflags,
16 [ --enable-sim-cflags=opts Extra CFLAGS for use in building simulator],
17 [case "${enableval}" in
18 yes) sim_cflags="-O2 -fomit-frame-pointer";;
19 no) sim_cflags="";;
20 *) sim_cflags=`echo "${enableval}" | sed -e "s/,/ /g"`;;
21 esac
22 if test x"$silent" != x"yes" && test x"$sim_cflags" != x""; then
23 echo "Setting sim cflags = $sim_cflags" 6>&1
24 fi],[sim_cflags=""])dnl
25
26 AC_ARG_ENABLE(sim-warnings,
27 [ --enable-sim-warnings=opts Extra CFLAGS for turning on compiler warnings except for idecode.o, semantics.o and psim.o],
28 [case "${enableval}" in
29 yes) sim_warnings="-Werror -Wall -Wpointer-arith -Wmissing-prototypes";;
30 no) sim_warnings="-w";;
31 *) sim_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
32 esac
33 if test x"$silent" != x"yes" && test x"$sim_warnings" != x""; then
34 echo "Setting warning flags = $sim_warnings" 6>&1
35 fi],[sim_warnings=""])dnl
36
37 AC_ARG_ENABLE(sim-config,
38 [ --enable-sim-config=file Override default config file],
39 [case "${enableval}" in
40 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-config=file");;
41 *) if test -f "${srcdir}/${enableval}"; then
42 sim_config="${enableval}";
43 elif test -f "${srcdir}/${enableval}-config.h"; then
44 sim_config="${enableval}-config.h"
45 else
46 AC_MSG_ERROR("Config file $enableval was not found");
47 sim_config=std-config.h
48 fi;;
49 esac
50 if test x"$silent" != x"yes" && test x"$sim_config" != x""; then
51 echo "Setting config flags = $sim_config" 6>&1
52 fi],[sim_config="std-config.h"
53 if test x"$silent" != x"yes"; then
54 echo "Setting config flags = $sim_config" 6>&1
55 fi])dnl
56
57 AC_ARG_ENABLE(sim-opcode,
58 [ --enable-sim-opcode=which Override default opcode lookup.],
59 [case "${enableval}" in
60 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-opcode=file");;
61 *) if test -f "${srcdir}/${enableval}"; then
62 sim_opcode="${enableval}"
63 elif test -f "${srcdir}/ppc-opcode-${enableval}"; then
64 sim_opcode="ppc-opcode-${enableval}"
65 else
66 AC_MSG_ERROR("File $enableval is not an opcode rules file");
67 sim_opcode="ppc-opcode-complex"
68 fi;;
69 esac
70 if test x"$silent" != x"yes" && test x"$sim_opcode" != x""; then
71 echo "Setting opcode flags = $sim_opcode" 6>&1
72 fi],[sim_opcode="ppc-opcode-complex"
73 if test x"$silent" != x"yes"; then
74 echo "Setting opcode flags = $sim_opcode"
75 fi])dnl
76
77 AC_ARG_ENABLE(sim-switch,
78 [ --enable-sim-switch Use a switch instead of a table for instruction call.],
79 [case "${enableval}" in
80 yes) sim_switch="-s";;
81 no) sim_switch="";;
82 *) AC_MSG_ERROR("--enable-sim-switch does not take a value"); sim_switch="";;
83 esac
84 if test x"$silent" != x"yes" && test x"$sim_switch" != x""; then
85 echo "Setting switch flags = $sim_switch" 6>&1
86 fi],[sim_switch="";
87 if test x"$silent" != x"yes"; then
88 echo "Setting switch flags = $sim_switch" 6>&1
89 fi])dnl
90
91 AC_ARG_ENABLE(sim-duplicate,
92 [ --enable-sim-duplicate Expand (duplicate) semantic functions.],
93 [case "${enableval}" in
94 yes) sim_dup="-e";;
95 no) sim_dup="";;
96 *) AC_MSG_ERROR("--enable-sim-duplicate does not take a value"); sim_dup="";;
97 esac
98 if test x"$silent" != x"yes" && test x"$sim_dup" != x""; then
99 echo "Setting duplicate flags = $sim_dup" 6>&1
100 fi],[sim_dup="-e"
101 if test x"$silent" != x"yes"; then
102 echo "Setting duplicate flags = $sim_dup" 6>&1
103 fi])dnl
104
105 AC_ARG_ENABLE(sim-filter,
106 [ --enable-sim-filter=rule Specify filter rules.],
107 [case "${enableval}" in
108 yes) AC_MSG_ERROR("--enable-sim-filter must be specified with a rule to filter or no"); sim_filter="";;
109 no) sim_filter="";;
110 *) sim_filter="-f $enableval";;
111 esac
112 if test x"$silent" != x"yes" && test x"$sim_filter" != x""; then
113 echo "Setting filter flags = $sim_filter" 6>&1
114 fi],[sim_filter="-f 64"
115 if test x"$silent" != x"yes"; then
116 echo "Setting filter flags = $sim_filter" 6>&1
117 fi])dnl
118
119 AC_ARG_ENABLE(sim-icache,
120 [ --enable-sim-icache=size Specify instruction cache size.],
121 icache=""
122 [case "${enableval}" in
123 yes) sim_icache="-r 1024"; icache="1024";;
124 define) sim_icache="-r 1024 -R"; icache="1024";;
125 no) sim_icache="";;
126 *) sim_icache="-r ${enableval}"; icache="${enableval}";;
127 esac
128 if test x"$silent" != x"yes" && test x"$icache" != x""; then
129 echo "Setting instruction cache size to $icache"
130 fi],[sim_icache="-r 1024"
131 if test x"$silent" != x"yes"; then
132 echo "Setting instruction cache size to 1024"
133 fi])dnl
134
135 AC_ARG_ENABLE(sim-inline,
136 [ --enable-sim-inline=inlines Specify which functions should be inlined.],
137 [sim_inline=""
138 case "$enableval" in
139 no) sim_inline="-DDEFAULT_INLINE=0";;
140 0) sim_inline="-DDEFAULT_INLINE=0";;
141 yes | 2) sim_inline="-DDEFAULT_INLINE=ALL_INLINE";;
142 1) sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS";;
143 *) for x in `echo "$enableval" | sed -e "s/,/ /g"`; do
144 new_flag=""
145 case "$x" in
146 *_INLINE=*) new_flag="-D$x";;
147 *_INLINE) new_flag="-D$x=ALL_INLINE";;
148 *=*) new_flag=`echo "$x" | sed -e "s/=/_INLINE=/" -e "s/^/-D/"`;;
149 *) new_flag="-D$x""_INLINE=ALL_INLINE";;
150 esac
151 if test x"$sim_inline" = x""; then
152 sim_inline="$new_flag"
153 else
154 sim_inline="$sim_inline $new_flag"
155 fi
156 done;;
157 esac
158 if test x"$silent" != x"yes" && test x"$sim_inline" != x""; then
159 echo "Setting inline flags = $sim_inline" 6>&1
160 fi],[if test x"$GCC" != ""; then
161 sim_inline="-DDEFAULT_INLINE=INLINE_LOCALS"
162 if test x"$silent" != x"yes"; then
163 echo "Setting inline flags = $sim_inline" 6>&1
164 fi
165 else
166 sim_inline=""
167 fi])dnl
168
169 AC_ARG_ENABLE(sim-bswap,
170 [ --enable-sim-bswap Use the BSWAP instruction on Intel 486s and Pentiums.],
171 [case "${enableval}" in
172 yes) sim_bswap="-DWITH_BSWAP=1";;
173 no) sim_bswap="-DWITH_BSWAP=0";;
174 *) AC_MSG_ERROR("--enable-sim-bswap does not take a value"); sim_bswap="";;
175 esac
176 if test x"$silent" != x"yes" && test x"$sim_bswap" != x""; then
177 echo "Setting bswap flags = $sim_bswap" 6>&1
178 fi],[sim_bswap=""])dnl
179
180 AC_ARG_ENABLE(sim-endian,
181 [ --enable-sim-endian=endian Specify target byte endian orientation.],
182 [case "${enableval}" in
183 yes) case "$target" in
184 *powerpc-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
185 *powerpcle-*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
186 *) echo "Unknown target $target" 1>&6; sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
187 esac;;
188 no) sim_endian="-DWITH_TARGET_BYTE_ORDER=0";;
189 b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";;
190 l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";;
191 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-endian"); sim_endian="";;
192 esac
193 if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then
194 echo "Setting endian flags = $sim_endian" 6>&1
195 fi],[sim_endian=""])dnl
196
197 AC_ARG_ENABLE(sim-hostendian,
198 [ --enable-sim-hostendain=end Specify host byte endian orientation.],
199 [case "${enableval}" in
200 no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";;
201 b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";;
202 l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";;
203 *) AC_MSG_ERROR("Unknown value $enableval for --enable-sim-hostendian"); sim_hostendian="";;
204 esac
205 if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then
206 echo "Setting hostendian flags = $sim_hostendian" 6>&1
207 fi],[
208 if test "x$cross_compiling" = "xno"; then
209 AC_C_BIGENDIAN
210 if test $ac_cv_c_bigendian = yes; then
211 sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN"
212 else
213 sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN"
214 fi
215 else
216 sim_hostendian="-DWITH_HOST_BYTE_ORDER=0"
217 fi])dnl
218
219 AC_ARG_ENABLE(sim-smp,
220 [ --enable-sim-smp=n Specify number of processors to configure for.],
221 [case "${enableval}" in
222 yes) sim_smp="-DWITH_SMP=5";;
223 no) sim_smp="-DWITH_SMP=0";;
224 *) sim_smp="-DWITH_SMP=$enableval";;
225 esac
226 if test x"$silent" != x"yes" && test x"$sim_smp" != x""; then
227 echo "Setting smp flags = $sim_smp" 6>&1
228 fi],[sim_smp="-DWITH_SMP=5"
229 if test x"$silent" != x"yes"; then
230 echo "Setting smp flags = $sim_smp" 6>&1
231 fi])dnl
232
233 AC_ARG_ENABLE(sim-xor-endian,
234 [ --enable-sim-xor-endian=n Specify number bytes involved in PowerPC XOR bi-endian mode (default 8).],
235 [case "${enableval}" in
236 yes) sim_xor_endian="-DWITH_XOR_ENDIAN=8";;
237 no) sim_xor_endian="-DWITH_XOR_ENDIAN=0";;
238 *) sim_xor_endian="-DWITH_XOR_ENDIAN=$enableval";;
239 esac
240 if test x"$silent" != x"yes" && test x"$sim_xor_endian" != x""; then
241 echo "Setting xor-endian flag = $sim_xor_endian" 6>&1
242 fi],[sim_xor_endian=""])dnl
243
244 AC_ARG_ENABLE(sim-bitsize,
245 [ --enable-sim-bitsize=n Specify target bitsize (32 or 64).],
246 [case "${enableval}" in
247 32|64) sim_bitsize="-DWITH_TARGET_WORD_BITSIZE=$enableval";;
248 *) AC_MSG_ERROR("--enable-sim-bitsize was given $enableval, expected 32 or 64"); sim_bitsize="";;
249 esac
250 if test x"$silent" != x"yes" && test x"$sim_bitsize" != x""; then
251 echo "Setting bitsize flags = $sim_bitsize" 6>&1
252 fi],[sim_bitsize=""])dnl
253
254 AC_ARG_ENABLE(sim-hostbitsize,
255 [ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
256 [case "${enableval}" in
257 32|64) sim_hostbitsize="-DWITH_HOST_WORD_BITSIZE=$enableval";;
258 *) AC_MSG_ERROR("--enable-sim-hostbitsize was given $enableval, expected 32 or 64"); sim_hostbitsize="";;
259 esac
260 if test x"$silent" != x"yes" && test x"$sim_hostbitsize" != x""; then
261 echo "Setting hostbitsize flags = $sim_hostbitsize" 6>&1
262 fi],[sim_hostbitsize=""])dnl
263
264 AC_ARG_ENABLE(sim-env,
265 [ --enable-sim-env=env Specify target environment (operating, virtual, user).],
266 [case "${enableval}" in
267 operating | os | oea) sim_env="-DWITH_ENVIRONMENT=OPERATING_ENVIRONMENT";;
268 virtual | vea) sim_env="-DWITH_ENVIRONMENT=VIRTUAL_ENVIRONMENT";;
269 user | uea) sim_env="-DWITH_ENVIRONMENT=USER_ENVIRONMENT";;
270 no) sim_env="-DWITH_ENVIRONMENT=0";;
271 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-env"); sim_env="";;
272 esac
273 if test x"$silent" != x"yes" && test x"$sim_env" != x""; then
274 echo "Setting env flags = $sim_env" 6>&1
275 fi],[sim_env=""])dnl
276
277 AC_ARG_ENABLE(sim-timebase,
278 [ --enable-sim-timebase Specify whether the PPC timebase is supported.],
279 [case "${enableval}" in
280 yes) sim_timebase="-DWITH_TIME_BASE=1";;
281 no) sim_timebase="-DWITH_TIME_BASE=0";;
282 *) AC_MSG_ERROR("--enable-sim-timebase does not take a value"); sim_timebase="";;
283 esac
284 if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
285 echo "Setting timebase flags = $sim_timebase" 6>&1
286 fi],[sim_timebase=""])dnl
287
288 AC_ARG_ENABLE(sim-alignment,
289 [ --enable-sim-alignment=align Specify strict or nonstrict alignment.],
290 [case "${enableval}" in
291 yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
292 no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
293 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
294 esac
295 if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
296 echo "Setting alignment flags = $sim_alignment" 6>&1
297 fi],[sim_alignment=""])dnl
298
299 AC_ARG_ENABLE(sim-trace,
300 [ --enable-sim-trace Specify whether tracing is supported.],
301 [case "${enableval}" in
302 yes) sim_trace="-DWITH_TRACE=1";;
303 no) sim_trace="-DWITH_TRACE=0";;
304 *) AC_MSG_ERROR("--enable-sim-trace does not take a value"); sim_trace="";;
305 esac
306 if test x"$silent" != x"yes" && test x"$sim_trace" != x""; then
307 echo "Setting trace flags = $sim_trace" 6>&1
308 fi],[sim_trace=""])dnl
309
310 AC_ARG_ENABLE(sim-assert,
311 [ --enable-sim-assert Specify whether to perform random assertions.],
312 [case "${enableval}" in
313 yes) sim_assert="-DWITH_ASSERT=1";;
314 no) sim_assert="-DWITH_ASSERT=0";;
315 *) AC_MSG_ERROR("--enable-sim-assert does not take a value"); sim_assert="";;
316 esac
317 if test x"$silent" != x"yes" && test x"$sim_assert" != x""; then
318 echo "Setting assert flags = $sim_assert" 6>&1
319 fi],[sim_assert=""])dnl
320
321 AC_ARG_ENABLE(sim-reserved-bits,
322 [ --enable-sim-reserved-bits Specify whether to check reserved bits in instruction.],
323 [case "${enableval}" in
324 yes) sim_reserved="-DWITH_RESERVED_BITS=1";;
325 no) sim_reserved="-DWITH_RESERVED_BITS=0";;
326 *) AC_MSG_ERROR("--enable-sim-reserved-bits does not take a value"); sim_reserved="";;
327 esac
328 if test x"$silent" != x"yes" && test x"$sim_reserved" != x""; then
329 echo "Setting reserved flags = $sim_reserved" 6>&1
330 fi],[sim_reserved=""])dnl
331
332 AC_ARG_ENABLE(sim-float,
333 [ --enable-sim-float Specify whether to use host floating point or simulate.],
334 [case "${enableval}" in
335 yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
336 no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
337 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
338 esac
339 if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
340 echo "Setting float flags = $sim_float" 6>&1
341 fi],[sim_float=""])dnl
342
343 AC_ARG_ENABLE(sim-monitor,
344 [ --enable-sim-monitor=mon Specify whether to enable monitoring events.],
345 [case "${enableval}" in
346 yes) sim_monitor="-DWITH_MON='MONITOR_INSTRUCTION_ISSUE | MONITOR_LOAD_STORE_UNIT'";;
347 no) sim_monitor="-DWITH_MON=0";;
348 instruction) sim_monitor="-DWITH_MON=MONITOR_INSTRUCTION_ISSUE";;
349 memory) sim_monitor="-DWITH_MON=MONITOR_LOAD_STORE_UNIT";;
350 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-mon"); sim_env="";;
351 esac
352 if test x"$silent" != x"yes" && test x"$sim_monitor" != x""; then
353 echo "Setting monitor flags = $sim_monitor" 6>&1
354 fi],[sim_monitor=""])dnl
355
356 AC_ARG_ENABLE(sim-model,
357 [ --enable-sim-model=which Specify PowerPC to model.],
358 [case "${enableval}" in
359 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-model=model");;
360 *) sim_model="-DWITH_MODEL=${enableval}";;
361 esac
362 if test x"$silent" != x"yes" && test x"$sim_model" != x""; then
363 echo "Setting model flags = $sim_model" 6>&1
364 fi],[sim_model=""])dnl
365
366 AC_ARG_ENABLE(sim-default-model,
367 [ --enable-sim-default-model=which Specify default PowerPC to model.],
368 [case "${enableval}" in
369 yes|no) AC_MSG_ERROR("No value supplied for --enable-sim-default-model=model");;
370 *) sim_default_model="-DWITH_DEFAULT_MODEL=${enableval}";;
371 esac
372 if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
373 echo "Setting default-model flags = $sim_default_model" 6>&1
374 fi],[sim_model=""])dnl
375
376 AC_ARG_ENABLE(sim-model-issue,
377 [ --enable-sim-model-issue Specify whether to simulate model specific actions],
378 [case "${enableval}" in
379 yes) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_PROCESS";;
380 no) sim_model_issue="-DWITH_MODEL_ISSUE=MODEL_ISSUE_IGNORE";;
381 *) AC_MSG_ERROR("--enable-sim-model-issue does not take a value"); sim_model_issue="";;
382 esac
383 if test x"$silent" != x"yes"; then
384 echo "Setting model-issue flags = $sim_model_issue" 6>&1
385 fi],[sim_model_issue=""])dnl
386
387 AC_ARG_ENABLE(sim-stdio,
388 [ --enable-sim-stdio Specify whether to use stdio for console input/output.],
389 [case "${enableval}" in
390 yes) sim_stdio="-DWITH_STDIO=DO_USE_STDIO";;
391 no) sim_stdio="-DWITH_STDIO=DONT_USE_STDIO";;
392 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-stdio"); sim_stdio="";;
393 esac
394 if test x"$silent" != x"yes" && test x"$sim_stdio" != x""; then
395 echo "Setting stdio flags = $sim_stdio" 6>&1
396 fi],[sim_stdio=""])dnl
397
398 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
399 AC_CANONICAL_SYSTEM
400 AC_ARG_PROGRAM
401
402 . ${srcdir}/../../bfd/configure.host
403
404 AC_CONFIG_HEADER(config.h:config.in)
405
406 AC_SUBST(CC_FOR_BUILD)
407 AC_SUBST(CFLAGS)
408 AC_SUBST(HDEFINES)
409 AR=${AR-ar}
410 AC_SUBST(AR)
411 AC_PROG_RANLIB
412 AC_SUBST(sim_cflags)
413 AC_SUBST(sim_warnings)
414 AC_SUBST(sim_config)
415 AC_SUBST(sim_opcode)
416 AC_SUBST(sim_switch)
417 AC_SUBST(sim_dup)
418 AC_SUBST(sim_filter)
419 AC_SUBST(sim_icache)
420 AC_SUBST(sim_inline)
421 AC_SUBST(sim_bswap)
422 AC_SUBST(sim_endian)
423 AC_SUBST(sim_xor_endian)
424 AC_SUBST(sim_hostendian)
425 AC_SUBST(sim_smp)
426 AC_SUBST(sim_bitsize)
427 AC_SUBST(sim_hostbitsize)
428 AC_SUBST(sim_env)
429 AC_SUBST(sim_timebase)
430 AC_SUBST(sim_alignment)
431 AC_SUBST(sim_float)
432 AC_SUBST(sim_trace)
433 AC_SUBST(sim_assert)
434 AC_SUBST(sim_reserved)
435 AC_SUBST(sim_monitor)
436 AC_SUBST(sim_model)
437 AC_SUBST(sim_default_model)
438 AC_SUBST(sim_model_issue)
439 AC_SUBST(sim_stdio)
440
441 AC_CHECK_FUNCS(getrusage)
442
443 AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h sys/ioctl.h)
444 AC_HEADER_DIRENT
445
446 AC_OUTPUT(Makefile,
447 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.039859 seconds and 5 git commands to generate.