FZ's advices to build nadvi *************************** Dependencies ************ You need - ocaml >= 3.07 - gcc >= 3.0 (required by libgs) - ocamldsort ftp://quatramaran.ens.fr/pub/ara/ocamldsort ftp://quatramaran.ens.fr/pub/ara/ocamldsort/ocamldsort-0.14.2.tar.gz - ocamlweb http://www.lri.fr/~filliatr/ocamlweb/index.en.html - ocamlsdl http://ocamlsdl.sourceforge.net (in turn, you must have libSDL installed on your machine: www.libsdl.org) - findlib http://www.ocaml-programming.de/packages/ All these packages are available via the GODI package system, and build fine on both Linux and MacOs X (there is a problem in the current GODI package for ocamlsdl - I already submitted a patch to the appropriate mailing list). If you want postscript rendering (nadvi has the proper fallbacks if libgs is not available, just set LIBGS_AVALIABLE=0 in the Makefile - see below), then you also need the Ghostscript Interpreter Library version 8.15 or higher (aka libgs). See the recipe to install it at the end of this document. Remark: nadvi has been tested with libgs 8.15 (GPL) and libgs 8.50 (Artifex). Building ******** - Edit the following variables in the Makefile: ARCH : either linux or macosx LIBGS_AVAILABLE : 1 for yes, 0 for no You may want to edit some of the path informations, in particular: C_SDL_INCLUDE C_SDL_LIBDIR (currently unused - we rely on findlib) C_GS_INCLUDE C_GS_LIBDIR (Remark: to ensure 8.15 - 8.50 cmpatibility, the relevant gs headers are no longer shipped with the nadvi sources). - make will build the bytecode advi, while - make opt will build the native advi. If LIBGS_AVAILABLE = 1, then you may want to set the environment variables export LD_LIBRARY_PATH=...location of libgs export GS_LIB=...location of the ghostscript library files (eg, gs_init.ps) before running ./advi. A recipe to build libgs 8.50 or 8.15 ************************************ Remark: this cookbook has not been tested with 8.15, but the whole process should not reserve big surprises. Remark: 8.15 is untested on MacOsX. - Verify that you are using gcc >= 3.0. - Download the sources of ghostscript-8.50 (www.ghostscript.com), and untar them. If you are on Linux (easy): - cd ghostscript-8.50 - ./configure -prefix ...where you want to install libgs --- you may run libgs without installing it, see below If configure complains that some libraries are not available (eg. libjpeg), then download their sources, untar them in the ghostscript-8.50 directory, rename them to remove the version number, and re-configure (ghostscript knows how to build them). - make so This builds libgs.so in the directory ghostscript-8.50/sobin. - if you want to install libgs, then make soinstall (Be careful: this version of gs should not overlap with other versions of gs you might have on your system). Alternatively, set the environment variables export LD_LIBRARY_PATH = ...ghostscript-8.50/sobin export GS_LIB = ...ghostscript-8.50/lib You may as well copy the templates/advix to a location in your execution path and adjust its environment variables. You are done. If you are on MacOsX, then the autoconf process is broken, and the default src/macos.mak makefile does not build the device driver. So, I suggest: - cd ghostscript-8.50 - ./configure -prefix ...where you want to install libgs If configure complains that some libraries are not available (eg. libjpeg), then download their sources, untar them in the ghostscript-8.50 directory, rename them to remove the version number, and re-configure (ghostscript knows how to build them). - apply the patch below to src/unix-dll.mak ############ the patch starts here ########################### --- unix-dll.mak-old Wed Feb 23 11:56:00 2005 +++ unix-dll.mak Wed Feb 23 14:09:31 2005 @@ -44,13 +44,17 @@ GSSOX_XE=$(BINDIR)/$(GSSOX_XENAME) GSSOX=$(BINDIR)/$(SOBINRELDIR)/$(GSSOX_XENAME) -# shared library -GS_SONAME=lib$(GS).so -GS_SONAME_MAJOR=$(GS_SONAME).$(GS_VERSION_MAJOR) -GS_SONAME_MAJOR_MINOR= $(GS_SONAME).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR) +# shared library +SOPREF= +SOSUF=.dylib + +GS_SONAME_BASE=lib$(GS)$(SOPREF) +GS_SONAME=$(GS_SONAME_BASE)$(SOSUF) +GS_SONAME_MAJOR=$(GS_SONAME_BASE).$(GS_VERSION_MAJOR)$(SOSUF) +GS_SONAME_MAJOR_MINOR=$(GS_SONAME_BASE).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR)$(SOSUF) GS_SO=$(BINDIR)/$(GS_SONAME) -GS_SO_MAJOR=$(GS_SO).$(GS_VERSION_MAJOR) -GS_SO_MAJOR_MINOR=$(GS_SO_MAJOR).$(GS_VERSION_MINOR) +GS_SO_MAJOR=$(BINDIR)/$(GS_SONAME_MAJOR) +GS_SO_MAJOR_MINOR=$(BINDIR)/$(GS_SONAME_MAJOR_MINOR) # Shared object is built by redefining GS_XE in a recursive make. @@ -74,7 +78,7 @@ # ------------------------- Recursive make targets ------------------------- # -SODEFS=LDFLAGS='$(LDFLAGS) $(CFLAGS_SO) -shared -Wl,-soname=$(GS_SONAME_MAJOR)'\ +SODEFS=LDFLAGS='$(LDFLAGS) $(CFLAGS_SO) -dynamiclib -install_name $(prefix)/$(GS_SONAME_MAJOR_MINOR)'\ GS_XE=$(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR)\ STDIO_IMPLEMENTATION=c\ DISPLAY_DEV=$(DD)$(SOOBJRELDIR)/display.dev\ ############# the patch ends here ################################# - make so This builds libgs.dylib in the directory ghostscript-8.50/sobin. - I did not try, but I believe that make soinstall will do the right thing. Alternatively, set appropriately the GS_LIB environment variable (this should be enough: on MacOs X, nadvi is statically linked for several reasons).