Skip to contentSkip to conversation

Use the libpng-config from staging instead of the one from the host.

PATCH New Jean-Christian de Rivaz 2 participants 4 messages Jan 18, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use the libpng-config from staging instead of the one from the host.

The gd package configure call 'libpng-config' to get the compiler flags required to use the libpng. The configure correctly allow to specify the path of the staging libpng-config by using the ac_cv_path_LIBPNG_CONFIG but the configure.ac call simply 'libpng-config' instead of the specified one. The configure.ac is now modified to call the specified libpng_config.

In buildroot gd.mk, specify the staging libpng-config and to a empty string the libpng12-config to prevent to use the -lpng12 flag or the host setting.

---
 package/gd/gd-libpng-config.patch |   22 ++++++++++++++++++++++
 package/gd/gd.mk                  |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 package/gd/gd-libpng-config.patch
package/gd/gd-libpng-config.patch new file +22 -0
new file mode 100644
index 0000000..655da78
@@ -0,0 +1,22 @@
+diff -ruN a/configure.ac b/configure.ac
+--- a/configure.ac	2013-01-18 02:00:59.000000000 +0100
++++ b/configure.ac	2013-01-18 02:01:44.000000000 +0100
+@@ -353,14 +353,14 @@
+   AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config])
+   AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
+   if test -n "$LIBPNG12_CONFIG"; then
+-    libpng_CPPFLAGS=`libpng12-config --cflags`
++    libpng_CPPFLAGS=`$LIBPNG12_CONFIG --cflags`
+     # should be --ldopts, but it's currently broken
+-    libpng_LDFLAGS=`libpng12-config --ldflags`
++    libpng_LDFLAGS=`$LIBPNG12_CONFIG --ldflags`
+     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
+   elif test -n "$LIBPNG_CONFIG"; then
+-    libpng_CPPFLAGS=`libpng-config --cflags`
++    libpng_CPPFLAGS=`$LIBPNG_CONFIG --cflags`
+     # should be --ldopts, but it's currently broken
+-    libpng_LDFLAGS=`libpng-config --ldflags`
++    libpng_LDFLAGS=`$LIBPNG_CONFIG --ldflags`
+     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
+   elif test -d "$withval"; then
+     libpng_CPPFLAGS="-I$withval/include"
package/gd/gd.mk +2 -0
index 972d8dd..96abf9e 100644
@@ -33,6 +33,8 @@ endif
 ifeq ($(BR2_PACKAGE_LIBPNG),y)
 GD_DEPENDENCIES += libpng
 GD_CONF_OPT += --with-png
+GD_CONF_ENV += ac_cv_path_LIBPNG12_CONFIG=""
+GD_CONF_ENV += ac_cv_path_LIBPNG_CONFIG=$(STAGING_DIR)/usr/bin/libpng-config
 endif
 
 ifeq ($(BR2_PACKAGE_XLIB_LIBXPM),y)
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 Use the libpng-config from staging instead of the one from the host.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"JC" == Jean-Christian de Rivaz <[email protected]> writes:

Hi,

JC> The gd package configure call 'libpng-config' to get the compiler JC> flags required to use the libpng. The configure correctly allow to JC> specify the path of the staging libpng-config by using the JC> ac_cv_path_LIBPNG_CONFIG but the configure.ac call simply JC> 'libpng-config' instead of the specified one. The configure.ac is now JC> modified to call the specified libpng_config.

JC> In buildroot gd.mk, specify the staging libpng-config and to a empty JC> string the libpng12-config to prevent to use the -lpng12 flag or the JC> host setting.

JC> Signed-off-by: Jean-Christian de Rivaz <[email protected]> JC> ---

 JC>  package/gd/gd-libpng-config.patch |   22 ++++++++++++++++++++++
 JC>  package/gd/gd.mk                  |    2 ++

JC> 2 files changed, 24 insertions(+), 0 deletions(-) JC> create mode 100644 package/gd/gd-libpng-config.patch

JC> diff --git a/package/gd/gd-libpng-config.patch b/package/gd/gd-libpng-config.patch JC> new file mode 100644
JC> index 0000000..655da78
JC> --- /dev/null

Please add a git-style header to this patch explaining what it does and your signed-off-by.

JC> +++ b/package/gd/gd-libpng-config.patch
JC> @@ -0,0 +1,22 @@
JC> +diff -ruN a/configure.ac b/configure.ac
JC> +--- a/configure.ac 2013-01-18 02:00:59.000000000 +0100
JC> ++++ b/configure.ac 2013-01-18 02:01:44.000000000 +0100
JC> +@@ -353,14 +353,14 @@

 JC> +   AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config])
 JC> +   AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
 JC> +   if test -n "$LIBPNG12_CONFIG"; then
 JC> +-    libpng_CPPFLAGS=`libpng12-config --cflags`
 JC> ++    libpng_CPPFLAGS=`$LIBPNG12_CONFIG --cflags`
 JC> +     # should be --ldopts, but it's currently broken
 JC> +-    libpng_LDFLAGS=`libpng12-config --ldflags`
 JC> ++    libpng_LDFLAGS=`$LIBPNG12_CONFIG --ldflags`
 JC> +     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
 JC> +   elif test -n "$LIBPNG_CONFIG"; then
 JC> +-    libpng_CPPFLAGS=`libpng-config --cflags`
 JC> ++    libpng_CPPFLAGS=`$LIBPNG_CONFIG --cflags`
 JC> +     # should be --ldopts, but it's currently broken
 JC> +-    libpng_LDFLAGS=`libpng-config --ldflags`
 JC> ++    libpng_LDFLAGS=`$LIBPNG_CONFIG --ldflags`
 JC> +     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'
Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 Use the libpng-config from staging instead of the one from the host.

The gd package configure call 'libpng-config' to get the compiler flags required to use the libpng. The configure correctly allow to specify the path of the staging libpng-config by using the ac_cv_path_LIBPNG_CONFIG but the configure.ac call simply 'libpng-config' instead of the specified one. The configure.ac is now modified to call the specified libpng_config.

In buildroot gd.mk, specify the staging libpng-config and to a empty string the libpng12-config to prevent to use the -lpng12 flag or the host setting.

---
 package/gd/gd-libpng-config.patch |   30 ++++++++++++++++++++++++++++++
 package/gd/gd.mk                  |    2 ++
 2 files changed, 32 insertions(+), 0 deletions(-)
 create mode 100644 package/gd/gd-libpng-config.patch
package/gd/gd-libpng-config.patch new file +30 -0
new file mode 100644
index 0000000..cf8b92e
@@ -0,0 +1,30 @@
+Call the libpng12-confg and libpng-config specified by
+$LIBPNG12_CONFIG and $LIBPNG_CONFIG variables that are set by
+ac_cv_path_LIBPNG12_CONFIG and ac_cv_path_LIBPNG_CONFIG. This is
+important for cross compiler that need to get the staging settings
+instead of the host settings.
+
+Signed-off-by: Jean-Christian de Rivaz <[email protected]>
+
+diff -Nura gd-2.0.35.orig/configure.ac gd-2.0.35/configure.ac
+--- gd-2.0.35.orig/configure.ac	2013-01-18 02:00:59.000000000 +0100
++++ gd-2.0.35/configure.ac	2013-01-18 02:01:44.000000000 +0100
+@@ -353,14 +353,14 @@
+   AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config])
+   AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
+   if test -n "$LIBPNG12_CONFIG"; then
+-    libpng_CPPFLAGS=`libpng12-config --cflags`
++    libpng_CPPFLAGS=`$LIBPNG12_CONFIG --cflags`
+     # should be --ldopts, but it's currently broken
+-    libpng_LDFLAGS=`libpng12-config --ldflags`
++    libpng_LDFLAGS=`$LIBPNG12_CONFIG --ldflags`
+     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
+   elif test -n "$LIBPNG_CONFIG"; then
+-    libpng_CPPFLAGS=`libpng-config --cflags`
++    libpng_CPPFLAGS=`$LIBPNG_CONFIG --cflags`
+     # should be --ldopts, but it's currently broken
+-    libpng_LDFLAGS=`libpng-config --ldflags`
++    libpng_LDFLAGS=`$LIBPNG_CONFIG --ldflags`
+     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
+   elif test -d "$withval"; then
+     libpng_CPPFLAGS="-I$withval/include"
package/gd/gd.mk +2 -0
index 972d8dd..96abf9e 100644
@@ -33,6 +33,8 @@ endif
 ifeq ($(BR2_PACKAGE_LIBPNG),y)
 GD_DEPENDENCIES += libpng
 GD_CONF_OPT += --with-png
+GD_CONF_ENV += ac_cv_path_LIBPNG12_CONFIG=""
+GD_CONF_ENV += ac_cv_path_LIBPNG_CONFIG=$(STAGING_DIR)/usr/bin/libpng-config
 endif
 
 ifeq ($(BR2_PACKAGE_XLIB_LIBXPM),y)
Signature · 1 line
1.7.2.5
#3 lore raw

PATCH 1/1 Use the libpng-config from staging instead of the one from the host.

In reply to Jean-Christian de Rivaz
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"JC" == Jean-Christian de Rivaz <[email protected]> writes:

JC> The gd package configure call 'libpng-config' to get the compiler JC> flags required to use the libpng. The configure correctly allow to JC> specify the path of the staging libpng-config by using the JC> ac_cv_path_LIBPNG_CONFIG but the configure.ac call simply JC> 'libpng-config' instead of the specified one. The configure.ac is now JC> modified to call the specified libpng_config.

JC> In buildroot gd.mk, specify the staging libpng-config and to a empty JC> string the libpng12-config to prevent to use the -lpng12 flag or the JC> host setting.

JC> Signed-off-by: Jean-Christian de Rivaz <[email protected]> JC> ---

 JC>  package/gd/gd-libpng-config.patch |   22 ++++++++++++++++++++++
 JC>  package/gd/gd.mk                  |    2 ++

JC> 2 files changed, 24 insertions(+), 0 deletions(-) JC> create mode 100644 package/gd/gd-libpng-config.patch

JC> diff --git a/package/gd/gd-libpng-config.patch b/package/gd/gd-libpng-config.patch JC> new file mode 100644
JC> index 0000000..655da78
JC> --- /dev/null
JC> +++ b/package/gd/gd-libpng-config.patch
JC> @@ -0,0 +1,22 @@
JC> +diff -ruN a/configure.ac b/configure.ac
JC> +--- a/configure.ac 2013-01-18 02:00:59.000000000 +0100
JC> ++++ b/configure.ac 2013-01-18 02:01:44.000000000 +0100
JC> +@@ -353,14 +353,14 @@

 JC> +   AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config])
 JC> +   AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
 JC> +   if test -n "$LIBPNG12_CONFIG"; then
 JC> +-    libpng_CPPFLAGS=`libpng12-config --cflags`
 JC> ++    libpng_CPPFLAGS=`$LIBPNG12_CONFIG --cflags`
 JC> +     # should be --ldopts, but it's currently broken
 JC> +-    libpng_LDFLAGS=`libpng12-config --ldflags`
 JC> ++    libpng_LDFLAGS=`$LIBPNG12_CONFIG --ldflags`
 JC> +     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
 JC> +   elif test -n "$LIBPNG_CONFIG"; then
 JC> +-    libpng_CPPFLAGS=`libpng-config --cflags`
 JC> ++    libpng_CPPFLAGS=`$LIBPNG_CONFIG --cflags`
 JC> +     # should be --ldopts, but it's currently broken
 JC> +-    libpng_LDFLAGS=`libpng-config --ldflags`
 JC> ++    libpng_LDFLAGS=`$LIBPNG_CONFIG --ldflags`
 JC> +     libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`
 JC> +   elif test -d "$withval"; then
 JC> +     libpng_CPPFLAGS="-I$withval/include"
 JC> diff --git a/package/gd/gd.mk b/package/gd/gd.mk
 JC> index 972d8dd..96abf9e 100644
 JC> --- a/package/gd/gd.mk
 JC> +++ b/package/gd/gd.mk
 JC> @@ -33,6 +33,8 @@ endif
 JC>  ifeq ($(BR2_PACKAGE_LIBPNG),y)
 JC>  GD_DEPENDENCIES += libpng
 JC>  GD_CONF_OPT += --with-png

JC> +GD_CONF_ENV += ac_cv_path_LIBPNG12_CONFIG=""
JC> +GD_CONF_ENV += ac_cv_path_LIBPNG_CONFIG=$(STAGING_DIR)/usr/bin/libpng-config JC> endif

We should also explictly pass --without-png when not enabled so it doesn't try to use host libpng-config then.

Committed with that fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard