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