Only install GDBtk files when GDBtk is being built.
[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 CONFIG_INITS=
45 ENABLE_CFLAGS=
46 CONFIG_INSTALL=
47 CONFIG_UNINSTALL=
48
49 configdirs="doc testsuite"
50
51 AC_ARG_ENABLE(multi-ice,
52 [ --enable-multi-ice Build the multi-ice-gdb-server],
53 [case "${enableval}" in
54 yes ) enable_multi_ice="yes" ;;
55 no) enable_multi_ice="no" ;;
56 *) AC_MSG_ERROR(Bad value for --enable-multi-ice: ${enableval}) ;;
57 esac
58 ])
59
60 if test "${enable_multi_ice}" = "yes"; then
61 configdirs="${configdirs} multi-ice"
62 fi
63
64 dnl
65 changequote(,)dnl
66
67 . ${srcdir}/configure.host
68
69 . ${srcdir}/configure.tgt
70
71 dnl
72 changequote([,])dnl
73
74 AC_PROG_AWK
75 AC_PROG_INSTALL
76 AC_CHECK_TOOL(AR, ar)
77 AC_CHECK_TOOL(RANLIB, ranlib, :)
78 AC_PROG_YACC
79
80 AC_ARG_PROGRAM
81
82 AC_TYPE_SIGNAL
83
84 AC_HEADER_STDC
85
86 AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h thread_db.h proc_service.h \
87 memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
88 string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
89 term.h termio.h termios.h unistd.h wait.h sys/wait.h \
90 wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
91 time.h sys/ioctl.h)
92 AC_HEADER_STAT
93
94 AC_C_CONST
95
96 AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
97 AC_FUNC_ALLOCA
98
99 dnl See if ptrace.h provides the PTRACE_GETXFPREGS request.
100 dnl PTRACE_GETXFPREGS is a Cygnus invention, since we wrote our own
101 dnl Linux kernel patch for SSE support. That patch may or may not
102 dnl actually make it into the official distribution. If you find that
103 dnl years have gone by since this configure test was added, and Linux
104 dnl isn't using PTRACE_GETXFPREGS, that means that our patch didn't
105 dnl make it, and you can delete this code.
106 AC_MSG_CHECKING(for PTRACE_GETXFPREGS)
107 AC_CACHE_VAL(gdb_cv_have_ptrace_getxfpregs,
108 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
109 [PTRACE_GETXFPREGS;],
110 [gdb_cv_have_ptrace_getxfpregs=yes],
111 [gdb_cv_have_ptrace_getxfpregs=no])])
112 AC_MSG_RESULT($gdb_cv_have_ptrace_getxfpregs)
113 if test $gdb_cv_have_ptrace_getxfpregs = yes; then
114 AC_DEFINE(HAVE_PTRACE_GETXFPREGS)
115 fi
116
117 AC_CHECK_LIB(socket, socketpair)
118 AC_CHECK_FUNCS(socketpair)
119
120
121 BFD_NEED_DECLARATION(malloc)
122 BFD_NEED_DECLARATION(realloc)
123 BFD_NEED_DECLARATION(free)
124 BFD_NEED_DECLARATION(strerror)
125 BFD_NEED_DECLARATION(strdup)
126 BFD_NEED_DECLARATION(strstr)
127
128
129 # The following save_state_t checkery is only necessary for HPUX
130 # versions earlier than 10.20. When those fade from memory, this
131 # could be expunged. --jsm 1999-03-22
132
133 AC_MSG_CHECKING(for HPUX save_state structure)
134 AC_EGREP_HEADER(save_state_t, machine/save_state.h,
135 gdb_cv_hpux_savestate=yes, gdb_cv_hpux_savestate=no)
136 AC_EGREP_HEADER(ss_wide, machine/save_state.h, gdb_cv_hpux_sswide=yes,
137 gdb_cv_hpux_sswide=no)
138 if test $gdb_cv_hpux_savestate = yes
139 then
140 AC_DEFINE(HAVE_STRUCT_SAVE_STATE_T, 1)
141 fi
142 if test $gdb_cv_hpux_sswide = yes
143 then
144 AC_DEFINE(HAVE_STRUCT_MEMBER_SS_WIDE, 1)
145 fi
146 AC_MSG_RESULT($gdb_cv_hpux_sswide)
147
148
149 # If we are configured native on GNU/Linux, work around problems with
150 # sys/procfs.h
151 # Also detect which type of /proc is in use, such as for Unixware or Solaris.
152
153 if test "${target}" = "${host}"; then
154 case "${host}" in
155 i[[3456]]86-*-linux*)
156 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
157 AC_DEFINE(sys_quotactl)
158 ;;
159 *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
160 AC_DEFINE(NEW_PROC_API)
161 ;;
162 # FIXME: we would like to define NEW_PROC_API for all versions of
163 # Solaris from 2.6 on... but it isn't quite working yet. Seems
164 # to work on sparc 2.6, so let's try it out there.
165 sparc-sun-solaris2.6)
166 AC_DEFINE(NEW_PROC_API)
167 ;;
168 esac
169 fi
170
171 if test "$ac_cv_header_sys_procfs_h" = yes; then
172 BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
173 BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
174 BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
175 BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
176 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
177 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
178 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
179 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
180
181 dnl Check for PIOCSET ioctl entry
182
183 AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h)
184 AC_CACHE_VAL(gdb_cv_have_procfs_piocset,
185 [AC_TRY_COMPILE([#include <unistd.h>
186 #include <sys/types.h>
187 #include <sys/procfs.h>
188 ], [
189 int dummy;;
190 dummy = ioctl(0, PIOCSET, &dummy);
191 ],
192 gdb_cv_have_procfs_piocset=yes, gdb_cv_have_procfs_piocset=no)])
193 AC_MSG_RESULT($gdb_cv_have_procfs_piocset)
194 if test $gdb_cv_have_procfs_piocset = yes; then
195 AC_DEFINE(HAVE_PROCFS_PIOCSET)
196 fi
197 fi
198
199 dnl See if host has libm. This is usually needed by simulators.
200 AC_CHECK_LIB(m, main)
201
202 dnl Solaris puts wctype in /usr/lib/libw.a before Solaris 2.6.
203 dnl
204 dnl A bug in GNU ld 2.9.1 causes a problem if we link in -lw
205 dnl under Solaris 2.6 because it is some funky empty library.
206 dnl So only link in libw if we have to.
207 AC_CHECK_LIB(c, wctype,: ,AC_CHECK_LIB(w, wctype))
208
209 dnl See if compiler supports "long long" type.
210
211 AC_MSG_CHECKING(for long long support in compiler)
212 AC_CACHE_VAL(gdb_cv_c_long_long,
213 [AC_TRY_COMPILE(, [
214 extern long long foo;
215 switch (foo & 2) { case 0: return 1; }
216 ],
217 gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
218 AC_MSG_RESULT($gdb_cv_c_long_long)
219 if test $gdb_cv_c_long_long = yes; then
220 AC_DEFINE(CC_HAS_LONG_LONG)
221 fi
222
223 dnl See if the compiler and runtime support printing long long
224
225 AC_MSG_CHECKING(for long long support in printf)
226 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
227 [AC_TRY_RUN([
228 int main () {
229 char buf[32];
230 long long l = 0;
231 l = (l << 16) + 0x0123;
232 l = (l << 16) + 0x4567;
233 l = (l << 16) + 0x89ab;
234 l = (l << 16) + 0xcdef;
235 sprintf (buf, "0x%016llx", l);
236 return (strcmp ("0x0123456789abcdef", buf));
237 }],
238 gdb_cv_printf_has_long_long=yes,
239 gdb_cv_printf_has_long_long=no,
240 gdb_cv_printf_has_long_long=no)])
241 if test $gdb_cv_printf_has_long_long = yes; then
242 AC_DEFINE(PRINTF_HAS_LONG_LONG)
243 fi
244 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
245
246 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
247 dnl because autoconf complains about cross-compilation issues. However, this
248 dnl code uses the same variables as the macro for compatibility.
249
250 AC_MSG_CHECKING(for long double support in compiler)
251 AC_CACHE_VAL(ac_cv_c_long_double,
252 [AC_TRY_COMPILE(, [long double foo;],
253 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
254 AC_MSG_RESULT($ac_cv_c_long_double)
255 if test $ac_cv_c_long_double = yes; then
256 AC_DEFINE(HAVE_LONG_DOUBLE)
257 fi
258
259 dnl See if the compiler and runtime support printing long doubles
260
261 AC_MSG_CHECKING(for long double support in printf)
262 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
263 [AC_TRY_RUN([
264 int main () {
265 char buf[16];
266 long double f = 3.141592653;
267 sprintf (buf, "%Lg", f);
268 return (strncmp ("3.14159", buf, 7));
269 }],
270 gdb_cv_printf_has_long_double=yes,
271 gdb_cv_printf_has_long_double=no,
272 gdb_cv_printf_has_long_double=no)])
273 if test $gdb_cv_printf_has_long_double = yes; then
274 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
275 fi
276 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
277
278 dnl See if the compiler and runtime support scanning long doubles
279
280 AC_MSG_CHECKING(for long double support in scanf)
281 AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
282 [AC_TRY_RUN([
283 int main () {
284 char *buf = "3.141592653";
285 long double f = 0;
286 sscanf (buf, "%Lg", &f);
287 return !(f > 3.14159 && f < 3.14160);
288 }],
289 gdb_cv_scanf_has_long_double=yes,
290 gdb_cv_scanf_has_long_double=no,
291 gdb_cv_scanf_has_long_double=no)])
292 if test $gdb_cv_scanf_has_long_double = yes; then
293 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
294 fi
295 AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
296
297 AC_FUNC_MMAP
298
299 dnl See if thread_db library is around for Solaris thread debugging. Note that
300 dnl we must explicitly test for version 1 of the library because version 0
301 dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
302
303 dnl Note that we only want this if we are both native (host == target), and
304 dnl not doing a canadian cross build (build == host).
305
306 if test ${build} = ${host} -a ${host} = ${target} ; then
307 case ${host_os} in
308 hpux*)
309 AC_MSG_CHECKING(for HPUX/OSF thread support)
310 if test -f /usr/include/dce/cma_config.h ; then
311 if test "$GCC" = "yes" ; then
312 AC_MSG_RESULT(yes)
313 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
314 CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
315 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
316 CONFIG_INITS="${CONFIG_INITS} hpux-thread.c"
317 else
318 AC_MSG_RESULT(no (suppressed because you are not using GCC))
319 fi
320 else
321 AC_MSG_RESULT(no)
322 fi
323 ;;
324 solaris*)
325 AC_MSG_CHECKING(for Solaris thread debugging library)
326 if test -f /usr/lib/libthread_db.so.1 ; then
327 AC_MSG_RESULT(yes)
328 AC_DEFINE(HAVE_THREAD_DB_LIB)
329 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
330 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
331 AC_CHECK_LIB(dl, dlopen)
332 if test "$GCC" = "yes" ; then
333 # The GNU linker requires the -export-dynamic option to make
334 # all symbols visible in the dynamic symbol table.
335 hold_ldflags=$LDFLAGS
336 AC_MSG_CHECKING(for the ld -export-dynamic flag)
337 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
338 AC_TRY_LINK(, [int i;], found=yes, found=no)
339 LDFLAGS=$hold_ldflags
340 AC_MSG_RESULT($found)
341 if test $found = yes; then
342 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
343 fi
344 fi
345 # Sun randomly tweaked the prototypes in <proc_service.h>
346 # at one point.
347 AC_MSG_CHECKING(if <proc_service.h> is old)
348 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
349 AC_TRY_COMPILE([
350 #include <proc_service.h>
351 ps_err_e ps_pdwrite
352 (struct ps_prochandle*, psaddr_t, const void*, size_t);
353 ],, gdb_cv_proc_service_is_old=no,
354 gdb_cv_proc_service_is_old=yes)
355 ])
356 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
357 if test $gdb_cv_proc_service_is_old = yes; then
358 AC_DEFINE(PROC_SERVICE_IS_OLD)
359 fi
360 else
361 AC_MSG_RESULT(no)
362 fi
363 ;;
364 esac
365 AC_SUBST(CONFIG_LDFLAGS)
366 fi
367
368 dnl Handle optional features that can be enabled.
369
370 dnl Handle MI sub-directory configury.
371 AC_ARG_ENABLE(gdbmi,
372 [ --enable-gdbmi Enable GDB-MI interface],
373 [
374 case "${enable_gdbmi}" in
375 yes | no) ;;
376 "") enable_gdbmi=yes ;;
377 *)
378 AC_MSG_ERROR(Bad value for --enable-gdbmi: ${enableval})
379 ;;
380 esac
381 ])
382 case ${enable_gdbmi} in
383 "yes" )
384 if test -d "${srcdir}/mi" ; then
385 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_MI_OBS)"
386 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_MI_DEPS)"
387 CONFIG_SRCS="${CONFIG_SRS} \$(SUBDIR_MI_SRCS)"
388 CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_MI_INITS)"
389 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_MI_CFLAGS)"
390 CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_MI_INSTALL)"
391 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_MI_UNINSTALL)"
392 fi
393 ;;
394 esac
395
396 AC_ARG_ENABLE(tui,
397 [ --enable-tui Enable full-screen terminal user interface],
398 [
399 case "${enable_tui}" in
400 yes | no) ;;
401 "") enable_tui=yes ;;
402 *)
403 AC_MSG_ERROR(Bad value for --enable-tui: ${enableval})
404 ;;
405 esac
406 ])
407 case ${enable_tui} in
408 "yes" )
409 AC_DEFINE(TUI)
410 BUILD_TUI=all-tui
411 TUI_LIBRARY=tui/libtui.a
412 ;;
413 * )
414 BUILD_TUI=
415 TUI_LIBRARY=
416 ;;
417 esac
418 AC_SUBST(BUILD_TUI)
419 AC_SUBST(TUI_LIBRARY)
420
421 AC_ARG_ENABLE(netrom,
422 [ --enable-netrom Enable NetROM support],
423 [case "${enableval}" in
424 yes) enable_netrom=yes ;;
425 no) enable_netrom=no ;;
426 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
427 esac])
428
429 if test "${enable_netrom}" = "yes"; then
430 CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
431 CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
432 CONFIG_INITS="${CONFIG_INITS} remote-nrom.c"
433 fi
434
435 AC_ARG_ENABLE(build-warnings,
436 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
437 [
438 # not yet: -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
439 build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith"
440 case "${enableval}" in
441 yes) ;;
442 no) build_warnings="-w";;
443 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
444 build_warnings="${build_warnings} ${t}";;
445 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
446 build_warnings="${t} ${build_warnings}";;
447 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
448 esac
449 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
450 echo "Setting warning flags = $build_warnings" 6>&1
451 fi
452 WARN_CFLAGS=""
453 WERROR_CFLAGS=""
454 if test "x${build_warnings}" != x -a "x$GCC" = xyes
455 then
456 # Separate out the -Werror flag as some files just cannot be
457 # compiled with it enabled.
458 for w in ${build_warnings}; do
459 case $w in
460 -Werr*) WERROR_CFLAGS=-Werror ;;
461 *) WARN_CFLAGS="${WARN_CFLAGS} $w"
462 esac
463 done
464 fi],[build_warnings=""])dnl
465
466 AC_SUBST(WARN_CFLAGS)
467 AC_SUBST(WERROR_CFLAGS)
468
469 MMALLOC_CFLAGS=
470 MMALLOC=
471 AC_SUBST(MMALLOC_CFLAGS)
472 AC_SUBST(MMALLOC)
473
474 AC_ARG_WITH(mmalloc,
475 [ --with-mmalloc Use memory mapped malloc package],
476 [case "${withval}" in
477 yes) want_mmalloc=true ;;
478 no) want_mmalloc=false;;
479 *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
480 esac],[want_mmalloc=false])dnl
481
482 if test x$want_mmalloc = xtrue; then
483 AC_DEFINE(USE_MMALLOC)
484 AC_DEFINE(MMCHECK_FORCE)
485 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
486 MMALLOC='../mmalloc/libmmalloc.a'
487 fi
488
489
490 # In the Cygwin environment, we need some additional flags.
491 AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
492 [AC_EGREP_CPP(lose, [
493 #if defined (__CYGWIN__) || defined (__CYGWIN32__)
494 lose
495 #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
496
497 DLLTOOL=${DLLTOOL-dlltool}
498 WINDRES=${WINDRES-windres}
499 AC_SUBST(DLLTOOL)
500 AC_SUBST(WINDRES)
501
502 dnl Figure out which term library to use.
503 if test x$gdb_host = xgo32; then
504 TERM_LIB=
505 else
506 if test x$gdb_cv_os_cygwin = xyes; then
507 TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
508 else
509 TERM_LIB=
510 AC_CHECK_LIB(ncurses, tgetent, TERM_LIB=-lncurses,
511 AC_CHECK_LIB(Hcurses, tgetent, TERM_LIB=-lHcurses,
512 AC_CHECK_LIB(termlib, tgetent, TERM_LIB=-ltermlib,
513 AC_CHECK_LIB(termcap, tgetent, TERM_LIB=-ltermcap,
514 AC_CHECK_LIB(curses, tgetent, TERM_LIB=-lcurses,
515 AC_CHECK_LIB(terminfo, tgetent, TERM_LIB=-lterminfo))))))
516
517 if test "x$TERM_LIB" = x
518 then
519 AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
520 fi
521 fi
522 fi
523 AC_SUBST(TERM_LIB)
524
525 # libreadline needs libuser32.a in a cygwin environment
526 WIN32LIBS=
527 if test x$gdb_cv_os_cygwin = xyes; then
528 WIN32LIBS="-luser32"
529 case "${target}" in
530 *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
531 ;;
532 esac
533 fi
534 AC_SUBST(WIN32LIBS)
535
536 LIBGUI="../libgui/src/libgui.a"
537 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
538 AC_SUBST(LIBGUI)
539 AC_SUBST(GUI_CFLAGS_X)
540
541 AC_ARG_WITH(cpu,
542 [ --with-cpu=CPU Set the default CPU variant to debug],
543 [case "${target}" in
544 powerpc-* | powerpcle-* )
545 ## It would be nice to keep this table in sync with the one in
546 ## gcc/configure.
547 case "${with_cpu}" in
548 ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
549 | 604 | 750 )
550 ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
551 ;;
552 common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
553 ## These are all RS6000 variants, as far as GDB is concerned.
554 with_cpu=rs6000
555 ;;
556 603e | ec603e )
557 with_cpu=603
558 ;;
559 604e )
560 with_cpu=604
561 ;;
562 * )
563 AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
564 with_cpu=ppc-uisa
565 ;;
566 esac
567 ;;
568 * )
569 AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
570 ;;
571 esac
572 AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
573 ],)
574
575
576 ENABLE_GDBTK=
577
578 AC_ARG_ENABLE(gdbtk,
579 [ --enable-gdbtk Enable GDBTK GUI front end],
580 [case "${enableval}" in
581 yes)
582 case "$host" in
583 *go32*)
584 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
585 enable_gdbtk=no ;;
586 *windows*)
587 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
588 enable_gdbtk=no ;;
589 *)
590 enable_gdbtk=yes ;;
591 esac ;;
592 no)
593 enable_gdbtk=no ;;
594 *)
595 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
596 esac],
597 [
598 # Default is on for everything but go32 and Cygwin
599 case "$host" in
600 *go32* | *windows*)
601 ;;
602 *)
603 enable_gdbtk=yes ;;
604 esac
605 ])
606
607 WIN32LDAPP=
608 AC_SUBST(WIN32LIBS)
609 AC_SUBST(WIN32LDAPP)
610
611 configdir="unix"
612
613 GDBTKLIBS=
614 if test "${enable_gdbtk}" = "yes"; then
615
616 CY_AC_PATH_TCLCONFIG
617 if test -z "${no_tcl}"; then
618 CY_AC_LOAD_TCLCONFIG
619 CY_AC_PATH_TKCONFIG
620
621 # If $no_tk is nonempty, then we can't do Tk, and there is no
622 # point to doing Tcl.
623 if test -z "${no_tk}"; then
624 CY_AC_LOAD_TKCONFIG
625 CY_AC_PATH_TCLH
626 CY_AC_PATH_TKH
627 CY_AC_PATH_ITCLH
628 CY_AC_PATH_ITKH
629 CY_AC_PATH_TIXH
630
631 # now look for Itcl library stuff
632
633 CY_AC_PATH_ITCLCONFIG
634 if test -z "${no_itcl}"; then
635 CY_AC_LOAD_ITCLCONFIG
636 case "${host}" in
637 *-*-cygwin*)
638 itcldir=../itcl/itcl/win/
639 ;;
640 *)
641 itcldir=../itcl/itcl/unix/
642 ;;
643 esac
644
645
646 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
647 ITCL_DEPS="${itcldir}${ITCL_LIB_FILE}"
648 fi
649
650
651 # now look for Itk library stuff
652 CY_AC_PATH_ITKCONFIG
653 if test -z "${no_itcl}"; then
654 CY_AC_LOAD_ITKCONFIG
655
656 case "${host}" in
657 *-*-cygwin*)
658 itkdir=../itcl/itk/win/
659 ;;
660 *)
661 itkdir=../itcl/itk/unix/
662 ;;
663 esac
664
665 ITKLIB="${ITK_BUILD_LIB_SPEC}"
666 ITK_DEPS="${itkdir}${ITK_LIB_FILE}"
667 fi
668
669 # now look for Tix library stuff
670 CY_AC_PATH_TIXCONFIG
671 if test -z "${no_tix}"; then
672 CY_AC_LOAD_TIXCONFIG
673 TIXLIB="${TIX_BUILD_LIB_SPEC}"
674 TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}"
675 fi
676
677 ENABLE_GDBTK=1
678 ENABLE_CFLAGS="$ENABLE_CFLAGS -DGDBTK"
679 # Tcl/Tk 8.1 require -fwritable strings. I don't
680 # know whether 8.2 will or not, but I bet it will.
681 # I don't have to worry about 7.x since we don't support it.
682 GDBTK_CFLAGS=""
683 if test "$GCC" = "yes"; then
684 if test "$TCL_VERSION" != "8.0" ; then
685 GDBTK_CFLAGS="-fwritable-strings"
686 fi
687 fi
688
689 # Include some libraries that Tcl and Tk want.
690 TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
691 CONFIG_DEPS='$(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)'
692 # Yes, the ordering seems wrong here. But it isn't.
693 # TK_LIBS is the list of libraries that need to be linked
694 # after Tcl/Tk. Note that this isn't put into LIBS. If it
695 # were in LIBS then any link tests after this point would
696 # try to include things like `$(LIBGUI)', which wouldn't work.
697 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
698 CONFIG_SRCS="${CONFIG_SRCS} gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c"
699 CONFIG_OBS="${CONFIG_OBS} gdbtk.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-varobj.o gdbtk-wrapper.o"
700 CONFIG_INITS="${CONFIG_INITS} gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c"
701 CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
702 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
703
704 if test x$gdb_cv_os_cygwin = xyes; then
705 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
706 WIN32LDAPP="-Wl,--subsystem,console"
707 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
708 fi
709 fi
710 fi
711 fi
712
713 AC_SUBST(ENABLE_GDBTK)
714 AC_SUBST(X_CFLAGS)
715 AC_SUBST(X_LDFLAGS)
716 AC_SUBST(X_LIBS)
717 AC_SUBST(ITCLLIB)
718 AC_SUBST(ITCL_DEPS)
719 AC_SUBST(ITKLIB)
720 AC_SUBST(ITK_DEPS)
721 AC_SUBST(TIXLIB)
722 AC_SUBST(TIX_DEPS)
723 AC_SUBST(GDBTKLIBS)
724 AC_SUBST(GDBTK_CFLAGS)
725
726 AC_PATH_X
727
728
729 # Unlike the sim directory, whether a simulator is linked is controlled by
730 # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.
731 # This code just checks for a few cases where we'd like to ignore those
732 # definitions, even when they're present in the '.mt' file. These cases
733 # are when --disable-sim is specified, or if the simulator directory is
734 # not part of the soruce tree.
735 #
736 AC_ARG_ENABLE(sim,
737 [ --enable-sim Link gdb with simulator],
738 [echo "enable_sim = $enable_sim";
739 echo "enableval = ${enableval}";
740 case "${enableval}" in
741 yes) ignore_sim=false ;;
742 no) ignore_sim=true ;;
743 *) ignore_sim=false ;;
744 esac],
745 [ignore_sim=false])
746
747 if test ! -d "${srcdir}/../sim"; then
748 ignore_sim=true
749 fi
750
751 if test "${ignore_sim}" = "true"; then
752 IGNORE_SIM="SIM="
753 IGNORE_SIM_OBS="SIM_OBS="
754 else
755 IGNORE_SIM=""
756 IGNORE_SIM_OBS=""
757 AC_DEFINE(WITH_SIM)
758 fi
759 AC_SUBST(IGNORE_SIM)
760 AC_SUBST(IGNORE_SIM_OBS)
761
762 AC_SUBST(ENABLE_CFLAGS)
763
764 AC_SUBST(CONFIG_OBS)
765 AC_SUBST(CONFIG_DEPS)
766 AC_SUBST(CONFIG_SRCS)
767 AC_SUBST(CONFIG_INITS)
768 AC_SUBST(CONFIG_INSTALL)
769 AC_SUBST(CONFIG_UNINSTALL)
770
771 # Begin stuff to support --enable-shared
772 AC_ARG_ENABLE(shared,
773 [ --enable-shared Use shared libraries],
774 [case "${enableval}" in
775 yes) shared=true ;;
776 no) shared=false ;;
777 *) shared=true ;;
778 esac])dnl
779
780 HLDFLAGS=
781 HLDENV=
782 # If we have shared libraries, try to set rpath reasonably.
783 if test "${shared}" = "true"; then
784 case "${host}" in
785 *-*-hpux*)
786 HLDFLAGS='-Wl,+s,+b,$(libdir)'
787 ;;
788 *-*-irix5* | *-*-irix6*)
789 HLDFLAGS='-Wl,-rpath,$(libdir)'
790 ;;
791 *-*-linux*aout*)
792 ;;
793 *-*-linux* | *-pc-linux-gnu)
794 HLDFLAGS='-Wl,-rpath,$(libdir)'
795 ;;
796 *-*-solaris*)
797 HLDFLAGS='-R $(libdir)'
798 ;;
799 *-*-sysv4*)
800 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;'
801 ;;
802 esac
803 fi
804
805 # On SunOS, if the linker supports the -rpath option, use it to
806 # prevent ../bfd and ../opcodes from being included in the run time
807 # search path.
808 case "${host}" in
809 *-*-sunos*)
810 echo 'main () { }' > conftest.c
811 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
812 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
813 :
814 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
815 :
816 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
817 :
818 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
819 :
820 elif test "${shared}" = "true"; then
821 HLDFLAGS='-Wl,-rpath=$(libdir)'
822 else
823 HLDFLAGS='-Wl,-rpath='
824 fi
825 rm -f conftest.t conftest.c conftest
826 ;;
827 esac
828 AC_SUBST(HLDFLAGS)
829 AC_SUBST(HLDENV)
830 # End stuff to support --enable-shared
831
832 # target_subdir is used by the testsuite to find the target libraries.
833 target_subdir=
834 if test "${host}" != "${target}"; then
835 target_subdir="${target_alias}/"
836 fi
837 AC_SUBST(target_subdir)
838
839 frags=
840 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
841 if test ! -f ${host_makefile_frag}; then
842 AC_MSG_ERROR("*** Gdb does not support host ${host}")
843 fi
844 frags="$frags $host_makefile_frag"
845
846 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
847 if test ! -f ${target_makefile_frag}; then
848 AC_MSG_ERROR("*** Gdb does not support target ${target}")
849 fi
850 frags="$frags $target_makefile_frag"
851
852 AC_SUBST_FILE(host_makefile_frag)
853 AC_SUBST_FILE(target_makefile_frag)
854 AC_SUBST(frags)
855
856 changequote(,)dnl
857 hostfile=`sed -n '
858 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
859 ' ${host_makefile_frag}`
860
861 targetfile=`sed -n '
862 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
863 ' ${target_makefile_frag}`
864
865 # these really aren't orthogonal true/false values of the same condition,
866 # but shells are slow enough that I like to reuse the test conditions
867 # whenever possible
868 if test "${target}" = "${host}"; then
869 nativefile=`sed -n '
870 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
871 ' ${host_makefile_frag}`
872 # else
873 # GDBserver is only useful in a "native" enviroment
874 # configdirs=`echo $configdirs | sed 's/gdbserver//'`
875 fi
876 changequote([,])
877
878 SUBDIRS="doc testsuite nlm"
879 if test "${enable_multi_ice}" = "yes"; then
880 SUBDIRS="${SUBDIRS} multi-ice"
881 fi
882
883 AC_SUBST(SUBDIRS)
884
885 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
886 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
887 # corresponding links. But we have to remove the xm.h files and tm.h
888 # files anyway, e.g. when switching from "configure host" to
889 # "configure none".
890
891 files=
892 links=
893 rm -f xm.h
894 if test "${hostfile}" != ""; then
895 files="${files} config/${gdb_host_cpu}/${hostfile}"
896 links="${links} xm.h"
897 fi
898 rm -f tm.h
899 if test "${targetfile}" != ""; then
900 files="${files} config/${gdb_target_cpu}/${targetfile}"
901 links="${links} tm.h"
902 fi
903 rm -f nm.h
904 if test "${nativefile}" != ""; then
905 files="${files} config/${gdb_host_cpu}/${nativefile}"
906 links="${links} nm.h"
907 else
908 # A cross-only configuration.
909 files="${files} config/nm-empty.h"
910 links="${links} nm.h"
911 fi
912 AC_PROG_LN_S
913 # Make it possible to use the GUI without doing a full install
914 if test "${enable_gdbtk}" = "yes" ; then
915 if test "$LN_S" = "ln -s" -a ! -f gdbtcl ; then
916 echo linking $srcdir/gdbtk/library to gdbtcl
917 $LN_S $srcdir/gdbtk/library gdbtcl
918 else
919 echo Warning: Unable to link $srcdir/gdbtk/library to gdbtcl. You will need to do a
920 echo " " make install before you are able to run the GUI.
921 fi
922 fi
923
924 AC_LINK_FILES($files, $links)
925
926 dnl Check for exe extension set on certain hosts (e.g. Win32)
927 AC_EXEEXT
928
929 AC_CONFIG_SUBDIRS($configdirs)
930 AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in,
931 [
932 dnl Autoconf doesn't provide a mechanism for modifying definitions
933 dnl provided by makefile fragments.
934 dnl
935 if test "${nativefile}" = ""; then
936 sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
937 < Makefile > Makefile.tem
938 mv -f Makefile.tem Makefile
939 fi
940
941 changequote(,)dnl
942 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
943 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
944 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
945 mv -f Makefile.tmp Makefile
946 changequote([,])dnl
947
948
949 case x$CONFIG_HEADERS in
950 xconfig.h:config.in)
951 echo > stamp-h ;;
952 esac
953 ],
954 [
955 gdb_host_cpu=$gdb_host_cpu
956 gdb_target_cpu=$gdb_target_cpu
957 nativefile=$nativefile
958 ])
959
960 exit 0