X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fconfigure.ac;h=9a6247be7f7d0ce7835a5359cf5ee9cb053e6adc;hb=70f575ccc8d2ef399512be60131931dc16149149;hp=2725e1868a0e4b91e1c1a3dc3f24f4b2664e1927;hpb=094a342e1973481b35234cafbff0cc45b37d3990;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/configure.ac b/gdb/configure.ac index 2725e1868a..9a6247be7f 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -48,49 +48,13 @@ CONFIG_CLEAN= CONFIG_INSTALL= CONFIG_UNINSTALL= -dnl Set up for gettext. PACKAGE is used when we call bindtextdomain. - -CY_GNU_GETTEXT +dnl Set up for gettext. +ZW_GNU_GETTEXT_SISTER_DIR localedir='${datadir}/locale' AC_SUBST(localedir) -if test "x$POSUB" != x; then - - dnl Lifted from GCC's config/gettext.m4. - AC_MSG_CHECKING(for catalogs to be installed) - # Look for .po and .gmo files in the source directory. - CATALOGS= AC_SUBST(CATALOGS) - XLINGUAS= - for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do - # If there aren't any .gmo files the shell will give us the - # literal string "../path/to/srcdir/po/*.gmo" which has to be - # weeded out. - case "$cat" in *\**) - continue;; - esac - # The quadruple backslash is collapsed to a double backslash - # by the backticks, then collapsed again by the double quotes, - # leaving us with one backslash in the sed expression (right - # before the dot that mustn't act as a wildcard). - cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"` - lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"` - # The user is allowed to set LINGUAS to a list of languages to - # install catalogs for. If it's empty that means "all of them." - if test "x$LINGUAS" = x; then - CATALOGS="$CATALOGS $cat" - XLINGUAS="$XLINGUAS $lang" - else - case "$LINGUAS" in *$lang*) - CATALOGS="$CATALOGS $cat" - XLINGUAS="$XLINGUAS $lang" - ;; - esac - fi - done - LINGUAS="$XLINGUAS" - AC_MSG_RESULT($LINGUAS) - +if test x"$USE_NLS" = xyes; then CONFIG_ALL="$CONFIG_ALL all-po" CONFIG_CLEAN="$CONFIG_CLEAN clean-po" CONFIG_INSTALL="$CONFIG_INSTALL install-po" @@ -111,12 +75,34 @@ AC_DEFINE_DIR(DEBUGDIR, debugdir, [Global directory for separate debug files. ]) #AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"), +if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi +else + test_prefix=$exec_prefix +fi +case ${debugdir} in +"${test_prefix}"|"${test_prefix}/"*|\ +'${exec_prefix}'|'${exec_prefix}/'*) + AC_DEFINE(DEBUGDIR_RELOCATABLE, 1, [Define if the debug directory should be relocated when GDB is moved.]) + ;; +esac + AC_CONFIG_SUBDIRS(doc testsuite) # Provide defaults for some variables set by the per-host and per-target # configuration. gdb_host_obs=posix-hdep.o +if test "${target}" = "${host}"; then + gdb_native=yes +else + gdb_native=no +fi + . $srcdir/configure.host . $srcdir/configure.tgt @@ -351,6 +337,17 @@ if test "$ac_cv_search_tgetent" = no; then AC_MSG_ERROR([no termcap library found]) fi +AC_LIB_HAVE_LINKFLAGS([expat], [], [#include "expat.h"], + [XML_Parser p = XML_ParserCreate (0);]) +if test "$HAVE_LIBEXPAT" != yes; then + AC_MSG_WARN([expat is missing or unusable; some features may be disabled.]) +else + save_LIBS=$LIBS + LIBS="$LIBS $LIBEXPAT" + AC_CHECK_FUNCS(XML_StopParser) + LIBS=$save_LIBS +fi + # ------------------------- # # Checks for header files. # # ------------------------- # @@ -370,6 +367,7 @@ AC_CHECK_HEADERS(link.h, [], [], AC_CHECK_HEADERS(machine/reg.h) AC_CHECK_HEADERS(poll.h sys/poll.h) AC_CHECK_HEADERS(proc_service.h thread_db.h gnu/libc-version.h) +AC_CHECK_HEADERS(signal.h) AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(stdint.h) @@ -379,6 +377,7 @@ AC_CHECK_HEADERS(sys/file.h) AC_CHECK_HEADERS(sys/filio.h) AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/param.h) +AC_CHECK_HEADERS(sys/resource.h) AC_CHECK_HEADERS(sys/proc.h, [], [], [#if HAVE_SYS_PARAM_H # include @@ -422,6 +421,9 @@ AC_CHECK_HEADERS(term.h, [], [], # unconditionally, so what's the point in checking these? AC_CHECK_HEADERS(ctype.h time.h) +# Create a header we can use portably to get the standard integer types. +GCC_HEADER_STDINT(gdb_stdint.h) + # ------------------------- # # Checks for declarations. # # ------------------------- # @@ -463,6 +465,7 @@ AC_FUNC_ALLOCA AC_FUNC_MMAP AC_FUNC_VFORK AC_CHECK_FUNCS(canonicalize_file_name realpath) +AC_CHECK_FUNCS(getrusage) AC_CHECK_FUNCS(getuid getgid) AC_CHECK_FUNCS(poll) AC_CHECK_FUNCS(pread64) @@ -1045,7 +1048,8 @@ if test ${build} = ${host} -a ${host} = ${target} ; then AC_SUBST(CONFIG_LDFLAGS) fi -dnl See if we have a thread_db header file that has TD_NOTALLOC. +dnl See if we have a thread_db header file that has TD_NOTALLOC and +dnl other error codes. if test "x$ac_cv_header_thread_db_h" = "xyes"; then AC_CACHE_CHECK([whether has TD_NOTALLOC], gdb_cv_thread_db_h_has_td_notalloc, @@ -1056,11 +1060,37 @@ if test "x$ac_cv_header_thread_db_h" = "xyes"; then gdb_cv_thread_db_h_has_td_notalloc=no ) ) + AC_CACHE_CHECK([whether has TD_VERSION], + gdb_cv_thread_db_h_has_td_version, + AC_TRY_COMPILE( + [#include ], + [int i = TD_VERSION;], + gdb_cv_thread_db_h_has_td_version=yes, + gdb_cv_thread_db_h_has_td_version=no + ) + ) + AC_CACHE_CHECK([whether has TD_NOTLS], + gdb_cv_thread_db_h_has_td_notls, + AC_TRY_COMPILE( + [#include ], + [int i = TD_NOTLS;], + gdb_cv_thread_db_h_has_td_notls=yes, + gdb_cv_thread_db_h_has_td_notls=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 has the TD_NOTALLOC error code.]) fi +if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then + AC_DEFINE(THREAD_DB_HAS_TD_VERSION, 1, + [Define if has the TD_VERSION error code.]) +fi +if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then + AC_DEFINE(THREAD_DB_HAS_TD_NOTLS, 1, + [Define if has the TD_NOTLS error code.]) +fi dnl See if we have a sys/syscall header file that has __NR_tkill. if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then @@ -1091,7 +1121,7 @@ AC_ARG_WITH(sysroot, TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' - if test "x$exec_prefix" = xNONE; then + if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then if test "x$prefix" = xNONE; then test_prefix=/usr/local else @@ -1132,32 +1162,15 @@ if test "${ERROR_ON_WARNING}" = yes ; then WERROR_CFLAGS="-Werror" fi -# NOTE: Don't add -Wall or -Wunused, they both include -# -Wunused-parameter which reports bogus warnings. -# NOTE: If you add to this list, remember to update +# The entries after -Wno-pointer-sign are disabled warnings which may +# be enabled in the future, which can not currently be used to build +# GDB. +# NOTE: If you change this list, remember to update # gdb/doc/gdbint.texinfo. -build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \ --Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \ --Wunused-label -Wunused-function -Wno-pointer-sign" - -# GCC supports -Wuninitialized only with -O or -On, n != 0. -if test x${CFLAGS+set} = xset; then - case "${CFLAGS}" in - *"-O0"* ) ;; - *"-O"* ) - build_warnings="${build_warnings} -Wuninitialized" - ;; - esac -else - build_warnings="${build_warnings} -Wuninitialized" -fi +build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ +-Wformat-nonliteral -Wno-pointer-sign \ +-Wno-unused -Wno-switch" -# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs -# -Wunused-function -Wunused-variable -Wunused-value -# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual -# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -# -Woverloaded-virtual -Winline -Werror" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in @@ -1202,7 +1215,7 @@ then CFLAGS="$saved_CFLAGS" esac done - AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS}) + AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS}) fi AC_SUBST(WARN_CFLAGS) AC_SUBST(WERROR_CFLAGS) @@ -1447,7 +1460,7 @@ fi AC_SUBST(target_subdir) frags= -if test "${target}" = "${host}"; then +if test "${gdb_native}" = "yes"; then host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh if test ! -f ${host_makefile_frag}; then AC_MSG_ERROR("*** Gdb does not support native target ${host}") @@ -1473,10 +1486,10 @@ s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p ' ${host_makefile_frag}` targetfile=`sed -n ' -s/DEPRECATED_TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p +s/^[ ]*DEPRECATED_TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p ' ${target_makefile_frag}` -if test "${target}" = "${host}"; then +if test "${gdb_native}" = "yes"; then # We pick this up from the host configuration file (.mh) because we # do not have a native configuration Makefile fragment. nativefile=`sed -n ' @@ -1502,8 +1515,8 @@ if test "x$enable_multi_ice" = xyes; then AC_CONFIG_SUBDIRS(multi-ice) fi -# We only build gdbserver automatically if host and target are the same. -if test "x$target" = "x$host"; then +# We only build gdbserver automatically in a native configuration. +if test "$gdb_native" = "yes"; then AC_MSG_CHECKING(whether gdbserver is supported on this host) if test "x$build_gdbserver" = xyes; then AC_MSG_RESULT(yes) @@ -1513,12 +1526,6 @@ if test "x$target" = "x$host"; then fi fi -# We configure the nlm subdirectory on netware targets, as instructed -# by configure.tgt. -if test "x$build_nlm" = xyes; then - AC_CONFIG_SUBDIRS(nlm) -fi - # If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or # nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link # to an empty version.