This requires gettext version 0.18.3 or later, and it removes
the GP_GETTEXT_HACK which used to generate a po/Makevars file
from the po/Makevers.template.
gettext 0.18.3 is the same gettext version requirement
as libexif uses.
gettext 0.18.3 has been released 2013-07-07, which is
a similar timeframe of the autoconf, automake and libtool
releases we require.
If you ever need to build a post 2021 libgphoto2 from
git on a system with pre 0.18.3 gettext, you can can
always prepare a tarball using "make dist" on a system
with gettext 0.18.3 or later, and build that tarball
on the older machine.
Not generating the po/Makevars file any more means that
we need additional consistency checks for the parts of
po/Makevars which cannot be derived from the Autoconf
standard set of AC_SUBST()ed Makefile.in variables.
This gives us a few more features and fixes to rely
on which are present in libtool 2.4.2 (released
2011-10-18), which is older than our autoconf,
automake, and gettext requirements and should therefore
not exclude anyone from building libgphoto2.
Update the libtool initialization to use the more
modern (modern in the sense of libtool 1.9b from
2004-08-29) LT_INIT macro.
We still do not use LTDL_INIT() as that (like AC_WITH_LTDL
used to) insists on us shipping libltdl sources in our
release tarballs, and we do not like shipping third party
sources.
autoconf 2.59c has introduced docdir, htmldir, so we do not need to
have --with-doc-dir= and --with-html-dir= any more. --docdir= and
--htmldir= will do the job.
This rewrites the variadic macro PTP_CNT_INIT() and the ptp_init_container()
function such that they compile with the strictest compiler available:
clang -std=c99 -pedantic -Wall -Wextra -Weverything
This is achieved by moving the code argument to be the first of the
variable arguments, and adapting the parameter counting and argument
handling inside ptp_init_container() accordingly.
As the code in ptp_init_container() which handles the va_args and puts
them into PTPContainer Param<N> fields relies on a particular memory
layout of the PTPContainer struct, this adds compile time assertions
which check the memory layout is the one the code expects.
Closes: https://github.com/gphoto/libgphoto2/pull/740
C11 has added static_assert(EXPR, MSG) to assert.h, but C99
only knows runtime assertions using assert(EXPR). This
defines the COMPILETIME_ASSERT(EXPR) macro which works with
both C11 and later using static_assert(), and another way
if compiling using a pre-C11 language standard.