
1- How to build on Mac OS X
===========================

The Mac OS X version of djvulibre can be built in one of two ways:

- the Unix way
- the Xcode way

These instructions are to help setup and build djvulibre for a
multi-architecture binary (ppc, i386).  Your milage with the following
configure options (note: libjpeg.a and libtiff.a are installed
universal on the machine this was tested with.)

We recommend that you first install macports with the 
libraries zlib, libpng, jpeg and tiff with option +universal.
The commands to install these libraries are
  $ sudo port install zlib +universal
  $ sudo port install libpng +universal
  $ sudo port install jpeg +universal
  $ sudo port install tiff +universal

Then you can run configure

./configure \
   --enable-static=yes \
   --disable-desktopfiles \
   --with-extra-includes=/usr/include \
   --with-extra-libraries=/usr/lib \
   CFLAGS="-arch ppc -arch i386" \
   CXXFLAGS="-arch ppc -arch i386" \
   LDFLAGS="-arch ppc -arch i386"

The --with-extra-include and --with-extra-libraries are here
to favor system libraries (in /usr) over those that come with macports.
Then you can compile with 

$ make

Running "make install" will install djvulibre in directory /usr/local.
Note that the produced libraries will depend on the macports jpeg and tiff
libraries.  You can change that using the command "install_name_tool"
and other macosx tricks...


Alternatively you can just open the macosx/DjVuLibre/DjVuLibre.xcodeproj 
and build everything using Xcode. This can be painful if you do not have
the same version of Xcode as the one we used to generate that file.
In Leon's opinion, this is hell.  Jeff agrees, those dyld dependancies 
trap us forever in the eighth circle.

Note that the macosx directory contains a few useful tools
that are not compiled using the main makefile:

The djvu.mdimporter program is a spotlight importer for djvu metadata.
The djvu.qlgenerator program generates quicklook data (leopard only).
