From f0016899eec4ff2ad61ef56a21e4132dd314a37f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Feb 2013 12:12:42 +0200 Subject: Install plugin to pkgexecdir instead of bindir --- configure.ac | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index c0d4c30..5c77399 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ AC_LANG(C++) static_plugin="$enable_static" AS_IF([test x$static_plugin = xyes], - AC_DEFINE([STATIC_PLUGIN], [1], [Building static plugin.])) + AC_DEFINE([ODB_STATIC_PLUGIN], [1], [Building static plugin.])) # Check for plugin support in GCC unless we are building a static plugin. # In the latter case the headers normally come from the GCC build directly @@ -37,6 +37,49 @@ AS_IF([test x$static_plugin = xyes], # AS_IF([test x$static_plugin = xno], GCC_PLUGIN) +# Unless we are building a static plugin, try to figure out a relative +# path from the driver (bindir) to the plugin (libexecdir). +# +if test x$static_plugin = xno; then + # Get the expanded values for bindif and libexecdir. + # + if test x$exec_prefix = xNONE; then + if test x$prefix = xNONE; then + e_exec_prefix=$ac_default_prefix + else + e_exec_prefix=$prefix + fi + else + e_exec_prefix=$exec_prefix + fi + + e_pkglibexecdir=`echo "$libexecdir/$PACKAGE_NAME" | sed "s?^\\\${exec_prefix}?$e_exec_prefix?"` + e_bindir=`echo "$bindir" | sed "s?^\\\${exec_prefix}?$e_exec_prefix?"` + + # Try to find a common prefix. + # + common=$e_bindir + odb_plugindir=$e_pkglibexecdir + + while test x$common != x/; do + suffix=`echo "$e_pkglibexecdir" | sed "s?^$common/*??"` + if test x$suffix != x$e_pkglibexecdir; then + # Replace all the remaining directories in bindir with ".." + # and append the suffix. + odb_plugindir=`echo "$e_bindir" | sed "s?^$common/*??"` + odb_plugindir=`echo "$odb_plugindir" | sed ['s?[^/][^/]*?..?g']` + if test x$odb_plugindir != x -a x$suffix != x; then + odb_plugindir="$odb_plugindir/$suffix" + else + odb_plugindir="$odb_plugindir$suffix" + fi + break + fi + common=`AS_DIRNAME(["$common"])` + done + AC_DEFINE_UNQUOTED([ODB_PLUGIN_PATH], ["$odb_plugindir"], [Plugin path.]) +fi + # G++ name. # AC_ARG_WITH( @@ -57,7 +100,7 @@ AC_ARG_WITH( AS_IF( [test "x$gxx_name" != x], - [AC_DEFINE_UNQUOTED([GXX_NAME], ["$gxx_name"], [g++ binary.])]) + [AC_DEFINE_UNQUOTED([ODB_GXX_NAME], ["$gxx_name"], [g++ binary.])]) # Default options file. # @@ -79,7 +122,7 @@ AC_ARG_WITH( AS_IF( [test "x$options_file" != x], - [AC_DEFINE_UNQUOTED([DEFAULT_OPTIONS_FILE], ["$options_file"], [default options file path.])]) + [AC_DEFINE_UNQUOTED([ODB_DEFAULT_OPTIONS_FILE], ["$options_file"], [default options file path.])]) # Create the libtool executable so that we can use it in further tests. # -- cgit v1.1