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