* configure.in: Check whether printf family supports printing
[binutils-gdb.git] / gdb / configure.in
1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996 Free Software Foundation, Inc.
3 dnl
4 dnl This file is part of GDB.
5 dnl
6 dnl This program is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 2 of the License, or
9 dnl (at your option) any later version.
10 dnl
11 dnl This program is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 dnl GNU General Public License for more details.
15 dnl
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with this program; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 dnl Process this file with autoconf to produce a configure script.
21
22 AC_PREREQ(2.3)dnl
23 AC_INIT(main.c)
24 AC_CONFIG_HEADER(config.h:config.in)
25
26 AC_PROG_CC
27 AC_AIX
28 AC_MINIX
29 AC_ISC_POSIX
30
31 AC_PROG_INSTALL
32 AC_PROG_RANLIB
33 AC_PROG_YACC
34
35 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
36 AC_CANONICAL_SYSTEM
37 AC_ARG_PROGRAM
38
39 AC_HEADER_STDC
40 AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h link.h)
41 AC_HEADER_STAT
42
43 AC_MSG_CHECKING([for gregset_t type])
44 AC_CACHE_VAL(gdb_cv_have_gregset_t,
45 [AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
46 gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
47 AC_MSG_RESULT($gdb_cv_have_gregset_t)
48 if test $gdb_cv_have_gregset_t = yes; then
49 AC_DEFINE(HAVE_GREGSET_T)
50 fi
51
52 AC_MSG_CHECKING([for fpregset_t type])
53 AC_CACHE_VAL(gdb_cv_have_fpregset_t,
54 [AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
55 gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
56 AC_MSG_RESULT($gdb_cv_have_fpregset_t)
57 if test $gdb_cv_have_fpregset_t = yes; then
58 AC_DEFINE(HAVE_FPREGSET_T)
59 fi
60
61 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
62 dnl because autoconf complains about cross-compilation issues. However, this
63 dnl code uses the same variables as the macro for compatibility.
64
65 AC_MSG_CHECKING(for long double support in compiler)
66 AC_CACHE_VAL(ac_cv_c_long_double,
67 [AC_TRY_COMPILE(, [long double foo;],
68 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
69 AC_MSG_RESULT($ac_cv_c_long_double)
70 if test $ac_cv_c_long_double = yes; then
71 AC_DEFINE(HAVE_LONG_DOUBLE)
72 fi
73
74 dnl See if the compiler and runtime support printing long doubles
75
76 AC_MSG_CHECKING(for long double support in printf)
77 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
78 [AC_TRY_RUN([
79 int main () {
80 char buf[16];
81 long double f = 3.141592653;
82 sprintf (buf, "%Lg", f);
83 return (strncmp ("3.14159", buf, 7));
84 }],
85 gdb_cv_printf_has_long_double=yes,
86 gdb_cv_printf_has_long_double=no,
87 gdb_cv_printf_has_long_double=no)])
88 if test $gdb_cv_printf_has_long_double = yes; then
89 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
90 fi
91 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
92
93 AC_FUNC_MMAP
94
95 dnl Handle optional features that can be enabled.
96 ENABLE_CFLAGS=
97 ENABLE_CLIBS=
98 ENABLE_OBS=
99
100 AC_ARG_ENABLE(netrom,
101 [ --enable-netrom ],
102 [case "${enableval}" in
103 yes) enable_netrom=yes ;;
104 no) enable_netrom=no ;;
105 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
106 esac])
107
108 if test "${enable_netrom}" = "yes"; then
109 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
110 fi
111
112 # start-sanitize-gm
113 ENABLE_GM=
114
115 AC_ARG_ENABLE(gm,
116 [ --enable-gm ],
117 [case "${enableval}" in
118 yes) ENABLE_OBS="${ENABLE_OBS} gmagic.o"
119 ENABLE_CFLAGS=-DGENERAL_MAGIC
120 ;;
121 no) ;;
122 *) AC_MSG_ERROR(bad value ${enableval} given for gm option) ;;
123 esac])
124
125 # end-sanitize-gm
126
127 AC_ARG_ENABLE(sim-powerpc,
128 [ --enable-sim-powerpc ],
129 [case "${enableval}" in
130 yes) powerpc_sim=yes ;;
131 no) powerpc_sim=no ;;
132 *) AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
133 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
134
135 # start-sanitize-gdbtk
136 ENABLE_GDBTK=
137
138 AC_ARG_ENABLE(gdbtk,
139 [ --enable-gdbtk ],
140 [case "${enableval}" in
141 yes)
142 case "$host" in
143 *go32*)
144 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
145 enable_gdbtk=no ;;
146 *)
147 enable_gdbtk=yes ;;
148 esac ;;
149 no)
150 enable_gdbtk=no ;;
151 *)
152 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
153 esac],
154 [
155 # Default is on for everything but go32
156 case "$host" in
157 *go32*)
158 ;;
159 *)
160 enable_gdbtk=yes ;;
161 esac
162 ])
163
164 if test "${enable_gdbtk}" = "yes"; then
165
166 AC_PATH_X
167 AC_PATH_XTRA
168
169 CY_AC_PATH_TCL
170 CY_AC_PATH_TK
171
172 # Look for dynamic linking libraries that Tcl might need. This is
173 # only done for Tcl 7.5 and greater. It would be good to look for and
174 # use the "configInfo" file that Tcl generates, but for now that is
175 # beyond us.
176 if test $tclmajor -ge 7 -a $tclminor -ge 5 ; then
177 AC_CHECK_LIB(dl, main, , AC_CHECK_LIB(dld, main))
178 fi
179
180 ENABLE_GDBTK=1
181
182 if test "x$no_x" != "xyes"; then
183 if test "x$x_includes" != "x" ;
184 then
185 X_CFLAGS="-I$x_includes"
186 else
187 X_CFLAGS=""
188 fi
189
190 if test "x$x_libraries" != "x" ;
191 then
192 X_LDFLAGS="-L$x_libraries"
193 else
194 X_LDFLAGS=""
195 fi
196
197 case "$host" in
198 #
199 # gdb linked statically w/ Solaris iff GCC is used, otherwise dynamic
200 #
201 sparc*-sun-solaris2*)
202 if test "x$GCC" = "xyes";
203 then
204 X_LIBS="-Wl,-Bstatic -lX11 -lXext -lX11 -Wl,-Bdynamic -ldl -lw"
205 else
206 if test "x$x_libraries" != "x" ;
207 then
208 X_LDFLAGS="$X_LDFLAGS -R$x_libraries"
209 fi
210 X_LIBS="-lX11 -lXext -lX11"
211 fi ;;
212 #
213 # gdb linked statically w/ SunOS or HPUX
214 #
215 m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
216 if test "x$x_libraries" != "x" ;
217 then
218 X_LIBS="$x_libraries/libX11.a"
219 else
220 X_LIBS="/usr/lib/libX11.a"
221 fi ;;
222 #
223 # default is to link dynamically
224 #
225 *)
226 X_LIBS="-lX11" ;;
227 esac
228 else
229 X_LDLAGS=""
230 X_CFLAGS=""
231 X_LIBS=""
232 AC_MSG_WARN([No X based programs will be built])
233 fi
234
235 TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)'
236 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS} -lm"
237 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
238 fi
239
240 AC_SUBST(ENABLE_GDBTK)
241 AC_SUBST(X_CFLAGS)
242 AC_SUBST(X_LDFLAGS)
243 AC_SUBST(X_LIBS)
244 # end-sanitize-gdbtk
245
246 AC_SUBST(ENABLE_CFLAGS)
247 AC_SUBST(ENABLE_CLIBS)
248 AC_SUBST(ENABLE_OBS)
249
250 # target_subdir is used by the testsuite to find the target libraries.
251 target_subdir=
252 if test "${host}" != "${target}"; then
253 target_subdir="${target_alias}/"
254 fi
255 AC_SUBST(target_subdir)
256
257 configdirs="doc testsuite"
258
259 dnl
260 changequote(,)dnl
261
262 # Map host cpu into the config cpu subdirectory name.
263 # The default is $host_cpu.
264
265 case "${host_cpu}" in
266
267 c[12]) gdb_host_cpu=convex ;;
268 hppa*) gdb_host_cpu=pa ;;
269 i[3456]86) gdb_host_cpu=i386 ;;
270 m68*) gdb_host_cpu=m68k ;;
271 m88*) gdb_host_cpu=m88k ;;
272 np1) gdb_host_cpu=gould ;;
273 pyramid) gdb_host_cpu=pyr ;;
274 powerpc*) gdb_host_cpu=powerpc ;;
275 sparc64) gdb_host_cpu=sparc ;;
276 *) gdb_host_cpu=$host_cpu ;;
277
278 esac
279
280 # map host info into gdb names.
281
282 case "${host}" in
283
284 a29k-*-*) gdb_host=ultra3 ;;
285
286 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
287 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
288 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
289
290 arm-*-*) gdb_host=arm ;;
291
292 c[12]-*-*) gdb_host=convex ;;
293
294 hppa*-*-bsd*) gdb_host=hppabsd ;;
295 hppa*-*-hiux*) gdb_host=hppahpux ;;
296 hppa*-*-hpux*) gdb_host=hppahpux ;;
297 hppa*-*-osf*) gdb_host=hppaosf ;;
298
299 i[3456]86-ncr-*) gdb_host=ncr3000 ;;
300 i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
301 i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
302 i[3456]86-sequent-sysv*) gdb_host=ptx ;;
303 i[3456]86-*-aix*) gdb_host=i386aix ;;
304 i[3456]86-*-bsd*) gdb_host=i386bsd ;;
305 i[3456]86-*-dgux*) gdb_host=i386dgux ;;
306 i[3456]86-*-freebsd*) gdb_host=fbsd ;;
307 i[3456]86-*-netbsd*) gdb_host=nbsd ;;
308 i[3456]86-*-go32*) gdb_host=go32 ;;
309 i[3456]86-*-linux*) gdb_host=linux ;;
310 i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
311 i[3456]86-*-mach3*) gdb_host=i386m3 ;;
312 i[3456]86-*-mach*) gdb_host=i386mach ;;
313 i[3456]86-*-osf1mk*) gdb_host=osf1mk ;;
314 i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
315 i[3456]86-*-sco*) gdb_host=i386sco ;;
316 i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
317 i[3456]86-*-sunos*) gdb_host=sun386 ;;
318 i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
319 i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
320 i[3456]86-*-sysv4*) gdb_host=i386v4 ;;
321 i[3456]86-*-unixware) gdb_host=i386v4 ;;
322 i[3456]86-*-sysv*) gdb_host=i386v ;;
323 i[3456]86-*-isc*) gdb_host=i386v32 ;;
324 i[3456]86-*-os9k) gdb_host=i386os9k ;;
325 i[3456]86-*-cygwin32) gdb_host=cygwin32 ;;
326 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
327 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
328 m68030-sony-*) gdb_host=news1000 ;;
329
330 m68*-altos-*) gdb_host=altos ;;
331 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
332 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
333 m68*-att-*) gdb_host=3b1 ;;
334 m68*-bull*-sysv*) gdb_host=dpx2 ;;
335 m68*-hp-bsd*) gdb_host=hp300bsd ;;
336 m68*-hp-hpux*) gdb_host=hp300hpux ;;
337 m68*-isi-*) gdb_host=isi ;;
338 m68*-*-lynxos*) gdb_host=m68klynx ;;
339 m68*-*-netbsd*) gdb_host=nbsd ;;
340 m68*-*-sysv4*) gdb_host=m68kv4 ;;
341 m68*-motorola-*) gdb_host=delta68 ;;
342 m68*-sony-*) gdb_host=news ;;
343 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
344 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
345 m68*-sun-*) gdb_host=sun3os4 ;;
346
347 m88*-harris-cxux*) gdb_host=cxux ;;
348 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
349 m88*-motorola-sysv*) gdb_host=delta88 ;;
350 m88*-*-mach3*) gdb_host=mach3 ;;
351 m88*-*-*) gdb_host=m88k ;;
352
353 mips-dec-mach3*) gdb_host=mach3 ;;
354 mips-dec-*) gdb_host=decstation ;;
355 mips-little-*) gdb_host=littlemips ;;
356 mips-sgi-irix3*) gdb_host=irix3 ;;
357 mips-sgi-irix4*) gdb_host=irix4 ;;
358 mips-sgi-irix5*) gdb_host=irix5 ;;
359 mips-sony-*) gdb_host=news-mips ;;
360 mips-*-mach3*) gdb_host=mach3 ;;
361 mips-*-sysv4*) gdb_host=mipsv4 ;;
362 mips-*-sysv*) gdb_host=riscos ;;
363 mips-*-riscos*) gdb_host=riscos ;;
364
365 none-*-*) gdb_host=none ;;
366
367 np1-*-*) gdb_host=np1 ;;
368
369 ns32k-*-mach3*) gdb_host=mach3 ;;
370 ns32k-*-netbsd*) gdb_host=nbsd ;;
371 ns32k-umax-*) gdb_host=umax ;;
372 ns32k-utek-sysv*) gdb_host=merlin ;;
373
374 powerpc-*-aix*) gdb_host=aix ;;
375 powerpcle-*-cygwin32) gdb_host=cygwin32 ;;
376 pn-*-*) gdb_host=pn ;;
377
378 pyramid-*-*) gdb_host=pyramid ;;
379
380 romp-*-*) gdb_host=rtbsd ;;
381
382 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
383 rs6000-*-aix4*) gdb_host=aix4 ;;
384 rs6000-*-*) gdb_host=rs6000 ;;
385
386 sparc-*-lynxos*) gdb_host=sparclynx ;;
387 sparc-*-netbsd*) gdb_host=nbsd ;;
388 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
389 sparc-*-sunos4*) gdb_host=sun4os4 ;;
390 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
391 sparc-*-*) gdb_host=sun4os4 ;;
392 sparc64-*-*) gdb_host=sun4sol2 ;;
393
394 tahoe-*-*) gdb_host=tahoe ;;
395
396 vax-*-bsd*) gdb_host=vaxbsd ;;
397 vax-*-ultrix2*) gdb_host=vaxult2 ;;
398 vax-*-ultrix*) gdb_host=vaxult ;;
399
400 w65-*-*) gdb_host=w65 ;;
401
402 esac
403
404
405 # Map target cpu into the config cpu subdirectory name.
406 # The default is $target_cpu.
407
408 case "${target_cpu}" in
409
410 alpha) gdb_target_cpu=alpha ;;
411 c[12]) gdb_target_cpu=convex ;;
412 hppa*) gdb_target_cpu=pa ;;
413 i[3456]86) gdb_target_cpu=i386 ;;
414 m68*) gdb_target_cpu=m68k ;;
415 m88*) gdb_target_cpu=m88k ;;
416 mips*) gdb_target_cpu=mips ;;
417 np1) gdb_target_cpu=gould ;;
418 powerpc*) gdb_target_cpu=powerpc ;;
419 pn) gdb_target_cpu=gould ;;
420 pyramid) gdb_target_cpu=pyr ;;
421 sparc*) gdb_target_cpu=sparc ;;
422 *) gdb_target_cpu=$target_cpu ;;
423
424 esac
425
426 # map target info into gdb names.
427
428 case "${target}" in
429
430 a29k-*-aout*) gdb_target=a29k ;;
431 a29k-*-coff*) gdb_target=a29k ;;
432 a29k-*-elf*) gdb_target=a29k ;;
433 a29k-*-ebmon*) gdb_target=a29k ;;
434 a29k-*-kern*) gdb_target=a29k-kern ;;
435 a29k-*-none*) gdb_target=a29k ;;
436 a29k-*-sym1*) gdb_target=ultra3 ;;
437 a29k-*-udi*) gdb_target=a29k-udi ;;
438 a29k-*-vxworks*) gdb_target=vx29k ;;
439
440 alpha-*-osf*) gdb_target=alpha-osf1 ;;
441
442 # start-sanitize-arc
443 arc-*-*) gdb_target=arc ;;
444 # end-sanitize-arc
445
446 arm-*-*) gdb_target=arm ;;
447
448 c1-*-*) gdb_target=convex ;;
449 c2-*-*) gdb_target=convex ;;
450
451 h8300-*-*) gdb_target=h8300 ;;
452 h8500-*-*) gdb_target=h8500 ;;
453
454 sh-*-*) gdb_target=sh ;;
455
456 # start-sanitize-r16
457 r16-*-*) gdb_target=r16 ;;
458 # end-sanitize-r16
459
460 hppa*-*-bsd*) gdb_target=hppabsd ;;
461 hppa*-*-pro*) gdb_target=hppapro ;;
462 hppa*-*-hpux*) gdb_target=hppahpux ;;
463 hppa*-*-hiux*) gdb_target=hppahpux ;;
464 hppa*-*-osf*) gdb_target=hppaosf ;;
465
466 i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
467 i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
468 i[3456]86-sequent-sysv*) gdb_target=ptx ;;
469 i[3456]86-ncr-*) gdb_target=ncr3000 ;;
470 i[3456]86-*-aout*) gdb_target=i386aout ;;
471 i[3456]86-*-coff*) gdb_target=i386v ;;
472 i[3456]86-*-elf*) gdb_target=i386v ;;
473 i[3456]86-*-aix*) gdb_target=i386aix ;;
474 i[3456]86-*-bsd*) gdb_target=i386bsd ;;
475 i[3456]86-*-freebsd*) gdb_target=fbsd ;;
476 i[3456]86-*-netbsd*) gdb_target=nbsd ;;
477 i[3456]86-*-os9k) gdb_target=i386os9k ;;
478 i[3456]86-*-go32*) gdb_target=i386aout ;;
479 i[3456]86-*-lynxos*) gdb_target=i386lynx
480 configdirs="${configdirs} gdbserver" ;;
481 i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
482 i[3456]86-*-sunos*) gdb_target=sun386 ;;
483 i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
484 i[3456]86-*-sco*) gdb_target=i386v ;;
485 i[3456]86-*-sysv*) gdb_target=i386v ;;
486 i[3456]86-*-linux*) gdb_target=linux
487 configdirs="${configdirs} gdbserver" ;;
488 i[3456]86-*-isc*) gdb_target=i386v ;;
489 i[3456]86-*-mach3*) gdb_target=i386m3 ;;
490 i[3456]86-*-mach*) gdb_target=i386mach ;;
491 i[3456]86-*-netware*) gdb_target=i386nw
492 configdirs="${configdirs} nlm" ;;
493 i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
494 i[3456]86-*-cygwin32) gdb_target=cygwin32 ;;
495 i960-*-bout*) gdb_target=vxworks960 ;;
496 i960-nindy-coff*) gdb_target=nindy960 ;;
497 i960-*-coff*) gdb_target=mon960 ;;
498 i960-nindy-elf*) gdb_target=nindy960 ;;
499 i960-*-elf*) gdb_target=mon960 ;;
500
501 i960-*-nindy*) gdb_target=nindy960 ;;
502 i960-*-vxworks*) gdb_target=vxworks960 ;;
503
504 m68000-*-sunos3*) gdb_target=sun2os3 ;;
505 m68000-*-sunos4*) gdb_target=sun2os4 ;;
506
507 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
508 m68*-bull-sysv*) gdb_target=dpx2 ;;
509 m68*-hp-bsd*) gdb_target=hp300bsd ;;
510 m68*-hp-hpux*) gdb_target=hp300hpux ;;
511 m68*-altos-*) gdb_target=altos ;;
512 m68*-att-*) gdb_target=3b1 ;;
513 m68*-cisco*-*) gdb_target=cisco ;;
514 m68*-ericsson-*) gdb_target=es1800 ;;
515 m68*-isi-*) gdb_target=isi ;;
516 m68*-motorola-*) gdb_target=delta68 ;;
517 m68*-netx-*) gdb_target=vxworks68 ;;
518 m68*-sony-*) gdb_target=news ;;
519 m68*-tandem-*) gdb_target=st2000 ;;
520 m68*-rom68k-*) gdb_target=monitor ;;
521 m68*-*bug-*) gdb_target=monitor ;;
522 m68*-monitor-*) gdb_target=monitor ;;
523 m68*-est-*) gdb_target=monitor ;;
524 m68*-*-aout*) gdb_target=monitor ;;
525 m68*-*-coff*) gdb_target=monitor ;;
526 m68*-*-elf*) gdb_target=monitor ;;
527 m68*-*-lynxos*) gdb_target=m68klynx
528 configdirs="${configdirs} gdbserver" ;;
529 m68*-*-netbsd*) gdb_target=nbsd ;;
530 m68*-*-os68k*) gdb_target=os68k ;;
531 m68*-*-sunos3*) gdb_target=sun3os3 ;;
532 m68*-*-sunos4*) gdb_target=sun3os4 ;;
533 m68*-*-sysv4*) gdb_target=m68kv4 ;;
534 m68*-*-vxworks*) gdb_target=vxworks68 ;;
535
536 m88*-harris-cxux*) gdb_target=cxux ;;
537 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
538 m88*-*-mach3*) gdb_target=mach3 ;;
539 m88*-motorola-*) gdb_target=delta88 ;;
540 m88*-*-*) gdb_target=m88k ;;
541
542 mips64*-big-*) gdb_target=bigmips64 ;;
543 mips*-big-*) gdb_target=bigmips ;;
544 mips*-dec-mach3*) gdb_target=mach3 ;;
545 mips*-dec-*) gdb_target=decstation ;;
546 mips64*el-*-ecoff*) gdb_target=embedl64 ;;
547 mips64*-*-ecoff*) gdb_target=embed64 ;;
548 mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
549 mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
550 mips64*el-*-elf*) gdb_target=embedl64 ;;
551 mips64*-*-elf*) gdb_target=embed64 ;;
552 mips*el-*-ecoff*) gdb_target=embedl ;;
553 mips*-*-ecoff*) gdb_target=embed ;;
554 # start-sanitize-gm
555 mips*-*-magic*) gdb_target=embed ;;
556 # end-sanitize-gm
557 mips*el-*-elf*) gdb_target=embedl ;;
558 mips*-*-elf*) gdb_target=embed ;;
559 mips*-little-*) gdb_target=littlemips ;;
560 mips*-sgi-irix5*) gdb_target=irix5 ;;
561 mips*-sgi-*) gdb_target=irix3 ;;
562 mips*-sony-*) gdb_target=bigmips ;;
563 mips*-*-mach3*) gdb_target=mach3 ;;
564 mips*-*-sysv4*) gdb_target=mipsv4 ;;
565 mips*-*-sysv*) gdb_target=bigmips ;;
566 mips*-*-riscos*) gdb_target=bigmips ;;
567 mips*-*-vxworks*) gdb_target=vxmips ;;
568
569 none-*-*) gdb_target=none ;;
570
571 np1-*-*) gdb_target=np1 ;;
572
573 ns32k-*-mach3*) gdb_target=mach3 ;;
574 ns32k-*-netbsd*) gdb_target=nbsd ;;
575 ns32k-utek-sysv*) gdb_target=merlin ;;
576 ns32k-utek-*) gdb_target=umax ;;
577
578 pn-*-*) gdb_target=pn ;;
579 powerpc-*-macos*) gdb_target=macos ;;
580 powerpc-*-netware*) gdb_target=ppc-nw
581 configdirs="${configdirs} nlm" ;;
582
583 powerpc-*-aix4*) gdb_target=aix4 ;;
584 powerpc-*-aix*) gdb_target=aix ;;
585 powerpcle-*-cygwin32) gdb_target=cygwin32 ;;
586 powerpc-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
587 gdb_target=ppc-sim
588 else
589 gdb_target=ppc-eabi
590 fi ;;
591 powerpcle-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
592 gdb_target=ppcle-sim
593 else
594 gdb_target=ppcle-eabi
595 fi ;;
596
597 pyramid-*-*) gdb_target=pyramid ;;
598
599 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
600 rs6000-*-aix4*) gdb_target=aix4 ;;
601 rs6000-*-*) gdb_target=rs6000 ;;
602
603 sparc-*-aout*) gdb_target=sparc-em ;;
604 sparc-*-coff*) gdb_target=sparc-em ;;
605 sparc-*-elf*) gdb_target=sparc-em ;;
606 sparc-*-lynxos*) gdb_target=sparclynx
607 configdirs="${configdirs} gdbserver" ;;
608 sparc-*-netbsd*) gdb_target=nbsd ;;
609 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
610 sparc-*-sunos4*) gdb_target=sun4os4 ;;
611 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
612 sparc-*-vxworks*) gdb_target=vxsparc ;;
613 sparc-*-*) gdb_target=sun4os4 ;;
614 # Use sparc-em for sparclet for now.
615 sparclet-*-*) gdb_target=sparc-em ;;
616 sparclite*-*-*) gdb_target=sparclite ;;
617 # It's not clear what the right solution for "v8plus" systems is yet.
618 # For now, stick with sparc-sun-solaris2 since that's what config.guess
619 # should return. Work is still needed to get gdb to print the 64 bit
620 # regs (some of which are usable in v8plus) so sp64sol.mt hasn't been
621 # deleted though presumably it should be eventually.
622 #sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
623 sparc64-*-*) gdb_target=sp64 ;;
624
625 tahoe-*-*) gdb_target=tahoe ;;
626
627 vax-*-*) gdb_target=vax ;;
628
629 w65-*-*) gdb_target=w65 ;;
630
631 z8k-*-coff*) gdb_target=z8k ;;
632
633 esac
634
635 dnl
636 changequote([,])dnl
637
638 frags=
639 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
640 if test ! -f ${host_makefile_frag}; then
641 AC_MSG_ERROR("*** Gdb does not support host ${host}")
642 fi
643 frags="$frags $host_makefile_frag"
644
645 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
646 if test ! -f ${target_makefile_frag}; then
647 AC_MSG_ERROR("*** Gdb does not support target ${target}")
648 fi
649 frags="$frags $target_makefile_frag"
650
651 AC_SUBST_FILE(host_makefile_frag)
652 AC_SUBST_FILE(target_makefile_frag)
653 AC_SUBST(frags)
654
655 changequote(,)dnl
656 hostfile=`sed -n '
657 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
658 ' ${host_makefile_frag}`
659
660 targetfile=`sed -n '
661 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
662 ' ${target_makefile_frag}`
663
664 # these really aren't orthogonal true/false values of the same condition,
665 # but shells are slow enough that I like to reuse the test conditions
666 # whenever possible
667 if test "${target}" = "${host}"; then
668 nativefile=`sed -n '
669 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
670 ' ${host_makefile_frag}`
671 else
672 # GDBserver is only useful in a "native" enviroment
673 configdirs=`echo $configdirs | sed 's/gdbserver//'`
674 fi
675 changequote([,])
676
677 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
678 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
679 # corresponding links. But we have to remove the xm.h files and tm.h
680 # files anyway, e.g. when switching from "configure host" to
681 # "configure none".
682
683 files=
684 links=
685 rm -f xm.h
686 if test "${hostfile}" != ""; then
687 files="${files} config/${gdb_host_cpu}/${hostfile}"
688 links="${links} xm.h"
689 fi
690 rm -f tm.h
691 if test "${targetfile}" != ""; then
692 files="${files} config/${gdb_target_cpu}/${targetfile}"
693 links="${links} tm.h"
694 fi
695 rm -f nm.h
696 if test "${nativefile}" != ""; then
697 files="${files} config/${gdb_host_cpu}/${nativefile}"
698 links="${links} nm.h"
699 else
700 # A cross-only configuration.
701 files="${files} config/nm-empty.h"
702 links="${links} nm.h"
703 fi
704 # start-sanitize-gdbtk
705
706 # Make it possible to use the GUI without doing a full install
707 if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
708 files="${files} gdbtk.tcl"
709 links="${links} gdbtk.tcl"
710 fi
711 # end-sanitize-gdbtk
712
713 AC_LINK_FILES($files, $links)
714
715 AC_CONFIG_SUBDIRS($configdirs)
716 AC_OUTPUT(Makefile,
717 [
718 dnl Autoconf doesn't provide a mechanism for modifying definitions
719 dnl provided by makefile fragments.
720 dnl
721 if test "${nativefile}" = ""; then
722 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
723 < Makefile > Makefile.tem
724 mv -f Makefile.tem Makefile
725 fi
726
727 changequote(,)dnl
728 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
729 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
730 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
731 mv -f Makefile.tmp Makefile
732 changequote([,])dnl
733
734 case ${srcdir} in
735 .)
736 ;;
737 *)
738 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
739 echo "source ${srcdir}/.gdbinit" >> .gdbinit
740 esac
741
742 case x$CONFIG_HEADERS in
743 xconfig.h:config.in)
744 echo > stamp-h ;;
745 esac
746 ],
747 [
748 gdb_host_cpu=$gdb_host_cpu
749 gdb_target_cpu=$gdb_target_cpu
750 nativefile=$nativefile
751 ])
752
753 exit 0
754