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