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 https://github.com/gphoto/libgphoto2/issues/717 and
https://github.com/gphoto/libgphoto2/issues/717#issuecomment-1018040615
Fixes: https://github.com/gphoto/libgphoto2/issues/717
This catches clang in a clang specific C preprocessor conditional
before clang gets a chance to mess up at pretending to be gcc.
The camlibs/pentax/js0n.c state machine tables use a lot of both
GNU style range designators [ a ... b ], and later overrides some
of the values in the range. This is not very pure C, but relatively
effient to code, so we can accept silencing some warnings here.
Fixes: https://github.com/gphoto/libgphoto2/issues/761
Allow the --with-jpeg=yes configure argument again. This
was broken by commit ea00220b6f.
The GP_LIBJPEG macro in the configure script now handles the following cases:
--with-jpeg=no
--without-jpeg
Do not use libjpeg. Do not autodetect it either.
--with-jpeg
--with-jpeg=yes
Autodetect libjpeg. If not found, abort.
<no argument given>
--with-jpeg=auto
--with-jpeg=autodetect
Autodetect libjpeg. If found, use it.
However, it does *NOT* handle
--with-jpeg=/path/to/somewhere
at this time. Set LIBJPEG_CFLAGS and/or LIBJPEG_LIBS
instead to specify which libjpeg to compile with and
link against.
This mostly matches the behaviour from before commit
ea00220b6f, which was
--with-jpeg=no
--without-jpeg
Do not use libjpeg. Do not autodetect it either.
--with-jpeg
--with-jpeg=yes
--with-jpeg=<any value other than "no">
Autodetect libjpeg. If found, use it. Otherwise, silently
ignore the user's wish to build with libjpeg.
<no argument given>
Autodetect libjpeg. If found, use it.
If someone is running configure with --with-jpeg=yes and
libjpeg cannot be used, we can assume that building without
using libjpeg is not the outcome the user expects.
Fixes: https://github.com/gphoto/libgphoto2/issues/759
Closes: https://github.com/gphoto/libgphoto2/pull/760