1 dnl Process this file with autoconf to produce a configure script.
14 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
19 AC_CHECK_HEADERS(memory.h string.h strings.h unistd.h)
24 dnl Handle optional features that can be enabled.
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) ;;
37 if test "${enable_netrom}" = "yes"; then
38 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
41 # start-sanitize-gdbtk
46 [case "${enableval}" in
47 yes) enable_gdbtk=yes ;;
48 no) enable_gdbtk=no ;;
49 *) AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
52 if test "${enable_gdbtk}" = "yes"; then
60 TCL_LIBS='$(TCL) $(TK) $(X11)'
61 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS} -lm"
62 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
64 AC_SUBST(ENABLE_GDBTK)
67 AC_SUBST(ENABLE_CFLAGS)
68 AC_SUBST(ENABLE_CLIBS)
72 configdirs="doc testsuite"
77 # Map host cpu into the config cpu subdirectory name.
78 # The default is $host_cpu.
82 c[12]) gdb_host_cpu=convex ;;
83 hppa*) gdb_host_cpu=pa ;;
84 i[345]86) gdb_host_cpu=i386 ;;
85 m68*) gdb_host_cpu=m68k ;;
86 m88*) gdb_host_cpu=m88k ;;
87 np1) gdb_host_cpu=gould ;;
88 pyramid) gdb_host_cpu=pyr ;;
89 powerpc*) gdb_host_cpu=powerpc ;;
90 *) gdb_host_cpu=$host_cpu ;;
94 # map host info into gdb names.
98 a29k-*-*) gdb_host=ultra3 ;;
100 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
101 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
102 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
104 arm-*-*) gdb_host=arm ;;
106 c[12]-*-*) gdb_host=convex ;;
108 hppa*-*-bsd*) gdb_host=hppabsd ;;
109 hppa*-*-hiux*) gdb_host=hppahpux ;;
110 hppa*-*-hpux*) gdb_host=hppahpux ;;
111 hppa*-*-osf*) gdb_host=hppaosf ;;
113 i[345]86-ncr-*) gdb_host=ncr3000 ;;
114 i[345]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
115 i[345]86-sequent-sysv4*) gdb_host=ptx4 ;;
116 i[345]86-sequent-sysv*) gdb_host=ptx ;;
117 i[345]86-*-aix*) gdb_host=i386aix ;;
118 i[345]86-*-bsd*) gdb_host=i386bsd ;;
119 i[345]86-*-freebsd*) gdb_host=fbsd ;;
120 i[345]86-*-netbsd*) gdb_host=nbsd ;;
121 i[345]86-*-go32*) gdb_host=go32 ;;
122 i[345]86-*-linux*) gdb_host=linux ;;
123 i[345]86-*-lynxos*) gdb_host=i386lynx ;;
124 i[345]86-*-mach3*) gdb_host=i386m3 ;;
125 i[345]86-*-mach*) gdb_host=i386mach ;;
126 i[345]86-*-osf1mk*) gdb_host=osf1mk ;;
127 i[345]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
128 i[345]86-*-sco*) gdb_host=i386sco ;;
129 i[345]86-*-solaris*) gdb_host=i386sol2 ;;
130 i[345]86-*-sunos*) gdb_host=sun386 ;;
131 i[345]86-*-sysv3.2*) gdb_host=i386v32 ;;
132 i[345]86-*-sysv32*) gdb_host=i386v32 ;;
133 i[345]86-*-sysv4*) gdb_host=i386v4 ;;
134 i[345]86-*-unixware) gdb_host=i386v4 ;;
135 i[345]86-*-sysv*) gdb_host=i386v ;;
136 i[345]86-*-isc*) gdb_host=i386v32 ;;
137 i[345]86-*-os9k) gdb_host=i386os9k ;;
139 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
140 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
141 m68030-sony-*) gdb_host=news1000 ;;
143 m68*-altos-*) gdb_host=altos ;;
144 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
145 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
146 m68*-att-*) gdb_host=3b1 ;;
147 m68*-bull*-sysv*) gdb_host=dpx2 ;;
148 m68*-hp-bsd*) gdb_host=hp300bsd ;;
149 m68*-hp-hpux*) gdb_host=hp300hpux ;;
150 m68*-isi-*) gdb_host=isi ;;
151 m68*-*-lynxos*) gdb_host=m68klynx ;;
152 m68*-*-sysv4*) gdb_host=m68kv4 ;;
153 m68*-motorola-*) gdb_host=delta68 ;;
154 m68*-sony-*) gdb_host=news ;;
155 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
156 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
157 m68*-sun-*) gdb_host=sun3os4 ;;
159 m88*-harris-cxux*) gdb_host=cxux ;;
160 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
161 m88*-motorola-sysv*) gdb_host=delta88 ;;
162 m88*-*-mach3*) gdb_host=mach3 ;;
163 m88*-*-*) gdb_host=m88k ;;
165 mips-dec-mach3*) gdb_host=mach3 ;;
166 mips-dec-*) gdb_host=decstation ;;
167 mips-little-*) gdb_host=littlemips ;;
168 mips-sgi-irix3*) gdb_host=irix3 ;;
169 mips-sgi-irix4*) gdb_host=irix4 ;;
170 mips-sgi-irix5*) gdb_host=irix5 ;;
171 mips-sony-*) gdb_host=news-mips ;;
172 mips-*-mach3*) gdb_host=mach3 ;;
173 mips-*-sysv4*) gdb_host=mipsv4 ;;
174 mips-*-sysv*) gdb_host=riscos ;;
175 mips-*-riscos*) gdb_host=riscos ;;
177 none-*-*) gdb_host=none ;;
179 np1-*-*) gdb_host=np1 ;;
181 ns32k-*-mach3*) gdb_host=mach3 ;;
182 ns32k-*-netbsd*) gdb_host=nbsd ;;
183 ns32k-umax-*) gdb_host=umax ;;
184 ns32k-utek-sysv*) gdb_host=merlin ;;
186 powerpc-*-aix*) gdb_host=aix ;;
188 pn-*-*) gdb_host=pn ;;
190 pyramid-*-*) gdb_host=pyramid ;;
192 romp-*-*) gdb_host=rtbsd ;;
194 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
195 rs6000-*-*) gdb_host=rs6000 ;;
197 sparc-*-lynxos*) gdb_host=sparclynx ;;
198 sparc-*-netbsd*) gdb_host=nbsd ;;
199 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
200 sparc-*-sunos4*) gdb_host=sun4os4 ;;
201 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
202 sparc-*-*) gdb_host=sun4os4 ;;
204 tahoe-*-*) gdb_host=tahoe ;;
206 vax-*-bsd*) gdb_host=vaxbsd ;;
207 vax-*-ultrix2*) gdb_host=vaxult2 ;;
208 vax-*-ultrix*) gdb_host=vaxult ;;
210 w65-*-*) gdb_host=w65 ;;
215 # Map target cpu into the config cpu subdirectory name.
216 # The default is $target_cpu.
218 case "${target_cpu}" in
220 alpha) gdb_target_cpu=alpha ;;
221 c[12]) gdb_target_cpu=convex ;;
222 hppa*) gdb_target_cpu=pa ;;
223 i[345]86) gdb_target_cpu=i386 ;;
224 m68*) gdb_target_cpu=m68k ;;
225 m88*) gdb_target_cpu=m88k ;;
226 mips*) gdb_target_cpu=mips ;;
227 np1) gdb_target_cpu=gould ;;
228 powerpc*) gdb_target_cpu=powerpc ;;
229 pn) gdb_target_cpu=gould ;;
230 pyramid) gdb_target_cpu=pyr ;;
231 sparc*) gdb_target_cpu=sparc ;;
232 *) gdb_target_cpu=$target_cpu ;;
236 # map target info into gdb names.
240 a29k-*-aout*) gdb_target=a29k ;;
241 a29k-*-coff*) gdb_target=a29k ;;
242 a29k-*-elf*) gdb_target=a29k ;;
243 a29k-*-ebmon*) gdb_target=a29k ;;
244 a29k-*-kern*) gdb_target=a29k-kern ;;
245 a29k-*-none*) gdb_target=a29k ;;
246 a29k-*-sym1*) gdb_target=ultra3 ;;
247 a29k-*-udi*) gdb_target=a29k-udi ;;
248 a29k-*-vxworks*) gdb_target=vx29k ;;
250 alpha-*-osf*) gdb_target=alpha-osf1 ;;
253 arc-*-*) gdb_target=arc ;;
256 arm-*-*) gdb_target=arm ;;
258 c1-*-*) gdb_target=convex ;;
259 c2-*-*) gdb_target=convex ;;
261 h8300-*-*) gdb_target=h8300 ;;
262 h8500-*-*) gdb_target=h8500 ;;
264 sh-*-*) gdb_target=sh ;;
267 r16-*-*) gdb_target=r16 ;;
270 hppa*-*-bsd*) gdb_target=hppabsd ;;
271 hppa*-*-pro*) gdb_target=hppapro ;;
272 hppa*-*-hpux*) gdb_target=hppahpux ;;
273 hppa*-*-hiux*) gdb_target=hppahpux ;;
274 hppa*-*-osf*) gdb_target=hppaosf ;;
276 i[345]86-sequent-bsd*) gdb_target=symmetry ;;
277 i[345]86-sequent-sysv4*) gdb_target=ptx4 ;;
278 i[345]86-sequent-sysv*) gdb_target=ptx ;;
279 i[345]86-ncr-*) gdb_target=ncr3000 ;;
280 i[345]86-*-aout*) gdb_target=i386aout ;;
281 i[345]86-*-coff*) gdb_target=i386v ;;
282 i[345]86-*-elf*) gdb_target=i386v ;;
283 i[345]86-*-aix*) gdb_target=i386aix ;;
284 i[345]86-*-bsd*) gdb_target=i386bsd ;;
285 i[345]86-*-freebsd*) gdb_target=fbsd ;;
286 i[345]86-*-netbsd*) gdb_target=nbsd ;;
287 i[345]86-*-os9k) gdb_target=i386os9k ;;
288 i[345]86-*-go32*) gdb_target=i386aout ;;
289 i[345]86-*-lynxos*) gdb_target=i386lynx
290 configdirs="${configdirs} gdbserver" ;;
291 i[345]86-*-solaris*) gdb_target=i386sol2 ;;
292 i[345]86-*-sunos*) gdb_target=sun386 ;;
293 i[345]86-*-sysv4*) gdb_target=i386v4 ;;
294 i[345]86-*-sco*) gdb_target=i386v ;;
295 i[345]86-*-sysv*) gdb_target=i386v ;;
296 i[345]86-*-linux*) gdb_target=linux ;;
297 i[345]86-*-isc*) gdb_target=i386v ;;
298 i[345]86-*-mach3*) gdb_target=i386m3 ;;
299 i[345]86-*-mach*) gdb_target=i386mach ;;
300 i[345]86-*-netware*) gdb_target=i386nw
301 configdirs="${configdirs} nlm" ;;
302 i[345]86-*-osf1mk*) gdb_target=i386mk ;;
304 i960-*-bout*) gdb_target=vxworks960 ;;
305 i960-*-coff*) gdb_target=nindy960 ;;
306 i960-*-elf*) gdb_target=nindy960 ;;
308 i960-*-nindy*) gdb_target=nindy960 ;;
309 i960-*-vxworks*) gdb_target=vxworks960 ;;
311 m68000-*-sunos3*) gdb_target=sun2os3 ;;
312 m68000-*-sunos4*) gdb_target=sun2os4 ;;
314 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
315 m68*-bull-sysv*) gdb_target=dpx2 ;;
316 m68*-hp-bsd*) gdb_target=hp300bsd ;;
317 m68*-hp-hpux*) gdb_target=hp300hpux ;;
318 m68*-altos-*) gdb_target=altos ;;
319 m68*-att-*) gdb_target=3b1 ;;
320 m68*-cisco*-*) gdb_target=cisco ;;
321 m68*-ericsson-*) gdb_target=es1800 ;;
322 m68*-isi-*) gdb_target=isi ;;
323 m68*-motorola-*) gdb_target=delta68 ;;
324 m68*-netx-*) gdb_target=vxworks68 ;;
325 m68*-sony-*) gdb_target=news ;;
326 m68*-tandem-*) gdb_target=st2000 ;;
327 m68*-rom68k-*) gdb_target=monitor ;;
328 m68*-*bug-*) gdb_target=monitor ;;
329 m68*-monitor-*) gdb_target=monitor ;;
330 m68*-est-*) gdb_target=monitor ;;
331 m68*-*-aout*) gdb_target=monitor ;;
332 m68*-*-coff*) gdb_target=monitor ;;
333 m68*-*-elf*) gdb_target=monitor ;;
334 m68*-*-lynxos*) gdb_target=m68klynx
335 configdirs="${configdirs} gdbserver" ;;
336 m68*-*-os68k*) gdb_target=os68k ;;
337 m68*-*-sunos3*) gdb_target=sun3os3 ;;
338 m68*-*-sunos4*) gdb_target=sun3os4 ;;
339 m68*-*-sysv4*) gdb_target=m68kv4 ;;
340 m68*-*-vxworks*) gdb_target=vxworks68 ;;
342 m88*-harris-cxux*) gdb_target=cxux ;;
343 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
344 m88*-*-mach3*) gdb_target=mach3 ;;
345 m88*-motorola-*) gdb_target=delta88 ;;
346 m88*-*-*) gdb_target=m88k ;;
348 mips64*-big-*) gdb_target=bigmips64 ;;
349 mips*-big-*) gdb_target=bigmips ;;
350 mips*-dec-mach3*) gdb_target=mach3 ;;
351 mips*-dec-*) gdb_target=decstation ;;
352 mips64*el-*-ecoff*) gdb_target=idtl64 ;;
353 mips64*-idt-ecoff*) gdb_target=idt64 ;;
354 mips64*el-*-elf*) gdb_target=idtl64 ;;
355 mips64*-*-elf*) gdb_target=idt64 ;;
356 mips*el-*-ecoff*) gdb_target=idtl ;;
357 mips*-*-ecoff*) gdb_target=idt ;;
358 mips*el-*-elf*) gdb_target=idtl ;;
359 mips*-*-elf*) gdb_target=idt ;;
360 mips*-little-*) gdb_target=littlemips ;;
361 mips*-sgi-irix5*) gdb_target=irix5 ;;
362 mips*-sgi-*) gdb_target=irix3 ;;
363 mips*-sony-*) gdb_target=bigmips ;;
364 mips*-*-mach3*) gdb_target=mach3 ;;
365 mips*-*-sysv4*) gdb_target=mipsv4 ;;
366 mips*-*-sysv*) gdb_target=bigmips ;;
367 mips*-*-riscos*) gdb_target=bigmips ;;
369 none-*-*) gdb_target=none ;;
371 np1-*-*) gdb_target=np1 ;;
373 ns32k-*-mach3*) gdb_target=mach3 ;;
374 ns32k-*-netbsd*) gdb_target=nbsd ;;
375 ns32k-utek-sysv*) gdb_target=merlin ;;
376 ns32k-utek-*) gdb_target=umax ;;
378 pn-*-*) gdb_target=pn ;;
379 powerpc-*-netware*) gdb_target=ppc-nw
380 configdirs="${configdirs} nlm" ;;
382 powerpc-*-aix*) gdb_target=aix ;;
383 powerpc-*-eabi*) gdb_target=ppc-eabi ;;
384 powerpcle-*-eabi*) gdb_target=ppcle-eabi ;;
386 pyramid-*-*) gdb_target=pyramid ;;
388 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
389 rs6000-*-*) gdb_target=rs6000 ;;
391 sparc-*-aout*) gdb_target=sparc-em ;;
392 sparc-*-coff*) gdb_target=sparc-em ;;
393 sparc-*-elf*) gdb_target=sparc-em ;;
394 sparc-*-lynxos*) gdb_target=sparclynx
395 configdirs="${configdirs} gdbserver" ;;
396 sparc-*-netbsd*) gdb_target=nbsd ;;
397 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
398 sparc-*-sunos4*) gdb_target=sun4os4 ;;
399 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
400 sparc-*-vxworks*) gdb_target=vxsparc ;;
401 sparc-*-*) gdb_target=sun4os4 ;;
402 sparclite*-*-*) gdb_target=sparclite ;;
403 sparc64-*-*) gdb_target=sp64 ;;
405 tahoe-*-*) gdb_target=tahoe ;;
407 vax-*-*) gdb_target=vax ;;
409 w65-*-*) gdb_target=w65 ;;
411 z8k-*-coff*) gdb_target=z8k ;;
419 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
420 if test ! -f ${host_makefile_frag}; then
421 AC_MSG_ERROR("*** Gdb does not support host ${host}")
423 frags="$frags $host_makefile_frag"
425 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
426 if test ! -f ${target_makefile_frag}; then
427 AC_MSG_ERROR("*** Gdb does not support target ${target}")
429 frags="$frags $target_makefile_frag"
431 AC_SUBST_FILE(host_makefile_frag)
432 AC_SUBST_FILE(target_makefile_frag)
437 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
438 ' ${host_makefile_frag}`
441 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
442 ' ${target_makefile_frag}`
444 # these really aren't orthogonal true/false values of the same condition,
445 # but shells are slow enough that I like to reuse the test conditions
447 if test "${target}" = "${host}"; then
449 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
450 ' ${host_makefile_frag}`
452 # GDBserver is only useful in a "native" enviroment
453 configdirs=`echo $configdirs | sed 's/gdbserver//'`
457 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
458 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
459 # corresponding links. But we have to remove the xm.h files and tm.h
460 # files anyway, e.g. when switching from "configure host" to
466 if test "${hostfile}" != ""; then
467 files="${files} config/${gdb_host_cpu}/${hostfile}"
468 links="${links} xm.h"
471 if test "${targetfile}" != ""; then
472 files="${files} config/${gdb_target_cpu}/${targetfile}"
473 links="${links} tm.h"
476 if test "${nativefile}" != ""; then
477 files="${files} config/${gdb_host_cpu}/${nativefile}"
478 links="${links} nm.h"
480 # A cross-only configuration.
481 files="${files} config/nm-empty.h"
482 links="${links} nm.h"
484 # start-sanitize-gdbtk
486 # Make it possible to use the GUI without doing a full install
487 if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
488 files="${files} gdbtk.tcl"
489 links="${links} gdbtk.tcl"
493 AC_LINK_FILES($files, $links)
495 AC_CONFIG_SUBDIRS($configdirs)
498 dnl Autoconf doesn't provide a mechanism for modifying definitions
499 dnl provided by makefile fragments.
501 if test "${nativefile}" = ""; then
502 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
503 < Makefile > Makefile.tem
504 mv -f Makefile.tem Makefile
508 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
509 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
510 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
511 mv -f Makefile.tmp Makefile
518 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
519 echo "source ${srcdir}/.gdbinit" >> .gdbinit
523 gdb_host_cpu=$gdb_host_cpu
524 gdb_target_cpu=$gdb_target_cpu
525 nativefile=$nativefile