Commit Graph

11970 Commits

Author SHA1 Message Date
Hans Ulrich Niedermann
24cae685e1 Remove --with-doc-dir and --with-html-dir
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.
2021-11-14 13:19:51 +01:00
Hans Ulrich Niedermann
88b6c0dc26 remove whitespace around AS_HELP_STRING options
Remove whitespace in `configure --help` before and after
--without-* and --disable-*.
2021-11-14 13:15:28 +01:00
Jan Tojnar
44cf70907f print-camera-list: clarify help
Use “version” instead of “mode” to avoid confusion with the “(file) mode” argument.
2021-11-12 01:48:00 +01:00
Hans Ulrich Niedermann
b6fae4fcce ptp2/ptp.c: Rewrite PTP_CNT_INIT to build with pure C99
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
2021-11-12 00:54:39 +01:00
Hans Ulrich Niedermann
8527242022 ptp2/ptp.c: tell emacs the c-file-style 2021-11-11 23:41:48 +01:00
Hans Ulrich Niedermann
a154a91599 Add compiletime-assert.h for COMPILETIME_ASSERT() macro
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.
2021-11-11 23:41:48 +01:00
Hans Ulrich Niedermann
4a0d9dcb1f Use non-reserved macro name for generated gphoto-endian.h 2021-11-10 00:33:16 +01:00
Hans Ulrich Niedermann
7d4313ce36 with-camlibs: document "everything" set in the --help output
As configuring --with-camlibs=everything is a very valid option
for build tests, document it.
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
7f2b3946fd with-camlibs: grammar fix for standard set description 2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
2270e2ac6c Add "mode: autoconf" line to all *.m4 files
This helps with editing the *.m4 files in the proper editor
mode.
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
30ee10437b Only use a single gphoto-m4/ subdir
Only use a single gphoto-m4/ subdir - namely that in
libgphoto2_port/gphoto-m4/. This prevents us from
needing to synchronize the contents of the gphoto-m4/
and the libgphoto2_port/gphoto-m4/ directories.

We can do that by switching from recursive make for the
gphoto-m4 subdirectories to using

    include path/to/gphoto-m4/Makefile-files

from both the top-level Makefile.am and libgphoto2_port/Makefile.am
using %reldir% (introduced in automake 1.14).
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
e866cd2256 Require at least automake 1.14
This gives us a few more features, and a few less conditionals
conditionally reimplementing features added to automake
before automake 1.14.

automake 1.14 is almost the same automake version requirement
as libexif uses (libexif requires 1.14.1).

automake 1.14 has been released 2013-06-20. If you ever
need to build a post 2021 libgphoto2 from git on a
system with pre 1.14 automake, you can can always
prepare a tarball using "make dist" on a system with
automake 1.14 or later, and build that tarball on the
older machine.
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
52d968ab3b Require at least autoconf-2.69
This gives us a few more features and bug fixes and fewer workarounds.

autoconf 2.69 is the same autoconf version requirement as libexif
uses.

autoconf 2.69 has been released 2012-04-25. If you ever need to build a
post 2021 libgphoto2 from git on a system with pre 2.69 autoconf, you
can always prepare a tarball using "make dist" on a system with autoconf
2.69 or later, and build that tarball on the older machine.
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
4b28cddef5 Add build tool version comment
This adds a list of tool releases with their respective release
dates and why they are important for libgphoto2 (libexif
requirements, notable bug fixes and features).
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
1a68a102f2 Remove definition of localedir
The "localedir" variable has been introduced by autoconf-2.59c.

We are requiring at least autoconf-2.62, so we do not need to
define and AC_SUBST "localedir" any more.
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
da44441982 indentation for readability 2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
3941952004 make gphoto-m4 directories identical
Make the two gphoto-m4 directories identical in preparation for
using just one of them.
2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
c6ad1601d6 remove old libtool/libltdl comments 2021-11-07 22:28:48 +01:00
Hans Ulrich Niedermann
b74841f299 Use LINGUAS files instead of ALL_LINGUAS variable 2021-11-07 22:28:39 +01:00
Hans Ulrich Niedermann
8c4a57b734 Use the same gettext setup
This puts AM_PO_SUBDIRS before AM_GNU_GETTEXT to fix the

    error: `po-directories' is already registered with AC_CONFIG_COMMANDS.

and puts the -DLOCALEDIR definition close to the gettext
setup.
2021-11-07 22:27:49 +01:00
Hans Ulrich Niedermann
ae171a9c1b Consistent checks for asm .symver and version-script
Use the same checks for asm .symver and -Wl,--version-script
support for both libgphoto2.la and libgphoto2_port.la.

This also reorganizes the Makefile.am files for libgphoto2.la
and libgphoto2_port.la so that things belonging together are
actually grouped together, so that inconsistencies can become
more visible.

This does not change what actually happens with when linking
the libraries:

  * libgphoto2.la is still linked with just a
       --export-symbols libgphoto2.sym
    list of exported symbols.

  * libgphoto2_port.la is still linked with a
       -Wl,--version-script=libgphoto2_port.ver
    version script.

However, the two library Makefile.am are now organized
in such a way that you can actually see that.

We should examine what those two symbol export methods actually
do on Linux/ELF (complete support for version script semantics),
and on non-ELF systems such as MacOSX dylib or Windows DLL.
2021-11-07 18:57:43 +01:00
Marcus Meissner
9e0efee77b handle motorola as MTP... fixes https://github.com/gphoto/gphoto2/issues/463 2021-11-07 17:28:26 +01:00
Marcus Meissner
3b52c7a967 sync from libmtp
also fixes https://github.com/gphoto/gphoto2/issues/463
2021-11-07 17:24:23 +01:00
Marcus Meissner
b42d16c92f added creative auto mode dial setting 2021-11-07 17:16:31 +01:00
Hans Ulrich Niedermann
774c7c58e7 gh workflow: install libgd-dev 2021-11-03 22:23:30 +01:00
Hans Ulrich Niedermann
2ad61b2fe3 m4 quote all macro arguments
Occasionally, not quoting macro arguments leads to
weird problems.

So we try to consistently quote the arguments to
avoid these kinds of problems.
2021-11-03 22:03:06 +01:00
Hans Ulrich Niedermann
e11841b3fc AC_CONFIG_FILES change to indented multi-line form 2021-11-03 22:03:06 +01:00
Hans Ulrich Niedermann
a04da934dc AM_INIT_AUTOMAKE change to indented multi-line form
This makes it easier to see and merge changes.
2021-11-03 22:03:06 +01:00
Hans Ulrich Niedermann
ac1d23b45b AC_INIT change to arguments on multiple lines
This makes changes easier to read in diffs.
2021-11-03 22:03:06 +01:00
Hans Ulrich Niedermann
5a00d0480e Use m4_pattern_forbid to find unnoticed GP_ strings
Use m4_pattern_forbid to find unnoticed GP_ strings
in the configure and config.status scripts.
2021-11-03 22:02:49 +01:00
Hans Ulrich Niedermann
24b7cfad16 gitignore for tests/ 2021-11-03 22:02:49 +01:00
Hans Ulrich Niedermann
ea00220b6f Update the checks for libjpeg (GP_LIBJPEG)
Update the checks for libjpeg to try libjpeg.pc with
PKG_CHECK_MODULES first, and also to allow explicitly
set LIBJPEG_CFLAGS and LIBJPEG_LIBS.

The old detection logic did not allow specifying the location
of libjpeg at all. It only allowed either disabling libjpeg
or using libjpeg from the default include and linker paths.

So this also changes the places in the Makefiles where we
used to add @LIBJPEG@ to the linker to both link with
$(LIBJPEG_LIBS) and compile with $(LIBJPEG_CFLAGS).

The new configure logic keeps --without-jpeg to force-
disable libjpeg, but updates the detection of libjpeg
to first try the LIBJPEG_* variables if given, otherwise
try PKG_CHECK_MODULES for libjpeg, and only then falls
back to the old way of just trying the default include
and link locations for libjpeg.

This mentions more information in the configure summary
if not building with libjpeg.

This is the first time we make it possible to build with
libjpeg from e.g. FreeBSD ports' or MacOS homebrew's
jpeg-turbo packages.
2021-11-03 22:02:49 +01:00
Hans Ulrich Niedermann
9878f31b79 Update libltdl checks (GP_LIBLTDL)
We still do not use LTDL_INIT() as LTDL_INIT insists on
us shipping libltdl sources in our release tarballs and
we still do not like shipping third party sources.

This now checks locations other than the default include
and linker paths, so that configure should find libltdl
by itself now on e.g. FreeBSD or OSX/homebrew.
2021-11-03 22:02:45 +01:00
Hans Ulrich Niedermann
302f4bf4b6 Make the compiler warnings work with clang, gcc, and others
Make the compiler warnings work with clang in addition to gcc by
test compiling all warning options before actually using them.

This came up when the pedantic build tests failed on FreeBSD 13.

To achieve this, we add -Werror=unknown-warning-option to
the CFLAGS for clang to abort immediately on encountering
an unknown warning option. This means we now only add warnings
which the compiler (clang, gcc, or whatever) actually supports.

As running configure now checks whether compiling is possible
for each warning flag, this should not introduce compatibility
issues where builds which used to work now fail to build.

However, you can always opt to not use the generated CFLAGS
by setting CFLAGS to empty or whatever else you want when
running your build, e.g. like

    make all check CFLAGS=
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
eef3638d22 tests: add pedantic compile tests for -std={c2x,c++20}
Add a pedantic C compile test for c2x in addition to
the existing ones for c90, c99, and c11.

Add a pedantic C++ compile test for c++20 in addition to
the existing ones for c++98, c++11, c++14, and c++17.
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
d7823edd44 tests: Always define, but only test conditionally
Always define the test programs, but only conditionally test them.

This makes certain that they can be build, that the sources are
added to the dist tarball, etc.
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
44a1b1a699 tests: Remove old pedantic compilation tests
These did not work with C++ on FreeBSD 13 anyway, due to
c++98 not working there, which the old pedantic compilation
just assumed was working without testing it in configure.

The new pedantic compilation tests offer a multitude of
language standards including c++98, but only tries building
the pedantic compilation tests for those language standards
for which configure has shown that building programs is
possible at all.
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
b57d5fdb57 gp-camlibs.m4: Fix GP_SLEEP invocation in in Gentoo hack
Fix the GP_SLEEP invocation in the Gentoo hack warning which
adds the ptp2 camlib if the only camlib requested is canon, as
modern Canon cameras use the ptp2 camlib, not the canon camlib.

Also syncs gphoto-m4/gp-camlibs.m4 to libgphoto2-port/gphoto-m4/.
2021-11-03 21:18:55 +01:00
Hans Ulrich Niedermann
49b4fda207 HACKING.md: Add note about printf(3) fmt strings using "%m"
The printf(3) format string character "%m" is available on
Linux/glibc and FreeBSD, but not on MacOSX. So using "%m"
should be limited to system specific code.
2021-11-03 18:10:33 +01:00
Marcus Meissner
9b9d6c68ef simplified after prohibit simplification 2021-10-31 11:54:58 +01:00
Marcus Meissner
6950d1681d avoid duplicate mvoie / liveview prohibition code strings for translation 2021-10-31 11:53:38 +01:00
Hans Ulrich Niedermann
804198d3f1 HACKING.md: Update with C99 being our requirement
We have been requiring at least parts of C99 like stdint.h for some
time now, but HACKING.md has not reflected that until now.

Closes: https://github.com/gphoto/libgphoto2/issues/724
2021-10-31 11:29:35 +01:00
Hans Ulrich Niedermann
8cee604f73 HACKING.md: Misc small improvements (grammar, whitespace, etc.) 2021-10-31 11:23:18 +01:00
Marcus Meissner
c164ad79f8 more spellchecking 2021-10-30 15:30:26 +02:00
Marcus Meissner
29edc9d714 more speling fixes 2021-10-29 15:22:54 +02:00
Marcus Meissner
4f5172b220 spelling fixes 2021-10-29 15:17:31 +02:00
Marcus Meissner
73a30b42f6 german translation completed 2021-10-29 14:35:44 +02:00
Marcus Meissner
bae6e2d107 updated german 2021-10-28 14:19:05 +02:00
Marcus Meissner
b7aaba0a15 make update-po 2021-10-28 09:58:18 +02:00
Hans Ulrich Niedermann
864f0dfa78 sync gp-gettext-hack.m4 files between gphoto-m4 dirs 2021-10-26 23:26:36 +02:00