4b292c871a02872576ca13f975c8e62c8dde9e7c
[deliverable/binutils-gdb.git] / gdb / configure.in
1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
3 dnl
4 dnl This file is part of GDB.
5 dnl
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.
10 dnl
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.
15 dnl
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.
19
20 dnl Process this file with autoconf to produce a configure script.
21
22 AC_PREREQ(2.13)dnl
23 AC_INIT(main.c)
24 AC_CONFIG_HEADER(config.h:config.in)
25
26 AC_PROG_CC
27 AC_AIX
28 AC_ISC_POSIX
29 AM_PROG_CC_STDC
30
31 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
32 AC_CANONICAL_SYSTEM
33
34 dnl gdb doesn't use gettext, but bfd does. We call this to ensure we
35 dnl link with the correct libraries.
36 ALL_LINGUAS=
37 CY_GNU_GETTEXT
38
39 dnl List of object files added by configure.
40
41 CONFIG_OBS=
42 CONFIG_DEPS=
43 CONFIG_SRCS=
44
45 configdirs="doc testsuite"
46
47 dnl
48 changequote(,)dnl
49
50 . ${srcdir}/configure.host
51
52 . ${srcdir}/configure.tgt
53
54 dnl
55 changequote([,])dnl
56
57 AC_PROG_INSTALL
58 AC_CHECK_TOOL(AR, ar)
59 AC_CHECK_TOOL(RANLIB, ranlib, :)
60 AC_PROG_YACC
61
62 AC_ARG_PROGRAM
63
64 AC_TYPE_SIGNAL
65
66 AC_HEADER_STDC
67
68 AC_CHECK_HEADERS(ctype.h curses.h endian.h libintl.h link.h \
69 memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
70 string.h sys/procfs.h sys/ptrace.h sys/reg.h \
71 term.h termio.h termios.h unistd.h wait.h sys/wait.h \
72 wchar.h wctype.h asm/debugreg.h)
73 AC_HEADER_STAT
74
75 AC_C_CONST
76
77 AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc)
78 AC_FUNC_ALLOCA
79
80 BFD_NEED_DECLARATION(malloc)
81 BFD_NEED_DECLARATION(realloc)
82 BFD_NEED_DECLARATION(free)
83 BFD_NEED_DECLARATION(strerror)
84 BFD_NEED_DECLARATION(strdup)
85
86 # If we are configured native on GNU/Linux, work around problems with sys/procfs.h
87 if test "${target}" = "${host}"; then
88 case "${host}" in
89 i[[3456]]86-*-linux*)
90 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
91 AC_DEFINE(sys_quotactl)
92 ;;
93 esac
94 fi
95
96 AC_MSG_CHECKING([for gregset_t type])
97 AC_CACHE_VAL(gdb_cv_have_gregset_t,
98 [AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
99 gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
100 AC_MSG_RESULT($gdb_cv_have_gregset_t)
101 if test $gdb_cv_have_gregset_t = yes; then
102 AC_DEFINE(HAVE_GREGSET_T)
103 fi
104
105 AC_MSG_CHECKING([for fpregset_t type])
106 AC_CACHE_VAL(gdb_cv_have_fpregset_t,
107 [AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
108 gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
109 AC_MSG_RESULT($gdb_cv_have_fpregset_t)
110 if test $gdb_cv_have_fpregset_t = yes; then
111 AC_DEFINE(HAVE_FPREGSET_T)
112 fi
113
114 dnl See if host has libm. This is usually needed by simulators.
115 AC_CHECK_LIB(m, main)
116
117 dnl Solaris puts wctype in /usr/lib/libw.a before Solaris 2.6.
118 dnl
119 dnl A bug in GNU ld 2.9.1 causes a problem if we link in -lw
120 dnl under Solaris 2.6 because it is some funky empty library.
121 dnl So only link in libw if we have to.
122 AC_CHECK_LIB(c, wctype,: ,AC_CHECK_LIB(w, wctype))
123
124 dnl Figure out which term library to use.
125 if test x$gdb_cv_os_cygwin = xyes; then
126 TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
127 else
128 TERM_LIB=
129 AC_CHECK_LIB(ncurses, tgetent, TERM_LIB=-lncurses,
130 AC_CHECK_LIB(termlib, tgetent, TERM_LIB=-ltermlib,
131 AC_CHECK_LIB(termcap, tgetent, TERM_LIB=-ltermcap,
132 AC_CHECK_LIB(curses, tgetent, TERM_LIB=-lcurses,
133 AC_CHECK_LIB(terminfo, tgetent, TERM_LIB=-lterminfo)))))
134
135 if test "x$TERM_LIB" = x
136 then
137 AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
138 fi
139 fi
140
141 AC_SUBST(TERM_LIB)
142
143 dnl See if compiler supports "long long" type.
144
145 AC_MSG_CHECKING(for long long support in compiler)
146 AC_CACHE_VAL(gdb_cv_c_long_long,
147 [AC_TRY_COMPILE(, [
148 extern long long foo;
149 switch (foo & 2) { case 0: return 1; }
150 ],
151 gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
152 AC_MSG_RESULT($gdb_cv_c_long_long)
153 if test $gdb_cv_c_long_long = yes; then
154 AC_DEFINE(CC_HAS_LONG_LONG)
155 fi
156
157 dnl See if the compiler and runtime support printing long long
158
159 AC_MSG_CHECKING(for long long support in printf)
160 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
161 [AC_TRY_RUN([
162 int main () {
163 char buf[32];
164 long long l = 0;
165 l = (l << 16) + 0x0123;
166 l = (l << 16) + 0x4567;
167 l = (l << 16) + 0x89ab;
168 l = (l << 16) + 0xcdef;
169 sprintf (buf, "0x%016llx", l);
170 return (strcmp ("0x0123456789abcdef", buf));
171 }],
172 gdb_cv_printf_has_long_long=yes,
173 gdb_cv_printf_has_long_long=no,
174 gdb_cv_printf_has_long_long=no)])
175 if test $gdb_cv_printf_has_long_long = yes; then
176 AC_DEFINE(PRINTF_HAS_LONG_LONG)
177 fi
178 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
179
180 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
181 dnl because autoconf complains about cross-compilation issues. However, this
182 dnl code uses the same variables as the macro for compatibility.
183
184 AC_MSG_CHECKING(for long double support in compiler)
185 AC_CACHE_VAL(ac_cv_c_long_double,
186 [AC_TRY_COMPILE(, [long double foo;],
187 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
188 AC_MSG_RESULT($ac_cv_c_long_double)
189 if test $ac_cv_c_long_double = yes; then
190 AC_DEFINE(HAVE_LONG_DOUBLE)
191 fi
192
193 dnl See if the compiler and runtime support printing long doubles
194
195 AC_MSG_CHECKING(for long double support in printf)
196 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
197 [AC_TRY_RUN([
198 int main () {
199 char buf[16];
200 long double f = 3.141592653;
201 sprintf (buf, "%Lg", f);
202 return (strncmp ("3.14159", buf, 7));
203 }],
204 gdb_cv_printf_has_long_double=yes,
205 gdb_cv_printf_has_long_double=no,
206 gdb_cv_printf_has_long_double=no)])
207 if test $gdb_cv_printf_has_long_double = yes; then
208 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
209 fi
210 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
211
212 dnl See if the compiler and runtime support scanning long doubles
213
214 AC_MSG_CHECKING(for long double support in scanf)
215 AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
216 [AC_TRY_RUN([
217 int main () {
218 char *buf = "3.141592653";
219 long double f = 0;
220 sscanf (buf, "%Lg", &f);
221 return !(f > 3.14159 && f < 3.14160);
222 }],
223 gdb_cv_scanf_has_long_double=yes,
224 gdb_cv_scanf_has_long_double=no,
225 gdb_cv_scanf_has_long_double=no)])
226 if test $gdb_cv_scanf_has_long_double = yes; then
227 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
228 fi
229 AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
230
231 AC_FUNC_MMAP
232
233 dnl See if thread_db library is around for Solaris thread debugging. Note that
234 dnl we must explicitly test for version 1 of the library because version 0
235 dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
236
237 dnl Note that we only want this if we are both native (host == target), and
238 dnl not doing a canadian cross build (build == host).
239
240 if test ${build} = ${host} -a ${host} = ${target} ; then
241 case ${host_os} in
242 hpux*)
243 AC_MSG_CHECKING(for HPUX/OSF thread support)
244 if test -f /usr/include/dce/cma_config.h ; then
245 if test "$GCC" = "yes" ; then
246 AC_MSG_RESULT(yes)
247 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
248 CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
249 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
250 else
251 AC_MSG_RESULT(no (suppressed because you are not using GCC))
252 fi
253 else
254 AC_MSG_RESULT(no)
255 fi
256 ;;
257 solaris*)
258 AC_MSG_CHECKING(for Solaris thread debugging library)
259 if test -f /usr/lib/libthread_db.so.1 ; then
260 AC_MSG_RESULT(yes)
261 AC_DEFINE(HAVE_THREAD_DB_LIB)
262 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
263 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
264 AC_CHECK_LIB(dl, dlopen)
265 if test "$GCC" = "yes" ; then
266 # The GNU linker requires the -export-dynamic option to make
267 # all symbols visible in the dynamic symbol table.
268 hold_ldflags=$LDFLAGS
269 AC_MSG_CHECKING(for the ld -export-dynamic flag)
270 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
271 AC_TRY_LINK(, [int i;], found=yes, found=no)
272 LDFLAGS=$hold_ldflags
273 AC_MSG_RESULT($found)
274 if test $found = yes; then
275 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
276 fi
277 fi
278 # Sun randomly tweaked the prototypes in <proc_service.h>
279 # at one point.
280 AC_MSG_CHECKING(if <proc_service.h> is old)
281 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
282 AC_TRY_COMPILE([
283 #include <proc_service.h>
284 ps_err_e ps_pdwrite
285 (struct ps_prochandle*, psaddr_t, const void*, size_t);
286 ],, gdb_cv_proc_service_is_old=no,
287 gdb_cv_proc_service_is_old=yes)
288 ])
289 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
290 if test $gdb_cv_proc_service_is_old = yes; then
291 AC_DEFINE(PROC_SERVICE_IS_OLD)
292 fi
293 else
294 AC_MSG_RESULT(no)
295 fi
296 ;;
297 esac
298 AC_SUBST(CONFIG_LDFLAGS)
299 fi
300
301 dnl Handle optional features that can be enabled.
302 ENABLE_CFLAGS=
303
304 AC_ARG_ENABLE(tui,
305 [ --enable-tui Enable full-screen terminal user interface],
306 [
307 case "${enable_tui}" in
308 yes | no) ;;
309 "") enable_tui=yes ;;
310 *)
311 AC_MSG_ERROR(Bad value for --enable-tui: ${enableval})
312 ;;
313 esac
314 ])
315 case ${enable_tui} in
316 "yes" )
317 AC_DEFINE(TUI)
318 BUILD_TUI=all-tui
319 TUI_LIBRARY=tui/libtui.a
320 ;;
321 * )
322 BUILD_TUI=
323 TUI_LIBRARY=
324 ;;
325 esac
326 AC_SUBST(BUILD_TUI)
327 AC_SUBST(TUI_LIBRARY)
328
329 AC_ARG_ENABLE(netrom,
330 [ --enable-netrom Enable NetROM support],
331 [case "${enableval}" in
332 yes) enable_netrom=yes ;;
333 no) enable_netrom=no ;;
334 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
335 esac])
336
337 if test "${enable_netrom}" = "yes"; then
338 CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
339 CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
340 fi
341
342 AC_ARG_ENABLE(build-warnings,
343 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
344 [build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
345 case "${enableval}" in
346 yes) ;;
347 no) build_warnings="-w";;
348 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
349 build_warnings="${build_warnings} ${t}";;
350 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
351 build_warnings="${t} ${build_warnings}";;
352 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
353 esac],[build_warnings=""])dnl
354
355 if test "x${build_warnings}" != x -a "x$GCC" = xyes
356 then
357 WARN_CFLAGS="${build_warnings}"
358 else
359 WARN_CFLAGS=""
360 fi
361 AC_SUBST(WARN_CFLAGS)
362
363 MMALLOC_CFLAGS=
364 MMALLOC=
365 AC_SUBST(MMALLOC_CFLAGS)
366 AC_SUBST(MMALLOC)
367
368 AC_ARG_WITH(mmalloc,
369 [ --with-mmalloc Use memory mapped malloc package],
370 [case "${withval}" in
371 yes) want_mmalloc=true ;;
372 no) want_mmalloc=false;;
373 *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
374 esac],[want_mmalloc=false])dnl
375
376 if test x$want_mmalloc = xtrue; then
377 AC_DEFINE(USE_MMALLOC)
378 AC_DEFINE(MMCHECK_FORCE)
379 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
380 MMALLOC='../mmalloc/libmmalloc.a'
381 fi
382
383 # start-sanitize-carp
384 # The below takes an educated guess at the targets that
385 # should be built. It is an interum version that provides
386 # significant backward compatibility.
387
388 AC_ARG_ENABLE(carp,
389 [ --enable-carp Configure alternative readaptive paradigm ],
390 [case "${enableval}" in
391 yes) enable_carp=yes ;;
392 no) enable_carp=no ;;
393 *) AC_MSG_ERROR([bad value ${enableval} for carp option]) ;;
394 esac],[enable_carp=no])dnl
395
396 AC_ARG_ENABLE(targets,
397 [ --enable-targets alternative target configurations],
398 [case "${enableval}" in
399 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
400 ;;
401 no) enable_targets= ;;
402 *) enable_targets="$enableval" ;;
403 esac])dnl
404
405 # Canonicalize the secondary target names.
406 all_targets=false
407 if test -n "$enable_targets" ; then
408 if test "$enable_targets" = all ; then
409 all_targets=true
410 else
411 for targ in `echo $enable_targets | sed 's/,/ /g'`
412 do
413 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
414 if test -n "$result" ; then
415 canon_targets="$canon_targets $result"
416 fi
417 done
418 fi
419 fi
420
421 # Convert the target names into GDB [*]-tdep.c names
422 changequote(,)dnl
423 selarchs=
424 for targ in $target $canon_targets
425 do
426 if test "x$targ" = "xall" ; then
427 all_targets=true
428 else
429 t_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
430 t_vendor=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
431 t_os=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
432 mt=`
433 target=$targ
434 target_cpu=$t_cpu
435 target_vendor=$t_vendor
436 target_os=$t_os
437 . ${srcdir}/configure.tgt
438 echo ${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt`
439 if test -r ${mt} ; then
440 # This gets confused over .mt files that have multiple -tdep.o
441 tdep=`sed -n '
442 s/^.*[ =]\([^ ]*\)-tdep.o.*/\1/p
443 ' $mt`
444 selarchs="$selarchs $tdep"
445 fi
446 fi
447 done
448 changequote([,])dnl
449
450 # We don't do any links based on the target system, just makefile config.
451
452 if test x${all_targets} = xfalse ; then
453
454 # Target architecture .o files.
455 ta=
456
457 for arch in $selarchs
458 do
459 archdefs="$archdefs -DARCH_$arch"
460 ta="$ta ${arch}-tdep.o"
461 # Special cases
462 case "$arch" in
463 dvp) ta="$ta mips-tdep.o dvp-tdep.o" ;;
464 esac
465 done
466
467 # Weed out duplicate .o files.
468 f=""
469 for i in $ta ; do
470 case " $f " in
471 *" $i "*) ;;
472 *) f="$f $i" ;;
473 esac
474 done
475 ta="$f"
476
477 # And duplicate -D flags.
478 f=""
479 for i in $archdefs ; do
480 case " $f " in
481 *" $i "*) ;;
482 *) f="$f $i" ;;
483 esac
484 done
485 archdefs="$f"
486
487 MACHINE_OBS="$ta"
488
489 else # all_targets is true
490 archdefs=-DARCH_all
491 MACHINE_OBS='$(ALL_MACHINES)'
492 fi
493
494 dnl Don't define an archdefs list
495 dnl AC_SUBST(archdefs)
496 dnl XXXX this name will change several more times
497 if test "${enable_carp}" = yes ; then
498 gdb_target=carp
499 gdb_target_cpu=carp
500 else
501 MACHINE_OBS="# $MACHINE_OBS"
502 fi
503 AC_SUBST(MACHINE_OBS)
504
505 # end-sanitize-carp
506 # start-sanitize-gdbtk
507 # start-sanitize-ide
508 ENABLE_IDE=
509 AC_ARG_ENABLE(ide, [ --enable-ide Enable IDE support])
510 if test "$enable_ide" = yes; then
511 enable_ide=yes
512 ENABLE_IDE=1
513 else
514 enable_ide=no
515 fi
516 AC_SUBST(ENABLE_IDE)
517
518 AC_ARG_WITH(foundry-libs,
519 [ --with-foundry-libs=DIR Use the Foundry SDK in DIR],
520 [FOUNDRY_LIB_BASE=${withval}])
521 AC_SUBST(FOUNDRY_LIB_BASE)
522
523 #
524 # This is the Foundry SDK
525 #
526 # These variables are used to determine where the Foundry libs and
527 # header files are located.
528 #
529 if test "$FOUNDRY_LIB_BASE" != ""; then
530 LIBGUI="${FOUNDRY_LIB_BASE}/lib/libgui.a"
531 GUI_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include"
532 if test x$enable_ide = xyes; then
533 IDE_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include -DIDE"
534 IDE_X="-L${FOUNDRY_LIB_BASE}/lib -lilu-Tk -lilu-c -lilu"
535 else
536 IDE_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include"
537 fi
538 LIBIDETCL="${FOUNDRY_LIB_BASE}/lib/libidetcl.a"
539 LIBIDE="${FOUNDRY_LIB_BASE}/lib/libide.a"
540 IDE_DEPS="${FOUNDRY_LIB_BASE}/lib/libilu-Tk.a ${FOUNDRY_LIB_BASE}/lib/libilu-c.a ${FOUNDRY_LIB_BASE}/lib/libilu.a"
541 else
542 # end-sanitize-ide
543 LIBGUI="../libgui/src/libgui.a"
544 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
545 # start-sanitize-ide
546 if test x$enable_ide = xyes; then
547 IDE_CFLAGS_X="-I${srcdir}/../libidetcl/src -I${srcdir}/../libide/src -DIDE -I${srcdir}/../ilu/runtime/mainloop"
548 IDE_X="-L../ilu/runtime/mainloop -lilu-Tk -L../ilu/runtime/c -lilu-c -L../ilu/runtime/kernel -lilu"
549 else
550 IDE_CFLAGS_X="-I${srcdir}/../libidetcl/src -I${srcdir}/../libide/src"
551 fi
552 LIBIDETCL="../libidetcl/src/libidetcl.a"
553 LIBIDE="../libide/src/libide.a"
554 IDE_DEPS="../ilu/runtime/mainloop/libilu-Tk.a ../ilu/runtime/c/libilu-c.a ../ilu/runtime/kernel/libilu.a"
555 fi
556
557 # end-sanitize-ide
558 AC_SUBST(LIBGUI)
559 AC_SUBST(GUI_CFLAGS_X)
560 # start-sanitize-ide
561 AC_SUBST(IDE_CFLAGS_X)
562 AC_SUBST(IDE_X)
563 AC_SUBST(LIBIDETCL)
564 AC_SUBST(LIBIDE)
565 AC_SUBST(IDE_DEPS)
566 # end-sanitize-ide
567
568
569 AC_ARG_WITH(cpu,
570 [ --with-cpu=CPU set the default CPU variant to debug],
571 [case "${target}" in
572 powerpc-* | powerpcle-* )
573 ## It would be nice to keep this table in sync with the one in
574 ## gcc/configure.
575 case "${with_cpu}" in
576 ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
577 | 604 | 750 )
578 ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
579 ;;
580 common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
581 ## These are all RS6000 variants, as far as GDB is concerned.
582 with_cpu=rs6000
583 ;;
584 603e | ec603e )
585 with_cpu=603
586 ;;
587 604e )
588 with_cpu=604
589 ;;
590 * )
591 AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
592 with_cpu=ppc-uisa
593 ;;
594 esac
595 ;;
596 * )
597 AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
598 ;;
599 esac
600 AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
601 ],)
602
603
604 ENABLE_GDBTK=
605
606 AC_ARG_ENABLE(gdbtk,
607 [ --enable-gdbtk Enable GDBTK GUI front end],
608 [case "${enableval}" in
609 yes)
610 case "$host" in
611 *go32*)
612 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
613 enable_gdbtk=no ;;
614 *windows*)
615 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
616 enable_gdbtk=no ;;
617 *)
618 enable_gdbtk=yes ;;
619 esac ;;
620 no)
621 enable_gdbtk=no ;;
622 *)
623 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
624 esac],
625 [
626 # Default is on for everything but go32 and Cygwin
627 case "$host" in
628 *go32* | *windows*)
629 ;;
630 *)
631 enable_gdbtk=yes ;;
632 esac
633 ])
634
635 # In the Cygwin environment, we need some additional flags.
636 AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
637 [AC_EGREP_CPP(lose, [
638 #ifdef __CYGWIN32__
639 lose
640 #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
641
642 WIN32LIBS=
643 WIN32LDAPP=
644 AC_SUBST(WIN32LIBS)
645 AC_SUBST(WIN32LDAPP)
646
647 DLLTOOL=${DLLTOOL-dlltool}
648 WINDRES=${WINDRES-windres}
649 AC_SUBST(DLLTOOL)
650 AC_SUBST(WINDRES)
651
652 if test x$gdb_cv_os_cygwin = xyes; then
653 WIN32LIBS="-luser32"
654 if test x$enable_ide = xyes; then
655 WIN32LIBS="$WIN32LIBS -ladvapi32"
656 fi
657 fi
658
659 configdir="unix"
660
661 GDBTKLIBS=
662 if test "${enable_gdbtk}" = "yes"; then
663
664 CY_AC_PATH_TCLCONFIG
665 if test -z "${no_tcl}"; then
666 CY_AC_LOAD_TCLCONFIG
667 CY_AC_PATH_TKCONFIG
668
669 # If $no_tk is nonempty, then we can't do Tk, and there is no
670 # point to doing Tcl.
671 if test -z "${no_tk}"; then
672 CY_AC_LOAD_TKCONFIG
673 CY_AC_PATH_TCLH
674 CY_AC_PATH_TKH
675 CY_AC_PATH_ITCLH
676 CY_AC_PATH_ITKH
677 CY_AC_PATH_TIX
678
679 # now look for Itcl library stuff
680
681 CY_AC_PATH_ITCLCONFIG
682 if test -z "${no_itcl}"; then
683 CY_AC_LOAD_ITCLCONFIG
684 case "${host}" in
685 *-*-cygwin32*)
686 itcldir=../itcl/itcl/win/
687 ;;
688 *)
689 itcldir=../itcl/itcl/unix/
690 ;;
691 esac
692
693
694 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
695 ITCL_DEPS="${itcldir}${ITCL_LIB_FILE}"
696 fi
697
698
699 # now look for Itk library stuff
700 CY_AC_PATH_ITKCONFIG
701 if test -z "${no_itcl}"; then
702 CY_AC_LOAD_ITKCONFIG
703
704 case "${host}" in
705 *-*-cygwin32*)
706 itkdir=../itcl/itk/win/
707 ;;
708 *)
709 itkdir=../itcl/itk/unix/
710 ;;
711 esac
712
713 ITKLIB="${ITK_BUILD_LIB_SPEC}"
714 ITK_DEPS="${itkdir}${ITK_LIB_FILE}"
715 fi
716
717 # now look for tix library stuff
718 TIXVERSION=4.1.8.0
719 . ${ac_cv_c_tclconfig}/tclConfig.sh
720 case "${host}" in
721 *-*-cygwin*)
722 tixdir=../tix/win/tcl8.0
723 ;;
724 *)
725 tixdir=../tix/unix/tk8.0
726 ;;
727 esac
728 if test "${TCL_SHARED_BUILD}" = "1"; then
729 TIX_LIB_EXT="${TCL_SHLIB_SUFFIX}"
730
731 # Can't win them all: SunOS 4 (others?) appends a version
732 # number after the ".so"
733 case "${host}" in
734 *-*-sunos4*)
735 TIX_LIB_EXT="${TIX_LIB_EXT}.1.0" ;;
736 esac
737
738 else
739 TIX_LIB_EXT=".a"
740 fi
741
742 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
743 TIXLIB="-L${tixdir} -ltix${TIXVERSION}"
744 TIX_DEPS="${tixdir}/libtix${TIXVERSION}${TIX_LIB_EXT}"
745 else
746 TIXLIB="-L${tixdir} -ltix`echo ${TIXVERSION} | tr -d .`"
747 TIX_DEPS="${tixdir}/libtix`echo ${TIXVERSION} | tr -d .`${TIX_LIB_EXT}"
748 fi
749
750 ENABLE_GDBTK=1
751 ENABLE_CFLAGS="${ENABLE_CFLAGS} -DGDBTK"
752
753 # Include some libraries that Tcl and Tk want.
754 if test "${enable_ide}" = "yes"; then
755 TCL_LIBS='$(LIBIDETCL) $(LIBIDE) $(LIBGUI) $(IDE) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
756 CONFIG_DEPS='$(LIBIDETCL) $(LIBIDE) $(LIBGUI) $(IDE_DEPS) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)'
757 else
758 TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
759 CONFIG_DEPS='$(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)'
760 fi
761 # Yes, the ordering seems wrong here. But it isn't.
762 # TK_LIBS is the list of libraries that need to be linked
763 # after Tcl/Tk. Note that this isn't put into LIBS. If it
764 # were in LIBS then any link tests after this point would
765 # try to include things like `$(LIBGUI)', which wouldn't work.
766 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
767 CONFIG_OBS="${CONFIG_OBS} gdbtk.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-variable.o gdbtk-wrapper.o"
768
769 if test x$gdb_cv_os_cygwin = xyes; then
770 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
771 WIN32LDAPP="-Wl,--subsystem,console"
772 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
773 fi
774 fi
775 fi
776 fi
777
778 AC_SUBST(ENABLE_GDBTK)
779 AC_SUBST(X_CFLAGS)
780 AC_SUBST(X_LDFLAGS)
781 AC_SUBST(X_LIBS)
782 AC_SUBST(ITCLLIB)
783 AC_SUBST(ITCL_DEPS)
784 AC_SUBST(ITKLIB)
785 AC_SUBST(ITK_DEPS)
786 AC_SUBST(TIXLIB)
787 AC_SUBST(TIX_DEPS)
788 AC_SUBST(GDBTKLIBS)
789 # end-sanitize-gdbtk
790
791 AC_PATH_X
792 # start-sanitize-sky
793 # Enable GPU2 library for MIPS simulator
794 AC_ARG_WITH(sim-gpu2,
795 [ --with-sim-gpu2=DIR Use GPU2 library under given DIR],
796 [case "${target}" in
797 mips*-sky*-*)
798 if test -d "${withval}"
799 then
800 if test x${x_libraries} != x
801 then
802 LIBS="${LIBS} -L${withval}/lib -lgpu2 -L${x_libraries} -lX11 -lXext -lm"
803 else
804 LIBS="${LIBS} -L${withval}/lib -lgpu2 -lX11 -lXext -lm"
805 fi
806 else
807 AC_MSG_WARN([Directory ${withval} does not exist.])
808 fi ;;
809 *) AC_MSG_WARN([--with-sim-gpu2 option invalid for target ${target}])
810 esac])dnl
811
812 # Enable target accurate FP library
813 AC_ARG_WITH(sim-funit,
814 [ --with-sim-funit=DIR Use target FP lib under given DIR],
815 [case "${target}" in
816 mips*-sky*-*)
817 if test -d "${withval}"
818 then
819 LIBS="${LIBS} -L${withval}/lib -lfunit"
820 else
821 AC_MSG_WARN([Directory ${withval} does not exist.])
822 fi ;;
823 *) AC_MSG_WARN([--with-sim-funit option invalid for target ${target}])
824 esac])dnl
825 # end-sanitize-sky
826
827 AC_SUBST(ENABLE_CFLAGS)
828
829 AC_SUBST(CONFIG_OBS)
830 AC_SUBST(CONFIG_DEPS)
831 AC_SUBST(CONFIG_SRCS)
832
833 # Begin stuff to support --enable-shared
834 AC_ARG_ENABLE(shared,
835 [ --enable-shared Use shared libraries],
836 [case "${enableval}" in
837 yes) shared=true ;;
838 no) shared=false ;;
839 *) shared=true ;;
840 esac])dnl
841
842 HLDFLAGS=
843 HLDENV=
844 # If we have shared libraries, try to set rpath reasonably.
845 if test "${shared}" = "true"; then
846 case "${host}" in
847 *-*-hpux*)
848 HLDFLAGS='-Wl,+s,+b,$(libdir)'
849 ;;
850 *-*-irix5* | *-*-irix6*)
851 HLDFLAGS='-Wl,-rpath,$(libdir)'
852 ;;
853 *-*-linux*aout*)
854 ;;
855 *-*-linux* | *-pc-linux-gnu)
856 HLDFLAGS='-Wl,-rpath,$(libdir)'
857 ;;
858 *-*-solaris*)
859 HLDFLAGS='-R $(libdir)'
860 ;;
861 *-*-sysv4*)
862 HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
863 ;;
864 esac
865 fi
866
867 # On SunOS, if the linker supports the -rpath option, use it to
868 # prevent ../bfd and ../opcodes from being included in the run time
869 # search path.
870 case "${host}" in
871 *-*-sunos*)
872 echo 'main () { }' > conftest.c
873 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
874 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
875 :
876 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
877 :
878 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
879 :
880 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
881 :
882 elif test "${shared}" = "true"; then
883 HLDFLAGS='-Wl,-rpath=$(libdir)'
884 else
885 HLDFLAGS='-Wl,-rpath='
886 fi
887 rm -f conftest.t conftest.c conftest
888 ;;
889 esac
890 AC_SUBST(HLDFLAGS)
891 AC_SUBST(HLDENV)
892 # End stuff to support --enable-shared
893
894 # target_subdir is used by the testsuite to find the target libraries.
895 target_subdir=
896 if test "${host}" != "${target}"; then
897 target_subdir="${target_alias}/"
898 fi
899 AC_SUBST(target_subdir)
900
901 frags=
902 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
903 if test ! -f ${host_makefile_frag}; then
904 AC_MSG_ERROR("*** Gdb does not support host ${host}")
905 fi
906 frags="$frags $host_makefile_frag"
907
908 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
909 if test ! -f ${target_makefile_frag}; then
910 AC_MSG_ERROR("*** Gdb does not support target ${target}")
911 fi
912 frags="$frags $target_makefile_frag"
913
914 AC_SUBST_FILE(host_makefile_frag)
915 AC_SUBST_FILE(target_makefile_frag)
916 AC_SUBST(frags)
917
918 changequote(,)dnl
919 hostfile=`sed -n '
920 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
921 ' ${host_makefile_frag}`
922
923 targetfile=`sed -n '
924 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
925 ' ${target_makefile_frag}`
926
927 # these really aren't orthogonal true/false values of the same condition,
928 # but shells are slow enough that I like to reuse the test conditions
929 # whenever possible
930 if test "${target}" = "${host}"; then
931 nativefile=`sed -n '
932 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
933 ' ${host_makefile_frag}`
934 # else
935 # GDBserver is only useful in a "native" enviroment
936 # configdirs=`echo $configdirs | sed 's/gdbserver//'`
937 fi
938 changequote([,])
939
940 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
941 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
942 # corresponding links. But we have to remove the xm.h files and tm.h
943 # files anyway, e.g. when switching from "configure host" to
944 # "configure none".
945
946 files=
947 links=
948 rm -f xm.h
949 if test "${hostfile}" != ""; then
950 files="${files} config/${gdb_host_cpu}/${hostfile}"
951 links="${links} xm.h"
952 fi
953 rm -f tm.h
954 if test "${targetfile}" != ""; then
955 files="${files} config/${gdb_target_cpu}/${targetfile}"
956 links="${links} tm.h"
957 fi
958 rm -f nm.h
959 if test "${nativefile}" != ""; then
960 files="${files} config/${gdb_host_cpu}/${nativefile}"
961 links="${links} nm.h"
962 else
963 # A cross-only configuration.
964 files="${files} config/nm-empty.h"
965 links="${links} nm.h"
966 fi
967 # start-sanitize-gdbtk
968 AC_PROG_LN_S
969 # Make it possible to use the GUI without doing a full install
970 if test "${enable_gdbtk}" = "yes" -a ! -d gdbtcl2 ; then
971 if test "$LN_S" = "ln -s" -a ! -f gdbtcl2 ; then
972 echo linking $srcdir/gdbtcl2 to gdbtcl2
973 $LN_S $srcdir/gdbtcl2 gdbtcl2
974 else
975 echo Warning: Unable to link $srcdir/gdbtcl2 to gdbtcl2. You will need to do a
976 echo " " make install before you are able to run the GUI.
977 fi
978 fi
979 # end-sanitize-gdbtk
980
981 AC_LINK_FILES($files, $links)
982
983 dnl Check for exe extension set on certain hosts (e.g. Win32)
984 AC_EXEEXT
985
986 AC_CONFIG_SUBDIRS($configdirs)
987 AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in,
988 [
989 dnl Autoconf doesn't provide a mechanism for modifying definitions
990 dnl provided by makefile fragments.
991 dnl
992 if test "${nativefile}" = ""; then
993 sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
994 < Makefile > Makefile.tem
995 mv -f Makefile.tem Makefile
996 fi
997
998 changequote(,)dnl
999 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
1000 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
1001 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
1002 mv -f Makefile.tmp Makefile
1003 changequote([,])dnl
1004
1005 case x$CONFIG_HEADERS in
1006 xconfig.h:config.in)
1007 echo > stamp-h ;;
1008 esac
1009 ],
1010 [
1011 gdb_host_cpu=$gdb_host_cpu
1012 gdb_target_cpu=$gdb_target_cpu
1013 nativefile=$nativefile
1014 ])
1015
1016 exit 0
This page took 0.051276 seconds and 4 git commands to generate.