Steve Langasek wrote:
So maintainers, please take the advice given in that mail and fix your
packages to a) not use the output of Magick-config --libs when linking, and
b) use the Debian version of libtool (if applicable).
(One alternative to using Magick-config --libs seems to be to use pkg-config
-- not because ImageMagick gets its pkg-config support right, but because it
happens to get it right in a way that benefits us. ;)
Steve, can you give me some advice? I'm attempting to fix this
librmagick-ruby bug by switching from Magick-config to pkg-config.
Attached is the patch I'm planning to apply ... basically, it avoids
using $CFLAGS and $LDFLAGS values computing by "configure" (using
Magick-config) and uses output from "pkg-config" instead.
In my case, "Magick-config --libs" outputs
-lMagick -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldpstk
-ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm
-lpthread
whereas "pkg-config --libs ImageMagick" returns just
-lMagick
So, does it sound like this change will do the job?
--
cheers, MikeW http://www.dogbiscuit.org/mdub/
Index: ext/RMagick/extconf.rb.in
===================================================================
--- ext/RMagick/extconf.rb.in (revision 14)
+++ ext/RMagick/extconf.rb.in (working copy)
@@ -6,16 +6,10 @@
# Pass along Ruby's version number
VERSION_NUMBER = '0x'+RUBY_VERSION.tr('.','')
-$CFLAGS = "-Wall -g @CFLAGS@"
-$CPPFLAGS = "-DRUBY_VERSION=#{VERSION_NUMBER} @CPPFLAGS@"
+$CFLAGS = "-Wall -g " + `pkg-config --cflags ImageMagick`.chomp
+$CPPFLAGS = "-DRUBY_VERSION=#{VERSION_NUMBER}"
-if RUBY_VERSION >= '1.8.0'
- $DLDFLAGS = "@LDFLAGS@"
-else
- $LDFLAGS = "@LDFLAGS@"
-end
+$LOCAL_LIBS = `pkg-config --libs ImageMagick`.chomp
-$LOCAL_LIBS = "@LOCAL_LIBS@"
-
create_makefile("RMagick")