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}"