1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996 Free Software Foundation, Inc.
4 dnl This file is part of GDB.
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.
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.
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.
20 dnl Process this file with autoconf to produce a configure script.
24 AC_CONFIG_HEADER(config.h:config.in)
33 AC_CHECK_TOOL(RANLIB, ranlib, :)
37 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
42 AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h link.h endian.h)
45 AC_CHECK_FUNCS(setpgid sbrk)
47 AC_MSG_CHECKING([for gregset_t type])
48 AC_CACHE_VAL(gdb_cv_have_gregset_t,
49 [AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
50 gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
51 AC_MSG_RESULT($gdb_cv_have_gregset_t)
52 if test $gdb_cv_have_gregset_t = yes; then
53 AC_DEFINE(HAVE_GREGSET_T)
56 AC_MSG_CHECKING([for fpregset_t type])
57 AC_CACHE_VAL(gdb_cv_have_fpregset_t,
58 [AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
59 gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
60 AC_MSG_RESULT($gdb_cv_have_fpregset_t)
61 if test $gdb_cv_have_fpregset_t = yes; then
62 AC_DEFINE(HAVE_FPREGSET_T)
65 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
66 dnl because autoconf complains about cross-compilation issues. However, this
67 dnl code uses the same variables as the macro for compatibility.
69 AC_MSG_CHECKING(for long double support in compiler)
70 AC_CACHE_VAL(ac_cv_c_long_double,
71 [AC_TRY_COMPILE(, [long double foo;],
72 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
73 AC_MSG_RESULT($ac_cv_c_long_double)
74 if test $ac_cv_c_long_double = yes; then
75 AC_DEFINE(HAVE_LONG_DOUBLE)
78 dnl See if the compiler and runtime support printing long doubles
80 AC_MSG_CHECKING(for long double support in printf)
81 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
85 long double f = 3.141592653;
86 sprintf (buf, "%Lg", f);
87 return (strncmp ("3.14159", buf, 7));
89 gdb_cv_printf_has_long_double=yes,
90 gdb_cv_printf_has_long_double=no,
91 gdb_cv_printf_has_long_double=no)])
92 if test $gdb_cv_printf_has_long_double = yes; then
93 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
95 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
99 dnl Handle optional features that can be enabled.
104 AC_ARG_ENABLE(netrom,
106 [case "${enableval}" in
107 yes) enable_netrom=yes ;;
108 no) enable_netrom=no ;;
109 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
112 if test "${enable_netrom}" = "yes"; then
113 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
117 AC_ARG_ENABLE(sim-powerpc,
118 [ --enable-sim-powerpc ],
119 [case "${enableval}" in
120 yes) powerpc_sim=yes ;;
121 no) powerpc_sim=no ;;
122 *) AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
123 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
126 AC_SUBST(ENABLE_CFLAGS)
127 AC_SUBST(ENABLE_CLIBS)
130 # target_subdir is used by the testsuite to find the target libraries.
132 if test "${host}" != "${target}"; then
133 target_subdir="${target_alias}/"
135 AC_SUBST(target_subdir)
137 configdirs="doc testsuite"
142 # Map host cpu into the config cpu subdirectory name.
143 # The default is $host_cpu.
145 case "${host_cpu}" in
147 c[12]) gdb_host_cpu=convex ;;
148 hppa*) gdb_host_cpu=pa ;;
149 i[3456]86) gdb_host_cpu=i386 ;;
150 m68*) gdb_host_cpu=m68k ;;
151 m88*) gdb_host_cpu=m88k ;;
152 np1) gdb_host_cpu=gould ;;
153 pyramid) gdb_host_cpu=pyr ;;
154 powerpc*) gdb_host_cpu=powerpc ;;
155 sparc64) gdb_host_cpu=sparc ;;
156 *) gdb_host_cpu=$host_cpu ;;
160 # map host info into gdb names.
164 a29k-*-*) gdb_host=ultra3 ;;
166 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
167 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
168 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
170 arm-*-*) gdb_host=arm ;;
172 c[12]-*-*) gdb_host=convex ;;
174 hppa*-*-bsd*) gdb_host=hppabsd ;;
175 hppa*-*-hiux*) gdb_host=hppahpux ;;
176 hppa*-*-hpux*) gdb_host=hppahpux ;;
177 hppa*-*-osf*) gdb_host=hppaosf ;;
179 i[3456]86-ncr-*) gdb_host=ncr3000 ;;
180 i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
181 i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
182 i[3456]86-sequent-sysv*) gdb_host=ptx ;;
183 i[3456]86-*-aix*) gdb_host=i386aix ;;
184 i[3456]86-*-bsd*) gdb_host=i386bsd ;;
185 i[3456]86-*-dgux*) gdb_host=i386dgux ;;
186 i[3456]86-*-freebsd*) gdb_host=fbsd ;;
187 i[3456]86-*-netbsd*) gdb_host=nbsd ;;
188 i[3456]86-*-go32*) gdb_host=go32 ;;
189 i[3456]86-*-linux*) gdb_host=linux ;;
190 i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
191 i[3456]86-*-mach3*) gdb_host=i386m3 ;;
192 i[3456]86-*-mach*) gdb_host=i386mach ;;
193 i[3456]86-*-gnu*) gdb_host=i386gnu ;;
194 i[3456]86-*-osf1mk*) gdb_host=osf1mk ;;
195 i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;;
196 i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
197 i[3456]86-*-sco*) gdb_host=i386sco ;;
198 i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
199 i[3456]86-*-sunos*) gdb_host=sun386 ;;
200 i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
201 i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
202 i[3456]86-*-sysv4*) gdb_host=i386v4 ;;
203 i[3456]86-*-unixware) gdb_host=i386v4 ;;
204 i[3456]86-*-sysv*) gdb_host=i386v ;;
205 i[3456]86-*-isc*) gdb_host=i386v32 ;;
206 i[3456]86-*-os9k) gdb_host=i386os9k ;;
207 i[3456]86-*-cygwin32) gdb_host=cygwin32 ;;
208 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
209 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
210 m68030-sony-*) gdb_host=news1000 ;;
212 m68*-altos-*) gdb_host=altos ;;
213 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
214 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
215 m68*-att-*) gdb_host=3b1 ;;
216 m68*-bull*-sysv*) gdb_host=dpx2 ;;
217 m68*-hp-bsd*) gdb_host=hp300bsd ;;
218 m68*-hp-hpux*) gdb_host=hp300hpux ;;
219 m68*-isi-*) gdb_host=isi ;;
220 m68*-*-lynxos*) gdb_host=m68klynx ;;
221 m68*-*-netbsd*) gdb_host=nbsd ;;
222 m68*-*-sysv4*) gdb_host=m68kv4 ;;
223 m68*-motorola-*) gdb_host=delta68 ;;
224 m68*-sony-*) gdb_host=news ;;
225 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
226 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
227 m68*-sun-*) gdb_host=sun3os4 ;;
229 m88*-harris-cxux*) gdb_host=cxux ;;
230 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
231 m88*-motorola-sysv*) gdb_host=delta88 ;;
232 m88*-*-mach3*) gdb_host=mach3 ;;
233 m88*-*-*) gdb_host=m88k ;;
235 mips-dec-mach3*) gdb_host=mach3 ;;
236 mips-dec-*) gdb_host=decstation ;;
237 mips-little-*) gdb_host=littlemips ;;
238 mips-sgi-irix3*) gdb_host=irix3 ;;
239 mips-sgi-irix4*) gdb_host=irix4 ;;
240 mips-sgi-irix5*) gdb_host=irix5 ;;
241 mips-sony-*) gdb_host=news-mips ;;
242 mips-*-mach3*) gdb_host=mach3 ;;
243 mips-*-sysv4*) gdb_host=mipsv4 ;;
244 mips-*-sysv*) gdb_host=riscos ;;
245 mips-*-riscos*) gdb_host=riscos ;;
247 none-*-*) gdb_host=none ;;
249 np1-*-*) gdb_host=np1 ;;
251 ns32k-*-mach3*) gdb_host=mach3 ;;
252 ns32k-*-netbsd*) gdb_host=nbsd ;;
253 ns32k-umax-*) gdb_host=umax ;;
254 ns32k-utek-sysv*) gdb_host=merlin ;;
256 powerpc-*-aix*) gdb_host=aix ;;
257 powerpcle-*-cygwin32) gdb_host=cygwin32 ;;
258 pn-*-*) gdb_host=pn ;;
260 pyramid-*-*) gdb_host=pyramid ;;
262 romp-*-*) gdb_host=rtbsd ;;
264 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
265 rs6000-*-aix4*) gdb_host=aix4 ;;
266 rs6000-*-*) gdb_host=rs6000 ;;
268 sparc-*-lynxos*) gdb_host=sparclynx ;;
269 sparc-*-netbsd*) gdb_host=nbsd ;;
270 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
271 sparc-*-sunos4*) gdb_host=sun4os4 ;;
272 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
273 sparc-*-*) gdb_host=sun4os4 ;;
274 sparc64-*-*) gdb_host=sun4sol2 ;;
276 tahoe-*-*) gdb_host=tahoe ;;
278 vax-*-bsd*) gdb_host=vaxbsd ;;
279 vax-*-ultrix2*) gdb_host=vaxult2 ;;
280 vax-*-ultrix*) gdb_host=vaxult ;;
282 w65-*-*) gdb_host=w65 ;;
287 # Map target cpu into the config cpu subdirectory name.
288 # The default is $target_cpu.
290 case "${target_cpu}" in
292 alpha) gdb_target_cpu=alpha ;;
293 c[12]) gdb_target_cpu=convex ;;
294 hppa*) gdb_target_cpu=pa ;;
295 i[3456]86) gdb_target_cpu=i386 ;;
296 m68*) gdb_target_cpu=m68k ;;
297 m88*) gdb_target_cpu=m88k ;;
298 mips*) gdb_target_cpu=mips ;;
299 np1) gdb_target_cpu=gould ;;
300 powerpc*) gdb_target_cpu=powerpc ;;
301 pn) gdb_target_cpu=gould ;;
302 pyramid) gdb_target_cpu=pyr ;;
303 sparc*) gdb_target_cpu=sparc ;;
304 *) gdb_target_cpu=$target_cpu ;;
308 # map target info into gdb names.
312 a29k-*-aout*) gdb_target=a29k ;;
313 a29k-*-coff*) gdb_target=a29k ;;
314 a29k-*-elf*) gdb_target=a29k ;;
315 a29k-*-ebmon*) gdb_target=a29k ;;
316 a29k-*-kern*) gdb_target=a29k-kern ;;
317 a29k-*-none*) gdb_target=a29k ;;
318 a29k-*-sym1*) gdb_target=ultra3 ;;
319 a29k-*-udi*) gdb_target=a29k-udi ;;
320 a29k-*-vxworks*) gdb_target=vx29k ;;
322 alpha-*-osf*) gdb_target=alpha-osf1 ;;
325 arm-*-*) gdb_target=arm ;;
327 c1-*-*) gdb_target=convex ;;
328 c2-*-*) gdb_target=convex ;;
330 h8300-*-*) gdb_target=h8300 ;;
331 h8500-*-*) gdb_target=h8500 ;;
333 sh-*-*) gdb_target=sh ;;
336 hppa*-*-bsd*) gdb_target=hppabsd ;;
337 hppa*-*-pro*) gdb_target=hppapro ;;
338 hppa*-*-hpux*) gdb_target=hppahpux ;;
339 hppa*-*-hiux*) gdb_target=hppahpux ;;
340 hppa*-*-osf*) gdb_target=hppaosf ;;
342 i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
343 i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
344 i[3456]86-sequent-sysv*) gdb_target=ptx ;;
345 i[3456]86-ncr-*) gdb_target=ncr3000 ;;
346 i[3456]86-*-aout*) gdb_target=i386aout ;;
347 i[3456]86-*-coff*) gdb_target=i386v ;;
348 i[3456]86-*-elf*) gdb_target=i386v ;;
349 i[3456]86-*-aix*) gdb_target=i386aix ;;
350 i[3456]86-*-bsd*) gdb_target=i386bsd ;;
351 i[3456]86-*-freebsd*) gdb_target=fbsd ;;
352 i[3456]86-*-netbsd*) gdb_target=nbsd ;;
353 i[3456]86-*-os9k) gdb_target=i386os9k ;;
354 i[3456]86-*-go32*) gdb_target=i386aout ;;
355 i[3456]86-*-lynxos*) gdb_target=i386lynx
356 configdirs="${configdirs} gdbserver" ;;
357 i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
358 i[3456]86-*-sunos*) gdb_target=sun386 ;;
359 i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
360 i[3456]86-*-sco*) gdb_target=i386v ;;
361 i[3456]86-*-sysv*) gdb_target=i386v ;;
362 i[3456]86-*-linux*) gdb_target=linux
363 configdirs="${configdirs} gdbserver" ;;
364 i[3456]86-*-isc*) gdb_target=i386v ;;
365 i[3456]86-*-mach3*) gdb_target=i386m3 ;;
366 i[3456]86-*-mach*) gdb_target=i386mach ;;
367 i[3456]86-*-gnu*) gdb_target=i386gnu ;;
368 i[3456]86-*-netware*) gdb_target=i386nw
369 configdirs="${configdirs} nlm" ;;
370 i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
371 i[3456]86-*-cygwin32) gdb_target=cygwin32 ;;
372 i960-*-bout*) gdb_target=vxworks960 ;;
373 i960-nindy-coff*) gdb_target=nindy960 ;;
374 i960-*-coff*) gdb_target=mon960 ;;
375 i960-nindy-elf*) gdb_target=nindy960 ;;
376 i960-*-elf*) gdb_target=mon960 ;;
378 i960-*-nindy*) gdb_target=nindy960 ;;
379 i960-*-vxworks*) gdb_target=vxworks960 ;;
381 m68000-*-sunos3*) gdb_target=sun2os3 ;;
382 m68000-*-sunos4*) gdb_target=sun2os4 ;;
384 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
385 m68*-bull-sysv*) gdb_target=dpx2 ;;
386 m68*-hp-bsd*) gdb_target=hp300bsd ;;
387 m68*-hp-hpux*) gdb_target=hp300hpux ;;
388 m68*-altos-*) gdb_target=altos ;;
389 m68*-att-*) gdb_target=3b1 ;;
390 m68*-cisco*-*) gdb_target=cisco ;;
391 m68*-ericsson-*) gdb_target=es1800 ;;
392 m68*-isi-*) gdb_target=isi ;;
393 m68*-motorola-*) gdb_target=delta68 ;;
394 m68*-netx-*) gdb_target=vxworks68 ;;
395 m68*-sony-*) gdb_target=news ;;
396 m68*-tandem-*) gdb_target=st2000 ;;
397 m68*-rom68k-*) gdb_target=monitor ;;
398 m68*-*bug-*) gdb_target=monitor ;;
399 m68*-monitor-*) gdb_target=monitor ;;
400 m68*-est-*) gdb_target=monitor ;;
401 m68*-*-aout*) gdb_target=monitor ;;
402 m68*-*-coff*) gdb_target=monitor ;;
403 m68*-*-elf*) gdb_target=monitor ;;
404 m68*-*-lynxos*) gdb_target=m68klynx
405 configdirs="${configdirs} gdbserver" ;;
406 m68*-*-netbsd*) gdb_target=nbsd ;;
407 m68*-*-os68k*) gdb_target=os68k ;;
408 m68*-*-sunos3*) gdb_target=sun3os3 ;;
409 m68*-*-sunos4*) gdb_target=sun3os4 ;;
410 m68*-*-sysv4*) gdb_target=m68kv4 ;;
411 m68*-*-vxworks*) gdb_target=vxworks68 ;;
413 m88*-harris-cxux*) gdb_target=cxux ;;
414 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
415 m88*-*-mach3*) gdb_target=mach3 ;;
416 m88*-motorola-*) gdb_target=delta88 ;;
417 m88*-*-*) gdb_target=m88k ;;
419 mips64*-big-*) gdb_target=bigmips64 ;;
420 mips*-big-*) gdb_target=bigmips ;;
421 mips*-dec-mach3*) gdb_target=mach3 ;;
422 mips*-dec-*) gdb_target=decstation ;;
423 mips64*el-*-ecoff*) gdb_target=embedl64 ;;
424 mips64*-*-ecoff*) gdb_target=embed64 ;;
425 mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
426 mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
427 mips64*el-*-elf*) gdb_target=embedl64 ;;
428 mips64*-*-elf*) gdb_target=embed64 ;;
429 mips*el-*-ecoff*) gdb_target=embedl ;;
430 mips*-*-ecoff*) gdb_target=embed ;;
431 mips*el-*-elf*) gdb_target=embedl ;;
432 mips*-*-elf*) gdb_target=embed ;;
433 mips*-little-*) gdb_target=littlemips ;;
434 mips*-sgi-irix5*) gdb_target=irix5 ;;
435 mips*-sgi-*) gdb_target=irix3 ;;
436 mips*-sony-*) gdb_target=bigmips ;;
437 mips*-*-mach3*) gdb_target=mach3 ;;
438 mips*-*-sysv4*) gdb_target=mipsv4 ;;
439 mips*-*-sysv*) gdb_target=bigmips ;;
440 mips*-*-riscos*) gdb_target=bigmips ;;
441 mips*-*-vxworks*) gdb_target=vxmips ;;
443 none-*-*) gdb_target=none ;;
445 np1-*-*) gdb_target=np1 ;;
447 ns32k-*-mach3*) gdb_target=mach3 ;;
448 ns32k-*-netbsd*) gdb_target=nbsd ;;
449 ns32k-utek-sysv*) gdb_target=merlin ;;
450 ns32k-utek-*) gdb_target=umax ;;
452 pn-*-*) gdb_target=pn ;;
453 powerpc-*-macos*) gdb_target=macos ;;
454 powerpc-*-netware*) gdb_target=ppc-nw
455 configdirs="${configdirs} nlm" ;;
457 powerpc-*-aix4*) gdb_target=aix4 ;;
458 powerpc-*-aix*) gdb_target=aix ;;
459 powerpcle-*-cygwin32) gdb_target=cygwin32 ;;
460 powerpc-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
465 powerpcle-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
468 gdb_target=ppcle-eabi
471 pyramid-*-*) gdb_target=pyramid ;;
473 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
474 rs6000-*-aix4*) gdb_target=aix4 ;;
475 rs6000-*-*) gdb_target=rs6000 ;;
477 sparc-*-aout*) gdb_target=sparc-em ;;
478 sparc-*-coff*) gdb_target=sparc-em ;;
479 sparc-*-elf*) gdb_target=sparc-em ;;
480 sparc-*-lynxos*) gdb_target=sparclynx
481 configdirs="${configdirs} gdbserver" ;;
482 sparc-*-netbsd*) gdb_target=nbsd ;;
483 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
484 sparc-*-sunos4*) gdb_target=sun4os4 ;;
485 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
486 sparc-*-vxworks*) gdb_target=vxsparc ;;
487 sparc-*-*) gdb_target=sun4os4 ;;
488 # Use sparc-em for sparclet for now.
489 sparclet-*-*) gdb_target=sparc-em ;;
490 sparclite*-*-*) gdb_target=sparclite ;;
491 sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
492 sparc64-*-*) gdb_target=sp64 ;;
494 tahoe-*-*) gdb_target=tahoe ;;
496 vax-*-*) gdb_target=vax ;;
498 w65-*-*) gdb_target=w65 ;;
500 z8k-*-coff*) gdb_target=z8k ;;
508 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
509 if test ! -f ${host_makefile_frag}; then
510 AC_MSG_ERROR("*** Gdb does not support host ${host}")
512 frags="$frags $host_makefile_frag"
514 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
515 if test ! -f ${target_makefile_frag}; then
516 AC_MSG_ERROR("*** Gdb does not support target ${target}")
518 frags="$frags $target_makefile_frag"
520 AC_SUBST_FILE(host_makefile_frag)
521 AC_SUBST_FILE(target_makefile_frag)
526 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
527 ' ${host_makefile_frag}`
530 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
531 ' ${target_makefile_frag}`
533 # these really aren't orthogonal true/false values of the same condition,
534 # but shells are slow enough that I like to reuse the test conditions
536 if test "${target}" = "${host}"; then
538 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
539 ' ${host_makefile_frag}`
541 # GDBserver is only useful in a "native" enviroment
542 configdirs=`echo $configdirs | sed 's/gdbserver//'`
546 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
547 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
548 # corresponding links. But we have to remove the xm.h files and tm.h
549 # files anyway, e.g. when switching from "configure host" to
555 if test "${hostfile}" != ""; then
556 files="${files} config/${gdb_host_cpu}/${hostfile}"
557 links="${links} xm.h"
560 if test "${targetfile}" != ""; then
561 files="${files} config/${gdb_target_cpu}/${targetfile}"
562 links="${links} tm.h"
565 if test "${nativefile}" != ""; then
566 files="${files} config/${gdb_host_cpu}/${nativefile}"
567 links="${links} nm.h"
569 # A cross-only configuration.
570 files="${files} config/nm-empty.h"
571 links="${links} nm.h"
574 AC_LINK_FILES($files, $links)
576 AC_CONFIG_SUBDIRS($configdirs)
579 dnl Autoconf doesn't provide a mechanism for modifying definitions
580 dnl provided by makefile fragments.
582 if test "${nativefile}" = ""; then
583 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
584 < Makefile > Makefile.tem
585 mv -f Makefile.tem Makefile
589 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
590 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
591 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
592 mv -f Makefile.tmp Makefile
599 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
600 echo "source ${srcdir}/.gdbinit" >> .gdbinit
603 case x$CONFIG_HEADERS in
609 gdb_host_cpu=$gdb_host_cpu
610 gdb_target_cpu=$gdb_target_cpu
611 nativefile=$nativefile