2009-10-11 01:21:06 +00:00
|
|
|
Common Setup
|
|
|
|
============
|
2009-10-10 15:10:05 +00:00
|
|
|
|
2009-10-14 01:06:18 +00:00
|
|
|
To be able to build qpdf and run its test suite, you must have either
|
2009-10-14 01:20:46 +00:00
|
|
|
Cygwin or MSYS from MinGW (>= 1.0.11) installed. If you want to build
|
|
|
|
with Microsoft Visual C++, either Cygwin or MSYS will do. If you want
|
|
|
|
to build with MinGW, you must use MSYS rather than Cygwin.
|
2009-10-10 15:10:05 +00:00
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
As of this writing, the image comparison tests confuse ghostscript in
|
|
|
|
cygwin, but there's a chance they might work at some point. If you
|
|
|
|
want to run them, you need ghostscript and tiff utils as well. Then
|
|
|
|
omit --disable-test-compare-images from the configure statements given
|
2009-10-14 01:20:46 +00:00
|
|
|
below. The image comparison tests have not been tried under MSYS.
|
2009-10-10 15:10:05 +00:00
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
Building with MinGW
|
|
|
|
===================
|
2009-10-10 15:28:33 +00:00
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
QPDF is known to build and pass its test suite with MSYS-1.0.11 and
|
2009-10-22 18:04:46 +00:00
|
|
|
gcc 4.4.0 with C++ support. If you also have ActiveState Perl in your
|
|
|
|
path, you can fully configure, build, and test qpdf in this
|
|
|
|
environment. You will most likely not be able to build qpdf with
|
|
|
|
mingw using cygwin.
|
2009-10-10 15:28:33 +00:00
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
From your MSYS prompt, run
|
2009-10-10 18:06:26 +00:00
|
|
|
|
2009-10-20 01:46:56 +00:00
|
|
|
./config-mingw
|
|
|
|
|
|
|
|
and then
|
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
make
|
2009-10-10 18:06:26 +00:00
|
|
|
|
2009-10-22 18:04:46 +00:00
|
|
|
Note that ./config-mingw just runs ./configure with specific
|
|
|
|
arguments, so you can look at it, make adjustments, and manually run
|
|
|
|
configure instead.
|
|
|
|
|
2009-10-14 01:20:46 +00:00
|
|
|
Add the absolute path to the libqpdf/build directory to your PATH.
|
|
|
|
Make sure you can run the qpdf command by typing qpdf/build/qpdf and
|
|
|
|
making sure you get a help message rather than an error loading the
|
|
|
|
DLL or no output at all. Run the test suite by typing
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-14 01:20:46 +00:00
|
|
|
make check
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-14 01:20:46 +00:00
|
|
|
If all goes well, you should get a passing test suite.
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-22 18:04:46 +00:00
|
|
|
To create an installation directory, run make install. This will
|
|
|
|
create install-mingw/qpdf-VERSION and populate it. The binary
|
|
|
|
download of qpdf for Windows with mingw is created from this
|
|
|
|
directory.
|
|
|
|
|
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
Building with MSVC .NET 2008 Express
|
|
|
|
====================================
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
These instructions would likely work with newer version of MSVC or
|
|
|
|
with full version of MSVC. They may also work with .NET 2005. They
|
2009-10-22 18:04:46 +00:00
|
|
|
have only been tested with .NET 2008 Express (VC9.0). You may follow
|
|
|
|
these instructions from either Cygwin or from MSYS, though only MSYS
|
|
|
|
is regularly tested.
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
You should first set up your environment to be able to run MSVC from
|
|
|
|
the command line. There is usually a batch file included with MSVC
|
|
|
|
that does this. From that cmd prompt, you can start your cygwin
|
|
|
|
shell.
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
Configure as follows:
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-20 01:46:56 +00:00
|
|
|
./config-msvc
|
|
|
|
|
|
|
|
and then
|
|
|
|
|
2009-10-11 01:21:06 +00:00
|
|
|
make
|
2009-10-10 18:05:01 +00:00
|
|
|
|
2009-10-22 18:04:46 +00:00
|
|
|
Note that ./config-msvc just runs ./configure with specific arguments,
|
|
|
|
so you can look at it, make adjustments, and manually run configure
|
|
|
|
instead.
|
|
|
|
|
2009-10-21 00:27:24 +00:00
|
|
|
NOTE: automated dependencies are not generated with the msvc build.
|
|
|
|
If you're planning on making modifications, you should probably work
|
|
|
|
with mingw. If there is a need, I can add dependency information to
|
|
|
|
the msvc build, but since I only use it for generating release
|
|
|
|
versions, I haven't bothered.
|
|
|
|
|
2009-10-11 01:24:48 +00:00
|
|
|
Once built, add the full path to the libqpdf/build directory to your
|
|
|
|
path and run
|
2009-10-11 01:21:06 +00:00
|
|
|
|
|
|
|
make check
|
|
|
|
|
|
|
|
to run the test suite.
|
2009-10-10 18:05:01 +00:00
|
|
|
|
|
|
|
If you are building with MSVC and want to debug a crash in MSVC's
|
|
|
|
debugger, first start an instance of Visual C++. Then run qpdf. When
|
|
|
|
the abort/retry/ignore dialog pops up, first attach the process from
|
|
|
|
within visual C++, and then click Retry in qpdf.
|
2009-10-11 01:21:06 +00:00
|
|
|
|
2009-10-22 18:04:46 +00:00
|
|
|
A release version of qpdf is built by default. If you want to link
|
|
|
|
against debugging libraries, you will have to change /MD to /MDd in
|
|
|
|
make/msvc.mk. Note that you must redistribute the Microsoft runtime
|
|
|
|
DLLs. Linking with static runtime (/MT) won't work; see "Static
|
|
|
|
Runtime" below for details.
|
|
|
|
|
2009-10-11 13:24:08 +00:00
|
|
|
|
2009-10-14 01:20:46 +00:00
|
|
|
Runtime DLLs
|
|
|
|
============
|
|
|
|
|
|
|
|
Both build methods create executables and DLLs that are dependent on
|
2009-10-22 18:04:46 +00:00
|
|
|
the compiler's runtime DLLs. When you run make install, the
|
|
|
|
installation process will automatically detect the DLLs and copy them
|
|
|
|
into the installation bin directory. Look at the copy_dlls script for
|
|
|
|
details on how this is accomplished.
|
2009-10-14 01:20:46 +00:00
|
|
|
|
|
|
|
Redistribution of the runtime DLL is unavoidable as of this writing;
|
|
|
|
see "Static Runtime" below for details.
|
|
|
|
|
2009-10-11 15:06:44 +00:00
|
|
|
|
2009-10-11 13:24:08 +00:00
|
|
|
Static Runtime
|
|
|
|
==============
|
|
|
|
|
|
|
|
Building the DLL and executables with static runtime does not work
|
|
|
|
with either Visual C++ .NET 2008 (a.k.a. vc9) using /MT or with mingw
|
|
|
|
(at least as of 4.4.0) using -static-libgcc. The reason is that, in
|
|
|
|
both cases, there is static data involved with exception handling, and
|
|
|
|
when the runtime is linked in statically, exceptions cannot be thrown
|
|
|
|
across the DLL to EXE boundary. Since qpdf uses exception handling
|
|
|
|
extensively for error handling, we have no choice but to redistribute
|
|
|
|
the C++ runtime DLLs. Maybe this will be addressed in a future
|
|
|
|
version of the compilers.
|