]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix CPPFLAGS handling in gdbserver's build.
authorJoel Brobecker <brobecker@adacore.com>
Tue, 16 Sep 2014 18:55:01 +0000 (11:55 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 16 Sep 2014 20:31:07 +0000 (13:31 -0700)
In gdb/gdbserver/Makefile.in, IPAGENT_CFLAGS is defined using
an expression which references $(CPPFLAGS). But CPPFLAGS isn't
actually defined.

This patch first adds a CPPFLAGS definition, so as to inherit
the value passed at configure time (if any). And it then makes it
part of INTERNAL_CFLAGS_BASE, instead. There is no reason that
CPPFLAGS be useful for a certain class of source files, and not
the rest. This is also consistent with what's done in GDB.

gdb/gdbserver/ChangeLog:

        * Makefile.in (CPPFLAGS): Define.
        (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
        (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.

Tested by rebuilding GDBserver with a dummy CPPFLAGS, and verifying
that the compilation command was altered as expected.

gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in

index f244123c1b5ce89e9b62ec99c45d632e18689d9f..ec32f7160ac44f08ae160655e38c822177f48ec4 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-16  Joel Brobecker  <brobecker@adacore.com>
+
+       * Makefile.in (CPPFLAGS): Define.
+       (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
+       (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
+
 2014-09-16  Gary Benson  <gbenson@redhat.com>
 
        * inferiors.h (current_inferior): Renamed as...
index 074d93d3d3f64c3223242d46fc6b4497d66c3219..e9d6b15fb2e557dcb7c91c769b3f5c81461f5500 100644 (file)
@@ -128,10 +128,11 @@ WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \
 # CFLAGS is specifically reserved for setting from the command line
 # when running make.  I.E.  "make CFLAGS=-Wmissing-prototypes".
 CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
 
 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
 INTERNAL_CFLAGS_BASE =  ${CFLAGS} ${GLOBAL_CFLAGS} \
-       ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS}
+       ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
 INTERNAL_WARN_CFLAGS =  ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
 INTERNAL_CFLAGS =  ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
 
@@ -447,7 +448,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
 
 # Note, we only build the IPA if -fvisibility=hidden is supported in
 # the first place.
-IPAGENT_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
+IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
        -fPIC -DIN_PROCESS_AGENT \
        -fvisibility=hidden