summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-26 20:51:20 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-10-29 04:20:12 +0100
commit2762188456fa4a58d7927c5a18a0ded251054874 (patch)
tree94a07d542e12e3ec7f0f465f2314c3707cfe309e
parent8f7845b165a437501b4dd900cdf4d512ac57f089 (diff)
downloadamarok-2762188456fa4a58d7927c5a18a0ded251054874.tar.gz
amarok-2762188456fa4a58d7927c5a18a0ded251054874.zip
Fix build system for ruby >= 1.9
(cherry picked from commit d9227e4639f3489c25954aafa3657105881a3db1)
-rw-r--r--amarok/configure.in.in34
-rw-r--r--amarok/src/mediadevice/daap/mongrel/http11/Makefile.am7
2 files changed, 30 insertions, 11 deletions
diff --git a/amarok/configure.in.in b/amarok/configure.in.in
index 35ee69a3..083eb5e2 100644
--- a/amarok/configure.in.in
+++ b/amarok/configure.in.in
@@ -1100,15 +1100,37 @@ AC_CHECK_TYPES([uint8_t, u_int8_t, uint16_t, u_int16_t, uint32_t, u_int32_t, uin
AC_PATH_PROG(RUBY, ruby, no)
-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"] )'`]
+if test -n "$PKG_CONFIG"; then
+ RUBY_VERSION=`$PKG_CONFIG ruby --modversion 2>/dev/null`
+ if test -n "$RUBY_VERSION"; then
+ RUBY_CFLAGS=`$PKG_CONFIG ruby --cflags`
+ else
+ RUBY_VERSION=`$PKG_CONFIG ruby-1.9 --modversion 2>/dev/null`
+ RUBY_CFLAGS=`$PKG_CONFIG ruby-1.9 --cflags`
+ 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_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
+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"] )'`] fi
+ RUBY_CFLAGS="-I$ruby_includes"
+ RUBY_LIBRUBYARG="$ruby_ldflags"
+fi
-AC_SUBST(ruby_includes)
-AC_SUBST(ruby_ldflags)
+AC_SUBST(RUBY_CFLAGS)
+AC_SUBST(RUBY_LIBRUBYARG)
OLDCFLAGS="$CFLAGS"
-CFLAGS="-I$ruby_includes -Wall"
+CFLAGS="$RUBY_CFLAGS -Wall"
OLDCPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I$ruby_includes" #no I don't know why CPPFLAGS is used
+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
CFLAGS="$OLDCFLAGS"
CPPFLAGS="$OLDCPPFLAGS"
diff --git a/amarok/src/mediadevice/daap/mongrel/http11/Makefile.am b/amarok/src/mediadevice/daap/mongrel/http11/Makefile.am
index 15cf49ec..d1236f59 100644
--- a/amarok/src/mediadevice/daap/mongrel/http11/Makefile.am
+++ b/amarok/src/mediadevice/daap/mongrel/http11/Makefile.am
@@ -4,14 +4,11 @@ amarokrubylib_LTLIBRARIES = libhttp11.la
amarokrubylib_DATA = http11.rb
-INCLUDES = -I$(ruby_includes) -Dinline=__inline__ -Dasm=__asm__
+INCLUDES = $(RUBY_CFLAGS) -Dinline=__inline__ -Dasm=__asm__
libhttp11_la_LDFLAGS = \
-shared \
- $(ruby_ldflags)
-
-#http11_so_LIBADD = \
-# -lruby18
+ $(RUBY_LIBRUBYARG)
libhttp11_la_SOURCES = \
http11.c \