dnl Autoconf configure script for GDB, the GNU debugger.
-dnl Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+dnl Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
dnl Free Software Foundation, Inc.
dnl
dnl This file is part of GDB.
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
AC_CANONICAL_SYSTEM
-dnl gdb doesn't use gettext, but bfd does. We call this to ensure we
-dnl link with the correct libraries.
+dnl Set up for gettext. PACKAGE is used when we call bindtextdomain.
ALL_LINGUAS=
CY_GNU_GETTEXT
+AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
+
dnl List of object files added by configure.
CONFIG_INSTALL=
CONFIG_UNINSTALL=
+SUBDIRS="doc testsuite nlm"
configdirs="doc testsuite"
AC_ARG_ENABLE(multi-ice,
AC_ARG_PROGRAM
+# ---------------------- #
+# Checks for libraries. #
+# ---------------------- #
+
+# We might need to link with -lm; most simulators need it.
+AC_CHECK_LIB(m, main)
+
+# We need to link with -lw to get `wctype' on Solaris before Solaris
+# 2.6. Solaris 2.6 and beyond have this function in libc, and have a
+# libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1
+# is known to have this problem). Therefore we avoid libw if we can.
+AC_CHECK_FUNC(wctype, [],
+ [AC_CHECK_LIB(w, wctype)])
+
+# Some systems (e.g. Solaris) have `socketpair' in libsocket.
+AC_SEARCH_LIBS(socketpair, socket)
+
AC_TYPE_SIGNAL
+AC_HEADER_DIRENT
AC_HEADER_STDC
dnl Solaris 7 needs _MSE_INT_H defined to avoid a clash between <widec.h>
AC_CHECK_HEADERS(ctype.h nlist.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 \
+ string.h sys/procfs.h sys/proc.h sys/ptrace.h sys/reg.h stdint.h \
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
- dirent.h sys/ndir.h sys/dir.h ndir.h sys/filio.h \
+ sys/filio.h \
curses.h ncurses.h \
poll.h sys/poll.h)
AC_HEADER_STAT
AC_C_CONST
AC_C_INLINE
-AC_CHECK_FUNCS(bcopy btowc bzero canonicalize_file_name isascii poll \
+AC_CHECK_FUNCS(btowc canonicalize_file_name isascii poll \
realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask )
AC_FUNC_ALLOCA
AC_FUNC_VFORK
fi
-AC_CHECK_LIB(socket, socketpair)
AC_CHECK_FUNCS(socketpair)
ia64-*-aix*)
AC_DEFINE(NEW_PROC_API)
;;
- *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
+ *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
AC_DEFINE(NEW_PROC_API)
;;
*-*-solaris2.[[678]])
fi
fi
-dnl See if host has libm. This is usually needed by simulators.
-AC_CHECK_LIB(m, main)
-
-dnl Solaris puts wctype in /usr/lib/libw.a before Solaris 2.6.
-dnl
-dnl A bug in GNU ld 2.9.1 causes a problem if we link in -lw
-dnl under Solaris 2.6 because it is some funky empty library.
-dnl So only link in libw if we have to.
-AC_CHECK_LIB(c, wctype,: ,AC_CHECK_LIB(w, wctype))
-
dnl See if compiler supports "long long" type.
AC_MSG_CHECKING(for long long support in compiler)
;;
esac
-dnl See if thread_db library is around for Solaris thread debugging. Note that
-dnl we must explicitly test for version 1 of the library because version 0
-dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
-dnl Note that we only want this if we are both native (host == target), and
-dnl not doing a canadian cross build (build == host).
+dnl For certain native configurations, we need to check whether thread
+dnl support can be built in or not.
+dnl
+dnl Note that we only want this if we are both native (host == target),
+dnl and not doing a canadian cross build (build == host).
if test ${build} = ${host} -a ${host} = ${target} ; then
case ${host_os} in
fi
;;
solaris*)
+ # See if thread_db library is around for Solaris thread debugging.
+ # Note that we must explicitly test for version 1 of the library
+ # because version 0 (present on Solaris 2.4 or earlier) doesn't have
+ # the same API.
AC_MSG_CHECKING(for Solaris thread debugging library)
if test -f /usr/lib/libthread_db.so.1 ; then
AC_MSG_RESULT(yes)
AC_MSG_RESULT(no)
fi
;;
+ aix*)
+ AC_MSG_CHECKING(for AiX thread debugging library)
+ AC_CACHE_VAL(gdb_cv_have_aix_thread_debug,
+ [AC_TRY_COMPILE([#include <sys/pthdebug.h>],
+ [#ifndef PTHDB_VERSION_3
+ #error
+ #endif],
+ gdb_cv_have_aix_thread_debug=yes,
+ gdb_cv_have_aix_thread_debug=no)])
+ AC_MSG_RESULT($gdb_cv_have_aix_thread_debug)
+ if test $gdb_cv_have_aix_thread_debug = yes; then
+ CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
+ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} aix-thread.o"
+ CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
+ fi
+ ;;
esac
AC_SUBST(CONFIG_LDFLAGS)
fi
+dnl See if we have a thread_db header file that has TD_NOTALLOC.
+if test "x$ac_cv_header_thread_db_h" = "xyes"; then
+ AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
+ gdb_cv_thread_db_h_has_td_notalloc,
+ AC_TRY_COMPILE(
+ [#include <thread_db.h>],
+ [int i = TD_NOTALLOC;],
+ gdb_cv_thread_db_h_has_td_notalloc=yes,
+ gdb_cv_thread_db_h_has_td_notalloc=no
+ )
+ )
+fi
+if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
+ AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
+ [Define if <thread_db.h> has the TD_NOTALLOC error code.])
+fi
+
+dnl linux-proc.c wants to use pread64, which may require special CFLAGS
+dnl -D_BSD_SOURCE is normally assumed but we have to specify it because of
+dnl -D_XOPEN_SOURCE=500.
+if test $host = $target; then
+ case $target in
+ *-linux*)
+ save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
+ AC_TRY_LINK([#include <unistd.h>],
+ [pread64 (0, NULL, 0, 0);],
+ [ENABLE_CFLAGS="$ENABLE_CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
+ AC_DEFINE(HAVE_PREAD64)], [])
+ CFLAGS=$save_CFLAGS
+ ;;
+ esac
+fi
+
dnl The CLI cannot be disabled yet, but may be in the future
dnl Handle CLI sub-directory configury.
CY_AC_PATH_TKH
CY_AC_PATH_ITCLH
CY_AC_PATH_ITKH
- CY_AC_PATH_TIXH
# now look for Tk library stuff
ITK_DEPS="${ITK_LIB_FULL_PATH}"
fi
- # now look for Tix library stuff
- CY_AC_PATH_TIXCONFIG
- if test -z "${no_tix}"; then
- CY_AC_LOAD_TIXCONFIG
- TIXLIB="${TIX_BUILD_LIB_SPEC}"
- TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}"
- fi
-
ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
# Tcl/Tk 8.1 require -fwritable strings. I don't
# know whether 8.2 will or not, but I bet it will.
fi
# Include some libraries that Tcl and Tk want.
- TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
+ TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
# Yes, the ordering seems wrong here. But it isn't.
# TK_LIBS is the list of libraries that need to be linked
# after Tcl/Tk. Note that this isn't put into LIBS. If it
fi
fi
fi
+
+ SUBDIRS="${SUBDIRS} gdbtk"
+ configdirs="${configdirs} gdbtk"
fi
AC_SUBST(X_CFLAGS)
AC_SUBST(ITCL_DEPS)
AC_SUBST(ITKLIB)
AC_SUBST(ITK_DEPS)
-AC_SUBST(TIXLIB)
-AC_SUBST(TIX_DEPS)
AC_SUBST(GDBTKLIBS)
AC_SUBST(GDBTK_CFLAGS)
AC_SUBST(GDBTK_SRC_DIR)
*) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
esac
-SUBDIRS="doc testsuite nlm"
if test "${enable_multi_ice}" = "yes"; then
SUBDIRS="${SUBDIRS} multi-ice"
fi
dnl Check for exe extension set on certain hosts (e.g. Win32)
AC_EXEEXT
+dnl Detect the character set used by this host.
+
+dnl At the moment, we just assume it's ISO-8859-1 (which is a
+dnl superset of ASCII containing the characters needed for French,
+dnl German, Spanish, Italian, and possibly others), but if were
+dnl *were* to support any host character sets other than ISO-8859-1,
+dnl here's where we'd detect it.
+AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "ISO-8859-1",
+ [Define to be a string naming the default host character set.])
+
+AM_ICONV
+
AC_CONFIG_SUBDIRS($configdirs)
AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
[
dnl
if test "${nativefile}" = ""; then
< Makefile \
- sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
+ sed -e '/^NATDEPFILES[[ ]]*=.*\\$/,/[[^\\]]$/s/^/# /' \
+ -e '/^NATDEPFILES[[ ]]*=/s/^/# /' \
| sed -e '/^\(NATDEPFILES[[ ]]*[[+]]=[[ ]]*\)/s//# \1/' \
> Makefile.tem
mv -f Makefile.tem Makefile