1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
4 dnl This file is part of GDB.
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.
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.
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.
20 dnl Process this file with autoconf to produce a configure script.
24 AC_CONFIG_HEADER(config.h:config.in)
31 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
34 dnl gdb doesn't use gettext, but bfd does. We call this to ensure we
35 dnl link with the correct libraries.
39 dnl List of object files added by configure.
49 configdirs="doc testsuite"
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}) ;;
60 if test "${enable_multi_ice}" = "yes"; then
61 configdirs="${configdirs} multi-ice"
67 . ${srcdir}/configure.host
69 . ${srcdir}/configure.tgt
77 AC_CHECK_TOOL(RANLIB, ranlib, :)
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 \
96 AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
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)
117 AC_CHECK_LIB(socket, socketpair)
118 AC_CHECK_FUNCS(socketpair)
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)
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
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
140 AC_DEFINE(HAVE_STRUCT_SAVE_STATE_T, 1)
142 if test $gdb_cv_hpux_sswide = yes
144 AC_DEFINE(HAVE_STRUCT_MEMBER_SS_WIDE, 1)
146 AC_MSG_RESULT($gdb_cv_hpux_sswide)
149 # If we are configured native on GNU/Linux, work around problems with
151 # Also detect which type of /proc is in use, such as for Unixware or Solaris.
153 if test "${target}" = "${host}"; then
155 i[[3456]]86-*-linux*)
156 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
157 AC_DEFINE(sys_quotactl)
159 *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
160 AC_DEFINE(NEW_PROC_API)
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)
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)
181 dnl Check for PIOCSET ioctl entry
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>
190 dummy = ioctl(0, PIOCSET, &dummy);
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)
199 dnl See if host has libm. This is usually needed by simulators.
200 AC_CHECK_LIB(m, main)
202 dnl Solaris puts wctype in /usr/lib/libw.a before Solaris 2.6.
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))
209 dnl See if compiler supports "long long" type.
211 AC_MSG_CHECKING(for long long support in compiler)
212 AC_CACHE_VAL(gdb_cv_c_long_long,
214 extern long long foo;
215 switch (foo & 2) { case 0: return 1; }
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)
223 dnl See if the compiler and runtime support printing long long
225 AC_MSG_CHECKING(for long long support in printf)
226 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
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));
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)
244 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
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.
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)
259 dnl See if the compiler and runtime support printing long doubles
261 AC_MSG_CHECKING(for long double support in printf)
262 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
266 long double f = 3.141592653;
267 sprintf (buf, "%Lg", f);
268 return (strncmp ("3.14159", buf, 7));
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)
276 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
278 dnl See if the compiler and runtime support scanning long doubles
280 AC_MSG_CHECKING(for long double support in scanf)
281 AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
284 char *buf = "3.141592653";
286 sscanf (buf, "%Lg", &f);
287 return !(f > 3.14159 && f < 3.14160);
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)
295 AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
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.
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).
306 if test ${build} = ${host} -a ${host} = ${target} ; then
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
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"
318 AC_MSG_RESULT(no (suppressed because you are not using GCC))
325 AC_MSG_CHECKING(for Solaris thread debugging library)
326 if test -f /usr/lib/libthread_db.so.1 ; then
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"
345 # Sun randomly tweaked the prototypes in <proc_service.h>
347 AC_MSG_CHECKING(if <proc_service.h> is old)
348 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
350 #include <proc_service.h>
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)
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)
365 AC_SUBST(CONFIG_LDFLAGS)
368 dnl Handle optional features that can be enabled.
370 dnl Handle MI sub-directory configury.
372 [ --enable-gdbmi Enable GDB-MI interface],
374 case "${enable_gdbmi}" in
376 "") enable_gdbmi=yes ;;
378 AC_MSG_ERROR(Bad value for --enable-gdbmi: ${enableval})
382 case ${enable_gdbmi} in
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)"
397 [ --enable-tui Enable full-screen terminal user interface],
399 case "${enable_tui}" in
401 "") enable_tui=yes ;;
403 AC_MSG_ERROR(Bad value for --enable-tui: ${enableval})
407 case ${enable_tui} in
411 TUI_LIBRARY=tui/libtui.a
419 AC_SUBST(TUI_LIBRARY)
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) ;;
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"
435 AC_ARG_ENABLE(build-warnings,
436 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
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
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"`;;
449 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
450 echo "Setting warning flags = $build_warnings" 6>&1
454 if test "x${build_warnings}" != x -a "x$GCC" = xyes
456 # Separate out the -Werror flag as some files just cannot be
457 # compiled with it enabled.
458 for w in ${build_warnings}; do
460 -Werr*) WERROR_CFLAGS=-Werror ;;
461 *) WARN_CFLAGS="${WARN_CFLAGS} $w"
464 fi],[build_warnings=""])dnl
466 AC_SUBST(WARN_CFLAGS)
467 AC_SUBST(WERROR_CFLAGS)
471 AC_SUBST(MMALLOC_CFLAGS)
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
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'
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__)
495 #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
497 DLLTOOL=${DLLTOOL-dlltool}
498 WINDRES=${WINDRES-windres}
502 dnl Figure out which term library to use.
503 if test x$gdb_host = xgo32; then
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`'
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))))))
517 if test "x$TERM_LIB" = x
519 AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
525 # libreadline needs libuser32.a in a cygwin environment
527 if test x$gdb_cv_os_cygwin = xyes; then
530 *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
536 LIBGUI="../libgui/src/libgui.a"
537 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
539 AC_SUBST(GUI_CFLAGS_X)
542 [ --with-cpu=CPU Set the default CPU variant to debug],
544 powerpc-* | powerpcle-* )
545 ## It would be nice to keep this table in sync with the one in
547 case "${with_cpu}" in
548 ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
550 ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
552 common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
553 ## These are all RS6000 variants, as far as GDB is concerned.
563 AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
569 AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
572 AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
579 [ --enable-gdbtk Enable GDBTK GUI front end],
580 [case "${enableval}" in
584 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
587 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
595 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
598 # Default is on for everything but go32 and Cygwin
614 if test "${enable_gdbtk}" = "yes"; then
617 if test -z "${no_tcl}"; then
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
631 # now look for Itcl library stuff
633 CY_AC_PATH_ITCLCONFIG
634 if test -z "${no_itcl}"; then
635 CY_AC_LOAD_ITCLCONFIG
638 itcldir=../itcl/itcl/win/
641 itcldir=../itcl/itcl/unix/
646 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
647 ITCL_DEPS="${itcldir}${ITCL_LIB_FILE}"
651 # now look for Itk library stuff
653 if test -z "${no_itcl}"; then
658 itkdir=../itcl/itk/win/
661 itkdir=../itcl/itk/unix/
665 ITKLIB="${ITK_BUILD_LIB_SPEC}"
666 ITK_DEPS="${itkdir}${ITK_LIB_FILE}"
669 # now look for Tix library stuff
671 if test -z "${no_tix}"; then
673 TIXLIB="${TIX_BUILD_LIB_SPEC}"
674 TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}"
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.
683 if test "$GCC" = "yes"; then
684 if test "$TCL_VERSION" != "8.0" ; then
685 GDBTK_CFLAGS="-fwritable-strings"
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)"
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"
713 AC_SUBST(ENABLE_GDBTK)
724 AC_SUBST(GDBTK_CFLAGS)
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.
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 ;;
747 if test ! -d "${srcdir}/../sim"; then
751 if test "${ignore_sim}" = "true"; then
753 IGNORE_SIM_OBS="SIM_OBS="
760 AC_SUBST(IGNORE_SIM_OBS)
762 AC_SUBST(ENABLE_CFLAGS)
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)
771 # Begin stuff to support --enable-shared
772 AC_ARG_ENABLE(shared,
773 [ --enable-shared Use shared libraries],
774 [case "${enableval}" in
782 # If we have shared libraries, try to set rpath reasonably.
783 if test "${shared}" = "true"; then
786 HLDFLAGS='-Wl,+s,+b,$(libdir)'
788 *-*-irix5* | *-*-irix6*)
789 HLDFLAGS='-Wl,-rpath,$(libdir)'
793 *-*-linux* | *-pc-linux-gnu)
794 HLDFLAGS='-Wl,-rpath,$(libdir)'
797 HLDFLAGS='-R $(libdir)'
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;'
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
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
814 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
816 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
818 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
820 elif test "${shared}" = "true"; then
821 HLDFLAGS='-Wl,-rpath=$(libdir)'
823 HLDFLAGS='-Wl,-rpath='
825 rm -f conftest.t conftest.c conftest
830 # End stuff to support --enable-shared
832 # target_subdir is used by the testsuite to find the target libraries.
834 if test "${host}" != "${target}"; then
835 target_subdir="${target_alias}/"
837 AC_SUBST(target_subdir)
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}")
844 frags="$frags $host_makefile_frag"
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}")
850 frags="$frags $target_makefile_frag"
852 AC_SUBST_FILE(host_makefile_frag)
853 AC_SUBST_FILE(target_makefile_frag)
858 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
859 ' ${host_makefile_frag}`
862 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
863 ' ${target_makefile_frag}`
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
868 if test "${target}" = "${host}"; then
870 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
871 ' ${host_makefile_frag}`
873 # GDBserver is only useful in a "native" enviroment
874 # configdirs=`echo $configdirs | sed 's/gdbserver//'`
878 SUBDIRS="doc testsuite nlm"
879 if test "${enable_multi_ice}" = "yes"; then
880 SUBDIRS="${SUBDIRS} multi-ice"
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
894 if test "${hostfile}" != ""; then
895 files="${files} config/${gdb_host_cpu}/${hostfile}"
896 links="${links} xm.h"
899 if test "${targetfile}" != ""; then
900 files="${files} config/${gdb_target_cpu}/${targetfile}"
901 links="${links} tm.h"
904 if test "${nativefile}" != ""; then
905 files="${files} config/${gdb_host_cpu}/${nativefile}"
906 links="${links} nm.h"
908 # A cross-only configuration.
909 files="${files} config/nm-empty.h"
910 links="${links} nm.h"
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
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.
924 AC_LINK_FILES($files, $links)
926 dnl Check for exe extension set on certain hosts (e.g. Win32)
929 AC_CONFIG_SUBDIRS($configdirs)
930 AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in,
932 dnl Autoconf doesn't provide a mechanism for modifying definitions
933 dnl provided by makefile fragments.
935 if test "${nativefile}" = ""; then
936 sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
937 < Makefile > Makefile.tem
938 mv -f Makefile.tem Makefile
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
949 case x$CONFIG_HEADERS in
955 gdb_host_cpu=$gdb_host_cpu
956 gdb_target_cpu=$gdb_target_cpu
957 nativefile=$nativefile