diff --git a/README b/README index d4b9620b..40e0f33a 100644 --- a/README +++ b/README @@ -8,6 +8,9 @@ Artistic License which may be found in the source distribution as "Artistic-2.0". It is provided "as is" without express or implied warranty. +Building on UNIX/Linux +====================== + For UNIX and UNIX-like systems, you can usually get by with just ./configure @@ -17,8 +20,32 @@ make install For more detailed general information, see the "INSTALL" file in this directory. -For specific information about building qpdf on Windows, see -"README.windows". +Building on Windows +=================== + +QPDF is known to build and pass its test suite with mingw (gcc 4.4.0) +and Microsoft Visual C++ .NET 2008 Express. In both cases, cygwin is +required to run the test suite. Either cygwin or MSYS is required to +build as well in order to get make and other related tools. The MSVC +build has only been tested under cygwin. The mingw build requires +MSYS and will probably not work with cygwin. + +For details on how to build under Windows, see README.windows. + + +Additional Notes on Build +========================= + +QPDF's build system, inspired by abuild (http://www.abuild.org), can +optionally use its own built-in rules rather than using libtool and +obeying the compiler specified with configure. This can be enabled by +passing --with-buildrules=buildrules where buildrules corresponds to +one of the .mk files (other than rules.mk) in the make directory. +This should never be necessary on a UNIX system, but may be necessary +on a Windows system. See README.windows for details. There is a +gcc-linux.mk file enable "gcc-linux" build rules, but it is intended +to help test the build system; Linux users should build with the +"libtools" rules, which are enabled by default. The QPDF package provides some executables and a software library. A user's manual can be found in the "doc" directory. The docbook diff --git a/README.windows b/README.windows index 4cf547b8..92431da2 100644 --- a/README.windows +++ b/README.windows @@ -21,9 +21,9 @@ If you have MSYS and Mingw installed, you can run configure as follows: To build with msvc, you must be running in a shell environment that puts the MSVC tools in your path. Then you can run -XXX WHAT? +CC=cl CXX="cl /TP /GR" CPPFLAGS=-DHAVE_VSNPRINTF ./configure --disable-test-compare-images --enable-build-external-libs --with-buildrules=msvc -./configure --disable-test-compare-images --enable-build-external-libs --with-buildrules=msvc +This is tested with MSVC .NET 2008 Express. From there, run diff --git a/configure.ac b/configure.ac index d6523ff7..09670697 100644 --- a/configure.ac +++ b/configure.ac @@ -84,19 +84,30 @@ else AC_MSG_RESULT(no) fi -qpdf_USE_WALL=0 -AC_MSG_CHECKING(for whether $CC supports -Wall) -oCFLAGS=$CFLAGS -CFLAGS="$CFLAGS -Wall" -AC_TRY_COMPILE([], [int a = 1; int b = a; a = b;], - qpdf_USE_WALL=1, - qpdf_USE_WALL=0) -if test "$qpdf_USE_WALL" = "1"; then - AC_MSG_RESULT(yes) - CXXFLAGS="$CXXFLAGS -Wall" -else - AC_MSG_RESULT(no) - CFLAGS=$oCFLAGS +AC_MSG_CHECKING(which build rules to use) +AC_SUBST(BUILDRULES) +AC_ARG_WITH(buildrules, + AS_HELP_STRING([--with-buildrules=rules], + [which build rules to use; see README]), + [BUILDRULES=$withval], + [BUILDRULES=libtool]) +AC_MSG_RESULT($BUILDRULES) + +if test "$BUILDRULES" != "msvc"; then + qpdf_USE_WALL=0 + AC_MSG_CHECKING(for whether $CC supports -Wall) + oCFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Wall" + AC_TRY_COMPILE([], [int a = 1; int b = a; a = b;], + qpdf_USE_WALL=1, + qpdf_USE_WALL=0) + if test "$qpdf_USE_WALL" = "1"; then + AC_MSG_RESULT(yes) + CXXFLAGS="$CXXFLAGS -Wall" + else + AC_MSG_RESULT(no) + CFLAGS=$oCFLAGS + fi fi if test "$BUILD_EXTERNAL_LIBS" = "0"; then @@ -118,15 +129,6 @@ if test "$BUILD_EXTERNAL_LIBS" = "0"; then fi fi -AC_MSG_CHECKING(which build rules to use) -AC_SUBST(BUILDRULES) -AC_ARG_WITH(buildrules, - AS_HELP_STRING([--with-buildrules=rules], - [which build rules to use; see README]), - [BUILDRULES=$withval], - [BUILDRULES=libtool]) -AC_MSG_RESULT($BUILDRULES) - AC_SUBST(SKIP_TEST_COMPARE_IMAGES) AC_ARG_ENABLE(test-compare-images, AS_HELP_STRING([--enable-test-compare-images], diff --git a/make/msvc.mk b/make/msvc.mk index c5961c03..b60abc03 100644 --- a/make/msvc.mk +++ b/make/msvc.mk @@ -40,27 +40,26 @@ define makeslib lib /nologo /OUT:$(2) $(1) endef -# 1 2 3 4 5 6 7 -# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age) +# 1 2 3 4 5 +# Usage: $(call makelib,objs,library,current,revision,age) define makelib - cl /nologo /Zi /Gy /EHsc /MD /LD /Fe$(basename $(2))$(5).dll $(1) \ + cl /nologo /Zi /Gy /EHsc /MD /LD /Fe$(basename $(2))$(3).dll $(1) \ /link /incremental:no \ - $(foreach L,$(subst -L,,$(3)),/LIBPATH:$(L)) \ - $(foreach L,$(subst -l,,$(4)),$(L).lib) - if [ -f $(basename $(2))$(5).dll.manifest ]; then \ - mt.exe -nologo -manifest $(basename $(2))$(5).dll.manifest \ - -outputresource:$(basename $(2))$(5).dll\;2; \ + $(foreach L,$(subst -L,,$(LDFLAGS)),/LIBPATH:$(L)) \ + $(foreach L,$(subst -l,,$(LIBS)),$(L).lib) + if [ -f $(basename $(2))$(3).dll.manifest ]; then \ + mt.exe -nologo -manifest $(basename $(2))$(3).dll.manifest \ + -outputresource:$(basename $(2))$(3).dll\;2; \ fi - mv $(2)$(5).lib $(2).lib endef -# 1 2 3 4 -# Usage: $(call makebin,objs,binary,ldflags,libs) +# 1 2 +# Usage: $(call makebin,objs,binary) define makebin cl /nologo /Zi /Gy /EHsc /MD $(1) \ /link /incremental:no /OUT:$(2) \ - $(foreach L,$(subst -L,,$(3)),/LIBPATH:$(L)) \ - $(foreach L,$(subst -l,,$(4)),$(L).lib) + $(foreach L,$(subst -L,,$(LDFLAGS)),/LIBPATH:$(L)) \ + $(foreach L,$(subst -l,,$(LIBS)),$(L).lib) if [ -f $(2).manifest ]; then \ mt.exe -nologo -manifest $(2).manifest \ -outputresource:$(2)\;2; \