DisplayDWARF2 basic type encodings.
[deliverable/binutils-gdb.git] / sim / mips / configure.in
CommitLineData
19c5af72 1dnl Process this file with autoconf to produce a configure script.
5da9ce07 2sinclude(../common/aclocal.m4)
a271d1d9 3AC_PREREQ(2.5)dnl
8ad57737
JSC
4AC_INIT(Makefile.in)
5
e3d12c65 6SIM_AC_COMMON
8ad57737 7
50a2a691 8dnl Options available in this module
64ed8b6a 9SIM_AC_OPTION_INLINE()
76a6247f 10SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT)
50a2a691
AC
11SIM_AC_OPTION_HOSTENDIAN
12SIM_AC_OPTION_WARNINGS
13
4634263c 14# DEPRECATED
1a89994e
AC
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#
c476ac55 20case "${target}" in
82aeada7 21# start-sanitize-vr4xxx
bff2d368 22 mips64vr4xxx*-*-*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1" ;;
82aeada7 23# end-sanitize-vr4xxx
c476ac55 24# start-sanitize-tx19
bff2d368 25 mips*tx19*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
c476ac55 26# end-sanitize-tx19
bff2d368 27 mips64vr5xxx*-*-*) SIM_SUBTARGET="-DTARGET_ENABLE_FR=1" ;;
3fa454e9 28 mips*tx39*) SIM_SUBTARGET="-DSUBTARGET_R3900=1";;
c476ac55
GRK
29 *) SIM_SUBTARGET="";;
30esac
31AC_SUBST(SIM_SUBTARGET)
32
18c64df6 33
4634263c 34
18c64df6
AC
35#
36# Select the byte order of the target
37#
2d44e12a
AC
38mips_endian=
39default_endian=
18c64df6
AC
40case "${target}" in
41# start-sanitize-tx19
ee562da4 42 mips*tx19*) default_endian=BIG_ENDIAN ;;
18c64df6
AC
43# end-sanitize-tx19
44# start-sanitize-r5900
45 mips64r59*-*-*) mips_endian=LITTLE_ENDIAN ;;
46# end-sanitize-r5900
fda83b67 47 mips64el*-*-*) mips_endian=LITTLE_ENDIAN ;;
2d44e12a
AC
48 mips64*-*-*) default_endian=BIG_ENDIAN ;;
49 mips16*-*-*) default_endian=BIG_ENDIAN ;;
50 mips*-*-*) default_endian=BIG_ENDIAN ;;
51 *) default_endian=BIG_ENDIAN ;;
18c64df6 52esac
2d44e12a 53SIM_AC_OPTION_ENDIAN($mips_endian,$default_endian)
18c64df6
AC
54
55
4634263c 56
18c64df6
AC
57#
58# Select the bitsize of the target
59#
a48e8c8d 60mips_addr_bitsize=
18c64df6
AC
61case "${target}" in
62# start-sanitize-tx19
ee562da4 63 mips*tx19*) mips_bitsize=32 ; mips_msb=31 ;;
18c64df6
AC
64# end-sanitize-tx19
65# start-sanitize-r5900
a48e8c8d 66 mips64r59*-*-*) mips_bitsize=64 ; mips_msb=63 ; mips_addr_bitsize=32;;
18c64df6 67# end-sanitize-r5900
fda83b67
FCE
68# start-sanitize-sky
69 mips64*-sky*-*) mips_bitsize=64 ; mips_msb=63 ; mips_addr_bitsize=32;;
70# end-sanitize-sky
18c64df6
AC
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 ;;
75esac
a48e8c8d 76SIM_AC_OPTION_BITSIZE($mips_bitsize,$mips_msb,$mips_addr_bitsize)
18c64df6
AC
77
78
4634263c 79
18c64df6
AC
80#
81# Select the floating hardware support of the target
82#
83mips_fpu=HARDWARE_FLOATING_POINT
37379a25 84mips_fpu_bitsize=
18c64df6
AC
85case "${target}" in
86# start-sanitize-tx19
ee562da4 87 mips*tx19*) mips_fpu=SOFT_FLOATING_POINT ;;
18c64df6 88# end-sanitize-tx19
3fa454e9 89 mips*tx39*) mips_fpu=HARD_FLOATING_POINT
37379a25
AC
90 mips_fpu_bitsize=32
91 ;;
82aeada7 92# start-sanitize-vr4xxx
bff2d368 93 mips64vr4xxx*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=64 ;;
82aeada7 94# end-sanitize-vr4xxx
18c64df6 95# start-sanitize-r5900
a48e8c8d 96 mips64r59*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
18c64df6 97# end-sanitize-r5900
fda83b67
FCE
98# start-sanitize-sky
99 mips64*-sky*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
100# end-sanitize-sky
18c64df6
AC
101 mips64*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
102 mips16*-*-*) mips_fpu=HARD_FLOATING_POINT ;;
55ad270f 103 mips*-*-*) mips_fpu=HARD_FLOATING_POINT ; mips_fpu_bitsize=32 ;;
18c64df6
AC
104 *) mips_fpu=HARD_FLOATING_POINT ;;
105esac
37379a25 106SIM_AC_OPTION_FLOAT($mips_fpu,$mips_fpu_bitsize)
18c64df6
AC
107
108
4634263c 109
01737f42
AC
110#
111# Select the level of SMP support
112#
113case "${target}" in
114# start-sanitize-r5900
115 mips64r59*-*-*) mips_smp=1 ;;
116# end-sanitize-r5900
117 *) mips_smp=0 ;;
118esac
119SIM_AC_OPTION_SMP($mips_smp)
120
121
4634263c 122
122edc03 123#
44b8585a 124# Select the IGEN architecture
122edc03 125#
554eb429 126sim_gen=IGEN
c02ed6a8
AC
127sim_igen_machine="-M mipsIV"
128sim_m16_machine="-M mips16"
44b8585a
AC
129sim_igen_filter="32,64,f"
130sim_m16_filter="16"
122edc03 131case "${target}" in
90ad43b2 132# start-sanitize-tx19
554eb429 133 mips*tx19*) sim_gen=M16
c02ed6a8
AC
134 sim_igen_machine="-M tx19"
135 sim_m16_machine="-M tx19"
44b8585a
AC
136 sim_igen_filter="32"
137 sim_m16_filter="16"
138 ;;
90ad43b2 139# end-sanitize-tx19
554eb429 140 mips*tx39*) sim_gen=IGEN
37379a25
AC
141 sim_igen_filter="32,f"
142 sim_igen_machine="-M r3900"
143 ;;
122edc03 144# start-sanitize-r5900
554eb429 145 mips64r59*-*-*) sim_gen=IGEN
c02ed6a8 146 sim_igen_machine="-M r5900"
44b8585a 147 ;;
122edc03 148# end-sanitize-r5900
dd15abd5 149# start-sanitize-vr4320
554eb429 150 mips64vr4320-*-*) sim_gen=IGEN
dd15abd5
GRK
151 sim_igen_machine="-M mipsIV,vr4320 -G gen-multi-sim=vr4320"
152 ;;
153# end-sanitize-vr4320
554eb429 154 mips64vr43*-*-*) sim_gen=IGEN
dd15abd5
GRK
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 ;;
3d759c53 160# start-sanitize-cygnus
554eb429 161 mips64vr54*-*-*) sim_gen=IGEN
c02ed6a8 162 sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5400"
44b8585a 163 ;;
3d759c53 164# end-sanitize-cygnus
554eb429 165 mips64vr5*-*-*) sim_gen=IGEN
c02ed6a8 166 sim_igen_machine="-M vr5000"
3d759c53 167# start-sanitize-cygnus
255cbbf1 168 sim_igen_machine="-M vr5000,vr5400 -G gen-multi-sim=vr5000"
57791952 169# end-sanitize-cygnus
bd164e28 170 ;;
82aeada7 171# start-sanitize-vr4xxx
f87366ec
GRK
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# ;;
82aeada7 184# end-sanitize-vr4xxx
554eb429 185 mips64vr41*) sim_gen=M16
baa1a488
AC
186 sim_igen_machine="-M vr4100"
187 sim_m16_machine="-M vr4100"
57791952
AC
188 sim_igen_filter="32,64,f"
189 sim_m16_filter="16"
180d1f0b 190 ;;
554eb429
AC
191 mips64*-*-*) sim_igen_filter="32,64,f"
192 sim_gen=IGEN
4634263c 193 ;;
554eb429 194 mips16*-*-*) sim_gen=M16
4634263c
AC
195 sim_igen_filter="32,64,f"
196 sim_m16_filter="16"
44b8585a 197 ;;
554eb429 198 mips*lsi*) sim_gen=M16
a83d7d87
AC
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"
d1cbd70a 203 ;;
554eb429 204 mips*-*-*) sim_gen=IGEN
44b8585a 205 sim_igen_filter="32,f"
44b8585a 206 ;;
122edc03 207esac
01737f42
AC
208sim_igen_flags="-F ${sim_igen_filter} ${sim_igen_machine} ${sim_igen_smp}"
209sim_m16_flags=" -F ${sim_m16_filter} ${sim_m16_machine} ${sim_igen_smp}"
16bd5d6e
AC
210AC_SUBST(sim_igen_flags)
211AC_SUBST(sim_m16_flags)
44b8585a
AC
212AC_SUBST(sim_gen)
213
214
f872d0d6 215#
3fa454e9
FCE
216# Add simulated hardware devices
217#
f872d0d6 218hw_enabled=no
3fa454e9 219case "${target}" in
36e838d1
FCE
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 ;;
36e838d1
FCE
226# start-sanitize-sky
227 mips64r59*-sky-*)
fda83b67 228 mips_extra_objs='$(SIM_SKY_OBJS)'
36e838d1
FCE
229 SIM_SUBTARGET="-DTARGET_SKY -DWITH_DEVICES=1 -DDEVICE_INIT=1"
230 ;;
fda83b67
FCE
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 ;;
36e838d1
FCE
235# end-sanitize-sky
236 *)
237 mips_extra_objs=""
238 ;;
3fa454e9 239esac
f872d0d6 240SIM_AC_OPTION_HARDWARE($hw_enabled,$hw_devices,$hw_extra_devices)
36e838d1 241AC_SUBST(mips_extra_objs)
3fa454e9
FCE
242
243
fda83b67
FCE
244# Choose simulator engine
245case "${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 ;;
256esac
257AC_SUBST(mips_igen_engine)
258
259
9b23b76d
FCE
260AC_PATH_X
261mips_extra_libs=""
262# start-sanitize-sky
263# Enable GPU2 library
264AC_ARG_WITH(sim-gpu2,
265[ --with-sim-gpu2=path Use GPU2 library under given directory],
266[if test -d "${withval}"
267then
268 SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_GPU2 -I${withval}/include"
f915cc91 269 mips_extra_libs="-L${withval}/lib -lgpu2 -L${x_libraries} -lX11 -lXext"
fda83b67
FCE
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--
473mips_extra_libs="$mips_extra_libs"
474--EOF--
475
9b23b76d
FCE
476else
477 AC_MSG_ERROR("Directory ${withval} does not exist.");
478fi])dnl
fda83b67
FCE
479
480
3e5fbf91
JL
481# Enable target accurate FP library
482AC_ARG_WITH(sim-funit,
483[ --with-sim-funit=path Use target FP library under given directory],
484[if test -d "${withval}"
485then
486 SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_FUNIT -I${withval}/include"
487 mips_extra_libs="${mips_extra_libs} -L${withval}/lib -lfunit"
488else
489 AC_MSG_ERROR("Directory ${withval} does not exist.");
490fi])dnl
9b23b76d
FCE
491# end-sanitize-sky
492AC_SUBST(mips_extra_libs)
493
50a2a691 494AC_CHECK_HEADERS(string.h strings.h stdlib.h stdlib.h)
4fa134be 495AC_CHECK_LIB(m, fabs)
617c07c6 496AC_CHECK_FUNCS(aint anint sqrt)
4fa134be 497
e3d12c65 498SIM_AC_OUTPUT
This page took 0.144248 seconds and 4 git commands to generate.