2.3.0 build fails when 2.2.2 is installed
PDF transformation/manipulation program + library
Brought to you by:
jay_berkenbilt,
m-holger
Correction: this is the patch we are using:
https://trac.macports.org/browser/trunk/dports/textproc/qpdf/files/patch-FLAGS.diff?rev=88462
Sorry for the long delay in responding to this. I appreciate this patch and will include it in the next version of qpdf, unless it causes some problem. At a glance, I don't understand why changing the order of the arguments should have any effect, but I'll study it more closely including trying to build and test my current trunk while 2.2.2 is installed on my system.
Explanation of why changing the order fixes the problem: CPPFLAGS is traditionally where a user or package management system puts flags like "-I/somewhere/include", and that is what MacPorts does. Similarly, LDFLAGS is typically where flags like "-L/somewhere/lib" will appear. If /somewhere/include and /somewhere/lib contain an installed copy of qpdf 2.2.2, then building qpdf 2.3.0 with the above CPPFLAGS and LDFLAGS will fail, as shown in our bug report linked to above, because the old 2.2.2 headers and libraries will be found in preference to the new 2.3.0 ones. The fix is to make sure CPPFLAGS and LDFLAGS appear near the end of the compile lines, after all of your own -I and -L flags.
I have included your patch. It will be in the next version of qpdf. Your explanation makes perfect sense. The qpdf source code is now on github (qpdf/qpdf). I will be pushing this change this evening.
I will be releasing qpdf 3.0 within the next week. It includes this change, so I will go ahead and close this issue.