Mon Nov 9 18:22:55 1998 Dave Brolley <brolley@cygnus.com>
[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 ;;
180d1f0b
JM
190mips64vr4100-*-*) echo "NOTE: mips64vr4100 still uses gencode"
191 sim_default_gen=M16
192 sim_igen_machine="-M tx19"
193 sim_m16_machine="-M tx19"
194 sim_igen_filter = "32,64,f"
195 sim_m16_filter = "16"
196 sim_use_gen=NO
197 ;;
198
4634263c
AC
199 mips64*-*-*) sim_default_gen=IGEN
200 sim_igen_filter="32,64,f"
201 sim_use_gen=IGEN
202 ;;
44b8585a 203 mips16*-*-*) sim_default_gen=M16
4634263c
AC
204 sim_igen_filter="32,64,f"
205 sim_m16_filter="16"
37379a25 206 sim_use_igen=NO
44b8585a 207 ;;
4634263c 208 mips*-*-*) sim_default_gen=IGEN
44b8585a 209 sim_igen_filter="32,f"
4634263c 210 sim_use_gen=IGEN
44b8585a 211 ;;
122edc03 212esac
01737f42
AC
213sim_igen_flags="-F ${sim_igen_filter} ${sim_igen_machine} ${sim_igen_smp}"
214sim_m16_flags=" -F ${sim_m16_filter} ${sim_m16_machine} ${sim_igen_smp}"
16bd5d6e
AC
215AC_SUBST(sim_igen_flags)
216AC_SUBST(sim_m16_flags)
122edc03 217
4634263c
AC
218
219
44b8585a
AC
220#
221# Enable igen
222#
223AC_ARG_ENABLE(sim-igen,
224[ --enable-sim-igen=opts Enable IGEN simulator],
225[case "${enableval}" in
226 yes) sim_gen="${sim_default_gen}";;
227 no) sim_gen=NO;;
228 16) sim_gen=M16;;
9b23b76d 229 *) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-igen"); sim_gen="";;
44b8585a
AC
230esac
231if test x"$silent" != x"yes" && test x"$sim_gen" != x""; then
232 echo "Setting sim_igen = $sim_gen" 6>&1
233fi],[sim_gen="${sim_use_gen}"])dnl
234AC_SUBST(sim_gen)
235
236
f872d0d6 237#
3fa454e9
FCE
238# Add simulated hardware devices
239#
f872d0d6 240hw_enabled=no
3fa454e9 241case "${target}" in
36e838d1
FCE
242# start-sanitize-tx3904
243 mips*tx39*)
244 hw_enabled=yes
245 hw_extra_devices="tx3904cpu tx3904irc tx3904tmr tx3904sio"
246 mips_extra_objs="dv-sockser.o"
247 SIM_SUBTARGET="$SIM_SUBTARGET -DTARGET_TX3904=1"
248 ;;
249# end-sanitize-tx3904
250# start-sanitize-sky
251 mips64r59*-sky-*)
fda83b67 252 mips_extra_objs='$(SIM_SKY_OBJS)'
36e838d1
FCE
253 SIM_SUBTARGET="-DTARGET_SKY -DWITH_DEVICES=1 -DDEVICE_INIT=1"
254 ;;
fda83b67
FCE
255 mips64*-skyb-*)
256 mips_extra_objs='$(SIM_SKY_OBJS)'
257 SIM_SUBTARGET="-DTARGET_SKY -DTARGET_SKY_B -DWITH_DEVICES=1 -DDEVICE_INIT=1"
258 ;;
36e838d1
FCE
259# end-sanitize-sky
260 *)
261 mips_extra_objs=""
262 ;;
3fa454e9 263esac
f872d0d6 264SIM_AC_OPTION_HARDWARE($hw_enabled,$hw_devices,$hw_extra_devices)
36e838d1 265AC_SUBST(mips_extra_objs)
3fa454e9
FCE
266
267
fda83b67
FCE
268# Choose simulator engine
269case "${target}" in
270# start-sanitize-sky
271 mips64r59*-sky-*)
272 mips_igen_engine=""
273 ;;
274 mips64*-skyb-*)
275 mips_igen_engine=""
276 ;;
277# end-sanitize-sky
278 *) mips_igen_engine="engine.o"
279 ;;
280esac
281AC_SUBST(mips_igen_engine)
282
283
9b23b76d
FCE
284AC_PATH_X
285mips_extra_libs=""
286# start-sanitize-sky
287# Enable GPU2 library
288AC_ARG_WITH(sim-gpu2,
289[ --with-sim-gpu2=path Use GPU2 library under given directory],
290[if test -d "${withval}"
291then
292 SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_GPU2 -I${withval}/include"
f915cc91 293 mips_extra_libs="-L${withval}/lib -lgpu2 -L${x_libraries} -lX11 -lXext"
fda83b67
FCE
294 WITH_GPU2="yes" ; export WITH_GPU2
295
296 # complex X/etc. detection; stolen shamelessly from tcl/tk/gdb configury. --angela
297
298 #--------------------------------------------------------------------
299 # Locate the X11 header files and the X11 library archive. Try
300 # the ac_path_x macro first, but if it doesn't find the X stuff
301 # (e.g. because there's no xmkmf program) then check through
302 # a list of possible directories. Under some conditions the
303 # autoconf macro will return an include directory that contains
304 # no include files, so double-check its result just to be safe.
305 #--------------------------------------------------------------------
306
307 AC_PATH_X
308 not_really_there=""
309 if test "$no_x" = ""; then
310 if test "$x_includes" = ""; then
311 AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
312 else
313 if test ! -r $x_includes/X11/Intrinsic.h; then
314 not_really_there="yes"
315 fi
316 fi
317 fi
318 if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
319 AC_MSG_CHECKING(for X11 header files)
320 XINCLUDES="# no special path needed"
321 AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
322 if test "$XINCLUDES" = nope; then
323 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"
324 for i in $dirs ; do
325 if test -r $i/X11/Intrinsic.h; then
326 AC_MSG_RESULT($i)
327 XINCLUDES=" -I$i"
328 break
329 fi
330 done
331 fi
332 else
333 if test "$x_includes" != ""; then
334 XINCLUDES=-I$x_includes
335 else
336 XINCLUDES="# no special path needed"
337 fi
338 fi
339 if test "$XINCLUDES" = nope; then
340 AC_MSG_RESULT(couldn't find any!)
341 XINCLUDES="# no include files found"
342 fi
343
344 if test "$no_x" = yes; then
345 AC_MSG_CHECKING(for X11 libraries)
346 XLIBSW=nope
347 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"
348 for i in $dirs ; do
349 if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
350 AC_MSG_RESULT($i)
351 XLIBSW="-L$i -lX11"
352 x_libraries="$i"
353 break
354 fi
355 done
356 else
357 if test "$x_libraries" = ""; then
358 XLIBSW=-lX11
359 else
360 XLIBSW="-L$x_libraries -lX11"
361 fi
362 fi
363 if test "$XLIBSW" = nope ; then
364 AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
365 fi
366 if test "$XLIBSW" = nope ; then
367 AC_MSG_RESULT(couldn't find any! Using -lX11.)
368 XLIBSW=-lX11
369 fi
370
371 #--------------------------------------------------------------------
372 # Various manipulations on the search path used at runtime to
373 # find shared libraries:
374 # 1. If the X library binaries are in a non-standard directory,
375 # add the X library location into that search path.
376 # 2. On systems such as AIX and Ultrix that use "-L" as the
377 # search path option, colons cannot be used to separate
378 # directories from each other. Change colons to " -L".
379 # 3. Create two sets of search flags, one for use in cc lines
380 # and the other for when the linker is invoked directly. In
381 # the second case, '-Wl,' must be stripped off and commas must
382 # be replaced by spaces.
383 #--------------------------------------------------------------------
384
385 #
386 # CYGNUS LOCAL: statically link on Solaris, HPUX & SunOS so that
387 # we don't have problems with people not having libraries
388 # installed or not having LD_LIBRARY_PATH set.
389 #
390
391 case "$host" in
392 #
393 # gdb linked statically w/ Solaris iff GCC and GNU ld are used,
394 # otherwise dynamic
395 #
396 sparc-sun-solaris2*)
397 sol_xlibsw=
398 if test "x$GCC" = "xyes" ; then
399 # This is probably the simplest way to test for GNU ld.
400 # It only works with relatively recent versions of GNU
401 # ld.
402 gld_text=`$CC -Wl,--version 2>&1 | sed 1q`
403 case "$gld_text" in
404 GNU* | *BFD*)
405 # Why do we link against libX11 twice? Because the
406 # Openwin X11 and Xext libraries are seriously broken.
407 sol_xlibsw="-Wl,-Bstatic $XLIBSW -lXext -lX11 -Wl,-Bdynamic"
408 ;;
409 esac
410 fi
411 if test -z "$sol_xlibsw"; then
412 if test "x$x_libraries" != "x"; then
413 XLIBSW="$XLIBSW -R$x_libraries"
414 fi
415 else
416 XLIBSW=$sol_xlibsw
417 suppress_enable_shared=yes
418 fi
419 ;;
420 #
421 # gdb linked statically w/ SunOS or HPUX
422 #
423 m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
424 if test "x$x_libraries" != "x" ;
425 then
426 XLIBSW="$x_libraries/libX11.a"
427 else
428 XLIBSW="/usr/lib/libX11.a"
429 fi
430 suppress_enable_shared=yes
431 ;;
432 #
433 # default is to link dynamically
434 #
435 *)
436 ;;
437 esac
438 #
439 # END CYGNUS LOCAL
440
441
442 #--------------------------------------------------------------------
443 # Check for the existence of various libraries. The order here
444 # is important, so that then end up in the right order in the
445 # command line generated by make. The -lsocket and -lnsl libraries
446 # require a couple of special tricks:
447 # 1. Use "connect" and "accept" to check for -lsocket, and
448 # "gethostbyname" to check for -lnsl.
449 # 2. Use each function name only once: can't redo a check because
450 # autoconf caches the results of the last check and won't redo it.
451 # 3. Use -lnsl and -lsocket only if they supply procedures that
452 # aren't already present in the normal libraries. This is because
453 # IRIX 5.2 has libraries, but they aren't needed and they're
454 # bogus: they goof up name resolution if used.
455 # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
456 # To get around this problem, check for both libraries together
457 # if -lsocket doesn't work by itself.
458 #--------------------------------------------------------------------
459
460 AC_CHECK_LIB(Xbsd, main, [SOCKLIBSW="$SOCKLIBSW -lXbsd"])
461
462 # CYGNUS LOCAL: Store any socket library(ies) in the cache, and don't
463 # mess up the cache values of the functions we check for.
464 AC_CACHE_CHECK([for socket libraries], sim_cv_lib_sockets,
465 [sim_cv_lib_sockets=
466 sim_checkBoth=0
467 unset ac_cv_func_connect
468 AC_CHECK_FUNC(connect, sim_checkSocket=0, sim_checkSocket=1)
469 if test "$sim_checkSocket" = 1; then
470 unset ac_cv_func_connect
471 AC_CHECK_LIB(socket, main, sim_cv_lib_sockets="-lsocket",
472 sim_checkBoth=1)
473 fi
474 if test "$sim_checkBoth" = 1; then
475 sim_oldLibs=$SOCKLIBSW
476 SOCKLIBSW="$SOCKLIBSW -lsocket -lnsl"
477 unset ac_cv_func_accept
478 AC_CHECK_FUNC(accept,
479 [sim_checkNsl=0
480 sim_cv_lib_sockets="-lsocket -lnsl"])
481 unset ac_cv_func_accept
482 SOCKLIBSW=$sim_oldLibs
483 fi
484 unset ac_cv_func_gethostbyname
485 sim_oldLibs=$SOCKLIBSW
486 SOCKLIBSW="$SOCKLIBSW $sim_cv_lib_sockets"
487 AC_CHECK_FUNC(gethostbyname, ,
488 [AC_CHECK_LIB(nsl, main,
489 [sim_cv_lib_sockets="$sim_cv_lib_sockets -lnsl"])])
490 unset ac_cv_func_gethostbyname
491 SOCKLIBSW=$sim_oldSOCKLIBSW
492 ])
493 test -z "$sim_cv_lib_sockets" || SOCKLIBSW="$SOCKLIBSW $sim_cv_lib_sockets"
494
495 mips_extra_libs="-L${withval}/lib -lgpu2 -lm $XLIBSW $SOCKLIBSW"
496 cat > simConfig.sh << --EOF--
497mips_extra_libs="$mips_extra_libs"
498--EOF--
499
9b23b76d
FCE
500else
501 AC_MSG_ERROR("Directory ${withval} does not exist.");
502fi])dnl
fda83b67
FCE
503
504
3e5fbf91
JL
505# Enable target accurate FP library
506AC_ARG_WITH(sim-funit,
507[ --with-sim-funit=path Use target FP library under given directory],
508[if test -d "${withval}"
509then
510 SIM_SUBTARGET="${SIM_SUBTARGET} -DSKY_FUNIT -I${withval}/include"
511 mips_extra_libs="${mips_extra_libs} -L${withval}/lib -lfunit"
512else
513 AC_MSG_ERROR("Directory ${withval} does not exist.");
514fi])dnl
9b23b76d
FCE
515# end-sanitize-sky
516AC_SUBST(mips_extra_libs)
517
50a2a691 518AC_CHECK_HEADERS(string.h strings.h stdlib.h stdlib.h)
4fa134be 519AC_CHECK_LIB(m, fabs)
617c07c6 520AC_CHECK_FUNCS(aint anint sqrt)
4fa134be 521
e3d12c65 522SIM_AC_OUTPUT
This page took 0.133698 seconds and 4 git commands to generate.