Skip to content

Commit bd5aec3

Browse files
committed
pc files: Fix gphoto2 builds, avoid builds with wrong headers
In the *.pc files, use a C preprocessor include path both with and without the gphoto2/ path component: Cflags: -I${includedir} -I${includedir}/gphoto2 This allows both the preferred way to include gphoto2 headers #include <gphoto2/gphoto2.h> #include <gphoto2/gphoto2-camera.h> and also the early 2000s legacy way (still in use by kamera and others because we did not properly communicate and enforce that back when we were still stabilizing the API) #include <gphoto2.h> #include <gphoto2-camera.h> to produce builds with the libgphoto2 headers actually corresponding to the *.pc files in use. Any other option for the *.pc file Cflags either produces unintended build failures or builds which use the wrong header files (the `-I${includedir}/gphoto2` option), or breaks the `#include <...>` part of the libgphoto2 API from the early 2000s still in use by kamera and others (the `-I${includedir}` option). For details, see #717 and #717 (comment) Fixes: #717
1 parent 3fa40fe commit bd5aec3

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
libgphoto2 2.5.28.1 development snapshot
22

3+
general:
4+
* fixes build failures of libgphoto2 clients and builds using the
5+
wrong libgphoto2 headers (issue #717)
6+
37
ptp2:
48
* fixed a regression in Fuji preview capture which would lead to crashes
59
* made the wait-event property extractor more robust (it sometimes gets NULL ptrs), hopefully fixing Sony crashes

libgphoto2.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Version: @VERSION@
1212
Requires: libgphoto2_port >= 0.10.0
1313
Requires.private: @REQUIREMENTS_FOR_LIBEXIF@
1414
Libs: -L${libdir} -lgphoto2 -lm
15-
Cflags: -I${includedir}/gphoto2
15+
Cflags: -I${includedir} -I${includedir}/gphoto2

libgphoto2_port/libgphoto2_port.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Description: Device-independent access to serial, USB, and other ports
1010
URL: http://gphoto.org/proj/libgphoto2/
1111
Version: @VERSION@
1212
Libs: -L${libdir} -lgphoto2_port -lm
13-
Cflags: -I${includedir}/gphoto2
13+
Cflags: -I${includedir} -I${includedir}/gphoto2

0 commit comments

Comments
 (0)