Use AC_DEFINE for USE_THREAD_DB
authorPedro Alves <palves@redhat.com>
Wed, 17 Apr 2013 09:58:15 +0000 (09:58 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 17 Apr 2013 09:58:15 +0000 (09:58 +0000)
Use AC_DEFINE for USE_THREAD_DB instead of manually passing it down
through -D flags.

gdb/gdbserver/
2013-04-17  Pedro Alves  <palves@redhat.com>

* 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/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/config.in
gdb/gdbserver/configure
gdb/gdbserver/configure.ac

index f4c454391969e4c0b66ee4558c35575ca46f5cae..5edc818bcb12453fcff10ada21bcd6969ef1011a 100644 (file)
@@ -1,3 +1,11 @@
+2013-04-17  Pedro Alves  <palves@redhat.com>
+
+       * 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.
+
 2013-04-16  Pedro Alves  <palves@redhat.com>
 
        * linux-low.h (struct lwp_info) <thread_known>: Move under
index a2281cbb9b8fc005b85c8ef3df1f76708dcc3d79..faa00983b5d6ebb9ce246feee09cffbda50703fd 100644 (file)
@@ -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.
index 738c32224dbd072b20d689ff2aaa9f3d0ea1aad6..35a836dc614488cc7e1167a62c50d831357f3479 100644 (file)
 #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. */
index da257bb76a283669f3c4f0cf72f166ee56815b06..5a561833aca36205cdbcc6d6c9cc871e9ce25f3d 100755 (executable)
@@ -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=
index f6227d1378aa8c0c3c8894a460bc658632d79576..fdd891848e1a70717aeeec17bbacb0b61d000dfd 100644 (file)
@@ -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 <thread_db.h>], [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)