From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10758 invoked by alias); 17 Apr 2013 10:02:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10749 invoked by uid 89); 17 Apr 2013 10:02:49 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 17 Apr 2013 10:02:11 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3HA29Ll023416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Apr 2013 06:02:09 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3HA289b026745; Wed, 17 Apr 2013 06:02:08 -0400 Message-ID: <516E731F.8000900@redhat.com> Date: Wed, 17 Apr 2013 15:54:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Use AC_DEFINE for USE_THREAD_DB (was: Re: [PATCH 5/6] Fix remaining GDBserver issues with !HAVE_THREAD_DB_H.) References: <20130416183043.540.32214.stgit@brno.lan> <20130416183118.540.36291.stgit@brno.lan> <87a9oy9tk6.fsf@fleche.redhat.com> In-Reply-To: <87a9oy9tk6.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00526.txt.bz2 On 04/16/2013 08:14 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> +INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) \ > Pedro> + @USE_THREAD_DB@ -DGDBSERVER > > It seems like gdbserver/configure.ac could just use AC_DEFINE instead. Agreed. I've applied the patch below. Thanks. ------------- Use AC_DEFINE for USE_THREAD_DB instead of manually passing it down through -D flags. gdb/gdbserver/ 2013-04-17 Pedro Alves * configure.ac (USE_THREAD_DB): Delete variable. (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB. Don't AC_SUBST USE_THREAD_DB. * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@. * config.in, configure: Regenerate. --- gdb/gdbserver/Makefile.in | 3 +-- gdb/gdbserver/config.in | 3 +++ gdb/gdbserver/configure | 7 +++---- gdb/gdbserver/configure.ac | 4 +--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index a2281cb..faa0098 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -123,8 +123,7 @@ CFLAGS = @CFLAGS@ INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) -INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) \ - @USE_THREAD_DB@ -DGDBSERVER +INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER # LDFLAGS is specifically reserved for setting from the command line # when running make. diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in index 738c322..35a836d 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -289,6 +289,9 @@ #endif +/* Define if we should use libthread_db. */ +#undef USE_THREAD_DB + /* Define if we should use the Windows API, instead of the POSIX API. On Windows, we use the Windows API when building for MinGW, but the POSIX API when building for Cygwin. */ diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index da257bb..5a56183 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -594,7 +594,6 @@ extra_libraries IPA_DEPFILES srv_xmlfiles srv_xmlbuiltin -USE_THREAD_DB GDBSERVER_LIBS GDBSERVER_DEPFILES RDYNAMIC @@ -5625,7 +5624,6 @@ LIBS="$old_LIBS" srv_thread_depfiles= srv_libs= -USE_THREAD_DB= if test "$srv_linux_thread_db" = "yes"; then if test "$ac_cv_lib_dl_dlopen" = "yes"; then @@ -5685,7 +5683,9 @@ $as_echo "$found" >&6; } fi srv_thread_depfiles="thread-db.o proc-service.o" - USE_THREAD_DB="-DUSE_THREAD_DB" + +$as_echo "#define USE_THREAD_DB 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TD_VERSION" >&5 $as_echo_n "checking for TD_VERSION... " >&6; } if test "${gdbsrv_cv_have_td_version+set}" = set; then : @@ -5918,7 +5918,6 @@ fi - GNULIB=build-gnulib-gdbserver/import GNULIB_STDINT_H= diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index f6227d1..fdd8918 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -322,7 +322,6 @@ LIBS="$old_LIBS" srv_thread_depfiles= srv_libs= -USE_THREAD_DB= if test "$srv_linux_thread_db" = "yes"; then if test "$ac_cv_lib_dl_dlopen" = "yes"; then @@ -350,7 +349,7 @@ if test "$srv_linux_thread_db" = "yes"; then fi srv_thread_depfiles="thread-db.o proc-service.o" - USE_THREAD_DB="-DUSE_THREAD_DB" + AC_DEFINE(USE_THREAD_DB, 1, [Define if we should use libthread_db.]) AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version, [AC_TRY_COMPILE([#include ], [TD_VERSION;], [gdbsrv_cv_have_td_version=yes], @@ -459,7 +458,6 @@ fi AC_SUBST(GDBSERVER_DEPFILES) AC_SUBST(GDBSERVER_LIBS) -AC_SUBST(USE_THREAD_DB) AC_SUBST(srv_xmlbuiltin) AC_SUBST(srv_xmlfiles) AC_SUBST(IPA_DEPFILES)