diff -ru ming-0.4.0.beta5.orig/Makefile.am ming-0.4.0.beta5/Makefile.am
--- ming-0.4.0.beta5.orig/Makefile.am	2007-09-17 07:35:31.000000000 -0400
+++ ming-0.4.0.beta5/Makefile.am	2009-09-20 21:12:41.000000000 -0400
@@ -11,6 +11,7 @@
 AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip 1.4d
 
 additionnal_dist_subdirs = 
+ACLOCAL_AMFLAGS = -I macros
 
 if BUILD_PERL_EXTENSION
 PERLSUBDIR = perl_ext
diff -ru ming-0.4.0.beta5.orig/src/blocks/Makefile.am ming-0.4.0.beta5/src/blocks/Makefile.am
--- ming-0.4.0.beta5.orig/src/blocks/Makefile.am	2007-09-14 13:23:47.000000000 -0400
+++ ming-0.4.0.beta5/src/blocks/Makefile.am	2009-09-20 21:12:41.000000000 -0400
@@ -69,8 +69,9 @@
 
 endif #zlib
 
+libblock_la_CPPFLAGS = $(AM_CPPFLAGS)
 if USE_FREETYPE
-libblock_la_CFLAGS = $(FREETYPE_CFLAGS) $(AM_CFLAGS)
+libblock_la_CPPFLAGS += $(FREETYPE_CFLAGS)
 TTF_SOURCE = ttffont.c
 endif
 
diff -ru ming-0.4.0.beta5.orig/src/blocks/pngdbl.c ming-0.4.0.beta5/src/blocks/pngdbl.c
--- ming-0.4.0.beta5.orig/src/blocks/pngdbl.c	2007-07-15 15:50:43.000000000 -0400
+++ ming-0.4.0.beta5/src/blocks/pngdbl.c	2011-07-30 13:29:34.000000000 -0400
@@ -43,7 +43,7 @@
 }
 
 static int pngReadFunc(png_structp png, unsigned char *buf, int len)
-{	SWFInput input = (SWFInput) png->io_ptr;
+{	SWFInput input = (SWFInput) png_get_io_ptr(png);
 	return SWFInput_read(input, buf, len);
 }
 
@@ -109,7 +109,7 @@
 		return 0;
 	}
 
-	if(setjmp(png_ptr->jmpbuf))
+	if(setjmp(png_jmpbuf(png_ptr)))
 	{
 		png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
     	return 0;
diff -ru ming-0.4.0.beta5.orig/test/actionscript/Makefile.am ming-0.4.0.beta5/test/actionscript/Makefile.am
--- ming-0.4.0.beta5.orig/test/actionscript/Makefile.am	2007-09-17 07:35:54.000000000 -0400
+++ ming-0.4.0.beta5/test/actionscript/Makefile.am	2009-09-20 21:12:41.000000000 -0400
@@ -48,5 +48,5 @@
 
 ActionScriptTest_SOURCES = ActionScriptTest.c ../run_test.c ../../util/makeswf_utils.c
 ActionScriptTest_LDADD = $(top_builddir)/src/libming.la
-ActionScriptTest_CFLAGS = -DTOP_BUILDDIR='"$(top_builddir)"' -DTOP_SOURCEDIR='"$(srcdir)"' -I$(top_srcdir)/util/ -DAS_TESTS='"$(AS_TESTS)"'
+ActionScriptTest_CPPFLAGS = -DTOP_BUILDDIR='"$(top_builddir)"' -DTOP_SOURCEDIR='"$(srcdir)"' -I$(top_srcdir)/util/ -DAS_TESTS='"$(AS_TESTS)"' $(AM_CPPFLAGS)
 
diff -ru ming-0.4.0.beta5.orig/util/Makefile.am ming-0.4.0.beta5/util/Makefile.am
--- ming-0.4.0.beta5.orig/util/Makefile.am	2007-07-15 15:57:53.000000000 -0400
+++ ming-0.4.0.beta5/util/Makefile.am	2009-09-20 21:13:09.000000000 -0400
@@ -52,7 +52,6 @@
 	action.c	\
 	blocktypes.c	\
 	decompile.c	\
-	main.c		\
 	parser.c	\
 	read.c 
 
@@ -71,44 +70,44 @@
 	swfoutput.h	\
 	swftypes.h
 
-listswf_SOURCES = outputtxt.c
+listswf_SOURCES = outputtxt.c main.c	
 listswf_LDADD = libutil.la $(top_builddir)/src/libming.la
 listswf_CFLAGS = -DNODECOMPILE
 
-listswf_d_SOURCES = outputtxt.c
+listswf_d_SOURCES = outputtxt.c main.c
 listswf_d_LDADD = libutil.la $(top_builddir)/src/libming.la
 
-swftophp_SOURCES = outputscript.c
+swftophp_SOURCES = outputscript.c main.c
 swftophp_LDADD = libutil.la $(top_builddir)/src/libming.la
 swftophp_CFLAGS = -DSWFPHP
 
-swftoperl_SOURCES = outputscript.c
+swftoperl_SOURCES = outputscript.c main.c
 swftoperl_LDADD = libutil.la $(top_builddir)/src/libming.la
 swftoperl_CFLAGS = -DSWFPERL
 
-swftopython_SOURCES = outputscript.c
+swftopython_SOURCES = outputscript.c main.c
 swftopython_LDADD = libutil.la $(top_builddir)/src/libming.la
 swftopython_CFLAGS = -DSWFPYTHON
 
-swftocxx_SOURCES = outputscript.c
+swftocxx_SOURCES = outputscript.c main.c
 swftocxx_LDADD = libutil.la $(top_builddir)/src/libming.la
 swftocxx_CFLAGS = -DSWFPLUSPLUS
 
-swftotcl_SOURCES = outputscript.c
+swftotcl_SOURCES = outputscript.c main.c
 swftotcl_LDADD = libutil.la $(top_builddir)/src/libming.la
 swftotcl_CFLAGS = -DSWFTCL
 
-listaction_SOURCES = outputtxt.c
+listaction_SOURCES = outputtxt.c main.c
 listaction_LDADD = libutil.la $(top_builddir)/src/libming.la
 listaction_CFLAGS = -DACTIONONLY -DNODECOMPILE
 
-listaction_d_SOURCES = outputtxt.c
+listaction_d_SOURCES = outputtxt.c main.c
 listaction_d_LDADD = libutil.la $(top_builddir)/src/libming.la
 listaction_d_CFLAGS = -DACTIONONLY 
 
 ttftofft_SOURCES = ttftofft.c outputswf.c
 ttftofft_LDADD = libutil.la $(top_builddir)/src/libming.la $(FREETYPE_LIBS)
-ttftofft_CFLAGS = -DNODECOMPILE $(FREETYPE_CFLAGS)
+ttftofft_CPPFLAGS = -DNODECOMPILE $(FREETYPE_CFLAGS)
 
 listfdb_SOURCES = listfdb.c
 listfdb_LDADD = $(top_builddir)/src/libming.la
@@ -122,8 +121,9 @@
 listjpeg_SOURCES = listjpeg.c
 listjpeg_LDADD = $(top_builddir)/src/libming.la
 
-makefdb_SOURCES = outputfdb.c
+makefdb_SOURCES = outputfdb.c main.c
 makefdb_LDADD = libutil.la $(top_builddir)/src/libming.la
+makefdb_CFLAGS = -DMAKE_FDB
 
 gif2mask_SOURCES = gif2mask.c
 gif2mask_LDADD = $(top_builddir)/src/libming.la
diff -ru ming-0.4.0.beta5.orig/util/png2dbl.c ming-0.4.0.beta5/util/png2dbl.c
--- ming-0.4.0.beta5.orig/util/png2dbl.c	2007-07-15 15:40:03.000000000 -0400
+++ ming-0.4.0.beta5/util/png2dbl.c	2011-07-30 13:30:36.000000000 -0400
@@ -87,7 +87,7 @@
     error("Couldn't create end_info\n");
   }
 
-  if(setjmp(png_ptr->jmpbuf))
+  if(setjmp(png_jmpbuf(png_ptr)))
   {
     png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
     fclose(fp);
