shithub: jbig2

Download patch

ref: 86e0b052dc32de4e0f9a3cbc7dbf27211a2b3182
parent: 8e6b447d8bddabc0acd5834fa493110b1bb3e9c7
author: Ralph Giles <giles@ghostscript.com>
date: Fri May 22 19:21:48 EDT 2009

Fix the jam build to work without config.h.

Previously, the Jamfile assumed a config.h had be created, usually by
running the configure script, but possibly also created manually. This
is extra work for those wanting a quick build. Therefore we pass some
defines on the compiler command line instead.

These are also likely to be wrong: we assume libpng is available on
all non-windows platforms. It's an incremental improvement, however,
and actual build-time configuration based on detected resources is
difficult in Jam.

--- a/Jamfile
+++ b/Jamfile
@@ -5,7 +5,12 @@
 
 include $(HOME)/.jamrules ;
 
-CCFLAGS += -DHAVE_CONFIG_H ;
+# assume stdint.h and libpng are available, except on win32
+if $(OS) != NT {
+  CCFLAGS += -DHAVE_STDINT_H -DHAVE_LIBPNG ;
+  LINKLIBS += -lpng -lz ;
+  Library libjbig2dec : jbig2_image_png.c ;
+}
 
 Library libjbig2dec :
 	jbig2_arith.c jbig2_arith_int.c jbig2_arith_iaid.c jbig2_huffman.c
@@ -13,7 +18,7 @@
 	jbig2_symbol_dict.c jbig2_text.c
 	jbig2_halftone.c
 	jbig2_generic.c jbig2_refinement.c jbig2_mmr.c
-	jbig2_image.c jbig2_image_pbm.c
+	jbig2_image.c jbig2_image_pbm.c # jbig2_image_png.c
 	jbig2_metadata.c 
 	jbig2.c
 	;