From afabe7b0eff9c73957d28a5d4cd96f869a5821ef Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 8 Nov 2012 19:23:05 +0100 Subject: [PATCH] Use proper Ruby library depending on the available version --- configure.in | 8 ++++++++ src/dumm/Makefile.am | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index c00a478b7..2516ea994 100644 --- a/configure.in +++ b/configure.in @@ -666,6 +666,14 @@ if test x$dumm = xtrue; then else AC_MSG_ERROR([don't know how to run ruby]) fi + AC_MSG_CHECKING([for libruby]) + saved_LIBS=$LIBS + LIBS=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["LIBRUBYARG_SHARED"]] || ""') 2>/dev/null` + AC_TRY_LINK_FUNC(ruby_init, + [AC_MSG_RESULT([$LIBS]); RUBYLIB=$LIBS], + [AC_MSG_ERROR([not found])]) + AC_SUBST(RUBYLIB) + LIBS=$saved_LIBS fi if test x$fast = xtrue; then diff --git a/src/dumm/Makefile.am b/src/dumm/Makefile.am index 8b8cebcd8..3e4625ec8 100644 --- a/src/dumm/Makefile.am +++ b/src/dumm/Makefile.am @@ -11,7 +11,7 @@ irdumm_SOURCES = irdumm.c libdumm_la_LIBADD = -lbridge -lfuse -lutil $(top_builddir)/src/libstrongswan/libstrongswan.la dumm_LDADD = libdumm.la ${gtk_LIBS} $(top_builddir)/src/libstrongswan/libstrongswan.la -irdumm_LDADD = libdumm.la -lruby1.8 $(top_builddir)/src/libstrongswan/libstrongswan.la +irdumm_LDADD = libdumm.la ${RUBYLIB} $(top_builddir)/src/libstrongswan/libstrongswan.la INCLUDES = -I$(top_srcdir)/src/libstrongswan ${gtk_CFLAGS} \ ${RUBYINCLUDE}