summaryrefslogtreecommitdiff
blob: b02555afb65f3fba769afc1f1b90295edc573b4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
When : when building ruby bindings, it can not find ruby versin so configure will never enable ruby support
Why : It is required if you want to use libprelude with ruby
Upstream : https://www.prelude-siem.org/issues/759 It should be added in the next version of Prelude.
--- a/m4/am_path_ruby.m4
+++ b/m4/am_path_ruby.m4
@@ -96,11 +96,11 @@
   dnl   (shared libraries)
   AC_CACHE_CHECK([for $am_display_RUBY extension module directory],
     [am_cv_ruby_rbexecdir],
-    [am_cv_ruby_rbexecdir=`$RUBY -rrbconfig -e "drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/; prefix = Regexp.new('\\A' + Regexp.quote(RbConfig::CONFIG[['prefix']])); \\$prefix = RbConfig::CONFIG[['prefix']].sub(drive, ''); \\$sitearchdir = RbConfig::CONFIG[['sitearchdir']].sub(prefix, '\\$(prefix)').sub(drive, ''); print \\$sitearchdir;" 2>/dev/null || echo "${RUBY_EXEC_PREFIX}/local/lib/site_ruby/${RUBY_VERSION}/${RUBY_PLATFORM}"`])
+    [am_cv_ruby_rbexecdir=`$RUBY -r rbconfig -e "print RbConfig::CONFIG[['vendorarchdir']]"`])
   AC_SUBST([rbexecdir], [$am_cv_ruby_rbexecdir])
 
-  RUBY_INCLUDES=`$RUBY -r rbconfig -e 'if RbConfig::CONFIG[["archdir"]] then print " -I" + RbConfig::CONFIG[["archdir"]] end
-                                       if RbConfig::CONFIG[["rubyhdrdir"]] then print " -I" + RbConfig::CONFIG[["rubyhdrdir"]] end'`
+  RUBY_VER=`$RUBY -rrbconfig -e "print RbConfig::CONFIG[['ruby_pc']]" | sed 's/.pc//g'`
+  RUBY_INCLUDES=`pkg-config $RUBY_VER --cflags`
   AC_SUBST([RUBY_INCLUDES])
 
   dnl pkgrbexecdir -- $(rbexecdir)/$(PACKAGE)