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