summaryrefslogtreecommitdiffstats
path: root/korundum
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-11 11:40:06 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-10-13 20:22:40 +0200
commitf6f0d597759bd72d5acfc2aefebce8f62e4fea52 (patch)
tree938ad19f264195ebf901c2267c825a896b195588 /korundum
parent7ad19b98e5d70cc790fcddee6018db6a1e954f64 (diff)
downloadtdebindings-f6f0d597759bd72d5acfc2aefebce8f62e4fea52.tar.gz
tdebindings-f6f0d597759bd72d5acfc2aefebce8f62e4fea52.zip
Detect presence of Ruby pkg-config file and adjust directory search accordingly
(cherry picked from commit de49c7480893e7d52f64ec1166a55cdf97b2541e)
Diffstat (limited to 'korundum')
-rw-r--r--korundum/rubylib/korundum/configure.in.in23
1 files changed, 19 insertions, 4 deletions
diff --git a/korundum/rubylib/korundum/configure.in.in b/korundum/rubylib/korundum/configure.in.in
index 81ad0bcb..5782123e 100644
--- a/korundum/rubylib/korundum/configure.in.in
+++ b/korundum/rubylib/korundum/configure.in.in
@@ -1,13 +1,28 @@
+KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
+ AC_MSG_WARN([Could not find pkg-config])
+])
+
AC_CHECK_PROG(RUBY, ruby, ruby)
if test -z "$RUBY"; then
DO_NOT_COMPILE="$DO_NOT_COMPILE korundum"
else
AC_MSG_CHECKING(for ruby dirs)
- RUBY_ARCHDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
- RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
- RUBY_SITEDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
- RUBY_RUBYLIBDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"rubylibdir"@:>@)'`
+ if test -n "$PKGCONFIG"; then
+ RUBY_VERSION=`$PKGCONFIG ruby --modversion 2>/dev/null`
+ if test -n "$RUBY_VERSION"; then
+ RUBY_ARCHDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"archdir"@:>@)'`
+ RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitearchdir"@:>@)'`
+ RUBY_SITEDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitelibdir"@:>@)'`
+ RUBY_RUBYLIBDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubylibdir"@:>@)'`
+ fi
+ fi
+ if test -z "$RUBY_VERSION"; then
+ RUBY_ARCHDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
+ RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
+ RUBY_SITEDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
+ RUBY_RUBYLIBDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"rubylibdir"@:>@)'`
+ fi
AC_MSG_RESULT([archdir $RUBY_ARCHDIR, sitearchdir $RUBY_SITEARCHDIR, sitedir $RUBY_SITEDIR])
AC_SUBST(RUBY_ARCHDIR)
AC_SUBST(RUBY_SITEARCHDIR)