summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-26 20:51:20 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-26 20:51:20 -0500
commitd9227e4639f3489c25954aafa3657105881a3db1 (patch)
tree6fe4a702fd5056f29f79eab7ffecc437fe52ad2d
parentf46ac3e8658bff4e9d9589025e5e40c513487f07 (diff)
downloadamarok-d9227e46.tar.gz
amarok-d9227e46.zip
Fix build system for ruby >= 1.9
-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 4f5e68be..fc18b4f1 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 \