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


> It looks like this patch will still create the directories with
> --disable-plugin.

Fixed.

> In addition, readlink is not a utility you can portably use in makefiles.

Fixed. The new patch is a bit more brittle than the previous one, but
uses only the relative paths that are already available.


> --
> Joseph S. Myers
> joseph@codesourcery.com
>


2009-04-21  Rafael Avila de Espindola  <espindola@google.com>

       * Makefile.in (enable_plugin,INSTALL_PLUGIN,plugindir,
  	              plugin_includedir): New.
       (install): Depend on INSTALL_PLUGIN.
       (PLUGIN_HEADERS): New.
       (install-plugin): New.
       * config.gcc: Add vxworks-dummy.h to tm_file for x86 and x86-64.


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 f4f6764..8906d34 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,10 @@ 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 objects are installed
+plugindir = $(libsubdir)/plugin
+# Directory in which plugin headers are installed
+plugin_includedir = $(plugindir)/include
 # Used to produce a relative $(gcc_tooldir) in gcc.o
 unlibsubdir = ../../..
 # $(prefix), expressed as a path relative to $(libsubdir).
@@ -3970,7 +3982,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)
@@ -3993,6 +4005,48 @@ 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
+
+# Install plugin-version.o and the headers needed to build a plugin.
+install-plugin: installdirs plugin-version.o
+# We keep the directory structure for files in config and .def files. All
+# other files are flattened to a single directory.
+	$(mkinstalldirs) $(DESTDIR)$(plugindir)
+	$(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+	$(INSTALL_DATA) plugin-version.o $(DESTDIR)$(plugindir)/plugin-version.o
+	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 a2c7032..0bd46be 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]