Explorar o código

gcc: Add a `gccplugin' variable to the `.pc' file.

* configure.ac: Substitute pkglibdir, gccplugindir,
  GCC_PLUGIN_DIR_PKGCONFIG, and GCC_PLUGIN_PKGCONFIG.

* gcc-plugin/src/Makefile.am (plugindir): Remove.
  (plugin_LTLIBRARIES): Rename to...
  (gccplugin_LTLIBRARIES): ... this.

* libstarpu-1.0.pc.in (pkglibdir): New variable.
  Substitute GCC_PLUGIN_PKGCONFIG and GCC_PLUGIN_PKGCONFIG.
Ludovic Courtès %!s(int64=13) %!d(string=hai) anos
pai
achega
9313e0ccb1
Modificáronse 3 ficheiros con 24 adicións e 6 borrados
  1. 17 0
      configure.ac
  2. 1 6
      gcc-plugin/src/Makefile.am
  3. 6 0
      libstarpu-1.0.pc.in

+ 17 - 0
configure.ac

@@ -1137,6 +1137,11 @@ if test "x$STARPU_DEVEL" != x; then
 	AC_DEFINE(STARPU_DEVEL, [1], [enable developer warnings])
 fi
 
+# Same value as Automake's, for use in other places.
+pkglibdir="\${libdir}/$PACKAGE"
+AC_SUBST([pkglibdir])
+
+
 ###############################################################################
 #                                                                             #
 #                               GCC extensions                                #
@@ -1159,6 +1164,18 @@ if test "x$enable_gcc_plugin" = "xyes" -o "x$enable_gcc_plugin" = "xmaybe" ; the
 	else
 	    AC_MSG_WARN([GCC plug-ins not supported; StarPU's GCC plug-in will not be built])
         fi
+    else
+        # The `.so' itself cannot be called `starpu-gcc.so' (because
+	# `-fplugin-arg-' option names and such must match the `.so'
+	# name), so use a meaningful directory name.
+	gccplugindir="\${pkglibdir}/${STARPU_EFFECTIVE_VERSION}/gcc"
+	AC_SUBST([gccplugindir])
+
+	# Lines to be inserted in the `.pc' file.
+	GCC_PLUGIN_DIR_PKGCONFIG="gccplugindir=$gccplugindir"
+	GCC_PLUGIN_PKGCONFIG="gccplugin=\${gccplugindir}/starpu.so"
+	AC_SUBST([GCC_PLUGIN_DIR_PKGCONFIG])
+	AC_SUBST([GCC_PLUGIN_PKGCONFIG])
     fi
 fi
 

+ 1 - 6
gcc-plugin/src/Makefile.am

@@ -13,14 +13,9 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-# The `.so' itself cannot be called `starpu-gcc.so' (because
-# `-fplugin-arg-' option names and such must match the `.so' name), so
-# use a meaningful directory name.
-plugindir = $(pkglibdir)/$(STARPU_EFFECTIVE_VERSION)/gcc
-
 # `LIBRARIES' would be more appropriate than `LTLIBRARIES' but it
 # requires a name prefixed by `lib'.
-plugin_LTLIBRARIES = starpu.la
+gccplugin_LTLIBRARIES = starpu.la
 
 starpu_la_SOURCES = starpu.c c-expr.y
 

+ 6 - 0
libstarpu-1.0.pc.in

@@ -17,8 +17,14 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
+pkglibdir=@pkglibdir@
 includedir=@includedir@
 
+# When the GCC plug-in is available, the following lines indicate
+# where it is installed.
+@GCC_PLUGIN_DIR_PKGCONFIG@
+@GCC_PLUGIN_PKGCONFIG@
+
 Name: starpu
 Description: offers support for heterogeneous multicore architecture
 Version: @PACKAGE_VERSION@