1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
|
1- PREREQUISITES
================
1.1 DJVULIBRE
-------------
You need DjVuLibre >= 3.5.18.
See http://djvu.sourceforge.net for the
source code and for pointers to binary packages.
Under debian type "apt-get install libdjvulibre-dev"
1.2 QT4
-------
You need Qt4 >= 4.2.0
See http://trolltech.com for the source code.
Select the version of Qt adapted to your platform.
Under debian type "apt-get install libqt4-dev qt4-dev-tools
1.3 PKG-CONFIG
--------------
Under Unix the configure script uses pkg-config
to locate the DjVuLibre library and its ancillary files.
See http://pkgconfig.freedesktop.org.
If you do not have pkg-config, you will have
to specify which compilation options using
the variabled DDJVUAPI_CFLAGS and DDJVUAPI_LIBS.
1.4 XDG-UTILS
-------------
Optionally, the installation process under unix creates
a shell script that installs the djview4 menu entry and icon.
This script depends on the XDG "Portland" utilities
available at http://portland.freedesktop.org.
See file desktopfiles/README for more information.
2 COMPILING AND INSTALLING UNDER UNIX
=====================================
2.1 CONFIGURE
-------------
First run the script 'configure' to generate the makefiles.
Command 'configure --help' list options and environment
variables that affect the generation of makefile.
The most useful ones are:
--prefix=<directory>
Indicate the base directory for installing djview.
The default prefix is /usr/local.
Binary packages are usually compiled with prefix /usr.
--mandir=<directory>
Indicates where the man pages go.
The default is ${prefix}/man but many systems
prefer to install man pages in ${prefix}/share/man.
PKG_CONFIG_PATH=<colon-separated-directories>
Indicates the path for search pkg-config description files.
The default path is /usr/lib/pkgconfig:/usr/share/pkgconfig.
If you have installed DjVuLibre with a prefix different
from /usr, you probably want to add ${prefix}/lib/pkgconfig
to this path.
DDJVUAPI_CFLAGS=<compiler-flags>
Compiler flags for using the DjVuLibre api.
This is useful when you do not have pkg-config
or when pkg-config does not locate DjVuLibre.
DDJVUAPI_LIBS=<linker-flags>
Linker flags for using the DjVuLibre api.
This is useful when you do not have pkg-config
or when pkg-config does not locate DjVuLibre.
QMAKE=<filaname>
Indicate the location of the Qt4 qmake executable.
This is useful when configure cannot locate Qt4.
Running configure creates all the required makefiles
and executes command qmake in directory src.
2.2 MAKE
--------
You can then compile djview4 with command
% make
2.3 INSTALL
-----------
Once the compilation is successful, command
% make install
copies the binary files to the appropriate location.
The following files are created
${bindir}/djview4
${bindir}/djview --> djview4
${mandir}/man1/djview4.1
${mandir}/man1/djview.1 --> djview4.1
${datadir}/djvu/djview4/...
Unless specified otherwise on the configure command line:
${bindir}=${prefix}/bin
${mandir}=${prefix}/man
${datadir}=${prefix}/share
File README_packagers contains more information
about the installation process.
After the installation, you can run
% ${datadir}/djview4/desktop/register-djview-menu install
to setup the djview4 menu entries and icons.
3 OTHER PLATFORMS
=================
In general you can compile the standalone
viewer djview4 on non unix platforms.
However the browser plugin capability
is currently not working on non X11 systems.
You will need to compile DjVuLibre.
You will need the appropriate version of Qt4.
3.1 MAC OS X
------------
There are two options under Mac OS X.
* Installing the X11 system and its development files.
First install the X11 version of Qt4.
Proceding as for normal Unix systems.
Please refer to section 2 for details.
* Installing the native Mac OS X version of Qt4.
First install the native Mac version of Qt4.
We recommend that you first install macports
with the libraries zlib, libpng, jpeg and tiff.
You must also install Qt and compile djvulibre.
Assuming Qt is in the default location and
djvulibre in /usr/local, configure with
$ ./configure --disable-nsdejavu \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig \
QMAKE=/Developer/Tools/Qt/qmake \
QMAKESPEC=macx-g++
Then compile with
$ make
Note1: The Qt4 documentation states that qmake can
also be used to generate an XCode project file.
But this is more dependent on the exact XCode version
you are using. Use QMAKESPEC=macx-xcode
Note2: This procedure generates a nice application bundle.
However the binaries inside the bundle may depend on
shared libraries located elsewhere. To produce a distributable
application bundle, you must fix that with command install_name_tool.
See the Qt documentation about the deployment of Mac applications.
Note3: Do not use command "make install".
Simply copy the application bundle where you want it.
3.2 WINDOWS
-----------
There are also two ways to compile djview under Windows.
* Using Visual C++ 2010
- First you need to compile Qt4 using Visual C++.
This used to be require patching the Qt source
<http://qtnode.net/wiki?title=Qt4_with_Visual_Studio>
Starting with Qt-4.3.2, the opensource Qt version
supports Visual C++ right out of the box.
- Compile djvulibre using the visual C++ method.
- Go to directory src
- Type command
$ qmake -win32 -tp vc
to generate a MS Visual C++ project file.
- Tweak the project file to properly link with
the djvulibre library and the tiff library.
One good way to do so is to open the file "djvulibre.sln"
that comes with the cvs version of djvulibre. Then add the
project "djview.vcproj" and insert the property sheets
"dirs", "warnings", "libtiff" and "tools" found in the
djvulibre-3.5/win32/djvulibre directory. You also need
to add the references to libdjvulibre and libtiff.
This works well despite requiring a lot of clicks.
* Using the MINGW compiler (not recommended)
- Install the binary version of Qt4.
- Install the mingw version of zlib, libtiff, libjpeg.
- Compile djvulibre using the configure method.
- Go to directory djview4/src.
- Type command
$ qmake DEFINES+=HAVE_TIFF \
LIBS+="-L$HOME/djvulibre-3.5/libdjvu/.libs -ldjvulibre -ltiff" \
QMAKE_CXXFLAGS+="-I$HOME/djvulibre-3.5"
where you replace the paths by the actual djvulibre paths.
- Then compile using
$ mingw32-make SHELL=cmd.exe
|