Branch: master

48043023 2019-11-18 12:48:05 François Andriot
Add Ruby-2.6 detection.

Signed-off-by: gregory guy <gregory-tde@...>
M korundum/rubylib/korundum/configure.in.in
M qtruby/rubylib/qtruby/configure.in.in

korundum/rubyl

diff --git a/korundum/rubylib/korundum/configure.in.in b/korundum/rubylib/korundum/configure.in.in
index 9bd6599..313fca4 100644
--- a/korundum/rubylib/korundum/configure.in.in
+++ b/korundum/rubylib/korundum/configure.in.in
@@ -15,7 +15,7 @@
       RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
     fi
     if test -z "$RUBY_VERSION"; then
-      for RUBY_TEST in 2.5 2.4 2.3 2.2 2.1 2.0 1.9; do
+      for RUBY_TEST in 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.9; do
         RUBY_VERSION=`$PKG_CONFIG ruby-$RUBY_TEST --modversion 2>/dev/null`
         if test -n "$RUBY_VERSION"; then
           RUBY_CFLAGS=`$PKG_CONFIG ruby-$RUBY_TEST --cflags`

qtruby/rubyl

diff --git a/qtruby/rubylib/qtruby/configure.in.in b/qtruby/rubylib/qtruby/configure.in.in
index ed1519c..1aab347 100644
--- a/qtruby/rubylib/qtruby/configure.in.in
+++ b/qtruby/rubylib/qtruby/configure.in.in
@@ -15,7 +15,7 @@
       RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
     fi
     if test -z "$RUBY_VERSION"; then
-      for RUBY_TEST in 2.5 2.4 2.3 2.2 2.1 2.0 1.9; do
+      for RUBY_TEST in 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.9; do
         RUBY_VERSION=`$PKG_CONFIG ruby-$RUBY_TEST --modversion 2>/dev/null`
         if test -n "$RUBY_VERSION"; then
           RUBY_CFLAGS=`$PKG_CONFIG ruby-$RUBY_TEST --cflags`
1aaf11f0 2019-11-24 10:26:34 gregory guy
fix bug #2056, tdebindings does not rely anymore on pkg-config
to build Ruby binding, only rbconfig.rb is needed.

Signed-off-by: gregory guy <gregory-tde@...>
Signed-off-by: Slávek Banko <slavek.banko@...>
M korundum/rubylib/korundum/configure.in.in
M qtruby/rubylib/qtruby/configure.in.in

korundum/rubyl

diff --git a/korundum/rubylib/korundum/configure.in.in b/korundum/rubylib/korundum/configure.in.in
index 313fca4..0a98763 100644
--- a/korundum/rubylib/korundum/configure.in.in
+++ b/korundum/rubylib/korundum/configure.in.in
@@ -1,61 +1,35 @@
-KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
-  AC_MSG_WARN([Could not find pkg-config])
-])
+AC_CHECK_PROG(RUBY_EXECUTABLE, ruby, ruby)
 
-AC_CHECK_PROG(RUBY, ruby, ruby)
-
-if test -z "$RUBY"; then
+if test -z "RUBY_EXECUTABLE"; then
   DO_NOT_COMPILE="$DO_NOT_COMPILE korundum"
 else
-  AC_MSG_CHECKING(for ruby dirs)
-  # Note: pkgconfig file exists only for ruby >= 1.9.3
-  if test -n "$PKGCONFIG"; then
-    RUBY_VERSION=`$PKGCONFIG ruby --modversion 2>/dev/null`
-    if test -n "$RUBY_VERSION"; then
-      RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
-    fi
-    if test -z "$RUBY_VERSION"; then
-      for RUBY_TEST in 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.9; do
-        RUBY_VERSION=`$PKG_CONFIG ruby-$RUBY_TEST --modversion 2>/dev/null`
-        if test -n "$RUBY_VERSION"; then
-          RUBY_CFLAGS=`$PKG_CONFIG ruby-$RUBY_TEST --cflags`
-          break
-        fi
-      done
-    fi
-    if test -z "$RUBY_VERSION"; then
-      # pkgconfig file does not exist but might be 1.9.1: RUBY_VERSION defined in ruby/version.h
-      if test -n "$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubyhdrdir"@:>@)'"; then
-        # rubyhdrdir parameter works only in >=1.9.1; this is 1.9.1
-        RUBY_MAJOR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"['MAJOR']"@:>@)'`
-        RUBY_MINOR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"['MINOR']"@:>@)'`
-        RUBY_TEENY=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"['TEENY']"@:>@)'`
-        if test "$RUBY_MAJOR" == "1" && test "$RUBY_MINOR" == "9"; then
-          RUBY_VERSION="$RUBY_MAJOR.$RUBY_MINOR.$RUBY_TEENY"
-          RUBY_CFLAGS="-I`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubyhdrdir"@:>@)'`"
-          RUBY_CFLAGS="$RUBY_CFLAGS/`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"arch"@:>@)'` $RUBY_CFLAGS"
-        fi
-      fi
-    fi
-    if test -n "$RUBY_VERSION"; then
-      RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"archdir"@:>@)'`
-      RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitearchdir"@:>@)'`
-      RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitelibdir"@:>@)'`
-      RUBY_RUBYLIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubylibdir"@:>@)'`
-      RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'`
-      RUBY_INCLUDEDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubyhdrdir"@:>@)'`
-      RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
-      AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
-    fi
+  RUBY_MAJOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MAJOR))"`
+  RUBY_MINOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MINOR))"`
+
+  RUBY_ARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+  RUBY_SITEARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitearchdir))"`
+  RUBY_SITEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitelibdir))"`
+  RUBY_LIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(libdir))"`
+  RUBY_RUBYLIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubylibdir))"`
+  RUBY_LIBRUBYARG=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))"`
+
+  RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR"
+  if test "$RUBY_SERIES" -ge "19"; then
+     AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
   fi
-  if test -z "$RUBY_VERSION"; then
-    RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
-    RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
-    RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
-    RUBY_RUBYLIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"rubylibdir"@:>@)'`
-    RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
-    RUBY_INCLUDEDIR=$RUBY_ARCHDIR
-    RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
+
+  if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then
+     RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"`
+     if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyarchhdrdir))"` = "true"; then
+        RUBY_ARCHINCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyarchhdrdir))"`
+     else
+        RUBY_ARCH=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(arch))"`
+        RUBY_ARCHINCLUDEDIR=${RUBY_INCLUDEDIR}/${RUBY_ARCH}
+     fi
+     RUBY_CFLAGS="-I${RUBY_INCLUDEDIR} -I${RUBY_ARCHINCLUDEDIR}"
+  else
+     RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+     RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
   fi
 
   # Removes trailing slashes, if any, to avoid fail to install with recent libtool.
@@ -64,7 +38,7 @@
   RUBY_LIBDIR=${RUBY_LIBDIR%/}
   RUBY_RUBYLIBDIR=${RUBY_RUBYLIBDIR%/}
 
-  AC_MSG_RESULT([
+  AC_MSG_RESULT([\
                   archdir $RUBY_ARCHDIR,
                   sitearchdir $RUBY_SITEARCHDIR,
                   sitedir $RUBY_SITEDIR,

qtruby/rubyl

diff --git a/qtruby/rubylib/qtruby/configure.in.in b/qtruby/rubylib/qtruby/configure.in.in
index 1aab347..db0594a 100644
--- a/qtruby/rubylib/qtruby/configure.in.in
+++ b/qtruby/rubylib/qtruby/configure.in.in
@@ -1,61 +1,35 @@
-KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
-  AC_MSG_WARN([Could not find pkg-config])
-])
+AC_CHECK_PROG(RUBY_EXECUTABLE, ruby, ruby)
 
-AC_CHECK_PROG(RUBY, ruby, ruby)
-
-if test -z "$RUBY"; then
+if test -z "RUBY_EXECUTABLE"; then
   DO_NOT_COMPILE="$DO_NOT_COMPILE qtruby"
 else
-  AC_MSG_CHECKING(for ruby dirs)
-  # Note: pkgconfig file exists only for ruby >= 1.9.3
-  if test -n "$PKGCONFIG"; then
-    RUBY_VERSION=`$PKGCONFIG ruby --modversion 2>/dev/null`
-    if test -n "$RUBY_VERSION"; then
-      RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
-    fi
-    if test -z "$RUBY_VERSION"; then
-      for RUBY_TEST in 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.9; do
-        RUBY_VERSION=`$PKG_CONFIG ruby-$RUBY_TEST --modversion 2>/dev/null`
-        if test -n "$RUBY_VERSION"; then
-          RUBY_CFLAGS=`$PKG_CONFIG ruby-$RUBY_TEST --cflags`
-          break
-        fi
-      done
-    fi
-    if test -z "$RUBY_VERSION"; then
-      # pkgconfig file does not exist but might be 1.9.1: RUBY_VERSION defined in ruby/version.h
-      if test -n "$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubyhdrdir"@:>@)'"; then
-        # rubyhdrdir parameter works only in >=1.9.1; this is 1.9.1
-        RUBY_MAJOR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"['MAJOR']"@:>@)'`
-        RUBY_MINOR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"['MINOR']"@:>@)'`
-        RUBY_TEENY=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"['TEENY']"@:>@)'`
-        if test "$RUBY_MAJOR" == "1" && test "$RUBY_MINOR" == "9"; then
-          RUBY_VERSION="$RUBY_MAJOR.$RUBY_MINOR.$RUBY_TEENY"
-          RUBY_CFLAGS="-I`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubyhdrdir"@:>@)'`"
-          RUBY_CFLAGS="$RUBY_CFLAGS/`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"arch"@:>@)'` $RUBY_CFLAGS"
-        fi
-      fi
-    fi
-    if test -n "$RUBY_VERSION"; then
-      RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"archdir"@:>@)'`
-      RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitearchdir"@:>@)'`
-      RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitelibdir"@:>@)'`
-      RUBY_RUBYLIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubylibdir"@:>@)'`
-      RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'`
-      RUBY_INCLUDEDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubyhdrdir"@:>@)'`
-      RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
-      AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
-    fi
+  RUBY_MAJOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MAJOR))"`
+  RUBY_MINOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MINOR))"`
+
+  RUBY_ARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+  RUBY_SITEARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitearchdir))"`
+  RUBY_SITEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitelibdir))"`
+  RUBY_LIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(libdir))"`
+  RUBY_RUBYLIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubylibdir))"`
+  RUBY_LIBRUBYARG=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))"`
+
+  RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR"
+  if test "$RUBY_SERIES" -ge "19"; then
+     AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
   fi
-  if test -z "$RUBY_VERSION"; then
-    RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
-    RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
-    RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
-    RUBY_RUBYLIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"rubylibdir"@:>@)'`
-    RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
-    RUBY_INCLUDEDIR=$RUBY_ARCHDIR
-    RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
+
+  if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then
+     RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"`
+     if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyarchhdrdir))"` = "true"; then
+        RUBY_ARCHINCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyarchhdrdir))"`
+     else
+        RUBY_ARCH=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(arch))"`
+        RUBY_ARCHINCLUDEDIR=${RUBY_INCLUDEDIR}/${RUBY_ARCH}
+     fi
+     RUBY_CFLAGS="-I${RUBY_INCLUDEDIR} -I${RUBY_ARCHINCLUDEDIR}"
+  else
+     RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
+     RUBY_CFLAGS="-I${RUBY_INCLUDEDIR}"
   fi
 
   # Removes trailing slashes, if any, to avoid fail to install with recent libtool.
@@ -64,7 +38,7 @@
   RUBY_LIBDIR=${RUBY_LIBDIR%/}
   RUBY_RUBYLIBDIR=${RUBY_RUBYLIBDIR%/}
 
-  AC_MSG_RESULT([
+  AC_MSG_RESULT([\
                   archdir $RUBY_ARCHDIR,
                   sitearchdir $RUBY_SITEARCHDIR,
                   sitedir $RUBY_SITEDIR,

Branch: r14.0.x

6b98c93a 2019-11-24 11:27:10 gregory guy
fix bug #2056, tdebindings does not rely anymore on pkg-config
to build Ruby binding, only rbconfig.rb is needed.

Signed-off-by: gregory guy <gregory-tde@...>
Signed-off-by: Slávek Banko <slavek.banko@...>
(cherry picked from commit 1aaf11f05e12e72cff263c13a28964dabc5dcf7a)
M korundum/rubylib/korundum/configure.in.in
M qtruby/rubylib/qtruby/configure.in.in
** Diff limit reached (max: 250 lines) **