Browse Source

gcc: Install the plug-in under a GCC-version-dependent directory.

* configure.ac: Check the GCC version.  Append "/GCC_MAJOR.GCC_MINOR" to
  $gccplugindir.

* m4/gcc.m4 (STARPU_GCC_VERSION): New macro.
Ludovic Courtès 13 years ago
parent
commit
46e9ebe12c
2 changed files with 12 additions and 1 deletions
  1. 4 1
      configure.ac
  2. 8 0
      m4/gcc.m4

+ 4 - 1
configure.ac

@@ -1182,10 +1182,13 @@ if test "x$enable_gcc_plugin" = "xyes" -o "x$enable_gcc_plugin" = "xmaybe" ; the
 	    AC_MSG_WARN([GCC plug-ins not supported; StarPU's GCC plug-in will not be built])
         fi
     else
+        # What GCC version are we using?
+        STARPU_GCC_VERSION
+
         # 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"
+	gccplugindir="\${pkglibdir}/${STARPU_EFFECTIVE_VERSION}/gcc/${STARPU_GCC_VERSION_MAJOR}.${STARPU_GCC_VERSION_MINOR}"
 	AC_SUBST([gccplugindir])
 
 	# Lines to be inserted in the `.pc' file.

+ 8 - 0
m4/gcc.m4

@@ -84,3 +84,11 @@ AC_DEFUN([STARPU_GCC_PLUGIN_SUPPORT], [
 
   AC_SUBST([GCC_PLUGIN_INCLUDE_DIR])
 ])
+
+dnl Substitute `STARPU_GCC_VERSION_MAJOR' and `STARPU_GCC_VERSION_MINOR'.
+AC_DEFUN([STARPU_GCC_VERSION], [
+  AC_COMPUTE_INT([STARPU_GCC_VERSION_MAJOR], [__GNUC__])
+  AC_COMPUTE_INT([STARPU_GCC_VERSION_MINOR], [__GNUC_MINOR__])
+  AC_SUBST([STARPU_GCC_VERSION_MAJOR])
+  AC_SUBST([STARPU_GCC_VERSION_MINOR])
+])