aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Marc-Antoine Perennou <Marc-Antoine@Perennou.com> 2015-01-18 19:48:12 +0100
committerAvatar Marc-Antoine Perennou <Marc-Antoine@Perennou.com> 2015-01-19 20:32:45 +0100
commit663ac9c885dd469399cb7cf88fe481b4ca684cec (patch)
treee3ef3749b62c95146d2b544066cb92545c80af40
parent115421932dfba71cc27c9ab02289aeeb31695f96 (diff)
downloadpaludis-663ac9c885dd469399cb7cf88fe481b4ca684cec.tar.gz
paludis-663ac9c885dd469399cb7cf88fe481b4ca684cec.tar.xz
ruby: allow specifying version
Change-Id: Iccfc68ed4168fa0288745ceef258d09561293e8e Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
-rw-r--r--configure.ac21
1 files changed, 17 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 0bf3bdc..7f43366 100644
--- a/configure.ac
+++ b/configure.ac
@@ -717,11 +717,24 @@ AC_ARG_ENABLE([ruby],
AC_MSG_RESULT($enable_ruby)
if test "x$enable_ruby" = "xyes" ; then
- PKG_CHECK_MODULES(RUBY, [ruby-2.2], [
- RUBY=`pkg-config --variable=ruby ruby-2.2`
- RUBY_SITEARCHDIR=`pkg-config --variable=sitearchdir ruby-2.2`
+ AC_ARG_WITH([ruby-version],
+ AS_HELP_STRING([--with-ruby-version=2.2], [Specify Ruby version]),
+ RUBY_VERSION="$withval",
+ RUBY_VERSION="2.2")
+
+ case "$RUBY_VERSION" in
+ 1.9|2.0|2.1|2.2)
+ ;;
+ *)
+ AC_MSG_ERROR([Invalid ruby version specified])
+ ;;
+ esac
+
+ PKG_CHECK_MODULES(RUBY, [ruby-$RUBY_VERSION], [
+ RUBY=`pkg-config --variable=ruby ruby-$RUBY_VERSION`
+ RUBY_SITEARCHDIR=`pkg-config --variable=sitearchdir ruby-$RUBY_VERSION`
], [
- AC_MSG_ERROR([Ruby is required for --enable-ruby])
+ AC_MSG_ERROR([Ruby $RUBY_VERSION is required for --enable-ruby])
])
AC_ARG_WITH([ruby-install-dir],