From 30dbf94f53a3fd9760242883bdc5bddbaa0c9f44 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 21 Jun 2012 21:20:35 -0400 Subject: [PATCH] Fix order of build flags. Place user-specified CPPFLAGS and LDFLAGS later so that user-specified non-standard paths that have old versions of qpdf don't cause the build to fail. --- ChangeLog | 6 ++++++ make/libtool.mk | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d6a4b44..12609a21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2012-06-21 Jay Berkenbilt + * make/libtool.mk: Place user-specified CPPFLAGS and LDFLAGS later + in the compilation so that if a user installs things in a + non-standard place that they have to tell the build about, earlier + versions of qpdf installed there won't break the build. Thanks to + Macports for reporting this. (Fixes bug 3468860.) + * Instead of using off_t in the public APIs, use qpdf_offset_t instead. This is defined as long long in qpdf/Types.h. If your system doesn't support long long, you can redefine it. diff --git a/make/libtool.mk b/make/libtool.mk index 7cc6d435..e3cf7a1a 100644 --- a/make/libtool.mk +++ b/make/libtool.mk @@ -40,18 +40,20 @@ endif # 1 2 # Usage: $(call compile,src,includes) define compile - $(CXX) $(CPPFLAGS) $(CXXFLAGS) \ + $(CXX) $(CXXFLAGS) \ $(call depflags,$(basename $(call src_to_obj,$(1)))) \ $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ -c $(1) -o $(call src_to_obj,$(1)) endef # 1 2 # Usage: $(call c_compile,src,includes) define c_compile - $(CC) $(CPPFLAGS) $(CFLAGS) \ + $(CC) $(CFLAGS) \ $(call depflags,$(basename $(call c_src_to_obj,$(1)))) \ $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ -c $(1) -o $(call c_src_to_obj,$(1)) endef @@ -59,9 +61,10 @@ endef # Usage: $(call libcompile,src,includes) define libcompile $(LIBTOOL) --quiet --mode=compile \ - $(CXX) $(CPPFLAGS) $(CXXFLAGS) \ + $(CXX) $(CXXFLAGS) \ $(call libdepflags,$(basename $(call src_to_obj,$(1)))) \ $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ -c $(1) -o $(call src_to_obj,$(1)); \ $(call fixdeps,$(basename $(call src_to_obj,$(1)))) endef @@ -70,9 +73,10 @@ endef # Usage: $(call libcompile,src,includes) define c_libcompile $(LIBTOOL) --quiet --mode=compile \ - $(CC) $(CPPFLAGS) $(CXXFLAGS) \ + $(CC) $(CXXFLAGS) \ $(call libdepflags,$(basename $(call c_src_to_obj,$(1)))) \ $(foreach I,$(2),-I$(I)) \ + $(CPPFLAGS) \ -c $(1) -o $(call c_src_to_obj,$(1)); \ $(call fixdeps,$(basename $(call src_to_obj,$(1)))) endef @@ -90,14 +94,14 @@ endef define makelib $(LIBTOOL) --mode=link \ $(CXX) $(CXXFLAGS) $(LD_VERSION_FLAGS) \ - -o $(2) $(1) $(3) $(4) \ + -o $(2) $(1) $(4) $(3) \ -rpath $(libdir) -version-info $(5):$(6):$(7) endef # 1 2 3 4 # Usage: $(call makebin,objs,binary,ldflags,libs) define makebin - $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(1) -o $(2) $(3) $(4) + $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(1) -o $(2) $(4) $(3) endef # Install target