aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorCameron Cawley2019-09-20 21:44:40 +0100
committerEugene Sandulenko2019-09-21 03:08:56 +0200
commit5ae854cc2474b744020d41368f08416b24a5b06a (patch)
treedbce2168566f6ec11d7734ae92068c500e53fd53 /configure
parenta637f2d06bde5add0c69e780caca910e51a64c01 (diff)
downloadscummvm-rg350-5ae854cc2474b744020d41368f08416b24a5b06a.tar.gz
scummvm-rg350-5ae854cc2474b744020d41368f08416b24a5b06a.tar.bz2
scummvm-rg350-5ae854cc2474b744020d41368f08416b24a5b06a.zip
CONFIGURE: Allow using pkg-config to detect libpng
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure10
1 files changed, 8 insertions, 2 deletions
diff --git a/configure b/configure
index 370e1815af..cb74cad983 100755
--- a/configure
+++ b/configure
@@ -4429,6 +4429,12 @@ echo "$_jpeg"
# Check for PNG
#
echocheck "PNG >= 1.2.8"
+if test "$_pkg_config" = "yes" && $_pkgconfig --exists libpng; then
+ append_var PNG_LIBS "`$_pkgconfig --libs libpng`"
+ append_var PNG_CFLAGS "`$_pkgconfig --cflags libpng`"
+else
+ append_var PNG_LIBS "-lpng -lz"
+fi
if test "$_png" = auto ; then
_png=no
cat > $TMPC << EOF
@@ -4441,10 +4447,10 @@ int main(void) {
return 0;
}
EOF
- cc_check $PNG_CFLAGS $PNG_LIBS -lpng -lz && _png=yes
+ cc_check $PNG_CFLAGS $PNG_LIBS && _png=yes
fi
if test "$_png" = yes ; then
- append_var LIBS "$PNG_LIBS -lpng -lz"
+ append_var LIBS "$PNG_LIBS"
append_var INCLUDES "$PNG_CFLAGS"
fi
define_in_config_if_yes "$_png" 'USE_PNG'