Commit 6bfa263a97c26d63679d0b4daa95bc98bf9fc30c

Werner Lemberg 2013-08-18T18:34:05

Fix Savannah bug #39804. * builds/unix/configure.raw (LIBPNG): Define and export. * builds/unix/freetype-config.in, builds/unix/freetype2.in: Handle libpng.

diff --git a/ChangeLog b/ChangeLog
index c79b8c0..0a18fea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-08-18  Werner Lemberg  <wl@gnu.org>
+
+	Fix Savannah bug #39804.
+
+	* builds/unix/configure.raw (LIBPNG): Define and export.
+	* builds/unix/freetype-config.in, builds/unix/freetype2.in: Handle
+	libpng.
+
 2013-08-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[base] Clean up BBox_Conic_Check.
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index acbe063..470f6d9 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -297,6 +297,7 @@ or pass `--without-png' to the `configure' script.])
 either set the LIBPNG_CFLAGS and LIBPNG_LDFLAGS environment variables,
 or pass `--without-png' to the `configure' script.])
     fi
+    LIBPNG="`libpng-config --libs`"
     LIBPNG_CFLAGS="`libpng-config --cflags`"
     LIBPNG_LDFLAGS="`libpng-config --ldflags`"
   fi
@@ -721,6 +722,7 @@ esac
 AC_SUBST([ftmac_c])
 AC_SUBST([LIBZ])
 AC_SUBST([LIBBZ2])
+AC_SUBST([LIBPNG])
 AC_SUBST([FT2_EXTRA_LIBS])
 AC_SUBST([SYSTEM_ZLIB])
 
diff --git a/builds/unix/freetype-config.in b/builds/unix/freetype-config.in
index 2edcd11..171741e 100644
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -141,7 +141,7 @@ if test "$echo_cflags" = "yes" ; then
 fi
 
 if test "$echo_libs" = "yes" ; then
-  libs="-lfreetype %LIBZ% %LIBBZ2% %FT2_EXTRA_LIBS%"
+  libs="-lfreetype %LIBZ% %LIBBZ2% %LIBPNG% %FT2_EXTRA_LIBS%"
   if test "${SYSROOT}$libdir" != "/usr/lib"  &&
      test "${SYSROOT}$libdir" != "/usr/lib64"; then
     echo -L${SYSROOT}$libdir $libs
diff --git a/builds/unix/freetype2.in b/builds/unix/freetype2.in
index c5c3027..7955f89 100644
--- a/builds/unix/freetype2.in
+++ b/builds/unix/freetype2.in
@@ -8,5 +8,5 @@ Description: A free, high-quality, and portable font engine.
 Version: %ft_version%
 Requires:
 Libs: -L${libdir} -lfreetype
-Libs.private: %LIBZ% %LIBBZ2% %FT2_EXTRA_LIBS%
+Libs.private: %LIBZ% %LIBBZ2% %LIBPNG% %FT2_EXTRA_LIBS%
 Cflags: -I${includedir}/freetype2 -I${includedir}
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
index 010607b..bde6560 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -63,6 +63,7 @@ version_info := @version_info@
 FT2_EXTRA_LIBS     := @FT2_EXTRA_LIBS@
 LIBBZ2             := @LIBBZ2@
 LIBZ               := @LIBZ@
+LIBPNG             := @LIBPNG@
 build_libtool_libs := @build_libtool_libs@
 ft_version         := @ft_version@
 
@@ -102,6 +103,7 @@ $(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
 	sed -e 's|%FT2_EXTRA_LIBS%|$(FT2_EXTRA_LIBS)|' \
 	    -e 's|%LIBBZ2%|$(LIBBZ2)|' \
 	    -e 's|%LIBZ%|$(LIBZ)|' \
+	    -e 's|%LIBPNG%|$(LIBPNG)|' \
 	    -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
 	    -e 's|%exec_prefix%|$(exec_prefix)|' \
 	    -e 's|%ft_version%|$(ft_version)|' \
@@ -119,6 +121,7 @@ $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
 	sed -e 's|%FT2_EXTRA_LIBS%|$(FT2_EXTRA_LIBS)|' \
 	    -e 's|%LIBBZ2%|$(LIBBZ2)|' \
 	    -e 's|%LIBZ%|$(LIBZ)|' \
+	    -e 's|%LIBPNG%|$(LIBPNG)|' \
 	    -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
 	    -e 's|%exec_prefix%|$(exec_prefix)|' \
 	    -e 's|%ft_version%|$(ft_version)|' \