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