* Makefile.in (CLIBS): Add LIBS to allow libraries to be
[binutils-gdb.git] / gdb / configure.in
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
18 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19
20 dnl Process this file with autoconf to produce a configure script.
21
22 AC_PREREQ(2.3)dnl
23 AC_INIT(main.c)
24
25 AC_PROG_CC
26 AC_AIX
27 AC_MINIX
28 AC_ISC_POSIX
29
30 AC_PROG_INSTALL
31 AC_PROG_RANLIB
32 AC_PROG_YACC
33
34 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
35 AC_CANONICAL_SYSTEM
36 AC_ARG_PROGRAM
37
38 AC_HEADER_STDC
39 AC_CHECK_HEADERS(memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h)
40 AC_HEADER_STAT
41
42 AC_FUNC_MMAP
43
44 dnl Handle optional features that can be enabled.
45 ENABLE_CFLAGS=
46 ENABLE_CLIBS=
47 ENABLE_OBS=
48
49 AC_ARG_ENABLE(netrom,
50 [ --enable-netrom ],
51 [case "${enableval}" in
52 yes) enable_netrom=yes ;;
53 no) enable_netrom=no ;;
54 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
55 esac])
56
57 if test "${enable_netrom}" = "yes"; then
58 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
59 fi
60
61 # start-sanitize-gm
62 ENABLE_GM=
63
64 AC_ARG_ENABLE(gm,
65 [ --enable-gm ],
66 [case "${enableval}" in
67 yes) ENABLE_OBS="${ENABLE_OBS} gmagic.o"
68 ENABLE_CFLAGS=-DGENERAL_MAGIC
69 ;;
70 no) ;;
71 *) AC_MSG_ERROR(bad value ${enableval} given for gm option) ;;
72 esac])
73
74 # end-sanitize-gm
75
76 AC_ARG_ENABLE(sim-powerpc,
77 [ --enable-sim-powerpc ],
78 [case "${enableval}" in
79 yes) powerpc_sim=yes ;;
80 no) powerpc_sim=no ;;
81 *) AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
82 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
83
84 # start-sanitize-gdbtk
85 ENABLE_GDBTK=
86
87 AC_ARG_ENABLE(gdbtk,
88 [ --enable-gdbtk ],
89 [case "${enableval}" in
90 yes)
91 case "$host" in
92 *go32*)
93 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
94 enable_gdbtk=no ;;
95 *)
96 enable_gdbtk=yes ;;
97 esac ;;
98 no)
99 enable_gdbtk=no ;;
100 *)
101 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
102 esac],
103 [
104 # Default is on for everything but go32
105 case "$host" in
106 *go32*)
107 ;;
108 *)
109 enable_gdbtk=yes ;;
110 esac
111 ])
112
113 if test "${enable_gdbtk}" = "yes"; then
114
115 AC_PATH_X
116 AC_PATH_XTRA
117
118 CYGNUS_PATH_TK
119 CYGNUS_PATH_TCL
120
121 ENABLE_GDBTK=1
122
123 if test "x$no_x" != "xyes"; then
124 if test "x$x_includes" != "x" ;
125 then
126 X_CFLAGS="-I$x_includes"
127 else
128 X_CFLAGS=""
129 fi
130
131 if test "x$x_libraries" != "x" ;
132 then
133 X_LDFLAGS="-L$x_libraries"
134 else
135 X_LDFLAGS=""
136 fi
137
138 case "$host" in
139 #
140 # gdb linked statically w/ Solaris iff GCC is used, otherwise dynamic
141 #
142 sparc-sun-solaris2*)
143 if test "x$GCC" = "xyes";
144 then
145 X_LIBS="-Wl,-Bstatic -lX11 -lXext -lX11 -Wl,-Bdynamic -ldl -lw"
146 else
147 if test "x$x_libraries" != "x" ;
148 then
149 X_LDFLAGS="$X_LDFLAGS -R$x_libraries"
150 fi
151 X_LIBS="-lX11 -lXext -lX11"
152 fi ;;
153 #
154 # gdb linked statically w/ SunOS or HPUX
155 #
156 m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
157 if test "x$x_libraries" != "x" ;
158 then
159 X_LIBS="$x_libraries/libX11.a"
160 else
161 X_LIBS="/usr/lib/libX11.a"
162 fi ;;
163 #
164 # default is to link dynamically
165 #
166 *)
167 X_LIBS="-lX11" ;;
168 esac
169 else
170 X_LDLAGS=""
171 X_CFLAGS=""
172 X_LIBS=""
173 AC_MSG_WARN([No X based programs will be built])
174 fi
175
176 TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)'
177 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS} -lm"
178 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
179 fi
180
181 AC_SUBST(ENABLE_GDBTK)
182 AC_SUBST(X_CFLAGS)
183 AC_SUBST(X_LDFLAGS)
184 AC_SUBST(X_LIBS)
185 # end-sanitize-gdbtk
186
187 AC_SUBST(ENABLE_CFLAGS)
188 AC_SUBST(ENABLE_CLIBS)
189 AC_SUBST(ENABLE_OBS)
190
191 # target_subdir is used by the testsuite to find the target libraries.
192 target_subdir=
193 if test "${host}" != "${target}"; then
194 target_subdir="${target_alias}/"
195 fi
196 AC_SUBST(target_subdir)
197
198 configdirs="doc testsuite"
199
200 dnl
201 changequote(,)dnl
202
203 # Map host cpu into the config cpu subdirectory name.
204 # The default is $host_cpu.
205
206 case "${host_cpu}" in
207
208 c[12]) gdb_host_cpu=convex ;;
209 hppa*) gdb_host_cpu=pa ;;
210 i[3456]86) gdb_host_cpu=i386 ;;
211 m68*) gdb_host_cpu=m68k ;;
212 m88*) gdb_host_cpu=m88k ;;
213 np1) gdb_host_cpu=gould ;;
214 pyramid) gdb_host_cpu=pyr ;;
215 powerpc*) gdb_host_cpu=powerpc ;;
216 *) gdb_host_cpu=$host_cpu ;;
217
218 esac
219
220 # map host info into gdb names.
221
222 case "${host}" in
223
224 a29k-*-*) gdb_host=ultra3 ;;
225
226 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
227 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
228 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
229
230 arm-*-*) gdb_host=arm ;;
231
232 c[12]-*-*) gdb_host=convex ;;
233
234 hppa*-*-bsd*) gdb_host=hppabsd ;;
235 hppa*-*-hiux*) gdb_host=hppahpux ;;
236 hppa*-*-hpux*) gdb_host=hppahpux ;;
237 hppa*-*-osf*) gdb_host=hppaosf ;;
238
239 i[3456]86-ncr-*) gdb_host=ncr3000 ;;
240 i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
241 i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
242 i[3456]86-sequent-sysv*) gdb_host=ptx ;;
243 i[3456]86-*-aix*) gdb_host=i386aix ;;
244 i[3456]86-*-bsd*) gdb_host=i386bsd ;;
245 i[3456]86-*-dgux*) gdb_host=i386dgux ;;
246 i[3456]86-*-freebsd*) gdb_host=fbsd ;;
247 i[3456]86-*-netbsd*) gdb_host=nbsd ;;
248 i[3456]86-*-go32*) gdb_host=go32 ;;
249 i[3456]86-*-linux*) gdb_host=linux ;;
250 i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
251 i[3456]86-*-mach3*) gdb_host=i386m3 ;;
252 i[3456]86-*-mach*) gdb_host=i386mach ;;
253 i[3456]86-*-osf1mk*) gdb_host=osf1mk ;;
254 i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
255 i[3456]86-*-sco*) gdb_host=i386sco ;;
256 i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
257 i[3456]86-*-sunos*) gdb_host=sun386 ;;
258 i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
259 i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
260 i[3456]86-*-sysv4*) gdb_host=i386v4 ;;
261 i[3456]86-*-unixware) gdb_host=i386v4 ;;
262 i[3456]86-*-sysv*) gdb_host=i386v ;;
263 i[3456]86-*-isc*) gdb_host=i386v32 ;;
264 i[3456]86-*-os9k) gdb_host=i386os9k ;;
265 i[3456]86-*-win32*) gdb_host=win32 ;;
266 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
267 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
268 m68030-sony-*) gdb_host=news1000 ;;
269
270 m68*-altos-*) gdb_host=altos ;;
271 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
272 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
273 m68*-att-*) gdb_host=3b1 ;;
274 m68*-bull*-sysv*) gdb_host=dpx2 ;;
275 m68*-hp-bsd*) gdb_host=hp300bsd ;;
276 m68*-hp-hpux*) gdb_host=hp300hpux ;;
277 m68*-isi-*) gdb_host=isi ;;
278 m68*-*-lynxos*) gdb_host=m68klynx ;;
279 m68*-*-sysv4*) gdb_host=m68kv4 ;;
280 m68*-motorola-*) gdb_host=delta68 ;;
281 m68*-sony-*) gdb_host=news ;;
282 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
283 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
284 m68*-sun-*) gdb_host=sun3os4 ;;
285
286 m88*-harris-cxux*) gdb_host=cxux ;;
287 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
288 m88*-motorola-sysv*) gdb_host=delta88 ;;
289 m88*-*-mach3*) gdb_host=mach3 ;;
290 m88*-*-*) gdb_host=m88k ;;
291
292 mips-dec-mach3*) gdb_host=mach3 ;;
293 mips-dec-*) gdb_host=decstation ;;
294 mips-little-*) gdb_host=littlemips ;;
295 mips-sgi-irix3*) gdb_host=irix3 ;;
296 mips-sgi-irix4*) gdb_host=irix4 ;;
297 mips-sgi-irix5*) gdb_host=irix5 ;;
298 mips-sony-*) gdb_host=news-mips ;;
299 mips-*-mach3*) gdb_host=mach3 ;;
300 mips-*-sysv4*) gdb_host=mipsv4 ;;
301 mips-*-sysv*) gdb_host=riscos ;;
302 mips-*-riscos*) gdb_host=riscos ;;
303
304 none-*-*) gdb_host=none ;;
305
306 np1-*-*) gdb_host=np1 ;;
307
308 ns32k-*-mach3*) gdb_host=mach3 ;;
309 ns32k-*-netbsd*) gdb_host=nbsd ;;
310 ns32k-umax-*) gdb_host=umax ;;
311 ns32k-utek-sysv*) gdb_host=merlin ;;
312
313 powerpc-*-aix*) gdb_host=aix ;;
314
315 pn-*-*) gdb_host=pn ;;
316
317 pyramid-*-*) gdb_host=pyramid ;;
318
319 romp-*-*) gdb_host=rtbsd ;;
320
321 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
322 rs6000-*-aix4*) gdb_host=aix4 ;;
323 rs6000-*-*) gdb_host=rs6000 ;;
324
325 sparc-*-lynxos*) gdb_host=sparclynx ;;
326 sparc-*-netbsd*) gdb_host=nbsd ;;
327 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
328 sparc-*-sunos4*) gdb_host=sun4os4 ;;
329 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
330 sparc-*-*) gdb_host=sun4os4 ;;
331
332 tahoe-*-*) gdb_host=tahoe ;;
333
334 vax-*-bsd*) gdb_host=vaxbsd ;;
335 vax-*-ultrix2*) gdb_host=vaxult2 ;;
336 vax-*-ultrix*) gdb_host=vaxult ;;
337
338 w65-*-*) gdb_host=w65 ;;
339
340 esac
341
342
343 # Map target cpu into the config cpu subdirectory name.
344 # The default is $target_cpu.
345
346 case "${target_cpu}" in
347
348 alpha) gdb_target_cpu=alpha ;;
349 c[12]) gdb_target_cpu=convex ;;
350 hppa*) gdb_target_cpu=pa ;;
351 i[3456]86) gdb_target_cpu=i386 ;;
352 m68*) gdb_target_cpu=m68k ;;
353 m88*) gdb_target_cpu=m88k ;;
354 mips*) gdb_target_cpu=mips ;;
355 np1) gdb_target_cpu=gould ;;
356 powerpc*) gdb_target_cpu=powerpc ;;
357 pn) gdb_target_cpu=gould ;;
358 pyramid) gdb_target_cpu=pyr ;;
359 sparc*) gdb_target_cpu=sparc ;;
360 *) gdb_target_cpu=$target_cpu ;;
361
362 esac
363
364 # map target info into gdb names.
365
366 case "${target}" in
367
368 a29k-*-aout*) gdb_target=a29k ;;
369 a29k-*-coff*) gdb_target=a29k ;;
370 a29k-*-elf*) gdb_target=a29k ;;
371 a29k-*-ebmon*) gdb_target=a29k ;;
372 a29k-*-kern*) gdb_target=a29k-kern ;;
373 a29k-*-none*) gdb_target=a29k ;;
374 a29k-*-sym1*) gdb_target=ultra3 ;;
375 a29k-*-udi*) gdb_target=a29k-udi ;;
376 a29k-*-vxworks*) gdb_target=vx29k ;;
377
378 alpha-*-osf*) gdb_target=alpha-osf1 ;;
379
380 # start-sanitize-arc
381 arc-*-*) gdb_target=arc ;;
382 # end-sanitize-arc
383
384 arm-*-*) gdb_target=arm ;;
385
386 c1-*-*) gdb_target=convex ;;
387 c2-*-*) gdb_target=convex ;;
388
389 h8300-*-*) gdb_target=h8300 ;;
390 h8500-*-*) gdb_target=h8500 ;;
391
392 sh-*-*) gdb_target=sh ;;
393
394 # start-sanitize-r16
395 r16-*-*) gdb_target=r16 ;;
396 # end-sanitize-r16
397
398 hppa*-*-bsd*) gdb_target=hppabsd ;;
399 hppa*-*-pro*) gdb_target=hppapro ;;
400 hppa*-*-hpux*) gdb_target=hppahpux ;;
401 hppa*-*-hiux*) gdb_target=hppahpux ;;
402 hppa*-*-osf*) gdb_target=hppaosf ;;
403
404 i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
405 i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
406 i[3456]86-sequent-sysv*) gdb_target=ptx ;;
407 i[3456]86-ncr-*) gdb_target=ncr3000 ;;
408 i[3456]86-*-aout*) gdb_target=i386aout ;;
409 i[3456]86-*-coff*) gdb_target=i386v ;;
410 i[3456]86-*-elf*) gdb_target=i386v ;;
411 i[3456]86-*-aix*) gdb_target=i386aix ;;
412 i[3456]86-*-bsd*) gdb_target=i386bsd ;;
413 i[3456]86-*-freebsd*) gdb_target=fbsd ;;
414 i[3456]86-*-netbsd*) gdb_target=nbsd ;;
415 i[3456]86-*-os9k) gdb_target=i386os9k ;;
416 i[3456]86-*-go32*) gdb_target=i386aout ;;
417 i[3456]86-*-lynxos*) gdb_target=i386lynx
418 configdirs="${configdirs} gdbserver" ;;
419 i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
420 i[3456]86-*-sunos*) gdb_target=sun386 ;;
421 i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
422 i[3456]86-*-sco*) gdb_target=i386v ;;
423 i[3456]86-*-sysv*) gdb_target=i386v ;;
424 i[3456]86-*-linux*) gdb_target=linux ;;
425 i[3456]86-*-isc*) gdb_target=i386v ;;
426 i[3456]86-*-mach3*) gdb_target=i386m3 ;;
427 i[3456]86-*-mach*) gdb_target=i386mach ;;
428 i[3456]86-*-netware*) gdb_target=i386nw
429 configdirs="${configdirs} nlm" ;;
430 i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
431 i[3456]86-*-win32) gdb_target=win32 ;;
432
433 i960-*-bout*) gdb_target=vxworks960 ;;
434 i960-*-coff*) gdb_target=nindy960 ;;
435 i960-*-elf*) gdb_target=nindy960 ;;
436
437 i960-*-nindy*) gdb_target=nindy960 ;;
438 i960-*-vxworks*) gdb_target=vxworks960 ;;
439
440 m68000-*-sunos3*) gdb_target=sun2os3 ;;
441 m68000-*-sunos4*) gdb_target=sun2os4 ;;
442
443 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
444 m68*-bull-sysv*) gdb_target=dpx2 ;;
445 m68*-hp-bsd*) gdb_target=hp300bsd ;;
446 m68*-hp-hpux*) gdb_target=hp300hpux ;;
447 m68*-altos-*) gdb_target=altos ;;
448 m68*-att-*) gdb_target=3b1 ;;
449 m68*-cisco*-*) gdb_target=cisco ;;
450 m68*-ericsson-*) gdb_target=es1800 ;;
451 m68*-isi-*) gdb_target=isi ;;
452 m68*-motorola-*) gdb_target=delta68 ;;
453 m68*-netx-*) gdb_target=vxworks68 ;;
454 m68*-sony-*) gdb_target=news ;;
455 m68*-tandem-*) gdb_target=st2000 ;;
456 m68*-rom68k-*) gdb_target=monitor ;;
457 m68*-*bug-*) gdb_target=monitor ;;
458 m68*-monitor-*) gdb_target=monitor ;;
459 m68*-est-*) gdb_target=monitor ;;
460 m68*-*-aout*) gdb_target=monitor ;;
461 m68*-*-coff*) gdb_target=monitor ;;
462 m68*-*-elf*) gdb_target=monitor ;;
463 m68*-*-lynxos*) gdb_target=m68klynx
464 configdirs="${configdirs} gdbserver" ;;
465 m68*-*-os68k*) gdb_target=os68k ;;
466 m68*-*-sunos3*) gdb_target=sun3os3 ;;
467 m68*-*-sunos4*) gdb_target=sun3os4 ;;
468 m68*-*-sysv4*) gdb_target=m68kv4 ;;
469 m68*-*-vxworks*) gdb_target=vxworks68 ;;
470
471 m88*-harris-cxux*) gdb_target=cxux ;;
472 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
473 m88*-*-mach3*) gdb_target=mach3 ;;
474 m88*-motorola-*) gdb_target=delta88 ;;
475 m88*-*-*) gdb_target=m88k ;;
476
477 mips64*-big-*) gdb_target=bigmips64 ;;
478 mips*-big-*) gdb_target=bigmips ;;
479 mips*-dec-mach3*) gdb_target=mach3 ;;
480 mips*-dec-*) gdb_target=decstation ;;
481 mips64*el-*-ecoff*) gdb_target=embedl64 ;;
482 mips64*-*-ecoff*) gdb_target=embed64 ;;
483 mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
484 mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
485 mips64*el-*-elf*) gdb_target=embedl64 ;;
486 mips64*-*-elf*) gdb_target=embed64 ;;
487 mips*el-*-ecoff*) gdb_target=embedl ;;
488 mips*-*-ecoff*) gdb_target=embed ;;
489 # start-sanitize-gm
490 mips*-*-magic*) gdb_target=embed ;;
491 # end-sanitize-gm
492 mips*el-*-elf*) gdb_target=embedl ;;
493 mips*-*-elf*) gdb_target=embed ;;
494 mips*-little-*) gdb_target=littlemips ;;
495 mips*-sgi-irix5*) gdb_target=irix5 ;;
496 mips*-sgi-*) gdb_target=irix3 ;;
497 mips*-sony-*) gdb_target=bigmips ;;
498 mips*-*-mach3*) gdb_target=mach3 ;;
499 mips*-*-sysv4*) gdb_target=mipsv4 ;;
500 mips*-*-sysv*) gdb_target=bigmips ;;
501 mips*-*-riscos*) gdb_target=bigmips ;;
502
503 none-*-*) gdb_target=none ;;
504
505 np1-*-*) gdb_target=np1 ;;
506
507 ns32k-*-mach3*) gdb_target=mach3 ;;
508 ns32k-*-netbsd*) gdb_target=nbsd ;;
509 ns32k-utek-sysv*) gdb_target=merlin ;;
510 ns32k-utek-*) gdb_target=umax ;;
511
512 pn-*-*) gdb_target=pn ;;
513 powerpc-*-macos*) gdb_target=macos ;;
514 powerpc-*-netware*) gdb_target=ppc-nw
515 configdirs="${configdirs} nlm" ;;
516
517 powerpc-*-aix4*) gdb_target=aix4 ;;
518 powerpc-*-aix*) gdb_target=aix ;;
519 powerpc-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
520 gdb_target=ppc-sim
521 else
522 gdb_target=ppc-eabi
523 fi ;;
524 powerpcle-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
525 gdb_target=ppcle-sim
526 else
527 gdb_target=ppcle-eabi
528 fi ;;
529
530 pyramid-*-*) gdb_target=pyramid ;;
531
532 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
533 rs6000-*-aix4*) gdb_target=aix4 ;;
534 rs6000-*-*) gdb_target=rs6000 ;;
535
536 sparc-*-aout*) gdb_target=sparc-em ;;
537 sparc-*-coff*) gdb_target=sparc-em ;;
538 sparc-*-elf*) gdb_target=sparc-em ;;
539 sparc-*-lynxos*) gdb_target=sparclynx
540 configdirs="${configdirs} gdbserver" ;;
541 sparc-*-netbsd*) gdb_target=nbsd ;;
542 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
543 sparc-*-sunos4*) gdb_target=sun4os4 ;;
544 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
545 sparc-*-vxworks*) gdb_target=vxsparc ;;
546 sparc-*-*) gdb_target=sun4os4 ;;
547 sparclite*-*-*) gdb_target=sparclite ;;
548 sparc64-*-*) gdb_target=sp64 ;;
549
550 tahoe-*-*) gdb_target=tahoe ;;
551
552 vax-*-*) gdb_target=vax ;;
553
554 w65-*-*) gdb_target=w65 ;;
555
556 z8k-*-coff*) gdb_target=z8k ;;
557
558 esac
559
560 dnl
561 changequote([,])dnl
562
563 frags=
564 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
565 if test ! -f ${host_makefile_frag}; then
566 AC_MSG_ERROR("*** Gdb does not support host ${host}")
567 fi
568 frags="$frags $host_makefile_frag"
569
570 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
571 if test ! -f ${target_makefile_frag}; then
572 AC_MSG_ERROR("*** Gdb does not support target ${target}")
573 fi
574 frags="$frags $target_makefile_frag"
575
576 AC_SUBST_FILE(host_makefile_frag)
577 AC_SUBST_FILE(target_makefile_frag)
578 AC_SUBST(frags)
579
580 changequote(,)dnl
581 hostfile=`sed -n '
582 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
583 ' ${host_makefile_frag}`
584
585 targetfile=`sed -n '
586 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
587 ' ${target_makefile_frag}`
588
589 # these really aren't orthogonal true/false values of the same condition,
590 # but shells are slow enough that I like to reuse the test conditions
591 # whenever possible
592 if test "${target}" = "${host}"; then
593 nativefile=`sed -n '
594 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
595 ' ${host_makefile_frag}`
596 else
597 # GDBserver is only useful in a "native" enviroment
598 configdirs=`echo $configdirs | sed 's/gdbserver//'`
599 fi
600 changequote([,])
601
602 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
603 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
604 # corresponding links. But we have to remove the xm.h files and tm.h
605 # files anyway, e.g. when switching from "configure host" to
606 # "configure none".
607
608 files=
609 links=
610 rm -f xm.h
611 if test "${hostfile}" != ""; then
612 files="${files} config/${gdb_host_cpu}/${hostfile}"
613 links="${links} xm.h"
614 fi
615 rm -f tm.h
616 if test "${targetfile}" != ""; then
617 files="${files} config/${gdb_target_cpu}/${targetfile}"
618 links="${links} tm.h"
619 fi
620 rm -f nm.h
621 if test "${nativefile}" != ""; then
622 files="${files} config/${gdb_host_cpu}/${nativefile}"
623 links="${links} nm.h"
624 else
625 # A cross-only configuration.
626 files="${files} config/nm-empty.h"
627 links="${links} nm.h"
628 fi
629 # start-sanitize-gdbtk
630
631 # Make it possible to use the GUI without doing a full install
632 if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
633 files="${files} gdbtk.tcl"
634 links="${links} gdbtk.tcl"
635 fi
636 # end-sanitize-gdbtk
637
638 AC_LINK_FILES($files, $links)
639
640 AC_CONFIG_SUBDIRS($configdirs)
641 AC_OUTPUT(Makefile,
642 [
643 dnl Autoconf doesn't provide a mechanism for modifying definitions
644 dnl provided by makefile fragments.
645 dnl
646 if test "${nativefile}" = ""; then
647 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
648 < Makefile > Makefile.tem
649 mv -f Makefile.tem Makefile
650 fi
651
652 changequote(,)dnl
653 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
654 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
655 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
656 mv -f Makefile.tmp Makefile
657 changequote([,])dnl
658
659 case ${srcdir} in
660 .)
661 ;;
662 *)
663 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
664 echo "source ${srcdir}/.gdbinit" >> .gdbinit
665 esac
666 ],
667 [
668 gdb_host_cpu=$gdb_host_cpu
669 gdb_target_cpu=$gdb_target_cpu
670 nativefile=$nativefile
671 ])
672
673 exit 0