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