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