Fix bug #2056, amarok does not rely anymore on pkg-config

to build Ruby support, only rbconfig.rb is needed.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 2d6d94a45c)
r14.0.x
gregory guy 4 years ago committed by Slávek Banko
parent 7e2b2c28fe
commit 8cde155c5e
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1147,62 +1147,70 @@ AC_CHECK_TYPES([uint8_t, u_int8_t, uint16_t, u_int16_t, uint32_t, u_int32_t, uin
# BEGIN DAAP MONGREL RUBY VARIABLE # BEGIN DAAP MONGREL RUBY VARIABLE
############################################################################### ###############################################################################
AC_PATH_PROG(RUBY, ruby, no) AC_CHECK_PROG(RUBY_EXECUTABLE, ruby, ruby)
if test -n "$PKG_CONFIG"; then if test -n "RUBY_EXECUTABLE"; then
RUBY_VERSION=`$PKG_CONFIG ruby --modversion 2>/dev/null` RUBY_MAJOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MAJOR))"`
if test -n "$RUBY_VERSION"; then RUBY_MINOR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(MINOR))"`
RUBY_CFLAGS=`$PKG_CONFIG ruby --cflags`
fi RUBY_ARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(archdir))"`
if test -z "$RUBY_VERSION"; then RUBY_SITEARCHDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitearchdir))"`
for RUBY_TEST in 2.5 2.4 2.3 2.2 2.1 2.0 1.9; do RUBY_SITEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(sitelibdir))"`
RUBY_VERSION=`$PKG_CONFIG ruby-$RUBY_TEST --modversion 2>/dev/null` RUBY_LIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(libdir))"`
if test -n "$RUBY_VERSION"; then RUBY_RUBYLIBDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubylibdir))"`
RUBY_CFLAGS=`$PKG_CONFIG ruby-$RUBY_TEST --cflags` RUBY_LIBRUBYARG=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(LIBRUBYARG_SHARED))"`
break
fi RUBY_SERIES="$RUBY_MAJOR$RUBY_MINOR"
done if test "$RUBY_SERIES" -ge "19"; then
fi AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
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 fi
if test -n "$RUBY_VERSION"; then
RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"archdir"@:>@)'` if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyhdrdir))"` = "true"; then
RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitearchdir"@:>@)'` RUBY_INCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyhdrdir))"`
RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitelibdir"@:>@)'` if test `${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.key?(%q(rubyarchhdrdir))"` = "true"; then
RUBY_RUBYLIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubylibdir"@:>@)'` RUBY_ARCHINCLUDEDIR=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(rubyarchhdrdir))"`
RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'` else
RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'` RUBY_ARCH=`${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG.fetch(%q(arch))"`
AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x]) 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 fi
fi
if test -z "$RUBY_VERSION"; then
ruby_includes=[`$RUBY -rrbconfig -e 'puts Config.expand( Config::MAKEFILE_CONFIG["archdir"] )'`]
ruby_ldflags=[`$RUBY -rrbconfig -e 'puts Config.expand( Config::MAKEFILE_CONFIG["LIBRUBYARG_SHARED"] )'`]
RUBY_CFLAGS="-I$ruby_includes"
RUBY_LIBRUBYARG="$ruby_ldflags"
fi
AC_SUBST(RUBY_CFLAGS) # Removes trailing slashes, if any, to avoid fail to install with recent libtool.
AC_SUBST(RUBY_LIBRUBYARG) RUBY_ARCHDIR=${RUBY_ARCHDIR%/}
OLDCFLAGS="$CFLAGS" RUBY_SITEDIR=${RUBY_SITEDIR%/}
CFLAGS="$RUBY_CFLAGS -Wall" RUBY_LIBDIR=${RUBY_LIBDIR%/}
OLDCPPFLAGS="$CPPFLAGS" RUBY_RUBYLIBDIR=${RUBY_RUBYLIBDIR%/}
CPPFLAGS="$RUBY_CFLAGS" #no I don't know why CPPFLAGS is used
AC_CHECK_HEADERS([ruby.h], [have_ruby_h=yes], [have_ruby_h=no]) #used in ruby check below AC_MSG_RESULT([\
CFLAGS="$OLDCFLAGS" archdir $RUBY_ARCHDIR,
CPPFLAGS="$OLDCPPFLAGS" sitearchdir $RUBY_SITEARCHDIR,
sitedir $RUBY_SITEDIR,
rubylibdir $RUBY_RUBYLIBDIR,
libdir $RUBY_LIBDIR,
includedir $RUBY_INCLUDEDIR,
librubyarg $RUBY_LIBRUBYARG,
cflags $RUBY_CFLAGS])
AC_SUBST(RUBY_ARCHDIR)
AC_SUBST(RUBY_SITEARCHDIR)
AC_SUBST(RUBY_SITEDIR)
AC_SUBST(RUBY_RUBYLIBDIR)
AC_SUBST(RUBY_LIBDIR)
AC_SUBST(RUBY_INCLUDEDIR)
AC_SUBST(RUBY_LIBRUBYARG)
AC_SUBST(RUBY_CFLAGS)
OLDCFLAGS="$CFLAGS"
CFLAGS="$RUBY_CFLAGS -Wall"
OLDCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$RUBY_CFLAGS"
AC_CHECK_HEADERS([ruby.h], [have_ruby_h=yes], [have_ruby_h=no]) #used in ruby check below
CFLAGS="$OLDCFLAGS"
CPPFLAGS="$OLDCPPFLAGS"
fi
############################################################################### ###############################################################################
# END DAAP MONGREL RUBY VARIABLE # END DAAP MONGREL RUBY VARIABLE
@ -1215,7 +1223,7 @@ CPPFLAGS="$OLDCPPFLAGS"
############################################################################### ###############################################################################
## TODO: Check version number >= 1.8 ## TODO: Check version number >= 1.8
if test "x$RUBY" = "xno" -o "x$have_ruby_h" = "xno"; then if test -z "$RUBY_EXECUTABLE" -o "x$have_ruby_h" = "xno"; then
amarok_error_noruby=yes amarok_error_noruby=yes
DO_NOT_COMPILE="$DO_NOT_COMPILE amarok" DO_NOT_COMPILE="$DO_NOT_COMPILE amarok"
no_amarok=yes no_amarok=yes

Loading…
Cancel
Save