DisplayDWARF2 basic type encodings.
[deliverable/binutils-gdb.git] / sim / mips / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 sinclude(../common/aclocal.m4)
3 AC_PREREQ(2.5)dnl
4 AC_INIT(Makefile.in)
5
6 SIM_AC_COMMON
7
8 dnl Options available in this module
9 SIM_AC_OPTION_INLINE()
10 SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
11 SIM_AC_OPTION_HOSTENDIAN
12 SIM_AC_OPTION_WARNINGS
13
14 # DEPRECATED
15 #
16 # Instead of defining a `subtarget' macro, code should be checking
17 # the value of {STATE,CPU}_ARCHITECTURE to identify the architecture
18 # in question.
19 #
20 case "${target}" in
21 # start-sanitize-vr4xxx
22 mips64vr4xxx*-*-*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1" ;;
23 # end-sanitize-vr4xxx
24 # start-sanitize-tx19
25 mips*tx19*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
26 # end-sanitize-tx19
27 mips64vr5xxx*-*-*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1" ;;
28 mips*tx39*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
29 *) SIM_SUBTARGET="";;
30 esac
31 AC_SUBST(SIM_SUBTARGET)
32
33
34
35 #
36 # Select the byte order of the target
37 #
38 mips_endian=
39 default_endian=
40 case "${target}" in
41 # start-sanitize-tx19
42 mips*tx19*) default_endian=BIG_ENDIAN ;;
43 # end-sanitize-tx19
44 # start-sanitize-r5900
45 mips64r59*-*-*) mips_endian=LITTLE_ENDIAN ;;
46 # end-sanitize-r5900
47 mips64el*-*-*) mips_endian=LITTLE_ENDIAN ;;
48 mips64*-*-*) default_endian=BIG_ENDIAN ;;
49 mips16*-*-*) default_endian=BIG_ENDIAN ;;
50 mips*-*-*) default_endian=BIG_ENDIAN ;;
51 *) default_endian=BIG_ENDIAN ;;
52 esac
53 SIM_AC_OPTION_ENDIAN($mips_endian,$default_endian)
54
55
56
57 #
58 # Select the bitsize of the target
59 #
60 mips_addr_bitsize=
61 case "${target}" in
62 # start-sanitize-tx19
63 mips*tx19*) mips_bitsize=32 ; mips_msb=31 ;;
64 # end-sanitize-tx19
65 # start-sanitize-r5900
66 mips64r59*-*-*) mips_bitsize=64 ; mips_msb=63 ; mips_addr_bitsize=32;;
67 # end-sanitize-r5900
68 # start-sanitize-sky
69 mips64*-sky*-*) mips_bitsize=64 ; mips_msb=63 ; mips_addr_bitsize=32;;
70 # end-sanitize-sky
71 mips64*-*-*) mips_bitsize=64 ; mips_msb=63 ;;
72 mips16*-*-*) mips_bitsize=64 ; mips_msb=63 ;;
73 mips*-*-*) mips_bitsize=32 ; mips_msb=31 ;;
74 *) mips_bitsize=64 ; mips_msb=63 ;;
75 esac
76 SIM_AC_OPTION_BITSIZE($mips_bitsize,$mips_msb,$mips_addr_bitsize)
77
78
79
80 #
81 # Select the floating hardware support of the target
82 #
83 mips_fpu=HARDWARE_FLOATING_POINT
84 mips_fpu_bitsize=
85 case "${target}" in
86 # start-sanitize-tx19
87 mips*tx19*) mips_fpu=SOFT_FLOATING_POINT ;;
88 # end-sanitize-tx19
89 mips*tx39*) mips_fpu=HARD_FLOATING_POINT
90 mips_fpu_bitsize=32
91 ;;
92 # start-sanitize-vr4xxx
93 mips64vr4xxx*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=64 ;;
94 # end-sanitize-vr4xxx
95 # start-sanitize-r5900
96 mips64r59*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
97 # end-sanitize-r5900
98 # start-sanitize-sky
99 mips64*-sky*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
100 # end-sanitize-sky
101 mips64*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
102 mips16*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
103 mips*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
104 *) mips_fpu=HARD_FLOATING_POINT ;;
105 esac
106 SIM_AC_OPTION_FLOAT($mips_fpu,$mips_fpu_bitsize)
107
108
109
110 #
111 # Select the level of SMP support
112 #
113 case "${target}" in
114 # start-sanitize-r5900
115 mips64r59*-*-*) mips_smp=1 ;;
116 # end-sanitize-r5900
117 *) mips_smp=0 ;;
118 esac
119 SIM_AC_OPTION_SMP($mips_smp)
120
121
122
123 #
124 # Select the IGEN architecture
125 #
126 sim_gen=IGEN
127 sim_igen_machine="-M mipsIV"
128 sim_m16_machine="-M mips16"
129 sim_igen_filter="32,64,f"
130 sim_m16_filter="16"
131 case "${target}" in
132 # start-sanitize-tx19
133 mips*tx19*) sim_gen=M16
134 sim_igen_machine="-M tx19"
135 sim_m16_machine="-M tx19"
136 sim_igen_filter="32"
137 sim_m16_filter="16"
138 ;;
139 # end-sanitize-tx19
140 mips*tx39*) sim_gen=IGEN
141 sim_igen_filter="32,f"
142 sim_igen_machine="-M r3900"
143 ;;
144 # start-sanitize-r5900
145 mips64r59*-*-*) sim_gen=IGEN
146 sim_igen_machine="-M r5900"
147 ;;
148 # end-sanitize-r5900
149 # start-sanitize-vr4320
150 mips64vr4320-*-*) sim_gen=IGEN
151 sim_igen_machine="-M mipsIV,vr4320 -G gen-multi-sim=vr4320"
152 ;;
153 # end-sanitize-vr4320
154 mips64vr43*-*-*) sim_gen=IGEN
155 sim_igen_machine="-M mipsIV"
156 # start-sanitize-vr4320
157 sim_igen_machine="-M mipsIV,vr4320 -G gen-multi-sim=mipsIV"
158 # end-sanitize-vr4320
159 ;;
160 # start-sanitize-cygnus
161 mips64vr54*-*-*) sim_gen=IGEN
162 sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5400"
163 ;;
164 # end-sanitize-cygnus
165 mips64vr5*-*-*) sim_gen=IGEN
166 sim_igen_machine="-M vr5000"
167 # start-sanitize-cygnus
168 sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5000"
169 # end-sanitize-cygnus
170 ;;
171 # start-sanitize-vr4xxx
172 mips64vr4xxx*-*-*) sim_gen=HACK
173 sim_igen_filter="32,64,f"
174 ;;
175 # mips64vr4xxx*-*-*) sim_gen=IGEN
176 # sim_igen_machine="-M mipsIV,vr4100,vr4121 -G gen-multi-sim=mipsIV"
177 # ;;
178 # mips64vr4xxx*-*-*) sim_gen=M16
179 # sim_igen_machine="-M mipsIV,vr4100 -G gen-multi-sim=mipsV"
180 # sim_m16_machine="-M vr4100"
181 # sim_igen_filter="32,64,f"
182 # sim_m16_filter="16"
183 # ;;
184 # end-sanitize-vr4xxx
185 mips64vr41*) sim_gen=M16
186 sim_igen_machine="-M vr4100"
187 sim_m16_machine="-M vr4100"
188 sim_igen_filter="32,64,f"
189 sim_m16_filter="16"
190 ;;
191 mips64*-*-*) sim_igen_filter="32,64,f"
192 sim_gen=IGEN
193 ;;
194 mips16*-*-*) sim_gen=M16
195 sim_igen_filter="32,64,f"
196 sim_m16_filter="16"
197 ;;
198 mips*lsi*) sim_gen=M16
199 sim_igen_machine="-M mipsIII,mips16"
200 sim_m16_machine="-M mips16,mipsIII"
201 sim_igen_filter="32,f"
202 sim_m16_filter="16"
203 ;;
204 mips*-*-*) sim_gen=IGEN
205 sim_igen_filter="32,f"
206 ;;
207 esac
208 sim_igen_flags="-F ${sim_igen_filter} ${sim_igen_machine} ${sim_igen_smp}"
209 sim_m16_flags=" -F ${sim_m16_filter} ${sim_m16_machine} ${sim_igen_smp}"
210 AC_SUBST(sim_igen_flags)
211 AC_SUBST(sim_m16_flags)
212 AC_SUBST(sim_gen)
213
214
215 #
216 # Add simulated hardware devices
217 #
218 hw_enabled=no
219 case "${target}" in
220 mips*tx39*)
221 hw_enabled=yes
222 hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio"
223 mips_extra_objs="dv-sockser.o"
224 SIM_SUBTARGET="$SIM_SUBTARGET -DTARGET_TX3904=1"
225 ;;
226 # start-sanitize-sky
227 mips64r59*-sky-*)
228 mips_extra_objs='$(SIM_SKY_OBJS)'
229 SIM_SUBTARGET="-DTARGET_SKY -DWITH_DEVICES=1 -DDEVICE_INIT=1"
230 ;;
231 mips64*-skyb-*)
232 mips_extra_objs='$(SIM_SKY_OBJS)'
233 SIM_SUBTARGET="-DTARGET_SKY -DTARGET_SKY_B -DWITH_DEVICES=1 -DDEVICE_INIT=1"
234 ;;
235 # end-sanitize-sky
236 *)
237 mips_extra_objs=""
238 ;;
239 esac
240 SIM_AC_OPTION_HARDWARE($hw_enabled,$hw_devices,$hw_extra_devices)
241 AC_SUBST(mips_extra_objs)
242
243
244 # Choose simulator engine
245 case "${target}" in
246 # start-sanitize-sky
247 mips64r59*-sky-*)
248 mips_igen_engine=""
249 ;;
250 mips64*-skyb-*)
251 mips_igen_engine=""
252 ;;
253 # end-sanitize-sky
254 *) mips_igen_engine="engine.o"
255 ;;
256 esac
257 AC_SUBST(mips_igen_engine)
258
259
260 AC_PATH_X
261 mips_extra_libs=""
262 # start-sanitize-sky
263 # Enable GPU2 library
264 AC_ARG_WITH(sim-gpu2,
265 [ --with-sim-gpu2=path Use GPU2 library under given directory],
266 [if test -d "${withval}"
267 then
268 SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_GPU2 -I${withval}/include"
269 mips_extra_libs="-L${withval}/lib -lgpu2 -L${x_libraries} -lX11 -lXext"
270 WITH_GPU2="yes" ; export WITH_GPU2
271
272 # complex X/etc. detection; stolen shamelessly from tcl/tk/gdb configury. --angela
273
274 #--------------------------------------------------------------------
275 # Locate the X11 header files and the X11 library archive. Try
276 # the ac_path_x macro first, but if it doesn't find the X stuff
277 # (e.g. because there's no xmkmf program) then check through
278 # a list of possible directories. Under some conditions the
279 # autoconf macro will return an include directory that contains
280 # no include files, so double-check its result just to be safe.
281 #--------------------------------------------------------------------
282
283 AC_PATH_X
284 not_really_there=""
285 if test "$no_x" = ""; then
286 if test "$x_includes" = ""; then
287 AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
288 else
289 if test ! -r $x_includes/X11/Intrinsic.h; then
290 not_really_there="yes"
291 fi
292 fi
293 fi
294 if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
295 AC_MSG_CHECKING(for X11 header files)
296 XINCLUDES="# no special path needed"
297 AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
298 if test "$XINCLUDES" = nope; then
299 dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
300 for i in $dirs ; do
301 if test -r $i/X11/Intrinsic.h; then
302 AC_MSG_RESULT($i)
303 XINCLUDES=" -I$i"
304 break
305 fi
306 done
307 fi
308 else
309 if test "$x_includes" != ""; then
310 XINCLUDES=-I$x_includes
311 else
312 XINCLUDES="# no special path needed"
313 fi
314 fi
315 if test "$XINCLUDES" = nope; then
316 AC_MSG_RESULT(couldn't find any!)
317 XINCLUDES="# no include files found"
318 fi
319
320 if test "$no_x" = yes; then
321 AC_MSG_CHECKING(for X11 libraries)
322 XLIBSW=nope
323 dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
324 for i in $dirs ; do
325 if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
326 AC_MSG_RESULT($i)
327 XLIBSW="-L$i -lX11"
328 x_libraries="$i"
329 break
330 fi
331 done
332 else
333 if test "$x_libraries" = ""; then
334 XLIBSW=-lX11
335 else
336 XLIBSW="-L$x_libraries -lX11"
337 fi
338 fi
339 if test "$XLIBSW" = nope ; then
340 AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
341 fi
342 if test "$XLIBSW" = nope ; then
343 AC_MSG_RESULT(couldn't find any! Using -lX11.)
344 XLIBSW=-lX11
345 fi
346
347 #--------------------------------------------------------------------
348 # Various manipulations on the search path used at runtime to
349 # find shared libraries:
350 # 1. If the X library binaries are in a non-standard directory,
351 # add the X library location into that search path.
352 # 2. On systems such as AIX and Ultrix that use "-L" as the
353 # search path option, colons cannot be used to separate
354 # directories from each other. Change colons to " -L".
355 # 3. Create two sets of search flags, one for use in cc lines
356 # and the other for when the linker is invoked directly. In
357 # the second case, '-Wl,' must be stripped off and commas must
358 # be replaced by spaces.
359 #--------------------------------------------------------------------
360
361 #
362 # CYGNUS LOCAL: statically link on Solaris, HPUX & SunOS so that
363 # we don't have problems with people not having libraries
364 # installed or not having LD_LIBRARY_PATH set.
365 #
366
367 case "$host" in
368 #
369 # gdb linked statically w/ Solaris iff GCC and GNU ld are used,
370 # otherwise dynamic
371 #
372 sparc-sun-solaris2*)
373 sol_xlibsw=
374 if test "x$GCC" = "xyes" ; then
375 # This is probably the simplest way to test for GNU ld.
376 # It only works with relatively recent versions of GNU
377 # ld.
378 gld_text=`$CC -Wl,--version 2>&1 | sed 1q`
379 case "$gld_text" in
380 GNU* | *BFD*)
381 # Why do we link against libX11 twice? Because the
382 # Openwin X11 and Xext libraries are seriously broken.
383 sol_xlibsw="-Wl,-Bstatic $XLIBSW -lXext -lX11 -Wl,-Bdynamic"
384 ;;
385 esac
386 fi
387 if test -z "$sol_xlibsw"; then
388 if test "x$x_libraries" != "x"; then
389 XLIBSW="$XLIBSW -R$x_libraries"
390 fi
391 else
392 XLIBSW=$sol_xlibsw
393 suppress_enable_shared=yes
394 fi
395 ;;
396 #
397 # gdb linked statically w/ SunOS or HPUX
398 #
399 m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
400 if test "x$x_libraries" != "x" ;
401 then
402 XLIBSW="$x_libraries/libX11.a"
403 else
404 XLIBSW="/usr/lib/libX11.a"
405 fi
406 suppress_enable_shared=yes
407 ;;
408 #
409 # default is to link dynamically
410 #
411 *)
412 ;;
413 esac
414 #
415 # END CYGNUS LOCAL
416
417
418 #--------------------------------------------------------------------
419 # Check for the existence of various libraries. The order here
420 # is important, so that then end up in the right order in the
421 # command line generated by make. The -lsocket and -lnsl libraries
422 # require a couple of special tricks:
423 # 1. Use "connect" and "accept" to check for -lsocket, and
424 # "gethostbyname" to check for -lnsl.
425 # 2. Use each function name only once: can't redo a check because
426 # autoconf caches the results of the last check and won't redo it.
427 # 3. Use -lnsl and -lsocket only if they supply procedures that
428 # aren't already present in the normal libraries. This is because
429 # IRIX 5.2 has libraries, but they aren't needed and they're
430 # bogus: they goof up name resolution if used.
431 # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
432 # To get around this problem, check for both libraries together
433 # if -lsocket doesn't work by itself.
434 #--------------------------------------------------------------------
435
436 AC_CHECK_LIB(Xbsd, main, [SOCKLIBSW="$SOCKLIBSW -lXbsd"])
437
438 # CYGNUS LOCAL: Store any socket library(ies) in the cache, and don't
439 # mess up the cache values of the functions we check for.
440 AC_CACHE_CHECK([for socket libraries], sim_cv_lib_sockets,
441 [sim_cv_lib_sockets=
442 sim_checkBoth=0
443 unset ac_cv_func_connect
444 AC_CHECK_FUNC(connect, sim_checkSocket=0, sim_checkSocket=1)
445 if test "$sim_checkSocket" = 1; then
446 unset ac_cv_func_connect
447 AC_CHECK_LIB(socket, main, sim_cv_lib_sockets="-lsocket",
448 sim_checkBoth=1)
449 fi
450 if test "$sim_checkBoth" = 1; then
451 sim_oldLibs=$SOCKLIBSW
452 SOCKLIBSW="$SOCKLIBSW -lsocket -lnsl"
453 unset ac_cv_func_accept
454 AC_CHECK_FUNC(accept,
455 [sim_checkNsl=0
456 sim_cv_lib_sockets="-lsocket -lnsl"])
457 unset ac_cv_func_accept
458 SOCKLIBSW=$sim_oldLibs
459 fi
460 unset ac_cv_func_gethostbyname
461 sim_oldLibs=$SOCKLIBSW
462 SOCKLIBSW="$SOCKLIBSW $sim_cv_lib_sockets"
463 AC_CHECK_FUNC(gethostbyname, ,
464 [AC_CHECK_LIB(nsl, main,
465 [sim_cv_lib_sockets="$sim_cv_lib_sockets -lnsl"])])
466 unset ac_cv_func_gethostbyname
467 SOCKLIBSW=$sim_oldSOCKLIBSW
468 ])
469 test -z "$sim_cv_lib_sockets" || SOCKLIBSW="$SOCKLIBSW $sim_cv_lib_sockets"
470
471 mips_extra_libs="-L${withval}/lib -lgpu2 -lm $XLIBSW $SOCKLIBSW"
472 cat > simConfig.sh << --EOF--
473 mips_extra_libs="$mips_extra_libs"
474 --EOF--
475
476 else
477 AC_MSG_ERROR("Directory ${withval} does not exist.");
478 fi])dnl
479
480
481 # Enable target accurate FP library
482 AC_ARG_WITH(sim-funit,
483 [ --with-sim-funit=path Use target FP library under given directory],
484 [if test -d "${withval}"
485 then
486 SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_FUNIT -I${withval}/include"
487 mips_extra_libs="${mips_extra_libs} -L${withval}/lib -lfunit"
488 else
489 AC_MSG_ERROR("Directory ${withval} does not exist.");
490 fi])dnl
491 # end-sanitize-sky
492 AC_SUBST(mips_extra_libs)
493
494 AC_CHECK_HEADERS(string.h strings.h stdlib.h stdlib.h)
495 AC_CHECK_LIB(m, fabs)
496 AC_CHECK_FUNCS(aint anint sqrt)
497
498 SIM_AC_OUTPUT
This page took 0.039377 seconds and 4 git commands to generate.