diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-11 11:40:06 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-11 11:40:06 -0500 |
commit | de49c7480893e7d52f64ec1166a55cdf97b2541e (patch) | |
tree | 5dbfaf3abccc61fc2952b97e500539a558e16f3e /qtruby/rubylib | |
parent | f4b0c9ccf3332007a974c499520c8e1ca95e612f (diff) | |
download | tdebindings-de49c7480893e7d52f64ec1166a55cdf97b2541e.tar.gz tdebindings-de49c7480893e7d52f64ec1166a55cdf97b2541e.zip |
Detect presence of Ruby pkg-config file and adjust directory search accordingly
Diffstat (limited to 'qtruby/rubylib')
-rw-r--r-- | qtruby/rubylib/qtruby/configure.in.in | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/qtruby/rubylib/qtruby/configure.in.in b/qtruby/rubylib/qtruby/configure.in.in index 453bb68d..3cfa630a 100644 --- a/qtruby/rubylib/qtruby/configure.in.in +++ b/qtruby/rubylib/qtruby/configure.in.in @@ -1,15 +1,32 @@ +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 qtruby" 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"@:>@)'` - RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'` - RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'` + 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"@:>@)'` + RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'` + RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'` + 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"@:>@)'` + RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'` + RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'` + fi AC_MSG_RESULT([archdir $RUBY_ARCHDIR, sitearchdir $RUBY_SITEARCHDIR, sitedir $RUBY_SITEDIR, libdir $RUBY_LIBDIR, librubyarg $RUBY_LIBRUBYARG]) AC_SUBST(RUBY_ARCHDIR) AC_SUBST(RUBY_SITEARCHDIR) |