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