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.
45 configdirs="doc testsuite"
50 . ${srcdir}/configure.host
52 . ${srcdir}/configure.tgt
59 AC_CHECK_TOOL(RANLIB, ranlib, :)
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)
77 AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc)
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)
86 # If we are configured native on GNU/Linux, work around problems with sys/procfs.h
87 if test "${target}" = "${host}"; then
90 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
91 AC_DEFINE(sys_quotactl)
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)
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)
114 dnl See if host has libm. This is usually needed by simulators.
115 AC_CHECK_LIB(m, main)
117 dnl Solaris puts wctype in /usr/lib/libw.a before Solaris 2.6.
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))
126 dnl See if compiler supports "long long" type.
128 AC_MSG_CHECKING(for long long support in compiler)
129 AC_CACHE_VAL(gdb_cv_c_long_long,
131 extern long long foo;
132 switch (foo & 2) { case 0: return 1; }
134 gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
135 AC_MSG_RESULT($gdb_cv_c_long_long)
136 if test $gdb_cv_c_long_long = yes; then
137 AC_DEFINE(CC_HAS_LONG_LONG)
140 dnl See if the compiler and runtime support printing long long
142 AC_MSG_CHECKING(for long long support in printf)
143 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
148 l = (l << 16) + 0x0123;
149 l = (l << 16) + 0x4567;
150 l = (l << 16) + 0x89ab;
151 l = (l << 16) + 0xcdef;
152 sprintf (buf, "0x%016llx", l);
153 return (strcmp ("0x0123456789abcdef", buf));
155 gdb_cv_printf_has_long_long=yes,
156 gdb_cv_printf_has_long_long=no,
157 gdb_cv_printf_has_long_long=no)])
158 if test $gdb_cv_printf_has_long_long = yes; then
159 AC_DEFINE(PRINTF_HAS_LONG_LONG)
161 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
163 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
164 dnl because autoconf complains about cross-compilation issues. However, this
165 dnl code uses the same variables as the macro for compatibility.
167 AC_MSG_CHECKING(for long double support in compiler)
168 AC_CACHE_VAL(ac_cv_c_long_double,
169 [AC_TRY_COMPILE(, [long double foo;],
170 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
171 AC_MSG_RESULT($ac_cv_c_long_double)
172 if test $ac_cv_c_long_double = yes; then
173 AC_DEFINE(HAVE_LONG_DOUBLE)
176 dnl See if the compiler and runtime support printing long doubles
178 AC_MSG_CHECKING(for long double support in printf)
179 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
183 long double f = 3.141592653;
184 sprintf (buf, "%Lg", f);
185 return (strncmp ("3.14159", buf, 7));
187 gdb_cv_printf_has_long_double=yes,
188 gdb_cv_printf_has_long_double=no,
189 gdb_cv_printf_has_long_double=no)])
190 if test $gdb_cv_printf_has_long_double = yes; then
191 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
193 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
195 dnl See if the compiler and runtime support scanning long doubles
197 AC_MSG_CHECKING(for long double support in scanf)
198 AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
201 char *buf = "3.141592653";
203 sscanf (buf, "%Lg", &f);
204 return !(f > 3.14159 && f < 3.14160);
206 gdb_cv_scanf_has_long_double=yes,
207 gdb_cv_scanf_has_long_double=no,
208 gdb_cv_scanf_has_long_double=no)])
209 if test $gdb_cv_scanf_has_long_double = yes; then
210 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
212 AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
216 dnl See if thread_db library is around for Solaris thread debugging. Note that
217 dnl we must explicitly test for version 1 of the library because version 0
218 dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
220 dnl Note that we only want this if we are both native (host == target), and
221 dnl not doing a canadian cross build (build == host).
223 if test ${build} = ${host} -a ${host} = ${target} ; then
226 AC_MSG_CHECKING(for HPUX/OSF thread support)
227 if test -f /usr/include/dce/cma_config.h ; then
228 if test "$GCC" = "yes" ; then
230 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
231 CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
232 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
234 AC_MSG_RESULT(no (suppressed because you are not using GCC))
241 AC_MSG_CHECKING(for Solaris thread debugging library)
242 if test -f /usr/lib/libthread_db.so.1 ; then
244 AC_DEFINE(HAVE_THREAD_DB_LIB)
245 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
246 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
247 AC_CHECK_LIB(dl, dlopen)
248 if test "$GCC" = "yes" ; then
249 # The GNU linker requires the -export-dynamic option to make
250 # all symbols visible in the dynamic symbol table.
251 hold_ldflags=$LDFLAGS
252 AC_MSG_CHECKING(for the ld -export-dynamic flag)
253 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
254 AC_TRY_LINK(, [int i;], found=yes, found=no)
255 LDFLAGS=$hold_ldflags
256 AC_MSG_RESULT($found)
257 if test $found = yes; then
258 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
261 # Sun randomly tweaked the prototypes in <proc_service.h>
263 AC_MSG_CHECKING(if <proc_service.h> is old)
264 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
266 #include <proc_service.h>
268 (struct ps_prochandle*, psaddr_t, const void*, size_t);
269 ],, gdb_cv_proc_service_is_old=no,
270 gdb_cv_proc_service_is_old=yes)
272 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
273 if test $gdb_cv_proc_service_is_old = yes; then
274 AC_DEFINE(PROC_SERVICE_IS_OLD)
281 AC_SUBST(CONFIG_LDFLAGS)
284 dnl Handle optional features that can be enabled.
288 [ --enable-tui Enable full-screen terminal user interface],
290 case "${enable_tui}" in
292 "") enable_tui=yes ;;
294 AC_MSG_ERROR(Bad value for --enable-tui: ${enableval})
298 case ${enable_tui} in
302 TUI_LIBRARY=tui/libtui.a
310 AC_SUBST(TUI_LIBRARY)
312 AC_ARG_ENABLE(netrom,
313 [ --enable-netrom Enable NetROM support],
314 [case "${enableval}" in
315 yes) enable_netrom=yes ;;
316 no) enable_netrom=no ;;
317 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
320 if test "${enable_netrom}" = "yes"; then
321 CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
322 CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
325 AC_ARG_ENABLE(build-warnings,
326 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
327 [build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
328 case "${enableval}" in
330 no) build_warnings="-w";;
331 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
332 build_warnings="${build_warnings} ${t}";;
333 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
334 build_warnings="${t} ${build_warnings}";;
335 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
336 esac],[build_warnings=""])dnl
338 if test "x${build_warnings}" != x -a "x$GCC" = xyes
340 WARN_CFLAGS="${build_warnings}"
344 AC_SUBST(WARN_CFLAGS)
348 AC_SUBST(MMALLOC_CFLAGS)
352 [ --with-mmalloc Use memory mapped malloc package],
353 [case "${withval}" in
354 yes) want_mmalloc=true ;;
355 no) want_mmalloc=false;;
356 *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
357 esac],[want_mmalloc=false])dnl
359 if test x$want_mmalloc = xtrue; then
360 AC_DEFINE(USE_MMALLOC)
361 AC_DEFINE(MMCHECK_FORCE)
362 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
363 MMALLOC='../mmalloc/libmmalloc.a'
366 # start-sanitize-carp
367 # The below takes an educated guess at the targets that
368 # should be built. It is an interum version that provides
369 # significant backward compatibility.
372 [ --enable-carp Configure alternative readaptive paradigm ],
373 [case "${enableval}" in
374 yes) enable_carp=yes ;;
375 no) enable_carp=no ;;
376 *) AC_MSG_ERROR([bad value ${enableval} for carp option]) ;;
377 esac],[enable_carp=no])dnl
379 AC_ARG_ENABLE(targets,
380 [ --enable-targets alternative target configurations],
381 [case "${enableval}" in
382 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
384 no) enable_targets= ;;
385 *) enable_targets="$enableval" ;;
388 # Canonicalize the secondary target names.
390 if test -n "$enable_targets" ; then
391 if test "$enable_targets" = all ; then
394 for targ in `echo $enable_targets | sed 's/,/ /g'`
396 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
397 if test -n "$result" ; then
398 canon_targets="$canon_targets $result"
404 # Convert the target names into GDB [*]-tdep.c names
407 for targ in $target $canon_targets
409 if test "x$targ" = "xall" ; then
412 t_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
413 t_vendor=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
414 t_os=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
418 target_vendor=$t_vendor
420 . ${srcdir}/configure.tgt
421 echo ${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt`
422 if test -r ${mt} ; then
423 # This gets confused over .mt files that have multiple -tdep.o
425 s/^.*[ =]\([^ ]*\)-tdep.o.*/\1/p
427 selarchs="$selarchs $tdep"
433 # We don't do any links based on the target system, just makefile config.
435 if test x${all_targets} = xfalse ; then
437 # Target architecture .o files.
440 for arch in $selarchs
442 archdefs="$archdefs -DARCH_$arch"
443 ta="$ta ${arch}-tdep.o"
446 dvp) ta="$ta mips-tdep.o dvp-tdep.o" ;;
450 # Weed out duplicate .o files.
460 # And duplicate -D flags.
462 for i in $archdefs ; do
472 else # all_targets is true
474 MACHINE_OBS='$(ALL_MACHINES)'
477 dnl Don't define an archdefs list
478 dnl AC_SUBST(archdefs)
479 dnl XXXX this name will change several more times
480 if test "${enable_carp}" = yes ; then
484 MACHINE_OBS="# $MACHINE_OBS"
486 AC_SUBST(MACHINE_OBS)
489 # start-sanitize-gdbtk
492 AC_ARG_ENABLE(ide, [ --enable-ide Enable IDE support])
493 if test "$enable_ide" = yes; then
501 AC_ARG_WITH(foundry-libs,
502 [ --with-foundry-libs=DIR Use the Foundry SDK in DIR],
503 [FOUNDRY_LIB_BASE=${withval}])
504 AC_SUBST(FOUNDRY_LIB_BASE)
507 # This is the Foundry SDK
509 # These variables are used to determine where the Foundry libs and
510 # header files are located.
512 if test "$FOUNDRY_LIB_BASE" != ""; then
513 LIBGUI="${FOUNDRY_LIB_BASE}/lib/libgui.a"
514 GUI_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include"
515 if test x$enable_ide = xyes; then
516 IDE_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include -DIDE"
517 IDE_X="-L${FOUNDRY_LIB_BASE}/lib -lilu-Tk -lilu-c -lilu"
519 IDE_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include"
521 LIBIDETCL="${FOUNDRY_LIB_BASE}/lib/libidetcl.a"
522 LIBIDE="${FOUNDRY_LIB_BASE}/lib/libide.a"
523 IDE_DEPS="${FOUNDRY_LIB_BASE}/lib/libilu-Tk.a ${FOUNDRY_LIB_BASE}/lib/libilu-c.a ${FOUNDRY_LIB_BASE}/lib/libilu.a"
526 LIBGUI="../libgui/src/libgui.a"
527 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
529 if test x$enable_ide = xyes; then
530 IDE_CFLAGS_X="-I${srcdir}/../libidetcl/src -I${srcdir}/../libide/src -DIDE -I${srcdir}/../ilu/runtime/mainloop"
531 IDE_X="-L../ilu/runtime/mainloop -lilu-Tk -L../ilu/runtime/c -lilu-c -L../ilu/runtime/kernel -lilu"
533 IDE_CFLAGS_X="-I${srcdir}/../libidetcl/src -I${srcdir}/../libide/src"
535 LIBIDETCL="../libidetcl/src/libidetcl.a"
536 LIBIDE="../libide/src/libide.a"
537 IDE_DEPS="../ilu/runtime/mainloop/libilu-Tk.a ../ilu/runtime/c/libilu-c.a ../ilu/runtime/kernel/libilu.a"
542 AC_SUBST(GUI_CFLAGS_X)
544 AC_SUBST(IDE_CFLAGS_X)
553 [ --with-cpu=CPU set the default CPU variant to debug],
555 powerpc-* | powerpcle-* )
556 ## It would be nice to keep this table in sync with the one in
558 case "${with_cpu}" in
559 ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
561 ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
563 common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
564 ## These are all RS6000 variants, as far as GDB is concerned.
574 AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
580 AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
583 AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
590 [ --enable-gdbtk Enable GDBTK GUI front end],
591 [case "${enableval}" in
595 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
598 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
606 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
609 # Default is on for everything but go32 and Cygwin
618 # In the Cygwin environment, we need some additional flags.
619 AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
620 [AC_EGREP_CPP(lose, [
623 #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
625 dnl Figure out which term library to use.
626 if test x$gdb_cv_os_cygwin = xyes; then
627 TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
630 AC_CHECK_LIB(ncurses, tgetent, TERM_LIB=-lncurses,
631 AC_CHECK_LIB(termlib, tgetent, TERM_LIB=-ltermlib,
632 AC_CHECK_LIB(termcap, tgetent, TERM_LIB=-ltermcap,
633 AC_CHECK_LIB(curses, tgetent, TERM_LIB=-lcurses,
634 AC_CHECK_LIB(terminfo, tgetent, TERM_LIB=-lterminfo)))))
636 if test "x$TERM_LIB" = x
638 AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
647 DLLTOOL=${DLLTOOL-dlltool}
648 WINDRES=${WINDRES-windres}
652 if test x$gdb_cv_os_cygwin = xyes; then
654 if test x$enable_ide = xyes; then
655 WIN32LIBS="$WIN32LIBS -ladvapi32"
662 if test "${enable_gdbtk}" = "yes"; then
665 if test -z "${no_tcl}"; then
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
679 # now look for Itcl library stuff
681 CY_AC_PATH_ITCLCONFIG
682 if test -z "${no_itcl}"; then
683 CY_AC_LOAD_ITCLCONFIG
686 itcldir=../itcl/itcl/win/
689 itcldir=../itcl/itcl/unix/
694 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
695 ITCL_DEPS="${itcldir}${ITCL_LIB_FILE}"
699 # now look for Itk library stuff
701 if test -z "${no_itcl}"; then
706 itkdir=../itcl/itk/win/
709 itkdir=../itcl/itk/unix/
713 ITKLIB="${ITK_BUILD_LIB_SPEC}"
714 ITK_DEPS="${itkdir}${ITK_LIB_FILE}"
717 # now look for tix library stuff
719 . ${ac_cv_c_tclconfig}/tclConfig.sh
722 tixdir=../tix/win/tcl8.0
725 tixdir=../tix/unix/tk8.0
728 if test "${TCL_SHARED_BUILD}" = "1"; then
729 TIX_LIB_EXT="${TCL_SHLIB_SUFFIX}"
731 # Can't win them all: SunOS 4 (others?) appends a version
732 # number after the ".so"
735 TIX_LIB_EXT="${TIX_LIB_EXT}.1.0" ;;
742 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
743 TIXLIB="-L${tixdir} -ltix${TIXVERSION}"
744 TIX_DEPS="${tixdir}/libtix${TIXVERSION}${TIX_LIB_EXT}"
746 TIXLIB="-L${tixdir} -ltix`echo ${TIXVERSION} | tr -d .`"
747 TIX_DEPS="${tixdir}/libtix`echo ${TIXVERSION} | tr -d .`${TIX_LIB_EXT}"
751 ENABLE_CFLAGS="${ENABLE_CFLAGS} -DGDBTK"
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)'
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)'
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"
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"
778 AC_SUBST(ENABLE_GDBTK)
793 # Enable GPU2 library for MIPS simulator
794 AC_ARG_WITH(sim-gpu2,
795 [ --with-sim-gpu2=DIR Use GPU2 library under given DIR],
798 if test -d "${withval}"
800 if test x${x_libraries} != x
802 LIBS="${LIBS} -L${withval}/lib -lgpu2 -L${x_libraries} -lX11 -lXext -lm"
804 LIBS="${LIBS} -L${withval}/lib -lgpu2 -lX11 -lXext -lm"
807 AC_MSG_WARN([Directory ${withval} does not exist.])
809 *) AC_MSG_WARN([--with-sim-gpu2 option invalid for target ${target}])
812 # Enable target accurate FP library
813 AC_ARG_WITH(sim-funit,
814 [ --with-sim-funit=DIR Use target FP lib under given DIR],
817 if test -d "${withval}"
819 LIBS="${LIBS} -L${withval}/lib -lfunit"
821 AC_MSG_WARN([Directory ${withval} does not exist.])
823 *) AC_MSG_WARN([--with-sim-funit option invalid for target ${target}])
827 AC_SUBST(ENABLE_CFLAGS)
830 AC_SUBST(CONFIG_DEPS)
831 AC_SUBST(CONFIG_SRCS)
833 # Begin stuff to support --enable-shared
834 AC_ARG_ENABLE(shared,
835 [ --enable-shared Use shared libraries],
836 [case "${enableval}" in
844 # If we have shared libraries, try to set rpath reasonably.
845 if test "${shared}" = "true"; then
848 HLDFLAGS='-Wl,+s,+b,$(libdir)'
850 *-*-irix5* | *-*-irix6*)
851 HLDFLAGS='-Wl,-rpath,$(libdir)'
855 *-*-linux* | *-pc-linux-gnu)
856 HLDFLAGS='-Wl,-rpath,$(libdir)'
859 HLDFLAGS='-R $(libdir)'
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;'
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
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
876 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
878 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
880 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
882 elif test "${shared}" = "true"; then
883 HLDFLAGS='-Wl,-rpath=$(libdir)'
885 HLDFLAGS='-Wl,-rpath='
887 rm -f conftest.t conftest.c conftest
892 # End stuff to support --enable-shared
894 # target_subdir is used by the testsuite to find the target libraries.
896 if test "${host}" != "${target}"; then
897 target_subdir="${target_alias}/"
899 AC_SUBST(target_subdir)
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}")
906 frags="$frags $host_makefile_frag"
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}")
912 frags="$frags $target_makefile_frag"
914 AC_SUBST_FILE(host_makefile_frag)
915 AC_SUBST_FILE(target_makefile_frag)
920 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
921 ' ${host_makefile_frag}`
924 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
925 ' ${target_makefile_frag}`
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
930 if test "${target}" = "${host}"; then
932 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
933 ' ${host_makefile_frag}`
935 # GDBserver is only useful in a "native" enviroment
936 # configdirs=`echo $configdirs | sed 's/gdbserver//'`
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
949 if test "${hostfile}" != ""; then
950 files="${files} config/${gdb_host_cpu}/${hostfile}"
951 links="${links} xm.h"
954 if test "${targetfile}" != ""; then
955 files="${files} config/${gdb_target_cpu}/${targetfile}"
956 links="${links} tm.h"
959 if test "${nativefile}" != ""; then
960 files="${files} config/${gdb_host_cpu}/${nativefile}"
961 links="${links} nm.h"
963 # A cross-only configuration.
964 files="${files} config/nm-empty.h"
965 links="${links} nm.h"
967 # start-sanitize-gdbtk
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
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.
981 AC_LINK_FILES($files, $links)
983 dnl Check for exe extension set on certain hosts (e.g. Win32)
986 AC_CONFIG_SUBDIRS($configdirs)
987 AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in,
989 dnl Autoconf doesn't provide a mechanism for modifying definitions
990 dnl provided by makefile fragments.
992 if test "${nativefile}" = ""; then
993 sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
994 < Makefile > Makefile.tem
995 mv -f Makefile.tem Makefile
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
1005 case x$CONFIG_HEADERS in
1006 xconfig.h:config.in)
1011 gdb_host_cpu=$gdb_host_cpu
1012 gdb_target_cpu=$gdb_target_cpu
1013 nativefile=$nativefile