# -------------------------------------------------------------------------- # # This is the Jamfile used for building Fitz and MuPDF. # Put compiler options and other tweaks in Jamrules, not here. # # http://public.perforce.com/public/jam/src/Jam.html # # Set environment variable BUILD to one of: debug release profile # # jam -sBUILD=release # SubDir TOP ; ALL_LOCATE_TARGET = [ FDirName $(TOP) build $(BUILD) ] ; BINDIR = [ FDirName $(TOP) dist ] ; LINKLIBS = -lfreetype -ljpeg -lz -lm ; FITZLIBS = libmupdf libstream libfitz librender libfonts ; if $(HAVE_JASPER) = yes { CCFLAGS += -DHAVE_JASPER ; LINKLIBS += -ljasper ; } if $(HAVE_JBIG2DEC) = yes { CCFLAGS += -DHAVE_JBIG2DEC ; LINKLIBS += -ljbig2dec ; } if $(NEED_GETOPT) = yes { CCFLAGS += -DNEED_GETOPT ; } if $(NEED_STRLCAT) = yes { CCFLAGS += -DNEED_STRLCAT ; } if $(NEED_STRLCPY) = yes { CCFLAGS += -DNEED_STRLCPY ; } if $(NEED_STRSEP) = yes { CCFLAGS += -DNEED_STRSEP ; } HDRS = [ FDirName $(TOP) include ] [ FDirName $(TOP) stream ] ; # -------------------------------------------------------------------------- rule UserObject { switch $(>) { case *.rc : WindRes $(<) : $(>) ; case *.cff : Cc $(<) : $(<:S=.c) ; HexDump $(<:S=.c) : $(>) ; case * : Echo "unknown suffix on" $(>) ; } } rule HexDump { Depends $(<) : $(>) ; MakeLocate $(<) : $(LOCATE_SOURCE) ; Clean clean : $(<) ; } rule WindRes { Depends $(<) : $(>) ; Clean clean : $(<) ; } actions HexDump { xxd -i $(>) > $(<) } actions WindRes { windres -i $(>) -o $(<) --include-dir=$(>:D) } # -------------------------------------------------------------------------- SubDir TOP fitz ; Library libfitz : base_cpudep.c base_error.c base_hash.c base_matrix.c base_memory.c base_rect.c base_rune.c node_debug.c node_misc1.c node_misc2.c node_optimize.c node_path.c node_text.c node_tree.c res_cmap.c res_colorspace.c res_font.c res_image.c res_shade.c ; if $(NEED_GETOPT) = yes { Library libfitz : util_getopt.c ; } if $(NEED_STRLCAT) = yes { Library libfitz : util_strlcat.c ; } if $(NEED_STRLCPY) = yes { Library libfitz : util_strlcpy.c ; } if $(NEED_STRSEP) = yes { Library libfitz : util_strsep.c ; } # -------------------------------------------------------------------------- SubDir TOP stream ; Library libstream : crypt_arc4.c crypt_md5.c obj_array.c obj_dict.c obj_parse.c obj_print.c obj_simple.c filt_a85d.c filt_a85e.c filt_ahxd.c filt_ahxe.c filt_arc4.c filt_buffer.c filt_dctd.c filt_dcte.c filt_faxd.c filt_faxdtab.c filt_faxe.c filt_faxetab.c filt_filec.c filt_filer.c filt_filew.c filt_flate.c filt_lzwd.c filt_lzwe.c filt_null.c filt_pipeline.c filt_predict.c filt_process.c filt_rld.c filt_rle.c ; if $(HAVE_JASPER) = yes { Library libstream : filt_jpxd.c ; } if $(HAVE_JBIG2DEC) = yes { Library libstream : filt_jbig2d.c ; } # -------------------------------------------------------------------------- SubDir TOP render ; Library librender : glyphcache.c pixmap.c porterduff.c meshdraw.c imagedraw.c imageunpack.c imagescale.c pathscan.c pathfill.c pathstroke.c render.c ; if $(OSPLAT) = PPC { Library librender : archppc.c ; } if $(OSPLAT) = SPARC { Library librender : archsparc.c ; } if $(OSPLAT) = X86 { Library librender : archx86.c ; } # -------------------------------------------------------------------------- SubDir TOP fonts ; Library libfonts : Dingbats.cff StandardSymL.cff URWChanceryL-MediItal.cff NimbusMonL-Bold.cff NimbusMonL-BoldObli.cff NimbusMonL-Regu.cff NimbusMonL-ReguObli.cff NimbusRomNo9L-Medi.cff NimbusRomNo9L-MediItal.cff NimbusRomNo9L-Regu.cff NimbusRomNo9L-ReguItal.cff NimbusSanL-Bold.cff NimbusSanL-BoldItal.cff NimbusSanL-Regu.cff NimbusSanL-ReguItal.cff ; # -------------------------------------------------------------------------- SubDir TOP mupdf ; Library libmupdf : pdf_annot.c pdf_build.c pdf_cmap.c pdf_colorspace1.c pdf_colorspace2.c pdf_crypt.c pdf_debug.c pdf_doctor.c pdf_font.c pdf_fontagl.c pdf_fontenc.c pdf_fontfile.c # use builtin fonts # pdf_fontfilefc.c # use fontconfig # pdf_fontfilems.c # scan $WINDIR/Fonts pdf_function.c pdf_image.c pdf_interpret.c pdf_lex.c pdf_nametree.c pdf_open.c pdf_outline.c pdf_page.c pdf_pagetree.c pdf_parse.c pdf_pattern.c pdf_repair.c pdf_resources.c pdf_save.c pdf_shade.c pdf_shade1.c pdf_shade2.c pdf_shade3.c pdf_shade4.c pdf_store.c pdf_stream.c pdf_type3.c pdf_unicode.c pdf_xobject.c pdf_xref.c ; # -------------------------------------------------------------------------- # # Build simple portable apps # SubDir TOP apps ; APPLIST = pdfrip pdfclean pdfdebug pdfmerge pdfselect ; for APP in $(APPLIST) { Main $(APP) : $(APP).c ; LinkLibraries $(APP) : $(FITZLIBS) ; InstallBin $(BINDIR) : $(APP)$(SUFEXE) ; } # -------------------------------------------------------------------------- # # Build non-portable GUI frontend apps # if $(OS) = MINGW { SubDir TOP apps windows ; Main ghostpdf : win_main.c win_res.rc ; LinkLibraries ghostpdf : $(FITZLIBS) ; LINKLIBS on ghostpdf$(SUFEXE) = $(LINKLIBS) -lgdi32 -lcomdlg32 -mwindows ; InstallBin $(BINDIR) : ghostpdf$(SUFEXE) ; } if $(HAVE_X11) = yes { SubDir TOP apps unix ; Main ghostpdf : x11pdf.c ximage.c ; LinkLibraries ghostpdf : $(FITZLIBS) ; LINKLIBS on ghostpdf$(SUFEXE) = $(LINKLIBS) -lX11 -lXext ; } # if $(OS) = MACOSX # { # SubDir TOP apps macosx ; # MACPDF = macpdf.app/Contents/MacOS/macpdf ; # Main $(MACPDF) : apps/macpdf.c ; # LinkLibraries $(MACPDF) : libmupdf libfitz ; # LINKLIBS on $(MACPDF) = $(LINKLIBS) -framework Carbon ; # } # # if $(HAVE_GTK) = yes # { # SubDir TOP apps gnome ; # Main gtkpdf : apps/gtkpdf.c ; # CCFLAGS on apps/gtkpdf$(SUFOBJ) = # $(CCFLAGS) `pkg-config --cflags gtk+ gthread` ; # LinkLibraries gtkpdf : libmupdf libfitz ; # LINKLIBS on gtkpdf$(SUFEXE) = # $(LINKLIBS) `pkg-config --libs gtk+ gmodule gthread` ; # }