AC_PREREQ(2.13)dnl
AC_INIT(main.c)
AC_CONFIG_HEADER(config.h:config.in)
+AM_MAINTAINER_MODE
AC_PROG_CC
AC_AIX
CONFIG_SRCS=
CONFIG_INITS=
ENABLE_CFLAGS=
+CONFIG_ALL=
+CONFIG_CLEAN=
+CONFIG_INSTALL=
+CONFIG_UNINSTALL=
configdirs="doc testsuite"
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_PROG_YACC
+dnl MiG is needed for the Hurd.
+AC_CHECK_TOOL(MIG, mig)
+
AC_ARG_PROGRAM
AC_TYPE_SIGNAL
AC_HEADER_STDC
+dnl Solaris 7 needs _MSE_INT_H defined to avoid a clash between <widec.h>
+dnl and <wchar.h> that causes AC_CHECK_HEADERS to think <curses.h> doesn't
+dnl exist.
+
+case $host_os in solaris2.7) case "$GCC" in yes)
+ AC_DEFINE(_MSE_INT_H)
+esac; esac
+
AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h thread_db.h proc_service.h \
memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask)
AC_FUNC_ALLOCA
+dnl See if ptrace.h provides the PTRACE_GETREGS request.
+AC_MSG_CHECKING(for PTRACE_GETREGS)
+AC_CACHE_VAL(gdb_cv_have_ptrace_getregs,
+[AC_TRY_COMPILE([#include <sys/ptrace.h>],
+ [PTRACE_GETREGS;],
+ [gdb_cv_have_ptrace_getregs=yes],
+ [gdb_cv_have_ptrace_getregs=no])])
+AC_MSG_RESULT($gdb_cv_have_ptrace_getregs)
+if test $gdb_cv_have_ptrace_getregs = yes; then
+ AC_DEFINE(HAVE_PTRACE_GETREGS)
+fi
+
dnl See if ptrace.h provides the PTRACE_GETXFPREGS request.
dnl PTRACE_GETXFPREGS is a Cygnus invention, since we wrote our own
dnl Linux kernel patch for SSE support. That patch may or may not
*-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
AC_DEFINE(NEW_PROC_API)
;;
- # FIXME: we would like to define NEW_PROC_API for all versions of
- # Solaris from 2.6 on... but it isn't quite working yet. Seems
- # to work on sparc 2.6, so let's try it out there.
- sparc-sun-solaris2.6)
+ *-*-solaris2.[[678]])
AC_DEFINE(NEW_PROC_API)
;;
esac
BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
+ dnl Check for broken prfpregset_t type
+
+ dnl For Linux/i386, glibc 2.1.3 was released with a bogus
+ dnl prfpregset_t type (it's a typedef for the pointer to a struct
+ dnl instead of the struct itself). We detect this here, and work
+ dnl around it in lin-thread.c.
+
+ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
+ AC_MSG_CHECKING(whether prfpregset_t type is broken)
+ AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
+ [AC_TRY_RUN([#include <sys/procfs.h>
+ int main ()
+ {
+ if (sizeof (prfpregset_t) == sizeof (void *))
+ return 1;
+ return 0;
+ }],
+ gdb_cv_prfpregset_t_broken=no,
+ gdb_cv_prfpregset_t_broken=yes,
+ gdb_cv_prfpregset_t_broken=yes)])
+ AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
+ if test $gdb_cv_prfpregset_t_broken = yes; then
+ AC_DEFINE(PRFPREGSET_T_BROKEN)
+ fi
+ fi
+
dnl Check for PIOCSET ioctl entry
AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h)
AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
- CONFIG_INITS="${CONFIG_INITS} hpux-thread.c"
else
AC_MSG_RESULT(no (suppressed because you are not using GCC))
fi
CONFIG_SRCS="${CONFIG_SRS} \$(SUBDIR_MI_SRCS)"
CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_MI_INITS)"
ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_MI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_MI_ALL)"
+ CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_MI_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_MI_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_MI_UNINSTALL)"
fi
;;
esac
if test "${enable_netrom}" = "yes"; then
CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
- CONFIG_INITS="${CONFIG_INITS} remote-nrom.c"
fi
+
+build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
+-Wformat -Wparentheses -Wpointer-arith"
+# Not yet: -Wall -Wpointer-arith -Wstrict-prototypes
+# -Wmissing-prototypes -Wmissing-declarations
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
-[
-# not yet: -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith"
-case "${enableval}" in
+[case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
esac
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
echo "Setting warning flags = $build_warnings" 6>&1
-fi
+fi])dnl
WARN_CFLAGS=""
WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
*) WARN_CFLAGS="${WARN_CFLAGS} $w"
esac
done
-fi],[build_warnings=""])dnl
-
+fi
AC_SUBST(WARN_CFLAGS)
AC_SUBST(WERROR_CFLAGS)
MMALLOC='../mmalloc/libmmalloc.a'
fi
+AC_ARG_WITH(included-regex,
+[ --with-included-regex Use included regex],
+[case "${withval}" in
+ yes) want_included_regex=true ;;
+ no) want_included_regex=false;;
+ *) AC_MSG_ERROR(bad value ${withval} for GDB with-included-regex option) ;;
+esac],[want_included_regex=true])dnl
+
+if test $want_included_regex = false; then
+ AC_MSG_CHECKING(for GNU regex)
+ AC_CACHE_VAL(gdb_cv_have_gnu_regex,
+[AC_TRY_COMPILE([#include <gnu-versions.h>
+#include <sys/types.h>
+#include <regex.h>],
+[#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2
+#error No valid GNU regex.
+#endif
+],
+ [gdb_cv_have_gnu_regex=yes],
+ [gdb_cv_have_gnu_regex=no])])
+ AC_MSG_RESULT($gdb_cv_have_gnu_regex)
+ if test $gdb_cv_have_gnu_regex = no; then
+ want_included_regex=true
+ fi
+fi
+
+if test x${want_included_regex} = xtrue; then
+ REGEX="gnu-regex.o"
+ AC_DEFINE(USE_INCLUDED_REGEX)
+fi
+AC_SUBST(REGEX)
# In the Cygwin environment, we need some additional flags.
AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
],)
-ENABLE_GDBTK=
-
AC_ARG_ENABLE(gdbtk,
[ --enable-gdbtk Enable GDBTK GUI front end],
[case "${enableval}" in
*go32* | *windows*)
;;
*)
- enable_gdbtk=yes ;;
- esac
+ if test -d "${srcdir}/gdbtk" ; then
+ enable_gdbtk=yes
+ fi
+ ;;
+esac
])
WIN32LDAPP=
TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}"
fi
- ENABLE_GDBTK=1
ENABLE_CFLAGS="$ENABLE_CFLAGS -DGDBTK"
# Tcl/Tk 8.1 require -fwritable strings. I don't
# know whether 8.2 will or not, but I bet it will.
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"
CONFIG_OBS="${CONFIG_OBS} gdbtk.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-varobj.o gdbtk-wrapper.o"
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"
+ CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_GDBTK_ALL)"
+ CONFIG_CLEAN="${CONFIG_ALL} \$(SUBDIR_GDBTK_CLEAN)"
+ CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
if test x$gdb_cv_os_cygwin = xyes; then
WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
fi
fi
-AC_SUBST(ENABLE_GDBTK)
AC_SUBST(X_CFLAGS)
AC_SUBST(X_LDFLAGS)
AC_SUBST(X_LIBS)
AC_SUBST(CONFIG_DEPS)
AC_SUBST(CONFIG_SRCS)
AC_SUBST(CONFIG_INITS)
+AC_SUBST(CONFIG_ALL)
+AC_SUBST(CONFIG_CLEAN)
+AC_SUBST(CONFIG_INSTALL)
+AC_SUBST(CONFIG_UNINSTALL)
# Begin stuff to support --enable-shared
AC_ARG_ENABLE(shared,
;;
*-*-linux*aout*)
;;
- *-*-linux* | *-pc-linux-gnu)
+ *-*-linux* | *-pc-linux-gnu*)
HLDFLAGS='-Wl,-rpath,$(libdir)'
;;
*-*-solaris*)
links="${links} nm.h"
fi
AC_PROG_LN_S
-# Make it possible to use the GUI without doing a full install
-if test "${enable_gdbtk}" = "yes" ; then
- if test "$LN_S" = "ln -s" -a ! -f gdbtcl ; then
- echo linking $srcdir/gdbtk/library to gdbtcl
- $LN_S $srcdir/gdbtk/library gdbtcl
- else
- echo Warning: Unable to link $srcdir/gdbtk/library to gdbtcl. You will need to do a
- echo " " make install before you are able to run the GUI.
- fi
-fi
AC_LINK_FILES($files, $links)