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