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