From: Markos Chandras <markos.chandras@imgtec.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
Date: Tue, 13 Mar 2012 13:35:08 +0000 [thread overview]
Message-ID: <1331645708-7650-1-git-send-email-markos.chandras@imgtec.com> (raw)
If $(HOST_DIR)/usr/bin is in the user's $PATH, and host-libxml2 is
installed, the configure script will find xml2-config in
$(HOST_DIR)/usr/bin and the xml2-config --prefix will return the
$(HOST_DIR)/usr. This is bad because imagemagick will append
-L$(HOST_DIR)/usr/lib to LDFLAGS and it will try to link against
the host's libraries instead of those located in the staging directory.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
It is pretty common for people to add $(HOST_DIR)/usr/bin to their $PATH
(also uggested in buildroot documentation:
http://buildroot.uclibc.org/buildroot.html#using_toolchain)
in order to use their cross-toolchain utilities so this problem may
be exposed to a significant number of people. The configure script
is modified to ensure that the xml2-config utility that was found in $PATH
is located in the sysroot directory. This will prevent host's libraries
to be appended to imagemagick's LDFLAGS. This patch depends on the one
added in commit 06ef58efc45dabf078c93358a6ce37f178ae8df5 and it needs to
be applied after that.
---
.../imagemagick-6.6.7-6-xml2-config-path.patch | 26 ++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
create mode 100644 package/imagemagick/imagemagick-6.6.7-6-xml2-config-path.patch
diff --git a/package/imagemagick/imagemagick-6.6.7-6-xml2-config-path.patch b/package/imagemagick/imagemagick-6.6.7-6-xml2-config-path.patch
new file mode 100644
index 0000000..f2a0d34
--- /dev/null
+++ b/package/imagemagick/imagemagick-6.6.7-6-xml2-config-path.patch
@@ -0,0 +1,26 @@
+Index: imagemagick-6.6.7-6/configure.ac
+===================================================================
+--- imagemagick-6.6.7-6.orig/configure.ac
++++ imagemagick-6.6.7-6/configure.ac
+@@ -2589,12 +2589,15 @@ if test "$with_xml" != 'no'; then
+ # the shared library installed under /usr/lib, whereas the package
+ # installs itself under $prefix/libxml and $prefix/lib.
+ xml2_prefix=`xml2-config --prefix`
+- if test -d "${xml2_prefix}/include/libxml2"; then
+- CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
+- fi
+- if test "${xml2_prefix}" != '/usr'; then
+- LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
+- fi
++ # Make sure we didn't pick the host's xml2-config
++ if `echo ${xml2_prefix} | grep sysroot > /dev/null 2>&1`; then
++ if test -d "${xml2_prefix}/include/libxml2"; then
++ CPPFLAGS="$CPPFLAGS -I${xml2_prefix}/include/libxml2"
++ fi
++ if test "${xml2_prefix}" != '/usr'; then
++ LDFLAGS="$LDFLAGS -L${xml2_prefix}/lib"
++ fi
++ fi
+ fi
+ failed=0
+ passed=0
--
1.7.1
next reply other threads:[~2012-03-13 13:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 13:35 Markos Chandras [this message]
2012-03-13 13:53 ` [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config Peter Korsgaard
2012-03-13 14:06 ` Markos Chandras
2012-03-13 14:16 ` Markos Chandras
2012-03-13 14:29 ` Markos Chandras
2012-03-13 15:29 ` Peter Korsgaard
2012-03-13 15:34 ` Markos Chandras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331645708-7650-1-git-send-email-markos.chandras@imgtec.com \
--to=markos.chandras@imgtec.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox