When we use a separate output directory, we add util/ to the include
path for the generated C files.  However, this is currently added to
the end of the path, behind /usr/include/slang and
/usr/include/gtk-2.0 if use of the respective libraries is enabled.
Thus the '#include "../perf.h"' in util/parse-events.l can actually
include /usr/include/perf.h if it exists.

Move '-Iutil/' ahead of all the other preprocessor options.

Reported-by: Sedat Dilek <sedat.di...@gmail.com>
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
 tools/perf/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 0eee64c..434175c 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -756,10 +756,10 @@ $(OUTPUT)perf.o perf.spec \
 # over the general rule for .o
 
 $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -w $<
+       $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -w $<
 
 $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 
-DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -w $<
+       $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -DYYENABLE_NLS=0 
-DYYLTYPE_IS_TRIVIAL=0 -w $<
 
 $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
        $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to