Permalink
Browse files

Build: find c-pragma.h,c-common.h regardless of gcc version

Add an extra -I line for the non-flattened location, then change all
inclusions to rely on the preprocessor search path to find the file.  It
is legal to specify a non-existent directory in the search path, so this
will work with both old and new layouts.
  • Loading branch information...
1 parent 99da8c8 commit 598c56676f6a217543701590c91c91931041179f Kevin Pyle committed Mar 25, 2012
Showing with 8 additions and 3 deletions.
  1. +1 −1 Makefile
  2. +1 −1 gcc-python-option.c
  3. +6 −1 gcc-python.c
View
@@ -97,7 +97,7 @@ PYTHON_CONFIG=python-config
PYTHON_INCLUDES=$(shell $(PYTHON_CONFIG) --includes)
PYTHON_LIBS=$(shell $(PYTHON_CONFIG) --libs)
-CPPFLAGS+= -I$(GCCPLUGINS_DIR)/include -I. $(PYTHON_INCLUDES)
+CPPFLAGS+= -I$(GCCPLUGINS_DIR)/include -I$(GCCPLUGINS_DIR)/include/c-family -I. $(PYTHON_INCLUDES)
# Allow user to pick optimization, choose whether warnings are fatal,
# and choose debugging information level.
CFLAGS?=-O2 -Werror -g
View
@@ -20,7 +20,7 @@
#include <Python.h>
#include "gcc-python.h"
#include "gcc-python-wrappers.h"
-#include "c-family/c-common.h" /* for warn_format */
+#include "c-common.h" /* for warn_format */
#include "diagnostic.h"
View
@@ -34,7 +34,12 @@ int plugin_is_GPL_compatible;
#include "cgraph.h"
#include "opts.h"
-#include "c-family/c-pragma.h" /* for parse_in */
+/*
+ * Use an unqualified name here and rely on dual search paths to let the
+ * compiler find it. This deals with c-pragma.h moving to a
+ * subdirectory in newer versions of gcc.
+ */
+#include "c-pragma.h" /* for parse_in */
#if 0
#define LOG(msg) \

0 comments on commit 598c566

Please sign in to comment.