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