The configure script now tries to figure out where ruby.h is located.
authorTobias Brunner <tobias@strongswan.org>
Wed, 20 May 2009 12:15:14 +0000 (14:15 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 20 May 2009 17:38:01 +0000 (19:38 +0200)
This is required because the location depends on the architecture.

configure.in
src/dumm/Makefile.am

index c3f6d21..913b4db 100644 (file)
@@ -904,6 +904,30 @@ if test x$dumm = xtrue; then
        PKG_CHECK_MODULES(gtk, [gtk+-2.0 vte])
        AC_SUBST(gtk_CFLAGS)
        AC_SUBST(gtk_LIBS)
+       AC_CHECK_PROGS(RUBY, ruby)
+       AC_MSG_CHECKING([for Ruby header files])
+       if test -n "$RUBY"; then
+               RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
+               if test -n "$RUBYDIR"; then
+                       dirs="$RUBYDIR"
+                       RUBYINCLUDE=none
+                       for i in $dirs; do
+                               if test -r $i/ruby.h; then
+                                       AC_MSG_RESULT([$i])
+                                       RUBYINCLUDE="-I$i"
+                                       break;
+                               fi
+                       done
+                       if test x"$RUBYINCLUDE" = xnone; then
+                               AC_MSG_ERROR([ruby.h not found])
+                       fi
+                       AC_SUBST(RUBYINCLUDE)
+               else
+                       AC_MSG_ERROR([unable to determine ruby configuration])
+               fi
+       else
+               AC_MSG_ERROR([don't know how to run ruby])
+       fi
 fi
 
 if test x$fast = xtrue; then
index 029290f..64e40ee 100644 (file)
@@ -15,5 +15,5 @@ dumm_LDADD = libdumm.la ${gtk_LIBS}
 irdumm_LDADD = libdumm.la -lruby1.8
 
 INCLUDES = -I$(top_srcdir)/src/libstrongswan ${gtk_CFLAGS} \
-  -I/usr/lib/ruby/1.8/i486-linux/
+  ${RUBYINCLUDE}
 AM_CFLAGS = -D_FILE_OFFSET_BITS=64