Patchwork Add support for finding libpng via pkg-config

login
register
mail settings
Submitter Brad
Date July 30, 2011, 5:45 a.m.
Message ID <20110730054551.GA18260@rox.home.comstyle.com>
Download mbox | patch
Permalink /patch/107476/
State New
Headers show

Comments

Brad - July 30, 2011, 5:45 a.m.
Add support for finding libpng via pkg-config.

Signed-off-by: Brad Smith <brad@comstyle.com>

---
 configure |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Anthony Liguori - Aug. 4, 2011, 10:07 p.m.
On 07/30/2011 12:45 AM, Brad wrote:
> Add support for finding libpng via pkg-config.
>
> Signed-off-by: Brad Smith<brad@comstyle.com>
>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   configure |    6 ++++++
>   1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 4012d15..25aa75f 100755
> --- a/configure
> +++ b/configure
> @@ -1519,11 +1519,17 @@ int main(void) {
>       return 0;
>   }
>   EOF
> +  if $pkg_config libpng --modversion>/dev/null 2>&1; then
> +    vnc_png_cflags=`$pkg_config libpng --cflags 2>  /dev/null`
> +    vnc_png_libs=`$pkg_config libpng --libs 2>  /dev/null`
> +  else
>       vnc_png_cflags=""
>       vnc_png_libs="-lpng"
> +  fi
>     if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then
>       vnc_png=yes
>       libs_softmmu="$vnc_png_libs $libs_softmmu"
> +    QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags"
>     else
>       if test "$vnc_png" = "yes" ; then
>         feature_not_found "vnc-png"

Patch

diff --git a/configure b/configure
index 4012d15..25aa75f 100755
--- a/configure
+++ b/configure
@@ -1519,11 +1519,17 @@  int main(void) {
     return 0;
 }
 EOF
+  if $pkg_config libpng --modversion >/dev/null 2>&1; then
+    vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null`
+    vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null`
+  else
     vnc_png_cflags=""
     vnc_png_libs="-lpng"
+  fi
   if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then
     vnc_png=yes
     libs_softmmu="$vnc_png_libs $libs_softmmu"
+    QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags"
   else
     if test "$vnc_png" = "yes" ; then
       feature_not_found "vnc-png"