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