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