improve linbpg detection
authorVincent Torri <vincent.torri@gmail.com>
Sun, 22 May 2011 08:53:31 +0000 (08:53 +0000)
committerVincent Torri <vincent.torri@gmail.com>
Sun, 22 May 2011 08:53:31 +0000 (08:53 +0000)
SVN revision: 59576

legacy/evas/m4/evas_check_loader.m4

index 52f953f36ae5eb4370ddee604478fdaedb81304b..0cb3d7b32ad84b497cda180d1b2bcf78d1ffa6ff 100644 (file)
@@ -176,13 +176,40 @@ have_dep="no"
 evas_image_loader_[]$1[]_cflags=""
 evas_image_loader_[]$1[]_libs=""
 
-PKG_CHECK_EXISTS([libpng14], [PKG_CHECK_MODULES([PNG], [libpng14], [have_dep="yes" requirement="libpng14"], [have_dep="no"])],
-  [PKG_CHECK_EXISTS([libpng12], [PKG_CHECK_MODULES([PNG], [libpng12], [have_dep="yes" requirement="libpng12"], [have_dep="no"])],
-    [PKG_CHECK_EXISTS([libpng10], [PKG_CHECK_MODULES([PNG], [libpng10], [have_dep="yes" requirement="libpng10"], [have_dep="no"])],
-      [PKG_CHECK_MODULES([PNG], [libpng], [have_dep="yes" requirement="libpng"], [have_dep="no"])
-    ])
-  ])
-])
+dnl libpng.pc is the latest version of libpng that ahs been installed.
+dnl We check it first.
+PKG_CHECK_MODULES([PNG],
+   [libpng],
+   [have_dep="yes" requirement="libpng"],
+   [have_dep="no"])
+
+if test "x${have_dep}" = "xno" ; then
+   PKG_CHECK_MODULES([PNG],
+      [libpng15],
+      [have_dep="yes" requirement="libpng15"],
+      [have_dep="no"])
+fi
+
+if test "x${have_dep}" = "xno" ; then
+   PKG_CHECK_MODULES([PNG],
+      [libpng14],
+      [have_dep="yes" requirement="libpng14"],
+      [have_dep="no"])
+fi
+
+if test "x${have_dep}" = "xno" ; then
+   PKG_CHECK_MODULES([PNG],
+      [libpng12],
+      [have_dep="yes" requirement="libpng12"],
+      [have_dep="no"])
+fi
+
+if test "x${have_dep}" = "xno" ; then
+   PKG_CHECK_MODULES([PNG],
+      [libpng10],
+      [have_dep="yes" requirement="libpng10"],
+      [have_dep="no"])
+fi
 
 evas_image_loader_[]$1[]_cflags="${PNG_CFLAGS}"
 evas_image_loader_[]$1[]_libs="${PNG_LIBS}"