Commit 30dbf94f53a3fd9760242883bdc5bddbaa0c9f44
1 parent
81e87523
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.
Showing
2 changed files
with
16 additions
and
6 deletions
ChangeLog
| 1 | 1 | 2012-06-21 Jay Berkenbilt <ejb@ql.org> |
| 2 | 2 | |
| 3 | + * make/libtool.mk: Place user-specified CPPFLAGS and LDFLAGS later | |
| 4 | + in the compilation so that if a user installs things in a | |
| 5 | + non-standard place that they have to tell the build about, earlier | |
| 6 | + versions of qpdf installed there won't break the build. Thanks to | |
| 7 | + Macports for reporting this. (Fixes bug 3468860.) | |
| 8 | + | |
| 3 | 9 | * Instead of using off_t in the public APIs, use qpdf_offset_t |
| 4 | 10 | instead. This is defined as long long in qpdf/Types.h. If your |
| 5 | 11 | system doesn't support long long, you can redefine it. | ... | ... |
make/libtool.mk
| ... | ... | @@ -40,18 +40,20 @@ endif |
| 40 | 40 | # 1 2 |
| 41 | 41 | # Usage: $(call compile,src,includes) |
| 42 | 42 | define compile |
| 43 | - $(CXX) $(CPPFLAGS) $(CXXFLAGS) \ | |
| 43 | + $(CXX) $(CXXFLAGS) \ | |
| 44 | 44 | $(call depflags,$(basename $(call src_to_obj,$(1)))) \ |
| 45 | 45 | $(foreach I,$(2),-I$(I)) \ |
| 46 | + $(CPPFLAGS) \ | |
| 46 | 47 | -c $(1) -o $(call src_to_obj,$(1)) |
| 47 | 48 | endef |
| 48 | 49 | |
| 49 | 50 | # 1 2 |
| 50 | 51 | # Usage: $(call c_compile,src,includes) |
| 51 | 52 | define c_compile |
| 52 | - $(CC) $(CPPFLAGS) $(CFLAGS) \ | |
| 53 | + $(CC) $(CFLAGS) \ | |
| 53 | 54 | $(call depflags,$(basename $(call c_src_to_obj,$(1)))) \ |
| 54 | 55 | $(foreach I,$(2),-I$(I)) \ |
| 56 | + $(CPPFLAGS) \ | |
| 55 | 57 | -c $(1) -o $(call c_src_to_obj,$(1)) |
| 56 | 58 | endef |
| 57 | 59 | |
| ... | ... | @@ -59,9 +61,10 @@ endef |
| 59 | 61 | # Usage: $(call libcompile,src,includes) |
| 60 | 62 | define libcompile |
| 61 | 63 | $(LIBTOOL) --quiet --mode=compile \ |
| 62 | - $(CXX) $(CPPFLAGS) $(CXXFLAGS) \ | |
| 64 | + $(CXX) $(CXXFLAGS) \ | |
| 63 | 65 | $(call libdepflags,$(basename $(call src_to_obj,$(1)))) \ |
| 64 | 66 | $(foreach I,$(2),-I$(I)) \ |
| 67 | + $(CPPFLAGS) \ | |
| 65 | 68 | -c $(1) -o $(call src_to_obj,$(1)); \ |
| 66 | 69 | $(call fixdeps,$(basename $(call src_to_obj,$(1)))) |
| 67 | 70 | endef |
| ... | ... | @@ -70,9 +73,10 @@ endef |
| 70 | 73 | # Usage: $(call libcompile,src,includes) |
| 71 | 74 | define c_libcompile |
| 72 | 75 | $(LIBTOOL) --quiet --mode=compile \ |
| 73 | - $(CC) $(CPPFLAGS) $(CXXFLAGS) \ | |
| 76 | + $(CC) $(CXXFLAGS) \ | |
| 74 | 77 | $(call libdepflags,$(basename $(call c_src_to_obj,$(1)))) \ |
| 75 | 78 | $(foreach I,$(2),-I$(I)) \ |
| 79 | + $(CPPFLAGS) \ | |
| 76 | 80 | -c $(1) -o $(call c_src_to_obj,$(1)); \ |
| 77 | 81 | $(call fixdeps,$(basename $(call src_to_obj,$(1)))) |
| 78 | 82 | endef |
| ... | ... | @@ -90,14 +94,14 @@ endef |
| 90 | 94 | define makelib |
| 91 | 95 | $(LIBTOOL) --mode=link \ |
| 92 | 96 | $(CXX) $(CXXFLAGS) $(LD_VERSION_FLAGS) \ |
| 93 | - -o $(2) $(1) $(3) $(4) \ | |
| 97 | + -o $(2) $(1) $(4) $(3) \ | |
| 94 | 98 | -rpath $(libdir) -version-info $(5):$(6):$(7) |
| 95 | 99 | endef |
| 96 | 100 | |
| 97 | 101 | # 1 2 3 4 |
| 98 | 102 | # Usage: $(call makebin,objs,binary,ldflags,libs) |
| 99 | 103 | define makebin |
| 100 | - $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(1) -o $(2) $(3) $(4) | |
| 104 | + $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(1) -o $(2) $(4) $(3) | |
| 101 | 105 | endef |
| 102 | 106 | |
| 103 | 107 | # Install target | ... | ... |