This is the mail archive of the
cygwin-apps@sources.redhat.com
mailing list for the Cygwin project.
Patch for libwmf-0.1.21b to compile under cygwin-1.1.8 with libpng support
- To: martin dot vermeer at hut dot fi
- Subject: Patch for libwmf-0.1.21b to compile under cygwin-1.1.8 with libpng support
- From: "Dr. Volker Zell" <Dr dot Volker dot Zell at oracle dot com>
- Date: 07 Feb 2001 11:59:06 +0100
- Cc: cygwin-apps at cygwin dot com
Hi
Here is a patch for libwmf-0.1.21b to compile under cygwin-1.1.8 with libpng support.
The main problem is that cygwin uses shared libraries from
o ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/mirrors/cygnus/contrib/libpng/libpng-1.0.9-3.tar.gz
and configure doesn't detect libpng because it uses png_info_init to detect the png library.
From libpng.txt:
The old libpng functions png_read_init(), png_write_init(),
png_info_init(), png_read_destroy(), and png_write_destory() have been
moved to PNG_INTERNAL in version 0.95 to discourage their use. These
functions will be removed from libpng version 2.0.0.
And from png.c
/* Allocate the memory for an info_struct for the application. We don't
* really need the png_ptr, but it could potentially be useful in the
* future. This should be used in favour of malloc(sizeof(png_info))
* and png_info_init() so that applications that want to use a shared
* libpng don't have to be recompiled if png_info changes size.
*/
diff -upr /gnu/libwmf/configure libwmf/configure
--- /gnu/libwmf/configure Wed Nov 29 07:02:00 2000
+++ libwmf/configure Tue Feb 6 15:52:36 2001
@@ -2626,9 +2626,9 @@ rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- echo $ac_n "checking for png_info_init in -lpng""... $ac_c" 1>&6
-echo "configure:2631: checking for png_info_init in -lpng" >&5
-ac_lib_var=`echo png'_'png_info_init | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for png_create_info_struct in -lpng""... $ac_c" 1>&6
+echo "configure:2631: checking for png_create_info_struct in -lpng" >&5
+ac_lib_var=`echo png'_'png_create_info_struct | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2640,10 +2640,10 @@ cat > conftest.$ac_ext <<EOF
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char png_info_init();
+char png_create_info_struct();
int main() {
-png_info_init()
+png_create_info_struct()
; return 0; }
EOF
if { (eval echo configure:2650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
diff -upr /gnu/libwmf/configure.in libwmf/configure.in
--- /gnu/libwmf/configure.in Sat Nov 25 17:31:31 2000
+++ libwmf/configure.in Tue Feb 6 15:51:25 2001
@@ -245,7 +245,7 @@ AC_ARG_WITH(png,
AC_CHECK_HEADER(png.h,
AC_CHECK_HEADER(pngconf.h,
- AC_CHECK_LIB(png, png_info_init,
+ AC_CHECK_LIB(png, png_create_info_struct,
AC_DEFINE(HasPNG)
if test "x${PNG_DIR}" != "x"; then
PNG_CFLAGS="-I${PNG_DIR}/include"
diff -upr /gnu/libwmf/wmftofig.c libwmf/wmftofig.c
--- /gnu/libwmf/wmftofig.c Thu Nov 9 10:18:44 2000
+++ libwmf/wmftofig.c Thu Feb 1 17:50:32 2001
@@ -1,6 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#ifdef __CYGWIN__
+#include <getopt.h>
+#endif
#include "xfwmfapi.h"
Ciao
Volker