summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Bouthenot <kolter@openics.org>2005-11-22 14:36:20 +0000
committerEmmanuel Bouthenot <kolter@openics.org>2005-11-22 14:36:20 +0000
commit578a57812f15c3bb5ba91492db4b02f8d7715d7e (patch)
treef642a13c778bc1e0e6a63ac5263b48f7bc5b9b61
parent83b82e1d7d9f4dc6fbf4ea2f47801558a884b447 (diff)
downloadweechat-578a57812f15c3bb5ba91492db4b02f8d7715d7e.zip
improve ruby detection
-rw-r--r--configure.in28
-rw-r--r--weechat/configure.in28
2 files changed, 48 insertions, 8 deletions
diff --git a/configure.in b/configure.in
index 4c53b444a..e2d2ffd17 100644
--- a/configure.in
+++ b/configure.in
@@ -273,11 +273,31 @@ fi
if test "x$enable_ruby" = "xyes" ; then
enable_plugins="yes"
+
+ AC_PATH_PROG(RUBY, ruby ruby1.9 ruby1.8)
+ if test -z $RUBY ; then
+ AC_MSG_ERROR([
+*** Ruby must be installed on your system
+*** but ruby interpreter couldn't be found in path.
+
+*** Please check that ruby is in path, or install
+*** it with your software package manager.])
+ fi
- # TODO: check that ruby lib and headers are installed
-
- RUBY_CFLAGS=-I`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
- RUBY_LFLAGS=`ruby -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
+ RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
+
+ AC_MSG_CHECKING(for Ruby header files)
+ if test -r "$RUBY_INCLUDE/ruby.h"; then
+ RUBY_CFLAGS="-I$RUBY_INCLUDE"
+ else
+ AC_MSG_ERROR([
+*** Ruby header files couldn't be found in your system.
+*** Try to install them with your software package manager.])
+ fi
+ AC_MSG_RESULT(found)
+
+ RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
+
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LFLAGS)
AC_DEFINE(PLUGIN_RUBY)
diff --git a/weechat/configure.in b/weechat/configure.in
index 4c53b444a..e2d2ffd17 100644
--- a/weechat/configure.in
+++ b/weechat/configure.in
@@ -273,11 +273,31 @@ fi
if test "x$enable_ruby" = "xyes" ; then
enable_plugins="yes"
+
+ AC_PATH_PROG(RUBY, ruby ruby1.9 ruby1.8)
+ if test -z $RUBY ; then
+ AC_MSG_ERROR([
+*** Ruby must be installed on your system
+*** but ruby interpreter couldn't be found in path.
+
+*** Please check that ruby is in path, or install
+*** it with your software package manager.])
+ fi
- # TODO: check that ruby lib and headers are installed
-
- RUBY_CFLAGS=-I`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
- RUBY_LFLAGS=`ruby -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
+ RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
+
+ AC_MSG_CHECKING(for Ruby header files)
+ if test -r "$RUBY_INCLUDE/ruby.h"; then
+ RUBY_CFLAGS="-I$RUBY_INCLUDE"
+ else
+ AC_MSG_ERROR([
+*** Ruby header files couldn't be found in your system.
+*** Try to install them with your software package manager.])
+ fi
+ AC_MSG_RESULT(found)
+
+ RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
+
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LFLAGS)
AC_DEFINE(PLUGIN_RUBY)