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