Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#939 libgphoto2: Put user CPPFLAGS after (not before) your own

closed-fixed
None
5
2013-05-12
2013-02-19
Ryan Schmidt
No

When building any software using MacPorts, we automatically put -I${prefix}/include into CPPFLAGS (to help that software find other software it might depend on). (Similarly we put -L${prefix}/lib into LDFLAGS.)

The libgphoto2 2.5.1.1 configure script sets AM_CPPFLAGS to the user-supplied $CPPFLAGS, then appends various -I flags to it for the various build directories.

The problem arises if another version of libgphoto2 is already installed, particularly one whose headers differ from those of the version being built. Because of the user-supplied -I${prefix}/include CPPFLAGS, files in ${prefix}/include get found in preference to files in the build directories, which can cause build failures like this one that was reported to us:

https://lists.macosforge.org/pipermail/macports-users/2009-March/014605.html

Here is the patch we've been using to fix this:

https://trac.macports.org/browser/trunk/dports/devel/libgphoto2/files/patch-configure.diff?rev=48890

We recommend making this change in your sources.

Discussion

    • status: open --> pending-fixed
    • assigned_to: Marcus Meissner
     
  • I rewrote the logic today and I think it should be fixed now.

    CPPFLAGS is at least evalauted after the other -I statements.

     
  • the libgphoto2_port.la things just work fine for me already, i can build 2.5 libgphoto2 on a system with 2.4 libgphoto2 without issues.

     
  • ... i have howveer merged a better version of your second patch into svn.

     
    • status: pending-fixed --> closed-fixed
     
  • fixed in 2.5.2