1 dnl Process this file with autoconf to produce a configure script.
15 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
20 AC_CHECK_HEADERS(memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h)
25 dnl Handle optional features that can be enabled.
32 [case "${enableval}" in
33 yes) enable_netrom=yes ;;
34 no) enable_netrom=no ;;
35 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
38 if test "${enable_netrom}" = "yes"; then
39 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
47 [case "${enableval}" in
48 yes) ENABLE_OBS="${ENABLE_OBS} magic.o"
49 ENABLE_CFLAGS=-DGENERAL_MAGIC
52 *) AC_MSG_ERROR(bad value ${enableval} given for gm option) ;;
57 # start-sanitize-gdbtk
62 [case "${enableval}" in
63 yes) enable_gdbtk=yes ;;
64 no) enable_gdbtk=no ;;
65 *) AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
68 if test "${enable_gdbtk}" = "yes"; then
77 if test "x$no_x" != "xyes"; then
78 if test "x$x_includes" != "x" ;
80 X_CFLAGS="-I$x_includes"
85 if test "x$x_libraries" != "x" ;
87 X_LDFLAGS="-L$x_libraries"
94 # gdb linked statically w/ Solaris iff GCC is used, otherwise dynamic
97 if test "x$GCC" = "xyes";
99 X_LIBS="-Wl,-Bstatic -lX11 -lXext -lX11 -Wl,-Bdynamic"
101 if test "x$x_libraries" != "x" ;
103 X_LDFLAGS="$X_LDFLAGS -R$x_libraries"
105 X_LIBS="-lX11 -lXext -lX11"
108 # gdb linked statically w/ SunOS or HPUX
110 m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
111 if test "x$x_libraries" != "x" ;
113 X_LIBS="$x_libraries/libX11.a"
115 X_LIBS="/usr/lib/libX11.a"
118 # default is to link dynamically
127 AC_MSG_WARN([No X based programs will be built])
130 TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)'
131 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS} -lm"
132 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
135 AC_SUBST(ENABLE_GDBTK)
141 AC_SUBST(ENABLE_CFLAGS)
142 AC_SUBST(ENABLE_CLIBS)
146 configdirs="doc testsuite"
151 # Map host cpu into the config cpu subdirectory name.
152 # The default is $host_cpu.
154 case "${host_cpu}" in
156 c[12]) gdb_host_cpu=convex ;;
157 hppa*) gdb_host_cpu=pa ;;
158 i[345]86) gdb_host_cpu=i386 ;;
159 m68*) gdb_host_cpu=m68k ;;
160 m88*) gdb_host_cpu=m88k ;;
161 np1) gdb_host_cpu=gould ;;
162 pyramid) gdb_host_cpu=pyr ;;
163 powerpc*) gdb_host_cpu=powerpc ;;
164 *) gdb_host_cpu=$host_cpu ;;
168 # map host info into gdb names.
172 a29k-*-*) gdb_host=ultra3 ;;
174 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
175 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
176 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
178 arm-*-*) gdb_host=arm ;;
180 c[12]-*-*) gdb_host=convex ;;
182 hppa*-*-bsd*) gdb_host=hppabsd ;;
183 hppa*-*-hiux*) gdb_host=hppahpux ;;
184 hppa*-*-hpux*) gdb_host=hppahpux ;;
185 hppa*-*-osf*) gdb_host=hppaosf ;;
187 i[345]86-ncr-*) gdb_host=ncr3000 ;;
188 i[345]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
189 i[345]86-sequent-sysv4*) gdb_host=ptx4 ;;
190 i[345]86-sequent-sysv*) gdb_host=ptx ;;
191 i[345]86-*-aix*) gdb_host=i386aix ;;
192 i[345]86-*-bsd*) gdb_host=i386bsd ;;
193 i[345]86-*-freebsd*) gdb_host=fbsd ;;
194 i[345]86-*-netbsd*) gdb_host=nbsd ;;
195 i[345]86-*-go32*) gdb_host=go32 ;;
196 i[345]86-*-linux*) gdb_host=linux ;;
197 i[345]86-*-lynxos*) gdb_host=i386lynx ;;
198 i[345]86-*-mach3*) gdb_host=i386m3 ;;
199 i[345]86-*-mach*) gdb_host=i386mach ;;
200 i[345]86-*-osf1mk*) gdb_host=osf1mk ;;
201 i[345]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
202 i[345]86-*-sco*) gdb_host=i386sco ;;
203 i[345]86-*-solaris*) gdb_host=i386sol2 ;;
204 i[345]86-*-sunos*) gdb_host=sun386 ;;
205 i[345]86-*-sysv3.2*) gdb_host=i386v32 ;;
206 i[345]86-*-sysv32*) gdb_host=i386v32 ;;
207 i[345]86-*-sysv4*) gdb_host=i386v4 ;;
208 i[345]86-*-unixware) gdb_host=i386v4 ;;
209 i[345]86-*-sysv*) gdb_host=i386v ;;
210 i[345]86-*-isc*) gdb_host=i386v32 ;;
211 i[345]86-*-os9k) gdb_host=i386os9k ;;
212 i[345]86-*-win32*) gdb_host=win32 ;;
213 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
214 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
215 m68030-sony-*) gdb_host=news1000 ;;
217 m68*-altos-*) gdb_host=altos ;;
218 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
219 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
220 m68*-att-*) gdb_host=3b1 ;;
221 m68*-bull*-sysv*) gdb_host=dpx2 ;;
222 m68*-hp-bsd*) gdb_host=hp300bsd ;;
223 m68*-hp-hpux*) gdb_host=hp300hpux ;;
224 m68*-isi-*) gdb_host=isi ;;
225 m68*-*-lynxos*) gdb_host=m68klynx ;;
226 m68*-*-sysv4*) gdb_host=m68kv4 ;;
227 m68*-motorola-*) gdb_host=delta68 ;;
228 m68*-sony-*) gdb_host=news ;;
229 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
230 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
231 m68*-sun-*) gdb_host=sun3os4 ;;
233 m88*-harris-cxux*) gdb_host=cxux ;;
234 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
235 m88*-motorola-sysv*) gdb_host=delta88 ;;
236 m88*-*-mach3*) gdb_host=mach3 ;;
237 m88*-*-*) gdb_host=m88k ;;
239 mips-dec-mach3*) gdb_host=mach3 ;;
240 mips-dec-*) gdb_host=decstation ;;
241 mips-little-*) gdb_host=littlemips ;;
242 mips-sgi-irix3*) gdb_host=irix3 ;;
243 mips-sgi-irix4*) gdb_host=irix4 ;;
244 mips-sgi-irix5*) gdb_host=irix5 ;;
245 mips-sony-*) gdb_host=news-mips ;;
246 mips-*-mach3*) gdb_host=mach3 ;;
247 mips-*-sysv4*) gdb_host=mipsv4 ;;
248 mips-*-sysv*) gdb_host=riscos ;;
249 mips-*-riscos*) gdb_host=riscos ;;
251 none-*-*) gdb_host=none ;;
253 np1-*-*) gdb_host=np1 ;;
255 ns32k-*-mach3*) gdb_host=mach3 ;;
256 ns32k-*-netbsd*) gdb_host=nbsd ;;
257 ns32k-umax-*) gdb_host=umax ;;
258 ns32k-utek-sysv*) gdb_host=merlin ;;
260 powerpc-*-aix*) gdb_host=aix ;;
262 pn-*-*) gdb_host=pn ;;
264 pyramid-*-*) gdb_host=pyramid ;;
266 romp-*-*) gdb_host=rtbsd ;;
268 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
269 rs6000-*-*) gdb_host=rs6000 ;;
271 sparc-*-lynxos*) gdb_host=sparclynx ;;
272 sparc-*-netbsd*) gdb_host=nbsd ;;
273 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
274 sparc-*-sunos4*) gdb_host=sun4os4 ;;
275 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
276 sparc-*-*) gdb_host=sun4os4 ;;
278 tahoe-*-*) gdb_host=tahoe ;;
280 vax-*-bsd*) gdb_host=vaxbsd ;;
281 vax-*-ultrix2*) gdb_host=vaxult2 ;;
282 vax-*-ultrix*) gdb_host=vaxult ;;
284 w65-*-*) gdb_host=w65 ;;
289 # Map target cpu into the config cpu subdirectory name.
290 # The default is $target_cpu.
292 case "${target_cpu}" in
294 alpha) gdb_target_cpu=alpha ;;
295 c[12]) gdb_target_cpu=convex ;;
296 hppa*) gdb_target_cpu=pa ;;
297 i[345]86) gdb_target_cpu=i386 ;;
298 m68*) gdb_target_cpu=m68k ;;
299 m88*) gdb_target_cpu=m88k ;;
300 mips*) gdb_target_cpu=mips ;;
301 np1) gdb_target_cpu=gould ;;
302 powerpc*) gdb_target_cpu=powerpc ;;
303 pn) gdb_target_cpu=gould ;;
304 pyramid) gdb_target_cpu=pyr ;;
305 sparc*) gdb_target_cpu=sparc ;;
306 *) gdb_target_cpu=$target_cpu ;;
310 # map target info into gdb names.
314 a29k-*-aout*) gdb_target=a29k ;;
315 a29k-*-coff*) gdb_target=a29k ;;
316 a29k-*-elf*) gdb_target=a29k ;;
317 a29k-*-ebmon*) gdb_target=a29k ;;
318 a29k-*-kern*) gdb_target=a29k-kern ;;
319 a29k-*-none*) gdb_target=a29k ;;
320 a29k-*-sym1*) gdb_target=ultra3 ;;
321 a29k-*-udi*) gdb_target=a29k-udi ;;
322 a29k-*-vxworks*) gdb_target=vx29k ;;
324 alpha-*-osf*) gdb_target=alpha-osf1 ;;
327 arc-*-*) gdb_target=arc ;;
330 arm-*-*) gdb_target=arm ;;
332 c1-*-*) gdb_target=convex ;;
333 c2-*-*) gdb_target=convex ;;
335 h8300-*-*) gdb_target=h8300 ;;
336 h8500-*-*) gdb_target=h8500 ;;
338 sh-*-*) gdb_target=sh ;;
341 r16-*-*) gdb_target=r16 ;;
344 hppa*-*-bsd*) gdb_target=hppabsd ;;
345 hppa*-*-pro*) gdb_target=hppapro ;;
346 hppa*-*-hpux*) gdb_target=hppahpux ;;
347 hppa*-*-hiux*) gdb_target=hppahpux ;;
348 hppa*-*-osf*) gdb_target=hppaosf ;;
350 i[345]86-sequent-bsd*) gdb_target=symmetry ;;
351 i[345]86-sequent-sysv4*) gdb_target=ptx4 ;;
352 i[345]86-sequent-sysv*) gdb_target=ptx ;;
353 i[345]86-ncr-*) gdb_target=ncr3000 ;;
354 i[345]86-*-aout*) gdb_target=i386aout ;;
355 i[345]86-*-coff*) gdb_target=i386v ;;
356 i[345]86-*-elf*) gdb_target=i386v ;;
357 i[345]86-*-aix*) gdb_target=i386aix ;;
358 i[345]86-*-bsd*) gdb_target=i386bsd ;;
359 i[345]86-*-freebsd*) gdb_target=fbsd ;;
360 i[345]86-*-netbsd*) gdb_target=nbsd ;;
361 i[345]86-*-os9k) gdb_target=i386os9k ;;
362 i[345]86-*-go32*) gdb_target=i386aout ;;
363 i[345]86-*-lynxos*) gdb_target=i386lynx
364 configdirs="${configdirs} gdbserver" ;;
365 i[345]86-*-solaris*) gdb_target=i386sol2 ;;
366 i[345]86-*-sunos*) gdb_target=sun386 ;;
367 i[345]86-*-sysv4*) gdb_target=i386v4 ;;
368 i[345]86-*-sco*) gdb_target=i386v ;;
369 i[345]86-*-sysv*) gdb_target=i386v ;;
370 i[345]86-*-linux*) gdb_target=linux ;;
371 i[345]86-*-isc*) gdb_target=i386v ;;
372 i[345]86-*-mach3*) gdb_target=i386m3 ;;
373 i[345]86-*-mach*) gdb_target=i386mach ;;
374 i[345]86-*-netware*) gdb_target=i386nw
375 configdirs="${configdirs} nlm" ;;
376 i[345]86-*-osf1mk*) gdb_target=i386mk ;;
377 i[345]86-*-win32) gdb_target=win32 ;;
379 i960-*-bout*) gdb_target=vxworks960 ;;
380 i960-*-coff*) gdb_target=nindy960 ;;
381 i960-*-elf*) gdb_target=nindy960 ;;
383 i960-*-nindy*) gdb_target=nindy960 ;;
384 i960-*-vxworks*) gdb_target=vxworks960 ;;
386 m68000-*-sunos3*) gdb_target=sun2os3 ;;
387 m68000-*-sunos4*) gdb_target=sun2os4 ;;
389 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
390 m68*-bull-sysv*) gdb_target=dpx2 ;;
391 m68*-hp-bsd*) gdb_target=hp300bsd ;;
392 m68*-hp-hpux*) gdb_target=hp300hpux ;;
393 m68*-altos-*) gdb_target=altos ;;
394 m68*-att-*) gdb_target=3b1 ;;
395 m68*-cisco*-*) gdb_target=cisco ;;
396 m68*-ericsson-*) gdb_target=es1800 ;;
397 m68*-isi-*) gdb_target=isi ;;
398 m68*-motorola-*) gdb_target=delta68 ;;
399 m68*-netx-*) gdb_target=vxworks68 ;;
400 m68*-sony-*) gdb_target=news ;;
401 m68*-tandem-*) gdb_target=st2000 ;;
402 m68*-rom68k-*) gdb_target=monitor ;;
403 m68*-*bug-*) gdb_target=monitor ;;
404 m68*-monitor-*) gdb_target=monitor ;;
405 m68*-est-*) gdb_target=monitor ;;
406 m68*-*-aout*) gdb_target=monitor ;;
407 m68*-*-coff*) gdb_target=monitor ;;
408 m68*-*-elf*) gdb_target=monitor ;;
409 m68*-*-lynxos*) gdb_target=m68klynx
410 configdirs="${configdirs} gdbserver" ;;
411 m68*-*-os68k*) gdb_target=os68k ;;
412 m68*-*-sunos3*) gdb_target=sun3os3 ;;
413 m68*-*-sunos4*) gdb_target=sun3os4 ;;
414 m68*-*-sysv4*) gdb_target=m68kv4 ;;
415 m68*-*-vxworks*) gdb_target=vxworks68 ;;
417 m88*-harris-cxux*) gdb_target=cxux ;;
418 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
419 m88*-*-mach3*) gdb_target=mach3 ;;
420 m88*-motorola-*) gdb_target=delta88 ;;
421 m88*-*-*) gdb_target=m88k ;;
423 mips64*-big-*) gdb_target=bigmips64 ;;
424 mips*-big-*) gdb_target=bigmips ;;
425 mips*-dec-mach3*) gdb_target=mach3 ;;
426 mips*-dec-*) gdb_target=decstation ;;
427 mips64*el-*-ecoff*) gdb_target=idtl64 ;;
428 mips64*-idt-ecoff*) gdb_target=idt64 ;;
429 mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
430 mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
431 mips64*el-*-elf*) gdb_target=idtl64 ;;
432 mips64*-*-elf*) gdb_target=idt64 ;;
433 mips*el-*-ecoff*) gdb_target=idtl ;;
434 mips*-*-ecoff*) gdb_target=idt ;;
436 mips*-*-magic*) gdb_target=idt ;;
438 mips*el-*-elf*) gdb_target=idtl ;;
439 mips*-*-elf*) gdb_target=idt ;;
440 mips*-little-*) gdb_target=littlemips ;;
441 mips*-sgi-irix5*) gdb_target=irix5 ;;
442 mips*-sgi-*) gdb_target=irix3 ;;
443 mips*-sony-*) gdb_target=bigmips ;;
444 mips*-*-mach3*) gdb_target=mach3 ;;
445 mips*-*-sysv4*) gdb_target=mipsv4 ;;
446 mips*-*-sysv*) gdb_target=bigmips ;;
447 mips*-*-riscos*) gdb_target=bigmips ;;
449 none-*-*) gdb_target=none ;;
451 np1-*-*) gdb_target=np1 ;;
453 ns32k-*-mach3*) gdb_target=mach3 ;;
454 ns32k-*-netbsd*) gdb_target=nbsd ;;
455 ns32k-utek-sysv*) gdb_target=merlin ;;
456 ns32k-utek-*) gdb_target=umax ;;
458 pn-*-*) gdb_target=pn ;;
459 powerpc-*-netware*) gdb_target=ppc-nw
460 configdirs="${configdirs} nlm" ;;
462 powerpc-*-aix4*) gdb_target=aix4 ;;
463 powerpc-*-aix*) gdb_target=aix ;;
464 powerpc-*-eabisim*) gdb_target=ppc-sim ;;
465 powerpc-*-eabi*) gdb_target=ppc-eabi ;;
466 powerpcle-*-eabisim*) gdb_target=ppcle-sim ;;
467 powerpcle-*-eabi*) gdb_target=ppcle-eabi ;;
469 pyramid-*-*) gdb_target=pyramid ;;
471 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
472 rs6000-*-aix4*) gdb_target=aix4 ;;
473 rs6000-*-*) gdb_target=rs6000 ;;
475 sparc-*-aout*) gdb_target=sparc-em ;;
476 sparc-*-coff*) gdb_target=sparc-em ;;
477 sparc-*-elf*) gdb_target=sparc-em ;;
478 sparc-*-lynxos*) gdb_target=sparclynx
479 configdirs="${configdirs} gdbserver" ;;
480 sparc-*-netbsd*) gdb_target=nbsd ;;
481 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
482 sparc-*-sunos4*) gdb_target=sun4os4 ;;
483 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
484 sparc-*-vxworks*) gdb_target=vxsparc ;;
485 sparc-*-*) gdb_target=sun4os4 ;;
486 sparclite*-*-*) gdb_target=sparclite ;;
487 sparc64-*-*) gdb_target=sp64 ;;
489 tahoe-*-*) gdb_target=tahoe ;;
491 vax-*-*) gdb_target=vax ;;
493 w65-*-*) gdb_target=w65 ;;
495 z8k-*-coff*) gdb_target=z8k ;;
503 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
504 if test ! -f ${host_makefile_frag}; then
505 AC_MSG_ERROR("*** Gdb does not support host ${host}")
507 frags="$frags $host_makefile_frag"
509 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
510 if test ! -f ${target_makefile_frag}; then
511 AC_MSG_ERROR("*** Gdb does not support target ${target}")
513 frags="$frags $target_makefile_frag"
515 AC_SUBST_FILE(host_makefile_frag)
516 AC_SUBST_FILE(target_makefile_frag)
521 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
522 ' ${host_makefile_frag}`
525 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
526 ' ${target_makefile_frag}`
528 # these really aren't orthogonal true/false values of the same condition,
529 # but shells are slow enough that I like to reuse the test conditions
531 if test "${target}" = "${host}"; then
533 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
534 ' ${host_makefile_frag}`
536 # GDBserver is only useful in a "native" enviroment
537 configdirs=`echo $configdirs | sed 's/gdbserver//'`
541 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
542 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
543 # corresponding links. But we have to remove the xm.h files and tm.h
544 # files anyway, e.g. when switching from "configure host" to
550 if test "${hostfile}" != ""; then
551 files="${files} config/${gdb_host_cpu}/${hostfile}"
552 links="${links} xm.h"
555 if test "${targetfile}" != ""; then
556 files="${files} config/${gdb_target_cpu}/${targetfile}"
557 links="${links} tm.h"
560 if test "${nativefile}" != ""; then
561 files="${files} config/${gdb_host_cpu}/${nativefile}"
562 links="${links} nm.h"
564 # A cross-only configuration.
565 files="${files} config/nm-empty.h"
566 links="${links} nm.h"
568 # start-sanitize-gdbtk
570 # Make it possible to use the GUI without doing a full install
571 if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
572 files="${files} gdbtk.tcl"
573 links="${links} gdbtk.tcl"
577 AC_LINK_FILES($files, $links)
579 AC_CONFIG_SUBDIRS($configdirs)
582 dnl Autoconf doesn't provide a mechanism for modifying definitions
583 dnl provided by makefile fragments.
585 if test "${nativefile}" = ""; then
586 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
587 < Makefile > Makefile.tem
588 mv -f Makefile.tem Makefile
592 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
593 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
594 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
595 mv -f Makefile.tmp Makefile
602 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
603 echo "source ${srcdir}/.gdbinit" >> .gdbinit
607 gdb_host_cpu=$gdb_host_cpu
608 gdb_target_cpu=$gdb_target_cpu
609 nativefile=$nativefile