This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [trunk][patch] Install headers and plugin-version.o


We now use plugin-version.h instead of plugin-version.o. Updated patch attached.

Bootstrapped and tested on linux x86-64. OK for trunk?

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 0e13e49..4915941 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -286,6 +286,14 @@ CLOOGINC = @CLOOGINC@
 # Libs and linker option needed for plugin support
 PLUGINLIBS = @pluginlibs@
 
+enable_plugin = @enable_plugin@
+
+ifeq ($(enable_plugin),yes)
+INSTALL_PLUGIN=install-plugin
+else
+INSTALL_PLUGIN=
+endif
+
 CPPLIB = ../libcpp/libcpp.a
 CPPINC = -I$(srcdir)/../libcpp/include
 
@@ -481,6 +489,8 @@ libexecdir = @libexecdir@
 libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
 # Directory in which the compiler finds executables
 libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+# Directory in which plugin headers are installed
+plugin_includedir = $(libsubdir)/plugin/include
 # Used to produce a relative $(gcc_tooldir) in gcc.o
 unlibsubdir = ../../..
 # $(prefix), expressed as a path relative to $(libsubdir).
@@ -3971,7 +3981,7 @@ maintainer-clean:
 # broken is small.
 install: install-common $(INSTALL_HEADERS) \
     install-cpp install-man install-info install-@POSUB@ \
-    install-driver
+    install-driver $(INSTALL_PLUGIN)
 
 # Handle cpp installation.
 install-cpp: installdirs cpp$(exeext)
@@ -3994,6 +4004,47 @@ installdirs:
 	$(mkinstalldirs) $(DESTDIR)$(man1dir)
 	$(mkinstalldirs) $(DESTDIR)$(man7dir)
 
+PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+  $(TOPLEV_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_PASS_H) gcc-plugin.h intl.h \
+  $(PLUGIN_VERSION_H)
+
+# Install the headers needed to build a plugin.
+install-plugin: installdirs
+# We keep the directory structure for files in config and .def files. All
+# other files are flattened to a single directory.
+	$(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+	headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\n' | sort -u`; \
+	for file in $$headers; do \
+	  if [ -f $$file ] ; then \
+	    path=$$file; \
+	  elif [ -f $(srcdir)/$$file ]; then \
+	    path=$(srcdir)/$$file; \
+	  else true; \
+	  fi; \
+	  if [ "$$path" != "" ]; then \
+	    config=gcc/config/; \
+	    echo $$path | grep "$$config" > /dev/null; \
+	    isconfig=$$?; \
+	    echo $$path | grep "\.def$$" > /dev/null; \
+	    isdef=$$?; \
+	    echo $$path | grep "^$(srcdir)" > /dev/null; \
+	    is_source=$$?; \
+	    if [ $$isdef = 0 ] || [ $$isconfig = 0 ]; then \
+	      if [ $$is_source = 0 ]; then \
+	        base=`echo $$path | sed "s|$(srcdir)||"`; \
+	        dest=$(plugin_includedir)/$$base; \
+	      else \
+	        dest=$(plugin_includedir)/`basename $$path`; \
+	      fi; \
+	    else \
+	      dest=$(plugin_includedir)/`basename $$path`; \
+	    fi; \
+	    dir=`dirname $$dest`; \
+	    mkdir -p $$dir; \
+	    $(INSTALL_DATA) $$path $(DESTDIR)/$$dest; \
+	  fi; \
+	done
+
 # Install the compiler executables built during cross compilation.
 install-common: native lang.install-common installdirs
 	for file in $(COMPILERS); do \
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 856a70b..503babe 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -375,12 +375,14 @@ i[34567]86-*-*)
 	if test "x$enable_cld" = xyes; then
 		tm_defines="${tm_defines} USE_IX86_CLD=1"
 	fi
+	tm_file="vxworks-dummy.h ${tm_file}"
 	;;
 x86_64-*-*)
 	tm_file="i386/biarch64.h ${tm_file}"
 	if test "x$enable_cld" = xyes; then
 		tm_defines="${tm_defines} USE_IX86_CLD=1"
 	fi
+	tm_file="vxworks-dummy.h ${tm_file}"
 	;;
 esac
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]