Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
@ 2012-03-13 13:35 Markos Chandras
  2012-03-13 13:53 ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Markos Chandras @ 2012-03-13 13:35 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
  2012-03-13 13:35 [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config Markos Chandras
@ 2012-03-13 13:53 ` Peter Korsgaard
  2012-03-13 14:06   ` Markos Chandras
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2012-03-13 13:53 UTC (permalink / raw)
  To: buildroot

>>>>> "Markos" == Markos Chandras <markos.chandras@imgtec.com> writes:

 Markos> If $(HOST_DIR)/usr/bin is in the user's $PATH, and host-libxml2 is
 Markos> installed, the configure script will find xml2-config in
 Markos> $(HOST_DIR)/usr/bin  and the xml2-config --prefix will return the
 Markos> $(HOST_DIR)/usr. This is bad because imagemagick will append
 Markos> -L$(HOST_DIR)/usr/lib to LDFLAGS and it will try to link against
 Markos> the host's libraries instead of those located in the staging directory.

Hmm, is this still a problem? We already have a libxml2 patch for
imagemagick to ensure it picks up the target one, and we explicitly pass
--without-xml if we're not building libxml2 for the target.

Are you testing against buildroot git? From the the patch file name I
would guess not. Could you retry with latest git and let me know if it
is still needed?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
  2012-03-13 13:53 ` Peter Korsgaard
@ 2012-03-13 14:06   ` Markos Chandras
  2012-03-13 14:16     ` Markos Chandras
  0 siblings, 1 reply; 7+ messages in thread
From: Markos Chandras @ 2012-03-13 14:06 UTC (permalink / raw)
  To: buildroot

On 03/13/2012 01:53 PM, Peter Korsgaard wrote:

>>>>>> "Markos" == Markos Chandras <markos.chandras@imgtec.com> writes:
> 
>  Markos> If $(HOST_DIR)/usr/bin is in the user's $PATH, and host-libxml2 is
>  Markos> installed, the configure script will find xml2-config in
>  Markos> $(HOST_DIR)/usr/bin  and the xml2-config --prefix will return the
>  Markos> $(HOST_DIR)/usr. This is bad because imagemagick will append
>  Markos> -L$(HOST_DIR)/usr/lib to LDFLAGS and it will try to link against
>  Markos> the host's libraries instead of those located in the staging directory.
> 
> Hmm, is this still a problem? We already have a libxml2 patch for
> imagemagick to ensure it picks up the target one, and we explicitly pass
> --without-xml if we're not building libxml2 for the target.
> 
> Are you testing against buildroot git? From the the patch file name I
> would guess not. Could you retry with latest git and let me know if it
> is still needed?
> 

Are you referring to the imagemagick-6.6.4-8-use-xml2-config.patch? If
yes, this does not fix the problem because AC_CHECK_PROG() searches for
programmes in the $PATH and if $(HOST_DIR)/usr/bin/xml2-config is in the
path, it will find that and set xml2_config variable to $(HOST_DIR)/usr
which in turn sets LDFLAGS to -L{xml2_config}/lib

-- 
markos

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
  2012-03-13 14:06   ` Markos Chandras
@ 2012-03-13 14:16     ` Markos Chandras
  2012-03-13 14:29       ` Markos Chandras
  0 siblings, 1 reply; 7+ messages in thread
From: Markos Chandras @ 2012-03-13 14:16 UTC (permalink / raw)
  To: buildroot

On 03/13/2012 02:06 PM, Markos Chandras wrote:

> On 03/13/2012 01:53 PM, Peter Korsgaard wrote:
> 
>>>>>>> "Markos" == Markos Chandras <markos.chandras@imgtec.com> writes:
>>
>>  Markos> If $(HOST_DIR)/usr/bin is in the user's $PATH, and host-libxml2 is
>>  Markos> installed, the configure script will find xml2-config in
>>  Markos> $(HOST_DIR)/usr/bin  and the xml2-config --prefix will return the
>>  Markos> $(HOST_DIR)/usr. This is bad because imagemagick will append
>>  Markos> -L$(HOST_DIR)/usr/lib to LDFLAGS and it will try to link against
>>  Markos> the host's libraries instead of those located in the staging directory.
>>
>> Hmm, is this still a problem? We already have a libxml2 patch for
>> imagemagick to ensure it picks up the target one, and we explicitly pass
>> --without-xml if we're not building libxml2 for the target.
>>
>> Are you testing against buildroot git? From the the patch file name I
>> would guess not. Could you retry with latest git and let me know if it
>> is still needed?
>>
> 
> Are you referring to the imagemagick-6.6.4-8-use-xml2-config.patch? If
> yes, this does not fix the problem because AC_CHECK_PROG() searches for
> programmes in the $PATH and if $(HOST_DIR)/usr/bin/xml2-config is in the
> path, it will find that and set xml2_config variable to $(HOST_DIR)/usr
> which in turn sets LDFLAGS to -L{xml2_config}/lib
> 

Hmm I think you are right. The imagemagick-6.6.4-8-use-xml2-config.patch
did not apply to my tree. Let me do some further testing and I will
reply back

-- 
markos

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
  2012-03-13 14:16     ` Markos Chandras
@ 2012-03-13 14:29       ` Markos Chandras
  2012-03-13 15:29         ` Peter Korsgaard
  0 siblings, 1 reply; 7+ messages in thread
From: Markos Chandras @ 2012-03-13 14:29 UTC (permalink / raw)
  To: buildroot

On 03/13/2012 02:16 PM, Markos Chandras wrote:

> On 03/13/2012 02:06 PM, Markos Chandras wrote:
> 
>> On 03/13/2012 01:53 PM, Peter Korsgaard wrote:
>>
>>>>>>>> "Markos" == Markos Chandras <markos.chandras@imgtec.com> writes:
>>>
>>>  Markos> If $(HOST_DIR)/usr/bin is in the user's $PATH, and host-libxml2 is
>>>  Markos> installed, the configure script will find xml2-config in
>>>  Markos> $(HOST_DIR)/usr/bin  and the xml2-config --prefix will return the
>>>  Markos> $(HOST_DIR)/usr. This is bad because imagemagick will append
>>>  Markos> -L$(HOST_DIR)/usr/lib to LDFLAGS and it will try to link against
>>>  Markos> the host's libraries instead of those located in the staging directory.
>>>
>>> Hmm, is this still a problem? We already have a libxml2 patch for
>>> imagemagick to ensure it picks up the target one, and we explicitly pass
>>> --without-xml if we're not building libxml2 for the target.
>>>
>>> Are you testing against buildroot git? From the the patch file name I
>>> would guess not. Could you retry with latest git and let me know if it
>>> is still needed?
>>>
>>
>> Are you referring to the imagemagick-6.6.4-8-use-xml2-config.patch? If
>> yes, this does not fix the problem because AC_CHECK_PROG() searches for
>> programmes in the $PATH and if $(HOST_DIR)/usr/bin/xml2-config is in the
>> path, it will find that and set xml2_config variable to $(HOST_DIR)/usr
>> which in turn sets LDFLAGS to -L{xml2_config}/lib
>>
> 
> Hmm I think you are right. The imagemagick-6.6.4-8-use-xml2-config.patch
> did not apply to my tree. Let me do some further testing and I will
> reply back
> 

Yes, for whatever reason the buildroot infrastructure ignored that patch
and never got applied. I guess my tree was broken somehow. Apologies for
the noise. Please ignore my patch.

-- 
markos

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
  2012-03-13 14:29       ` Markos Chandras
@ 2012-03-13 15:29         ` Peter Korsgaard
  2012-03-13 15:34           ` Markos Chandras
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2012-03-13 15:29 UTC (permalink / raw)
  To: buildroot

>>>>> "Markos" == Markos Chandras <Markos.Chandras@imgtec.com> writes:

Hi,

 Markos> Yes, for whatever reason the buildroot infrastructure ignored
 Markos> that patch and never got applied. I guess my tree was broken
 Markos> somehow. Apologies for the noise. Please ignore my patch.

The patch logic is somewhat complicated (and we're cleaning it up) - If
any patches match <package>-<version>-*.patch, then all other patches
are ignored.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config
  2012-03-13 15:29         ` Peter Korsgaard
@ 2012-03-13 15:34           ` Markos Chandras
  0 siblings, 0 replies; 7+ messages in thread
From: Markos Chandras @ 2012-03-13 15:34 UTC (permalink / raw)
  To: buildroot

On 03/13/2012 03:29 PM, Peter Korsgaard wrote:

>>>>>> "Markos" == Markos Chandras <Markos.Chandras@imgtec.com> writes:
> 
> Hi,
> 
>  Markos> Yes, for whatever reason the buildroot infrastructure ignored
>  Markos> that patch and never got applied. I guess my tree was broken
>  Markos> somehow. Apologies for the noise. Please ignore my patch.
> 
> The patch logic is somewhat complicated (and we're cleaning it up) - If
> any patches match <package>-<version>-*.patch, then all other patches
> are ignored.
> 

Yeah I noticed that a bit late after spending some time reading the
package/Makefile.package.in file. Thanks for clarifying this.

-- 
markos

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-13 15:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 13:35 [Buildroot] [PATCH] imagemagick: Ignore host's xml2-config Markos Chandras
2012-03-13 13:53 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox