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