diff options
39 files changed, 9 insertions, 5025 deletions
diff --git a/Makefile.am b/Makefile.am index b0ccbe075..52050e2c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,8 +8,8 @@ bin_SCRIPTS = gphoto2-config EXTRA_DIST = MAINTAINERS TESTERS installcheck.mk EXTRA_DIST += HACKING.md SECURITY.md -# Note: @subdirs@ lists all the directories from AC_CONFIG_SUBDIRS() -SUBDIRS = @subdirs@ libgphoto2 camlibs tests examples po packaging doc gphoto-m4 +# Note: $(subdirs) lists all the directories from AC_CONFIG_SUBDIRS() +SUBDIRS = $(subdirs) libgphoto2 camlibs tests examples po packaging doc EXTRA_DIST += libgphoto2.pc.in pkgconfig_DATA = libgphoto2.pc @@ -106,7 +106,9 @@ update-po: ######################################################################## # The following default options for aclocal and automake -# are required in the top level Makefile.am for the automatic +# are required in the top level Makefile.am for the automatic # re-building of the build system files. -ACLOCAL_AMFLAGS = -I auto-m4 -I gphoto-m4 +ACLOCAL_AMFLAGS = -I auto-m4 -I libgphoto2_port/gphoto-m4 + +include libgphoto2_port/gphoto-m4/Makefile-files diff --git a/configure.ac b/configure.ac index c876bd5b4..e1645a427 100644 --- a/configure.ac +++ b/configure.ac @@ -665,7 +665,6 @@ AC_CONFIG_FILES([ camlibs/Makefile camlibs/canon/doc/Makefile camlibs/konica/localization/Makefile - gphoto-m4/Makefile libgphoto2/Makefile libgphoto2.pc libgphoto2-uninstalled.pc diff --git a/gphoto-m4/Makefile-files b/gphoto-m4/Makefile-files deleted file mode 100644 index 6bc234866..000000000 --- a/gphoto-m4/Makefile-files +++ /dev/null @@ -1,36 +0,0 @@ -# -*- Makefile -*- - -EXTRA_DIST += %reldir%/README.md -EXTRA_DIST += %reldir%/gphoto-m4-sync - -EXTRA_DIST += %reldir%/gp-asm-symver-ifelse.m4 -EXTRA_DIST += %reldir%/gp-asm-symver-support.m4 -EXTRA_DIST += %reldir%/gp-byteorder.m4 -EXTRA_DIST += %reldir%/gp-camlibs.m4 -EXTRA_DIST += %reldir%/gp-check-doxygen.m4 -EXTRA_DIST += %reldir%/gp-check-library.m4 -EXTRA_DIST += %reldir%/gp-check-popt.m4 -EXTRA_DIST += %reldir%/gp-check-shell-environment.m4 -EXTRA_DIST += %reldir%/gp-config-msg.m4 -EXTRA_DIST += %reldir%/gp-documentation.m4 -EXTRA_DIST += %reldir%/gp-driverdir.m4 -EXTRA_DIST += %reldir%/gp-gettext-hack.m4 -EXTRA_DIST += %reldir%/gp-internal-docs.m4 -EXTRA_DIST += %reldir%/gp-libjpeg.m4 -EXTRA_DIST += %reldir%/gp-libltdl.m4 -EXTRA_DIST += %reldir%/gp-manual-docbook-xml.m4 -EXTRA_DIST += %reldir%/gp-manual-documentation.m4 -EXTRA_DIST += %reldir%/gp-manual-fig2dev.m4 -EXTRA_DIST += %reldir%/gp-manual-graphviz.m4 -EXTRA_DIST += %reldir%/gp-manual-gtk-doc.m4 -EXTRA_DIST += %reldir%/gp-manual-pstoimg.m4 -EXTRA_DIST += %reldir%/gp-manual-w3m.m4 -EXTRA_DIST += %reldir%/gp-packaging.m4 -EXTRA_DIST += %reldir%/gp-pedantic-compiler-flags.m4 -EXTRA_DIST += %reldir%/gp-progs.m4 -EXTRA_DIST += %reldir%/gp-references.m4 -EXTRA_DIST += %reldir%/gp-set.m4 -EXTRA_DIST += %reldir%/gp-sleep.m4 -EXTRA_DIST += %reldir%/gp-subpackage.m4 -EXTRA_DIST += %reldir%/gp-udev.m4 -EXTRA_DIST += %reldir%/gp-va-copy.m4 diff --git a/gphoto-m4/Makefile.am b/gphoto-m4/Makefile.am deleted file mode 100644 index b69097e76..000000000 --- a/gphoto-m4/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -# This is the compatibility Makefile.am - you are probably better off -# just including the Makefile-files directly from your top-level -# Makefile.am. - -EXTRA_DIST = - -include Makefile-files diff --git a/gphoto-m4/README.md b/gphoto-m4/README.md deleted file mode 100644 index b756b23fd..000000000 --- a/gphoto-m4/README.md +++ /dev/null @@ -1,140 +0,0 @@ -gphoto-m4 -========= - -`gphoto-m4` is the gPhoto projects' collection of m4 macros for use -with the autoconf/automake based build systems. - -It has been designed to be used in - - * `gphoto2` - * `libgphoto2` - * `libgphoto2_port` (located in `libgphoto2/`) - * `gtkam` - -Some macros are re-used ones from `libexif`. - -Since the gPhoto project moved from SVN to git, we have not figured -out yet how to properly include the `gphoto-m4` files into the -respective software's `gphoto-m4/` subdirectory (either `git subtree` -or `git submodule` come to mind). - -So for the time being, we manually update and synchronize the files. - - -Use of `gphoto-m4` after the switch to git from SVN ---------------------------------------------------- - -Since the gPhoto project moved from SVN to git, we have not figured -out yet how to properly include the `gphoto-m4` files into the -respective software's `gphoto-m4/` subdirectory. The options are: - - 1. Manually update (and hopefully synchronize) the files. - - Advantages: - - * No special commands needed for users or developers. - - Disadvantages: - - * The manual work for the maintainers is exhausting and error - prone. - - 2. Use `git submodule`. - - Advantages: - - * Defined mechanism for syncing and updating the `gphoto-m4/*` - files. - - Disadvantages: - - * Requires special git commands from everybody (users, - developers, and maintainers) all the time (e.g. `git clone - --recursive` instead of `git clone`). - - This is the showstopper for `git submodule`. - - 3. Use `git subtree`. - - Advantages: - - * Defined mechanism for syncing and updating the `gphoto-m4/*` - files. - - * Requires no special git commands from users or developers. - - * Not even people actually messing with the files in - `gphoto-m4/*` strictly need special commands. - - Only the maintainers who do the syncing and updating of the - `gphoto-m4/*` files need the special commands. - - Disadvantages: - - * Requires special knowledge of special commands instead of - just copying files around. The concept is less complex than - copying files round, but it does require special commands. - - * No rebasing possible across pulls to `gphoto-m4/`. Not really - necessary anyway, though. - - * Pushes of changes to from, say, `gphoto2/gphoto-m4` to - upstream `gphoto-m4` create a lot of commit history noise in - the `gphoto-m4` repository by including the complete history - of the `gphoto2` repository. - - Note this cannot be avoided by using `git subtree split`: - That is executed internally by `git subtree push`. - - So it appears that using `git subtree push` will push all - projects' commit history into the `gphoto-m4` repo. - - That is if not a showstopper, then at least very ugly. - -For the time being, we manually update and synchronize the files. - - -Manually syncing and updating files ------------------------------------ - -This section has not been written yet. - - -Using `git submodule` ---------------------- - -This section has not been written yet. - - -Using `git subtree` -------------------- - - -### Using `gphoto-m4` as git subtree ### - -This section describes how to use `gphoto-m4` when it has been set up -as a `git subtree` (e.g. in `gphoto2` and `libgphoto2`). - -Add a remote for `gphoto-m4`: - - git remote add origin-gphoto-m4 git@github.com:gphoto/gphoto-m4.git - -Pull changes to origin-gphoto-m4 into local `gphoto-m4`: - - git subtree pull --prefix gphoto-m4 origin-gphoto-m4 master --squash - -Now we can push local changes to 'gphoto-m4/*' back to -`origin-gphoto-m4` as follows: - - git subtree push --prefix gphoto-m4 origin-gphoto-m4 master - -FIXME: Add more typical uses cases. - - -### Setting up `gphoto-m4` as git subtree ### - -This section describes how we initially set up `gphoto-m4` as a git -subtree for `gphoto2`. This is only required once by one person, then -never needs to be done by anybody else ever again. - - git subtree add --prefix gphoto-m4 origin-gphoto-m4 master --squash diff --git a/gphoto-m4/gp-asm-symver-ifelse.m4 b/gphoto-m4/gp-asm-symver-ifelse.m4 deleted file mode 100644 index 33174f8f5..000000000 --- a/gphoto-m4/gp-asm-symver-ifelse.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl #################################################################### -dnl GP_ASM_SYMVER_IFELSE([ACTION-IF-TRUE], [ACTION-IF-FALSE]) -dnl #################################################################### -dnl -AC_DEFUN([GP_ASM_SYMVER_IFELSE], [dnl -AC_MSG_CHECKING([for asm .symver support]) -AC_COMPILE_IFELSE([dnl - AC_LANG_PROGRAM([[ - void f1(void); - void f1() {} - void f2(void); - void f2() {} - asm(".symver f1, f@VER1"); - asm(".symver f2, f@@VER2"); - ]], [[ - ]])dnl -], [dnl -AC_MSG_RESULT([yes]) -$1 -], [dnl -AC_MSG_RESULT([no]) -$2 -]) -])dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-asm-symver-support.m4 b/gphoto-m4/gp-asm-symver-support.m4 deleted file mode 100644 index 1b1826474..000000000 --- a/gphoto-m4/gp-asm-symver-support.m4 +++ /dev/null @@ -1,21 +0,0 @@ -dnl #################################################################### -dnl If compiler supports asm .symver, define HAVE_ASM_SYMVER C preprocessor macro and Automake conditional -dnl #################################################################### -dnl -AC_DEFUN([GP_ASM_SYMVER_SUPPORT], [dnl -GP_ASM_SYMVER_IFELSE([dnl - have_asm_symver=yes - AC_DEFINE([HAVE_ASM_SYMVERS], [1], - [Define if there is asm .symver support.]) -], [dnl - have_asm_symver=no -]) -AM_CONDITIONAL([HAVE_ASM_SYMVER], - [test "x$have_asm_symver" = xyes]) -])dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-byteorder.m4 b/gphoto-m4/gp-byteorder.m4 deleted file mode 100644 index 95d7435bf..000000000 --- a/gphoto-m4/gp-byteorder.m4 +++ /dev/null @@ -1,450 +0,0 @@ -dnl AC_NEED_BYTEORDER_H ( HEADER-TO-GENERATE ) -dnl Originally written by Dan Fandrich <dan@coneharvesters.com> -dnl My contribution is hereby placed into the public domain. -dnl No warranty is expressed or implied. -dnl -dnl Create a header file that guarantees that byte swapping macros of the -dnl ntohl variety as well as the extended types included in OpenBSD and -dnl NetBSD such as le32toh are defined. If possible, the standard ntohl -dnl are overloaded as they are optimized for the given platform, but when -dnl this is not possible (e.g. on a big-endian machine) they are defined -dnl in this file. - -dnl Look for a symbol in a header file -dnl AC_HAVE_SYMBOL ( IDENTIFIER, HEADER-FILE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND ) -AC_DEFUN([AC_HAVE_SYMBOL], -[ -AC_MSG_CHECKING(for $1 in $2) -AC_EGREP_CPP([symbol is present|\<$1\>],[ -#include <$2> -#ifdef $1 - symbol is present -#endif - ], -[AC_MSG_RESULT(yes) -$3 -], -[AC_MSG_RESULT(no) -$4 -])]) - - -dnl Create a header file that defines extended byte swapping macros -AC_DEFUN([AC_NEED_BYTEORDER_H], -[ -ac_dir=`AS_DIRNAME(["$1"])` -if test "$ac_dir" != "$1" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && AS_MKDIR_P(["$ac_dir"]) -fi - -# We're only interested in the target CPU, but it's not always set -effective_target="$target" -if test "x$effective_target" = xNONE || test "x$effective_target" = x ; then - effective_target="$host" -fi -AC_SUBST(effective_target) - -cat > "$1" << EOF -/* This file is generated automatically by configure */ -/* It is valid only for the system type ${effective_target} */ - -#ifndef __BYTEORDER_H -#define __BYTEORDER_H - -EOF - -dnl First, do an endian check -AC_C_BIGENDIAN - -dnl Look for NetBSD-style extended byte swapping macros -AC_HAVE_SYMBOL(le32toh,machine/endian.h, - [HAVE_LE32TOH=1 - cat >> "$1" << EOF -/* extended byte swapping macros are already available */ -#include <machine/endian.h> - -EOF], - -[ - -dnl Look for standard byte swapping macros -AC_HAVE_SYMBOL(ntohl,arpa/inet.h, - [cat >> "$1" << EOF -/* ntohl and relatives live here */ -#include <arpa/inet.h> -#define __HAVE_NTOHL - -EOF], - - [AC_HAVE_SYMBOL(ntohl,netinet/in.h, - [cat >> "$1" << EOF -/* ntohl and relatives live here */ -#include <netinet/in.h> -#define __HAVE_NTOHL - -EOF],true)]) -]) - -dnl Look for generic byte swapping macros - -dnl OpenBSD -AC_HAVE_SYMBOL(swap32,machine/endian.h, - [cat >> "$1" << EOF -/* swap32 and swap16 are defined in machine/endian.h */ - -EOF], - - [ -dnl Linux GLIBC - AC_HAVE_SYMBOL(bswap_32,byteswap.h, - [cat >> "$1" << EOF -/* Define generic byte swapping functions */ -#include <byteswap.h> -#define swap16(x) bswap_16(x) -#define swap32(x) bswap_32(x) -#define swap64(x) bswap_64(x) - -EOF], - - [ -dnl NetBSD - AC_HAVE_SYMBOL(bswap32,machine/endian.h, - dnl We're already including machine/endian.h if this test succeeds - [cat >> "$1" << EOF -/* Define generic byte swapping functions */ -EOF - if test "$HAVE_LE32TOH" != "1"; then - echo '#include <machine/endian.h>'>> "$1" - fi -cat >> "$1" << EOF -#define swap16(x) bswap16(x) -#define swap32(x) bswap32(x) -#define swap64(x) bswap64(x) - -EOF], - - [ -dnl FreeBSD - AC_HAVE_SYMBOL(__byte_swap_long,sys/types.h, - [cat >> "$1" << EOF -/* Define generic byte swapping functions */ -#include <sys/types.h> -#define swap16(x) __byte_swap_word(x) -#define swap32(x) __byte_swap_long(x) -/* No optimized 64 bit byte swapping macro is available */ -#define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ - ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ - ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ - ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ - ((x) >> 8) & 0x00000000ff000000ULL | \\ - ((x) >> 24) & 0x0000000000ff0000ULL | \\ - ((x) >> 40) & 0x000000000000ff00ULL | \\ - ((x) >> 56) & 0x00000000000000ffULL)) - -EOF], - - [ -dnl OS X - AC_HAVE_SYMBOL(NXSwapLong,machine/byte_order.h, - [cat >> "$1" << EOF -/* Define generic byte swapping functions */ -#include <machine/byte_order.h> -#define swap16(x) NXSwapShort(x) -#define swap32(x) NXSwapLong(x) -#define swap64(x) NXSwapLongLong(x) - -EOF], - [ - if test $ac_cv_c_bigendian = yes; then - cat >> "$1" << EOF -/* No other byte swapping functions are available on this big-endian system */ -#define swap16(x) ((uint16_t)(((x) << 8) | ((uint16_t)(x) >> 8))) -#define swap32(x) ((uint32_t)(((uint32_t)(x) << 24) & 0xff000000UL | \\ - ((uint32_t)(x) << 8) & 0x00ff0000UL | \\ - ((x) >> 8) & 0x0000ff00UL | \\ - ((x) >> 24) & 0x000000ffUL)) -#define swap64(x) ((uint64_t)(((uint64_t)(x) << 56) & 0xff00000000000000ULL | \\ - ((uint64_t)(x) << 40) & 0x00ff000000000000ULL | \\ - ((uint64_t)(x) << 24) & 0x0000ff0000000000ULL | \\ - ((uint64_t)(x) << 8) & 0x000000ff00000000ULL | \\ - ((x) >> 8) & 0x00000000ff000000ULL | \\ - ((x) >> 24) & 0x0000000000ff0000ULL | \\ - ((x) >> 40) & 0x000000000000ff00ULL | \\ - ((x) >> 56) & 0x00000000000000ffULL)) - -EOF - else - cat >> "$1" << EOF -/* Use these as generic byteswapping macros on this little endian system */ -/* on windows we might not have ntohs / ntohl without including winsock.dll, - * so use generic macros */ -#ifdef __HAVE_NTOHL -# define swap16(x) htons(x) -# define swap32(x) htonl(x) -#else -# define swap16(x) ((uint16_t)(((x) << 8) | ((uint16_t)(x) >> 8))) -# define swap32(x) ((uint32_t)((((uint32_t)(x) << 24) & 0xff000000UL) | \\ - (((uint32_t)(x) << 8) & 0x00ff0000UL) | \\ - (((x) >> 8) & 0x0000ff00UL) | \\ - (((x) >> 24) & 0x000000ffUL))) -#endif -/* No optimized 64 bit byte swapping macro is available */ -#define swap64(x) ((uint64_t)((((uint64_t)(x) << 56) & 0xff00000000000000ULL) | \\ - (((uint64_t)(x) << 40) & 0x00ff000000000000ULL) | \\ - (((uint64_t)(x) << 24) & 0x0000ff0000000000ULL) | \\ - (((uint64_t)(x) << 8) & 0x000000ff00000000ULL) | \\ - (((x) >> 8) & 0x00000000ff000000ULL) | \\ - (((x) >> 24) & 0x0000000000ff0000ULL) | \\ - (((x) >> 40) & 0x000000000000ff00ULL) | \\ - (((x) >> 56) & 0x00000000000000ffULL))) - -EOF - fi -]) - ]) - ]) - ]) -]) - - -[ -if test "$HAVE_LE32TOH" != "1"; then - cat >> "$1" << EOF -/* The byte swapping macros have the form: */ -/* EENN[a]toh or htoEENN[a] where EE is be (big endian) or */ -/* le (little-endian), NN is 16 or 32 (number of bits) and a, */ -/* if present, indicates that the endian side is a pointer to an */ -/* array of uint8_t bytes instead of an integer of the specified length. */ -/* h refers to the host's ordering method. */ - -/* So, to convert a 32-bit integer stored in a buffer in little-endian */ -/* format into a uint32_t usable on this machine, you could use: */ -/* uint32_t value = le32atoh(&buf[3]); */ -/* To put that value back into the buffer, you could use: */ -/* htole32a(&buf[3], value); */ - -/* Define aliases for the standard byte swapping macros */ -/* Arguments to these macros must be properly aligned on natural word */ -/* boundaries in order to work properly on all architectures */ -#ifndef htobe16 -# ifdef __HAVE_NTOHL -# define htobe16(x) htons(x) -# else -# ifdef WORDS_BIGENDIAN -# define htobe16(x) (x) -# else -# define htobe16(x) swap16(x) -# endif -# endif -#endif -#ifndef htobe32 -# ifdef __HAVE_NTOHL -# define htobe32(x) htonl(x) -# else -# ifdef WORDS_BIGENDIAN -# define htobe32(x) (x) -# else -# define htobe32(x) swap32(x) -# endif -# endif -#endif -#ifndef be16toh -# define be16toh(x) htobe16(x) -#endif -#ifndef be32toh -# define be32toh(x) htobe32(x) -#endif - -#define HTOBE16(x) (x) = htobe16(x) -#define HTOBE32(x) (x) = htobe32(x) -#define BE32TOH(x) (x) = be32toh(x) -#define BE16TOH(x) (x) = be16toh(x) - -EOF - - if test $ac_cv_c_bigendian = yes; then - cat >> "$1" << EOF -/* Define our own extended byte swapping macros for big-endian machines */ -#ifndef htole16 -# define htole16(x) swap16(x) -#endif -#ifndef htole32 -# define htole32(x) swap32(x) -#endif -#ifndef htole64 -# define htole64(x) swap64(x) -#endif -#ifndef le16toh -# define le16toh(x) swap16(x) -#endif -#ifndef le32toh -# define le32toh(x) swap32(x) -#endif -#ifndef le64toh -# define le64toh(x) swap64(x) -#endif - -#ifndef htobe64 -# define htobe64(x) (x) -#endif -#ifndef be64toh -# define be64toh(x) (x) -#endif - -#define HTOLE16(x) (x) = htole16(x) -#define HTOLE32(x) (x) = htole32(x) -#define HTOLE64(x) (x) = htole64(x) -#define LE16TOH(x) (x) = le16toh(x) -#define LE32TOH(x) (x) = le32toh(x) -#define LE64TOH(x) (x) = le64toh(x) - -#define HTOBE64(x) (void) (x) -#define BE64TOH(x) (void) (x) - -EOF - else - cat >> "$1" << EOF -/* On little endian machines, these macros are null */ -#ifndef htole16 -# define htole16(x) (x) -#endif -#ifndef htole32 -# define htole32(x) (x) -#endif -#ifndef htole64 -# define htole64(x) (x) -#endif -#ifndef le16toh -# define le16toh(x) (x) -#endif -#ifndef le32toh -# define le32toh(x) (x) -#endif -#ifndef le64toh -# define le64toh(x) (x) -#endif - -#define HTOLE16(x) (void) (x) -#define HTOLE32(x) (void) (x) -#define HTOLE64(x) (void) (x) -#define LE16TOH(x) (void) (x) -#define LE32TOH(x) (void) (x) -#define LE64TOH(x) (void) (x) - -/* These don't have standard aliases */ -#ifndef htobe64 -# define htobe64(x) swap64(x) -#endif -#ifndef be64toh -# define be64toh(x) swap64(x) -#endif - -#define HTOBE64(x) (x) = htobe64(x) -#define BE64TOH(x) (x) = be64toh(x) - -EOF - fi -fi - -cat >> "$1" << EOF -/* Define the C99 standard length-specific integer types */ -#include <stdint.h> - -EOF - -case "${effective_target}" in - i[3456]86-*) - cat >> "$1" << EOF -/* Here are some macros to create integers from a byte array */ -/* These are used to get and put integers from/into a uint8_t array */ -/* with a specific endianness. This is the most portable way to generate */ -/* and read messages to a network or serial device. Each member of a */ -/* packet structure must be handled separately. */ - -/* The i386 and compatibles can handle unaligned memory access, */ -/* so use the optimized macros above to do this job */ -#ifndef be16atoh -# define be16atoh(x) be16toh(*(uint16_t*)(x)) -#endif -#ifndef be32atoh -# define be32atoh(x) be32toh(*(uint32_t*)(x)) -#endif -#ifndef be64atoh -# define be64atoh(x) be64toh(*(uint64_t*)(x)) -#endif -#ifndef le16atoh -# define le16atoh(x) le16toh(*(uint16_t*)(x)) -#endif -#ifndef le32atoh -# define le32atoh(x) le32toh(*(uint32_t*)(x)) -#endif -#ifndef le64atoh -# define le64atoh(x) le64toh(*(uint64_t*)(x)) -#endif - -#ifndef htob16a -# define htobe16a(a,x) *(uint16_t*)(a) = htobe16(x) -#endif -#ifndef htobe32a -# define htobe32a(a,x) *(uint32_t*)(a) = htobe32(x) -#endif -#ifndef htobe64a -# define htobe64a(a,x) *(uint64_t*)(a) = htobe64(x) -#endif -#ifndef htole16a -# define htole16a(a,x) *(uint16_t*)(a) = htole16(x) -#endif -#ifndef htole32a -# define htole32a(a,x) *(uint32_t*)(a) = htole32(x) -#endif -#ifndef htole64a -# define htole64a(a,x) *(uint64_t*)(a) = htole64(x) -#endif - -EOF - ;; - - *) - cat >> "$1" << EOF -/* Here are some macros to create integers from a byte array */ -/* These are used to get and put integers from/into a uint8_t array */ -/* with a specific endianness. This is the most portable way to generate */ -/* and read messages to a network or serial device. Each member of a */ -/* packet structure must be handled separately. */ - -/* Non-optimized but portable macros */ -#define be16atoh(x) ((uint16_t)(((x)[0]<<8)|(x)[1])) -#define be32atoh(x) ((uint32_t)(((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3])) -#define be64atoh_x(x,off,shift) (((uint64_t)((x)[off]))<<shift) -#define be64atoh(x) ((uint64_t)(be64atoh_x(x,0,56)|be64atoh_x(x,1,48)|be64atoh_x(x,2,40)| \\ - be64atoh_x(x,3,32)|be64atoh_x(x,4,24)|be64atoh_x(x,5,16)|be64atoh_x(x,6,8)|((x)[7]))) -#define le16atoh(x) ((uint16_t)(((x)[1]<<8)|(x)[0])) -#define le32atoh(x) ((uint32_t)(((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0])) -#define le64atoh_x(x,off,shift) (((uint64_t)(x)[off])<<shift) -#define le64atoh(x) ((uint64_t)(le64atoh_x(x,7,56)|le64atoh_x(x,6,48)|le64atoh_x(x,5,40)| \\ - le64atoh_x(x,4,32)|le64atoh_x(x,3,24)|le64atoh_x(x,2,16)|le64atoh_x(x,1,8)|((x)[0]))) - -#define htobe16a(a,x) (a)[0]=(uint8_t)((x)>>8), (a)[1]=(uint8_t)(x) -#define htobe32a(a,x) (a)[0]=(uint8_t)((x)>>24), (a)[1]=(uint8_t)((x)>>16), \\ - (a)[2]=(uint8_t)((x)>>8), (a)[3]=(uint8_t)(x) -#define htobe64a(a,x) (a)[0]=(uint8_t)((x)>>56), (a)[1]=(uint8_t)((x)>>48), \\ - (a)[2]=(uint8_t)((x)>>40), (a)[3]=(uint8_t)((x)>>32), \\ - (a)[4]=(uint8_t)((x)>>24), (a)[5]=(uint8_t)((x)>>16), \\ - (a)[6]=(uint8_t)((x)>>8), (a)[7]=(uint8_t)(x) -#define htole16a(a,x) (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) -#define htole32a(a,x) (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \\ - (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) -#define htole64a(a,x) (a)[7]=(uint8_t)((x)>>56), (a)[6]=(uint8_t)((x)>>48), \\ - (a)[5]=(uint8_t)((x)>>40), (a)[4]=(uint8_t)((x)>>32), \\ - (a)[3]=(uint8_t)((x)>>24), (a)[2]=(uint8_t)((x)>>16), \\ - (a)[1]=(uint8_t)((x)>>8), (a)[0]=(uint8_t)(x) - -EOF - ;; -esac -] - -cat >> "$1" << EOF -#endif /*__BYTEORDER_H*/ -EOF]) diff --git a/gphoto-m4/gp-camlibs.m4 b/gphoto-m4/gp-camlibs.m4 deleted file mode 100644 index e472f77ea..000000000 --- a/gphoto-m4/gp-camlibs.m4 +++ /dev/null @@ -1,489 +0,0 @@ -dnl #################################################################### -dnl -dnl GP_CAMLIB & Co. -dnl -dnl #################################################################### -dnl -dnl Redundancy free definition of libgphoto2 camlibs. -dnl -dnl Removes the redundancy from the camlib lists, and executes -dnl additional consistency checks on the build system. -dnl -dnl Every camlib belongs to one of the following (disjunct) sets of -dnl camlibs: -dnl -dnl * the 'standard' set -dnl -dnl The set of camlibs which is most likely to support the most -dnl cameras. This is the default when --with-camlibs=... is not -dnl given. This used to be called 'all', even though it -dnl definitively does not comprise all camlibs. -dnl -dnl * the 'outdated' set -dnl -dnl These cameras are outdated in some way. The cameras may have -dnl fallen out of use, the camlib might have been superseded by -dnl another one, or other reasons. Not built by default. -dnl -dnl * the 'unlisted' set -dnl -dnl These camlibs will not be listed by './configure --help', but -dnl they can still be added to the set of camlibs to be built. -dnl -dnl Example usage: -dnl -dnl GP_CAMLIB([canon]) -dnl GP_CAMLIB([casio]) -dnl [...] -dnl AM_COND_IF([HAVE_LIBCURL], [dnl -dnl AM_COND_IF([HAVE_LIBXML2], [dnl -dnl GP_CAMLIB([lumix])dnl -dnl ]) -dnl ]) -dnl [...] -dnl GP_CAMLIB([ptp],[unlisted]) -dnl GP_CAMLIB([ptp2]) -dnl [...] -dnl GP_CAMLIB([toshiba]) -dnl GP_CAMLIBS_DEFINE() -dnl -dnl -dnl #################################################################### -dnl Implementation remarks -dnl #################################################################### -dnl -dnl Note that at this time, the set names are hard coded, but could be -dnl moved to a m4 time automatic set of set names at a later time. -dnl -dnl A few notes on macro and variable naming: -dnl -dnl * GP_* are the macros to be called from configure.ac -dnl * GP_CAMLIBS_* are also shell variables exported to configure.ac -dnl shell code and Makefile.am files -dnl * gp_m4_* are the macros used inside those macros as m4 variables -dnl * gp_sh_* are the shell variables used inside the GP_ shell code -dnl * The old, inconsistent names of the as untouched variables -dnl exported to configure.ac and Makefile.am are still inconsistent. -dnl -dnl -dnl #################################################################### -dnl Forbid everything first, allow specific variable names later -dnl #################################################################### -m4_pattern_forbid([GP_CAMLIBS_])dnl -m4_pattern_forbid([GP_CAMLIB_])dnl -dnl -dnl -dnl #################################################################### -dnl _GP_CAMLIBS_INIT -dnl Called internally when required. -dnl #################################################################### -AC_DEFUN_ONCE([_GP_CAMLIBS_INIT],[dnl -dnl # BEGIN $0($@) -AC_BEFORE([$0],[GP_CAMLIB])dnl -AC_REQUIRE([AC_PROG_GREP])dnl -AC_REQUIRE([AC_PROG_SED])dnl -AC_REQUIRE([GP_PROG_CMP])dnl -AC_REQUIRE([GP_PROG_SORT])dnl -AC_REQUIRE([GP_PROG_TR])dnl -AC_REQUIRE([GP_PROG_UNIQ])dnl -m4_foreach_w([var], [everything standard unlisted outdated], [dnl - m4_set_empty([gp_m4s_camlib_set_]var, [], [dnl - m4_errprintn([Error: non-empty set gp_m4s_camlib_set_]var[ already defined])dnl - m4_exit(1)dnl - ])dnl -])dnl -GP_SET_DEFINE([camlib-set-standard])dnl -GP_SET_DEFINE([camlib-set-unlisted])dnl -GP_SET_DEFINE([camlib-set-outdated])dnl -dnl # END $0($@) -])dnl -dnl -dnl -dnl #################################################################### -dnl GP_CAMLIB([mycamlib]) -dnl GP_CAMLIB([mycamlib], [outdated]) -dnl Add the camlib 'mycamlib' to the "standard" set of camlibs or -dnl the "outdated" set of camlibs, respectively. -dnl #################################################################### -m4_pattern_forbid([GP_CAMLIB])dnl -AC_DEFUN([GP_CAMLIB],[dnl -dnl # BEGIN $0($@) -AC_REQUIRE([_GP_CAMLIBS_INIT])dnl -AC_BEFORE([$0],[GP_CAMLIBS_DEFINE])dnl -m4_case([$#],[2],[dnl - m4_case([$2], [unlisted], [dnl - GP_SET_ADD([camlib-set-unlisted], [$1]) - m4_set_add([gp_m4s_camlib_set_unlisted], [$1])dnl - ], [outdated], [dnl - GP_SET_ADD([camlib-set-outdated], [$1]) - m4_set_add([gp_m4s_camlib_set_outdated], [$1])dnl - ], [dnl - m4_errprintn(__file__:__line__:[ Error: Wrong second argument to GP_CAMLIB])dnl - m4_exit(1)dnl - ])dnl -], [1], [dnl - GP_SET_ADD([camlib-set-standard], [$1]) - m4_set_add([gp_m4s_camlib_set_standard], [$1])dnl -], [dnl - m4_errprintn(__file__:__line__:[ Error: Wrong number of arguments to GP_CAMLIB])dnl - m4_exit(1)dnl -])dnl m4_case $# -m4_set_add([gp_m4s_camlib_set_everything], [$1], [], [dnl -m4_errprintn(__file__:__line__:[Duplicate declaration of camlib $1])dnl -m4_exit(1)dnl -])dnl -dnl # END $0($@) -])dnl AC_DEFUN GP_CAMLIB -dnl -dnl -dnl #################################################################### -dnl GP_CAMLIBS_WARNING -dnl Print warning about building a non-"standard" set of camlibs. -dnl #################################################################### -AC_DEFUN([GP_CAMLIBS_WARNING],[dnl -AC_MSG_WARN([ - - #=====================================================================# - # Caution: You have chosen to build a non-standard set of camlibs. # - # You may have disabled the camlib required for your camera, # - # or enabled a camlib which does *not* work and overrides # - # the camlib which *does* work. Consequently, # - # YOUR CAMERA MAY NOT WORK! # - # # - # Many cameras of several brands are supported by a camlib with a # - # name different from the name of the camera brand or model. If you # - # are unsure, please # - # * enable at least the 'ptp2' camlib # - # * or even better, just build the standard set of camlibs. # - #=====================================================================# -]) -GP_SLEEP([5]) -]) -dnl -dnl -dnl #################################################################### -dnl GP_CAMLIBS_CONDITIONAL_WARNING -dnl Call GP_CAMLIBS_WARNING when required. -dnl #################################################################### -AC_DEFUN([GP_CAMLIBS_CONDITIONAL_WARNING], [dnl -AS_VAR_IF([gp_sh_with_camlibs], [standard], [dnl -], [dnl -GP_CAMLIBS_WARNING -]) -])dnl -dnl -dnl -dnl #################################################################### -dnl GP_CAMLIBS_DEFINE -dnl Determine the set of camlibs to build from the --with-camlibs -dnl parameter, and set the build variables accordingly. -dnl #################################################################### -AC_DEFUN([GP_CAMLIBS_DEFINE],[dnl -# BEGIN $0($@) -AC_REQUIRE([_GP_CAMLIBS_INIT])dnl -AC_REQUIRE([GP_PROG_EXPR])dnl - -dnl GP_SET_MSG([camlib-set-standard]) -dnl GP_SET_MSG([camlib-set-outdated]) -dnl GP_SET_MSG([camlib-set-unlisted]) - -dnl Convert sets defined at m4 time (i.e. autoreconf time) -dnl into the same format as the sh time (i.e. configure time) -dnl defined sets. -m4_foreach_w([var], [everything standard outdated unlisted], [dnl -GP_SET_DEFINE([m4-camlib-set-]var) -GP_SET_ADD_ALL([m4-camlib-set-]var[]m4_set_listc([gp_m4s_camlib_set_]var)) -])dnl - -dnl GP_SET_MSG([m4-camlib-set-standard]) -dnl GP_SET_MSG([m4-camlib-set-unlisted]) -dnl GP_SET_MSG([m4-camlib-set-outdated]) - -GP_SET_DEFINE([camlib-set-everything])dnl -GP_SET_UNION([camlib-set-everything], [camlib-set-standard], [camlib-set-outdated], [camlib-set-unlisted]) - -dnl GP_SET_MSG([camlib-set-everything]) -dnl GP_SET_MSG([m4-camlib-set-everything]) - -dnl Yes, that help output won't be all that pretty, but we at least -dnl do not have to edit it by hand. -AC_ARG_WITH([camlibs],[AS_HELP_STRING( - [--with-camlibs=<list>], - [Compile camera drivers (camlibs) in <list>. ]dnl - [Camlibs may be separated with commas. ]dnl - [CAUTION: DRIVER NAMES AND CAMERA NAMES MAY DIFFER. ]dnl - ['standard' is the default is a standard set of camlibs: ]dnl - m4_set_contents(gp_m4s_camlib_set_standard, [ ]). - ['outdated' is a set of camlibs for very old cameras: ]dnl - m4_set_contents(gp_m4s_camlib_set_outdated, [ ]).dnl - [You can add or remove camlibs or camlib sets by appending ]dnl - [them to the list with a + or - sign in front.])], - [gp_sh_with_camlibs="${withval}"], - [gp_sh_with_camlibs="standard"])dnl - -dnl For backwards compatibility, accept --with-camlibs='all' and -dnl interpret it as --with-camlibs='standard'. -AS_VAR_IF([gp_sh_with_camlibs], [all], [dnl - gp_sh_with_camlibs="standard" -])dnl - -dnl Gentoo mode... if user just requested "canon", -dnl add "ptp2" to save support requests. -AS_VAR_IF([gp_sh_with_camlibs], [canon], [dnl - gp_sh_with_camlibs="${gp_sh_with_camlibs} ptp2" - AC_MSG_WARN([ - - #==============================================================# - # You have selected only the old 'canon' driver. However, most # - # current Canon camera models require the 'ptp2' driver. # - # # - # Autoselecting the 'ptp2' driver in addition to the 'canon' # - # driver to prevent unnecessary support requests. # - #==============================================================# -]) - GP_SLEEP([5]) -])dnl - -dnl set -x - -AC_MSG_CHECKING([with-camlibs requested]) -AS_VAR_IF([gp_sh_with_camlibs], [standard], [dnl - AC_MSG_RESULT([standard set]) -], [dnl - gp_sh_with_camlibs="$(AS_ECHO(["${gp_sh_with_camlibs}"]) | ${TR} ',' ' ')" - AC_MSG_RESULT([${gp_sh_with_camlibs}]) -]) - -dnl AC_MSG_CHECKING([for nothing]) -dnl AC_MSG_RESULT([nihil]) - -dnl Iterate over the list of given camlibs. -dnl -dnl Replace 'standard', 'outdated', 'unlisted', and 'everything' with -dnl the respective set of camlibs, and make sure any camlibs specified -dnl explicitly are actually valid defined camlibs. -GP_SET_DEFINE([m4-camlib-set]) -GP_SET_DEFINE([camlib-set]) -for gp_camlib in ${gp_sh_with_camlibs} -do - case "X$gp_camlib" in #( - X-*) - operator=remove - gp_camlib="$(AS_ECHO(["Y${gp_camlib}"]) | ${SED} 's/^Y.//')" - ;; #( - X+*) - operator=add - gp_camlib="$(AS_ECHO(["Y${gp_camlib}"]) | ${SED} 's/^Y.//')" - ;; #( - X[[A-Za-z0-9]]*) - operator=add - ;; #( - *) - AC_MSG_ERROR([Invalid name given for camlib set or camlib: '${gp_camlib}']) - ;; - esac - dnl AC_MSG_CHECKING([with-camlibs operator]) - dnl AC_MSG_RESULT([${operator}]) - dnl AC_MSG_CHECKING([with-camlibs camlib]) - dnl AC_MSG_RESULT([${gp_camlib}]) - - dnl Convert deprecated "all" parameter to "standard". - case "$gp_camlib" in #( - all) - AC_MSG_WARN([ - - #=============================================================# - # You have used 'all' in the argument to the configure script # - # --with-camlibs= parameter. 'all' is a deprecated name for # - # the 'standard' camlib set. # - # # - # Please change your call to the configure script to use # - # 'standard' instead. # - #=============================================================# -]) - GP_SLEEP([5]) - gp_camlib="standard" - ;; - esac - - dnl Now gp_camlib contains the camlib string, and operator 'add' or 'remove'. - case "$operator" in #( - add) - case "$gp_camlib" in #( - standard) - GP_SET_UNION([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-standard]) - GP_SET_UNION([camlib-set], [camlib-set], [camlib-set-standard]) - ;; #( - outdated) - GP_SET_UNION([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-outdated]) - GP_SET_UNION([camlib-set], [camlib-set], [camlib-set-outdated]) - ;; #( - unlisted) - GP_SET_UNION([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-unlisted]) - GP_SET_UNION([camlib-set], [camlib-set], [camlib-set-unlisted]) - ;; #( - everything) - GP_SET_UNION([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-everything]) - GP_SET_UNION([camlib-set], [camlib-set], [camlib-set-everything]) - ;; #( - *) - GP_SET_CONTAINS_IFELSE([m4-camlib-set-everything], ["${gp_camlib}"], [dnl - GP_SET_ADD([m4-camlib-set], ["$gp_camlib"]) - GP_SET_ADD([camlib-set], ["$gp_camlib"]) - ], [dnl - AC_MSG_ERROR([Unknown camlib found in --with-camlibs: '${gp_camlib}']) - ]) - ;; - esac - ;; #( - remove) - case "$gp_camlib" in #( - standard) - GP_SET_DIFFERENCE([camlib-set], [camlib-set], [camlib-set-standard]) - GP_SET_DIFFERENCE([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-standard]) - ;; #( - outdated) - GP_SET_DIFFERENCE([camlib-set], [camlib-set], [camlib-set-outdated]) - GP_SET_DIFFERENCE([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-outdated]) - ;; #( - unlisted) - GP_SET_DIFFERENCE([camlib-set], [camlib-set], [camlib-set-unlisted]) - GP_SET_DIFFERENCE([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-unlisted]) - ;; #( - everything) - GP_SET_DIFFERENCE([camlib-set], [camlib-set], [camlib-set-everything]) - GP_SET_DIFFERENCE([m4-camlib-set], [m4-camlib-set], [m4-camlib-set-everything]) - ;; #( - *) - GP_SET_CONTAINS_IFELSE([m4-camlib-set-everything], ["${gp_camlib}"], [dnl - GP_SET_REMOVE([camlib-set], ["$gp_camlib"]) - GP_SET_CONTAINS_IFELSE([m4-camlib-set], ["$gp_camlib"], [dnl - GP_SET_REMOVE([m4-camlib-set], ["$gp_camlib"]) - ], [dnl - AC_MSG_WARN([Removing camlib ${gp_camlib} from m4-camlib-set which does not contain ${gp_camlib}]) - ]) - ], [dnl - AC_MSG_ERROR([Unknown camlib found in --with-camlibs: '${gp_camlib}']) - ]) - ;; - esac - ;; - esac -done -AS_UNSET([gp_camlib]) -AC_MSG_CHECKING([with-camlibs parsing]) -AC_MSG_RESULT([finished]) - -dnl GP_SET_MSG([m4-camlib-set]) -dnl GP_SET_MSG([camlib-set]) - -dnl Camlibs requested, but cannot be built. -GP_SET_DEFINE([camlib-set-diff-skipping]) -GP_SET_DIFFERENCE([camlib-set-diff-skipping], [m4-camlib-set], [camlib-set]) -GP_SET_MSG([camlib-set-diff-skipping]) - -dnl Camlibs added over the standard set -GP_SET_DEFINE([camlib-set-diff-over-standard]) -GP_SET_DIFFERENCE([camlib-set-diff-over-standard], [camlib-set], [camlib-set-standard]) -GP_SET_MSG([camlib-set-diff-over-standard]) - -dnl Camlibs missing from the standard set -GP_SET_DEFINE([camlib-set-diff-from-standard]) -GP_SET_DIFFERENCE([camlib-set-diff-from-standard], [camlib-set-standard], [camlib-set]) -GP_SET_MSG([camlib-set-diff-from-standard]) - -GP_SET_DEBUG_MSG([camlib-set-diff-skipping]) -GP_SET_DEBUG_MSG([camlib-set-diff-from-standard]) -GP_SET_DEBUG_MSG([camlib-set-diff-over-standard]) - -GP_SET_SPACE_VAR([camlib-set-diff-skipping], [gp_camlib_set_skipping])dnl - -dnl We could use the cardinality of the difference sets to determine -dnl how far we are from the standard set. If we do not differ too -dnl much, we can still show the camlib set as "standard plus these -dnl minus those skipping that" instead of just listing the camlib -dnl names. - -dnl gp_camlibs_from_standard="$(GP_SET_CARDINALITY([camlib-set-diff-from-standard]))" -dnl AC_MSG_CHECKING([camlibs removed from standard set]) -dnl AC_MSG_RESULT([${gp_camlibs_from_standard}]) - -dnl gp_camlibs_over_standard="$(GP_SET_CARDINALITY([camlib-set-diff-over-standard]))" -dnl AC_MSG_CHECKING([camlibs added over standard set]) -dnl AC_MSG_RESULT([${gp_camlibs_over_standard}]) - -dnl gp_camlibs_non_standard="$(${EXPR} ${gp_camlibs_from_standard} + ${gp_camlibs_over_standard})" -dnl AC_MSG_CHECKING([total number of camlibs differing from standard set]) -dnl AC_MSG_RESULT([${gp_camlibs_non_standard}]) - -AC_MSG_CHECKING([whether skipping some requested camlibs]) -AS_IF([test "x$gp_camlib_set_skipping" = "x"], [dnl - AC_MSG_RESULT([no]) -], [dnl - AC_MSG_RESULT([yes (${gp_camlib_set_skipping})]) - AC_DEFINE_UNQUOTED([GP_CAMLIB_SET_SKIPPING], ["${gp_camlib_set_skipping}"], - [If defined, the camlibs which are skipped due to missing dependencies]) - AC_MSG_WARN([ - - #=========================================================# - # We are skipping building one or more camlibs, probably # - # due to missing dependencies. Check the dependencies if # - # you insist on building these camlibs. # - #=========================================================# -]) - GP_SLEEP([5]) -]) - -GP_SET_SPACE_VAR([camlib-set], [gp_camlib_set]) -AC_MSG_CHECKING([camlib set to build in detail]) -AC_MSG_RESULT([${gp_camlib_set}]) - -GP_CAMLIBS_CONDITIONAL_WARNING - -dnl Whether user has requested a non-standard set of camlibs -GP_SET_EQUAL_IFELSE([camlib-set], [camlib-set-standard], [dnl - AS_IF([test "x$gp_camlib_set_skipping" = "x"], [dnl - GP_CONFIG_MSG([Camlibs], - [standard set (${gp_camlib_set})]) - ], [dnl - GP_CONFIG_MSG([Camlibs], - [standard set (${gp_camlib_set} SKIPPING ${gp_camlib_set_skipping})]) - ]) -], [dnl - AS_IF([test "x$gp_camlib_set_skipping" = "x"], [dnl - GP_CONFIG_MSG([Camlibs], - [non-standard set (${gp_camlib_set})]) - ], [dnl - GP_CONFIG_MSG([Camlibs], - [non-standard set (${gp_camlib_set} SKIPPING ${gp_camlib_set_skipping})]) - ]) - m4_pattern_allow([GP_CAMLIB_SET_IS_NONSTANDARD])dnl - AC_DEFINE_UNQUOTED([GP_CAMLIB_SET_IS_NONSTANDARD], [1], - [define when the camlib set to buidl is non-standard]) -])dnl - -m4_pattern_allow([GP_CAMLIB_SET])dnl -AC_DEFINE_UNQUOTED([GP_CAMLIB_SET], ["${gp_camlib_set}"], - [The actually defined set of camlibs to build]) - -AS_UNSET([GP_CAMLIB_SET]) -for f in ${gp_camlib_set} -do - GP_CAMLIB_SET="${GP_CAMLIB_SET}${GP_CAMLIB_SET+ }${f}.la" -done -AS_UNSET([f]) -AC_SUBST([GP_CAMLIB_SET]) - -m4_pattern_allow([GP_CAMLIB_SET_EVERYTHING])dnl -AC_SUBST([GP_CAMLIB_SET_EVERYTHING], - ["m4_set_contents([gp_m4s_camlib_set_everything], [ ])"]) - -# END $0($@) -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-check-doxygen.m4 b/gphoto-m4/gp-check-doxygen.m4 deleted file mode 100644 index 482ba1e64..000000000 --- a/gphoto-m4/gp-check-doxygen.m4 +++ /dev/null @@ -1,21 +0,0 @@ -dnl doxygen related stuff -dnl look for tools -dnl define substitutions for Doxyfile.in -AC_DEFUN([GP_CHECK_DOXYGEN],[dnl -AC_REQUIRE([GP_CHECK_DOC_DIR])dnl -AC_PATH_PROG([DOT], [dot], [false]) -AC_PATH_PROG([DOXYGEN], [doxygen], [false]) -AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "xfalse"]) -AM_CONDITIONAL([HAVE_DOT], [test "x$DOT" != "xfalse"]) -if test "x$DOT" != "xfalse"; then - AC_SUBST([HAVE_DOT],[YES]) -else - AC_SUBST([HAVE_DOT],[NO]) -fi -AC_SUBST([HTML_APIDOC_DIR], ["${PACKAGE_TARNAME}-api.html"]) -AC_SUBST([DOXYGEN_OUTPUT_DIR], [doxygen-output]) -AC_SUBST([HTML_APIDOC_INTERNALS_DIR], ["${PACKAGE_TARNAME}-internals.html"]) -])dnl - - - diff --git a/gphoto-m4/gp-check-library.m4 b/gphoto-m4/gp-check-library.m4 deleted file mode 100644 index ee9ef004b..000000000 --- a/gphoto-m4/gp-check-library.m4 +++ /dev/null @@ -1,463 +0,0 @@ -dnl @synopsis GP_CHECK_LIBRARY([VARNAMEPART],[libname],[VERSION-REQUIREMENT], -dnl [headername],[functionname], -dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], -dnl [OPTIONAL-REQUIRED-ETC],[WHERE-TO-GET-IT]) -dnl -dnl Checks for the presence of a certain library. -dnl -dnl Parameters: -dnl -dnl VARNAMEPART partial variable name for variable definitions -dnl libname name of library -dnl VERSION-REQUIREMENT check for the version using pkg-config. -dnl default: [] -dnl headername name of header file -dnl default: [] -dnl functionname name of function name in library -dnl default: [] -dnl ACTION-IF-FOUND shell action to execute if found -dnl default: [] -dnl ACTION-IF-NOT-FOUND shell action to execute if not found -dnl default: [] -dnl OPTIONAL-REQUIRED-ETC one of "mandatory", "default-on", "default-off" -dnl "disable-explicitly" -dnl default: [mandatory] -dnl WHERE-TO-GET-IT place where to find the library, e.g. a URL -dnl default: [] -dnl -dnl What the ACTION-IFs can do: -dnl -dnl * change the variable have_[$1] to "yes" or "no" and thus change -dnl the outcome of the test -dnl * execute additional checks to define more specific variables, e.g. -dnl for different API versions -dnl -dnl What the OPTIONAL-REQUIRED-ETC options mean: -dnl -dnl mandatory Absolute requirement, cannot be disabled. -dnl default-on If found, it is used. If not found, it is not used. -dnl default-off In case of --with-libfoo, detect it. Without -dnl --with-libfoo, do not look for and use it. -dnl disable-explicitly Required by default, but can be disabled by -dnl explicitly giving --without-libfoo. -dnl -dnl These results have happened after calling GP_CHECK_LIBRARY: -dnl -dnl AM_CONDITIONAL([HAVE_VARPREFIX],[ if found ]) -dnl AM_SUBST([have_VARPREFIX], [ "yes" if found, "no" if not found ]) -dnl AM_SUBST([VARPREFIX_CFLAGS],[ -I, -D and stuff ]) -dnl AM_SUBST([VARPREFIX_LIBS], [ /path/to/libname.la -L/path -lfoo ]) -dnl -dnl Parameters to ./configure which influence the GP_CHECK_LIBRARY results: -dnl -dnl * VARNAMEPART_LIBS=/foobar/arm-palmos/lib/libname.la -dnl VARNAMEPART_CFLAGS=-I/foobar/include -dnl * --without-libfoo -dnl * --with-libfoo=/usr/local -dnl * --with-libfoo-include-dir=/foobar/include -dnl * --with-libfoo-lib=/foobar/arm-palmos/lib -dnl * --with-libfoo=autodetect -dnl -dnl Examples: -dnl GP_CHECK_LIBRARY([LIBEXIF], [libexif])dnl -dnl GP_CHECK_LIBRARY([LIBEXIF], [libexif-gtk], [>= 0.3.3])dnl -dnl note the space! ^ -dnl -dnl Possible enhancements: -dnl -dnl * Derive VAR_PREFIX directly from libname -dnl This will change the calling conventions, so be aware of that. -dnl * Give names of a header file and function name and to a test -dnl compilation. -dnl -AC_DEFUN([_GP_CHECK_LIBRARY_SOEXT],[dnl -AC_MSG_CHECKING([for dynamic library extension]) -soext="" -case "$host" in - *linux*) soext=".so" ;; - *sunos*) soext=".so" ;; - *solaris*) soext=".so" ;; - *bsd*) soext=".so" ;; - *darwin*) soext=".dylib" ;; - *w32*) soext=".dll" ;; -esac -case "$host_os" in - gnu*) soext=".so" ;; -esac -if test "x$soext" = "x"; then - soext=".so" - AC_MSG_RESULT([${soext}]) - AC_MSG_WARN([ -Host system "${host}" not recognized, defaulting to "${soext}". -]) -else - AC_MSG_RESULT([${soext}]) -fi -])dnl -dnl -dnl -m4_ifndef([PKG_PROG_PKG_CONFIG], [dnl - m4_fatal([PKG_PROG_PKG_CONFIG not found, do you have pkg-config installed with pkg.m4?]) -]) -dnl -dnl -AC_DEFUN([_GP_CHECK_LIBRARY],[ -# ---------------------------------------------------------------------- -# [GP_CHECK_LIBRARY]([$1],[$2],[$3], -# [$4],[$5], -# [...],[...],[$8]) -m4_ifval([$9],[dnl -# $9 -])dnl -# ---------------------------------------------------------------------- -dnl -dnl -AC_REQUIRE([GP_CONFIG_MSG])dnl -AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_REQUIRE([_GP_CHECK_LIBRARY_SOEXT])dnl -# Use _CFLAGS and _LIBS given to configure. -# This makes it possible to set these vars in a configure script -# and AC_CONFIG_SUBDIRS this configure. -AC_ARG_VAR([$1][_CFLAGS], [CFLAGS for compiling with ][$2])dnl -AC_ARG_VAR([$1][_LIBS], [LIBS to add for linking against ][$2])dnl -dnl -AC_MSG_CHECKING([for ][$2][ to use]) -m4_ifval([$3],[REQUIREMENTS_FOR_][$1][="][$2][ $3]["], - [REQUIREMENTS_FOR_][$1][="][$2]["]) -userdef_[$1]=no -have_[$1]=no -if test "x${[$1][_LIBS]}" = "x" && test "x${[$1][_CFLAGS]}" = "x"; then - # define --with/--without argument - m4_if([$8], [default-off], - [m4_pushdef([gp_lib_arg],[--without-][$2])dnl - try_[$1]=no - ], - [m4_pushdef([gp_lib_arg],[--with-][$2])dnl - try_[$1]=auto - ])dnl - AC_ARG_WITH([$2],[AS_HELP_STRING([gp_lib_arg][=PREFIX],[where to find ][$2][, "no" or "auto"])],[try_][$1][="$withval"]) - if test "x${[try_][$1]}" = "xno"; then - [REQUIREMENTS_FOR_][$1][=] - fi - if test "x${[try_][$1]}" = "xauto"; then [try_][$1]=autodetect; fi - AC_MSG_RESULT([${try_][$1][}]) - m4_popdef([gp_lib_arg])dnl - if test "x${[try_][$1]}" = "xautodetect"; then - # OK, we have to autodetect. - # We start autodetection with the cleanest known method: pkg-config - if test "x${[have_][$1]}" = "xno"; then - # we need that line break after the PKG_CHECK_MODULES - m4_ifval([$3], - [PKG_CHECK_MODULES([$1],[$2][ $3],[have_][$1][=yes],[:])], - [PKG_CHECK_MODULES([$1],[$2], [have_][$1][=yes],[:])] - ) - fi - # If pkg-config didn't find anything, try the libfoo-config program - # certain known libraries ship with. - if test "x${[have_][$1]}" = "xno"; then - AC_MSG_CHECKING([$2][ config program]) - m4_pushdef([gp_lib_config],[m4_if([$2],[libusb],[libusb-config], - [$2],[libgphoto2],[gphoto2-config], - [$2],[libgphoto2_port],[gphoto2-port-config], - [$2],[gdlib],[gdlib-config], - [$2],[libxml-2.0],[xml2-config], - [none])])dnl - AC_MSG_RESULT([gp_lib_config]) - AC_PATH_PROG([$1][_CONFIG_PROG],[gp_lib_config]) - if test -n "${[$1][_CONFIG_PROG]}" && - test "${[$1][_CONFIG_PROG]}" != "none"; then - m4_ifval([$3],[ - AC_MSG_CHECKING([for ][$2][ version according to ][gp_lib_config]) - m4_pushdef([gp_lib_compop],[regexp([$3], [\(>=\|>\|<\|<=\|=\)[ \t]*.*], [\1])])dnl comparison operator - m4_if( gp_lib_compop,[>=],[_][$1][_COMPN="-lt"], - gp_lib_compop,[>], [_][$1][_COMPN="-le"], - gp_lib_compop,[<], [_][$1][_COMPN="-ge"], - gp_lib_compop,[<=],[_][$1][_COMPN="-gt"], - gp_lib_compop,[=], [_][$1][_COMPN="-ne"], - [m4_errprint(__file__:__line__:[ Error: -Illegal version comparison operator: `gp_lib_compop' -It must be one of ">=", ">", "<", "<=", "=". -])m4_exit(1)]) - m4_popdef([gp_lib_compop])dnl - # split requested version number using m4 regexps - _[$1]_REQ_1="regexp([$3], [\(>=\|>\|<\|<=\|=\)[ \t]*\([0-9]+\).*], [\2])" - _[$1]_REQ_2="regexp([$3], [\(>=\|>\|<\|<=\|=\)[ \t]*\([0-9]+\)\.\([0-9]+\).*], [\3])" - _[$1]_REQ_3="regexp([$3], [\(>=\|>\|<\|<=\|=\)[ \t]*\([0-9]+\)\.\([0-9]+\)\.\([0-9]+\).*], [\4])" - _[$1]_REQ_4="regexp([$3], [\(>=\|>\|<\|<=\|=\)[ \t]*\([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)\(.*\)], [\5])" - # split installed version number via shell and sed - _[$1]_VERSION="$("${[$1][_CONFIG_PROG]}" --version | sed 's/^.* //')" - _[$1]_VER_1="$(echo "${_[$1]_VERSION}" | sed 's/\([[0-9]]*\).*/\1/g')" - _[$1]_VER_2="$(echo "${_[$1]_VERSION}" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/g')" - _[$1]_VER_3="$(echo "${_[$1]_VERSION}" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/g')" - _[$1]_VER_4="$(echo "${_[$1]_VERSION}" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)\(.*\)/\4/g')" - AC_MSG_RESULT([${_][$1][_VERSION}]) - _tmp=false - if test "${_[$1]_VER_1}" "${_[$1]_COMPN}" "${_[$1]_REQ_1}"; then _tmp=true; - elif test "${_[$1]_VER_2}" "${_[$1]_COMPN}" "${_[$1]_REQ_2}"; then _tmp=true; - elif test "${_[$1]_VER_3}" "${_[$1]_COMPN}" "${_[$1]_REQ_3}"; then _tmp=true; - elif test "x${_[$1]_VER_4}" = "x" && test "x${_[$1]_REQ_4}" != "x"; then _tmp=true; - elif test "${_[$1]_VER_4}" "${_[$1]_COMPN}" "${_[$1]_REQ_4}"; then _tmp=true; - fi - AC_MSG_CHECKING([if ][$2][ version is matching requirement ][$3]) - if "${_tmp}"; then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Version requirement ][$2][ ][$3][ not met. Found: ${_][$1][_VERSION}]) - else - AC_MSG_RESULT([yes]) - fi - ])dnl if version requirement given - AC_MSG_CHECKING([for ][$2][ parameters from ][gp_lib_config]) - [$1]_LIBS="$(${[$1][_CONFIG_PROG]} --libs || echo "*error*")" - [$1]_CFLAGS="$(${[$1][_CONFIG_PROG]} --cflags || echo "*error*")" - if test "x${[$1]_LIBS}" = "*error*" || - test "x${[$1]_CFLAGS}" = "*error*"; then - AC_MSG_RESULT([error]) - else - have_[$1]=yes - AC_MSG_RESULT([ok]) - fi - fi - m4_popdef([gp_lib_config])dnl - fi - m4_ifval([$3],[# Version requirement given, so we do not rely on probing.],[ - # Neither pkg-config, nor the libfoo-config program have found anything. - # So let's just probe the system. - AC_MSG_WARN([The `$2' library could not be found using pkg-config or its known config program. -No version checks will be performed if it is found using any other method.]) - if test "x${[have_][$1]}" = "xno"; then - ifs="$IFS" - IFS=":" # FIXME: for W32 and OS/2 we may need ";" here - for _libdir_ in \ - ${LD_LIBRARY_PATH} \ - "${libdir}" \ - "${prefix}/lib64" "${prefix}/lib" \ - /usr/lib64 /usr/lib \ - /usr/local/lib64 /usr/local/lib \ - /opt/lib64 /opt/lib - do - IFS="$ifs" - for _soext_ in .la ${soext} .a; do - if test -f "${_libdir_}/[$2]${_soext_}" - then - if test "x${_soext_}" = "x.la" || - test "x${_soext_}" = "x.a"; then - [$1]_LIBS="${_libdir_}/[$2]${_soext_}" - else - [$1]_LIBS="-L${_libdir_} -l$(echo "$2" | sed 's/^lib//')" - fi - break - fi - done - if test "x${[$1][_LIBS]}" != "x"; then - break - fi - done - IFS="$ifs" - if test "x${[$1][_LIBS]}" != "x"; then - have_[$1]=yes - fi - fi - ]) - elif test "x${[try_][$1]}" = "xno"; then - : - else - # We've been given a prefix to look in for library $2. - # We start looking for $2.la files first. - AC_MSG_CHECKING([for ][$2][.la file in ${[try_][$1]}]) - if test -f "${[try_][$1]}/lib/[$2].la"; then - [$1][_LIBS]="${[try_][$1]}/lib/[$2].la" - [$1][_CFLAGS]="-I${[try_][$1]}/include" - AC_MSG_RESULT([libtool file $][$1][_LIBS (good)]) - have_[$1]=yes - elif test -f "${[try_][$1]}/lib64/[$2].la"; then # HACK - [$1][_LIBS]="${[try_][$1]}/lib64/[$2].la" - [$1][_CFLAGS]="-I${[try_][$1]}/include" - AC_MSG_RESULT([libtool file $][$1][_LIBS (good)]) - have_[$1]=yes - else - AC_MSG_RESULT([wild guess that something is in $try_][$1]) - [$1][_LIBS]="-L${[try_][$1]}/lib -l$(echo "$2" | sed 's/^lib//')" - [$1][_CFLAGS]="-I${[try_][$1]}/include" - have_[$1]=yes - AC_MSG_WARN([ -* Warning: -* libtool file $2.la could not be found. -* We may be linking against the WRONG library. -]) - fi - fi -elif test "x${[$1][_LIBS]}" != "x" && test "x${[$1][_CFLAGS]}" != "x"; then - AC_MSG_RESULT([user-defined]) - userdef_[$1]=yes - have_[$1]=yes -else - AC_MSG_RESULT([broken call]) - AC_MSG_ERROR([ -* Fatal: -* When calling configure for ${PACKAGE_TARNAME} -* ${PACKAGE_NAME} -* either set both [$1][_LIBS] *and* [$1][_CFLAGS] -* or neither. -]) -fi -AC_SUBST([REQUIREMENTS_FOR_][$1]) -dnl -dnl ACTION-IF-FOUND -dnl -m4_ifval([$6],[dnl -if test "x${[have_][$1]}" = "xyes"; then -# ACTION-IF-FOUND -$6 -fi -])dnl -dnl -dnl ACTION-IF-NOT-FOUND -dnl -m4_ifval([$7],[dnl -if test "x${[have_][$1]}" = "xno"; then -# ACTION-IF-NOT-FOUND -$7 -fi -])dnl -dnl -dnl Run our own test compilation -dnl -m4_ifval([$4],[dnl -if test "x${[have_][$1]}" = "xyes"; then -dnl AC_MSG_CHECKING([whether ][$2][ test compile succeeds]) -dnl AC_MSG_RESULT([${[have_][$1]}]) -CPPFLAGS_save="$CPPFLAGS" -CPPFLAGS="${[$1]_CFLAGS}" -AC_CHECK_HEADER([$4],[have_][$1][=yes],[have_][$1][=no]) -CPPFLAGS="$CPPFLAGS_save" -fi -])dnl -dnl -dnl Run our own test link -dnl Does not work for libraries which be built after configure time, -dnl so we deactivate it for them (userdef_). -dnl -m4_ifval([$5],[dnl -if test "x${[userdef_][$1]}" = "xno" && test "x${[have_][$1]}" = "xyes"; then - AC_MSG_CHECKING([for function ][$5][ in ][$2]) - LIBS_save="$LIBS" - LIBS="${[$1]_LIBS}" - AC_TRY_LINK_FUNC([$5],[],[have_][$1][=no]) - LIBS="$LIBS_save" - AC_MSG_RESULT([${[have_][$1]}]) -fi -])dnl -dnl -dnl Abort configure script if mandatory, but not found -dnl -m4_if([$8],[mandatory],[ -if test "x${[have_][$1]}" = "xno"; then - AC_MSG_ERROR([ -PKG_CONFIG_PATH=${PKG_CONFIG_PATH} -[$1][_LIBS]=${[$1][_LIBS]} -[$1][_CFLAGS]=${[$1][_CFLAGS]} - -* Fatal: ${PACKAGE_NAME} requires $2 $3 to build. -* -* Possible solutions: -* - set PKG_CONFIG_PATH to adequate value -* - call configure with [$1][_LIBS]=.. and [$1][_CFLAGS]=.. -* - call configure with one of the --with-$2 parameters -][m4_ifval([$9],[dnl -* - get $2 and install it: -* $9],[dnl -* - get $2 and install it])]) -fi -])dnl -dnl -dnl Abort configure script if not found and not explicitly disabled -dnl -m4_if([$8],[disable-explicitly],[ -if test "x${[try_][$1]}" != "xno" && test "x${[have_][$1]}" = "xno"; then - AC_MSG_ERROR([ -PKG_CONFIG_PATH=${PKG_CONFIG_PATH} -[$1][_LIBS]=${[$1][_LIBS]} -[$1][_CFLAGS]=${[$1][_CFLAGS]} - -* Fatal: ${PACKAGE_NAME} by default requires $2 $3 to build. -* You must explicitly disable $2 to build ${PACKAGE_TARNAME} without it. -* -* Possible solutions: -* - call configure with --with-$2=no or --without-$2 -* - set PKG_CONFIG_PATH to adequate value -* - call configure with [$1][_LIBS]=.. and [$1][_CFLAGS]=.. -* - call configure with one of the --with-$2 parameters -][m4_ifval([$9],[dnl -* - get $2 and install it: -* $9],[dnl -* - get $2 and install it -])][m4_if([$2],[libusb],[dnl -* - if you have libusb >= 1.0 installed, you must also install -* either the libusb0 compat library or a libusb 0.x version -])]) -fi -])dnl -AM_CONDITIONAL([HAVE_][$1], [test "x$have_[$1]" = "xyes"]) -if test "x$have_[$1]" = "xyes"; then - AC_DEFINE([HAVE_][$1], 1, [whether we compile with ][$2][ support]) - GP_CONFIG_MSG([$2],[yes])dnl - AC_MSG_CHECKING([$2][ library flags]) - AC_MSG_RESULT(["${[$1][_LIBS]}"]) - AC_MSG_CHECKING([$2][ cpp flags]) - AC_MSG_RESULT(["${[$1][_CFLAGS]}"]) -else - [REQUIREMENTS_FOR_][$1][=] - GP_CONFIG_MSG([$2],[no])dnl -fi -dnl AC_SUBST is done implicitly by AC_ARG_VAR above. -dnl AC_SUBST([$1][_LIBS]) -dnl AC_SUBST([$1][_CFLAGS]) -])dnl -dnl -dnl #################################################################### -dnl -AC_DEFUN([_GP_CHECK_LIBRARY_SYNTAX_ERROR],[dnl -m4_errprint(__file__:__line__:[ Error: -*** Calling $0 macro with old syntax -*** Aborting. -])dnl -m4_exit(1)dnl -])dnl -dnl -dnl #################################################################### -dnl -AC_DEFUN([GP_CHECK_LIBRARY],[dnl -m4_if([$4], [mandatory], [_GP_CHECK_LIBRARY_SYNTAX_ERROR($0)], - [$4], [default-enabled], [_GP_CHECK_LIBRARY_SYNTAX_ERROR($0)], - [$4], [default-disabled], [_GP_CHECK_LIBRARY_SYNTAX_ERROR($0)])dnl -m4_if([$8], [], [dnl - _GP_CHECK_LIBRARY([$1],[$2],[$3],[$4],[$5],[$6],[$7],[mandatory],[$9])], - [$8], [default-on], [dnl - _GP_CHECK_LIBRARY([$1],[$2],[$3],[$4],[$5],[$6],[$7],[$8],[$9])], - [$8], [disable-explicitly], [dnl - _GP_CHECK_LIBRARY([$1],[$2],[$3],[$4],[$5],[$6],[$7],[$8],[$9])], - [$8], [default-off], [dnl - _GP_CHECK_LIBRARY([$1],[$2],[$3],[$4],[$5],[$6],[$7],[$8],[$9])], - [$8], [mandatory], [dnl - _GP_CHECK_LIBRARY([$1],[$2],[$3],[$4],[$5],[$6],[$7],[$8],[$9])], - [m4_errprint(__file__:__line__:[ Error: -Illegal argument 6 to $0: `$6' -It must be one of "default-on", "default-off", "mandatory". -])m4_exit(1)])dnl -])dnl -dnl -m4_pattern_disallow([GP_CHECK_LIBRARY]) -m4_pattern_disallow([_GP_CHECK_LIBRARY]) -m4_pattern_disallow([_GP_CHECK_LIBRARY_SYNTAX_ERROR]) -m4_pattern_disallow([_GP_CHECK_LIBRARY_SOEXT]) -dnl -dnl #################################################################### -dnl -dnl Please do not remove this: -dnl filetype: 6e60b4f0-acb2-4cd5-8258-42014f92bd2c -dnl I use this to find all the different instances of this file which -dnl are supposed to be synchronized. -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-check-popt.m4 b/gphoto-m4/gp-check-popt.m4 deleted file mode 100644 index 7b8b6aa8f..000000000 --- a/gphoto-m4/gp-check-popt.m4 +++ /dev/null @@ -1,241 +0,0 @@ -dnl @synopsis GP_CHECK_POPT(FLAG) -dnl -dnl Check whether libpopt is available. -dnl FLAG must be one of -dnl "mandatory" -dnl "default-enabled" -dnl "default-disabled" -dnl -AC_DEFUN([GP_CHECK_POPT],[ -# -# [GP_CHECK_POPT] -# -AC_REQUIRE([GP_CONFIG_MSG])dnl -m4_if([$1],[mandatory], [_GP_CHECK_POPT([mandatory])], - [$1],[default-enabled], [_GP_CHECK_POPT([disable])], - [$1],[default-disabled], [_GP_CHECK_POPT([enable])], - [m4_errprint(__file__:__line__:[ Error: -Illegal argument to $0: `$1' -Valid values are: mandatory, default-enabled, default-disabled -])m4_exit(1)])dnl -])dnl -dnl -AC_DEFUN([_GP_CHECK_POPT],[ -m4_if([$1],[mandatory],[ -try_popt=yes -require_popt=yes -],[ -try_popt=auto -require_popt=no -AC_ARG_ENABLE([popt], -[AS_HELP_STRING([--$1-popt],[Do not use popt])], -[ if test "x$enableval" = xno \ - || test "x$enableval" = xoff \ - || test "x$enableval" = xfalse; - then - try_popt=no - require_popt=no - elif test "x$enableval" = xyes \ - || test "x$enableval" = xon \ - || test "x$enableval" = xtrue - then - try_popt=yes - require_popt=yes - fi -])dnl -])dnl - -AC_MSG_CHECKING([whether popt is required]) -AC_MSG_RESULT([${require_popt}]) - -if test "$require_popt" != yes; then - AC_MSG_CHECKING([whether popt is requested]) - AC_MSG_RESULT([${try_popt}]) -fi - -dnl Implicit AC_SUBST -AC_ARG_VAR([POPT_CFLAGS],[cppflags to compile with libpopt])dnl -AC_ARG_VAR([POPT_LIBS],[location of libpopt to link against])dnl - -have_popt=no - -if test "x$POPT_CFLAGS" = "x" && test "x$POPT_LIBS" = "x"; then - - # try to find options to compile popt.h - CPPFLAGS_save="$CPPFLAGS" - popth_found=no - case "$MSYSTEM" in - MINGW32) - if test -n "/mingw32"; then - : - elif test -d "/mingw32/include"; then - CPPFLAGS="-I/mingw32/include ${CPPFLAGS}" - else - continue - fi - ac_cv_header_popt_h="" - unset ac_cv_header_popt_h - AC_CHECK_HEADER([popt.h], [popth_found=yes]) - ;; - MINGW64) - if test -n "${popt_prefix}"; then - : - elif test -d "/mingw64/include"; then - CPPFLAGS="-I/mingw64/include ${CPPFLAGS}" - else - continue - fi - ac_cv_header_popt_h="" - unset ac_cv_header_popt_h - AC_CHECK_HEADER([popt.h], [popth_found=yes]) - ;; - *) - for popt_prefix in "" /usr /usr/local - do - if test -n "${popt_prefix}"; then - : - elif test -d "${popt_prefix}/include"; then - CPPFLAGS="-I${popt_prefix}/include ${CPPFLAGS}" - else - continue - fi - ac_cv_header_popt_h="" - unset ac_cv_header_popt_h - AC_CHECK_HEADER([popt.h], [popth_found=yes]) - if test "$popth_found" = yes; then break; fi - done - ;; - esac - CPPFLAGS="$CPPFLAGS_save" - if test "$popth_found" = "yes"; then - if test "$popt_prefix" = ""; then - POPT_CFLAGS="" - else - POPT_CFLAGS="-I${popt_prefix}/include" - fi - elif test "$require_popt" = "yes"; then - AC_MSG_ERROR([ -* Cannot autodetect popt.h -* -* Set POPT_CFLAGS and POPT_LIBS correctly. -]) - fi - - # try to find options to link against popt - LDFLAGS_save="$LDFLAGS" - popt_links=no - case "$MSYSTEM" in - MINGW32) -# for ldir in "" lib; do - popt_libdir="/mingw32/lib" - if test "${popt_libdir}" = "/"; then - popt_libdir="" - elif test -d "${popt_libdir}"; then - LDFLAGS="-L${popt_libdir} ${LDFLAGS}" - else - continue - fi - # Avoid caching of results - ac_cv_lib_popt_poptStuffArgs="" - unset ac_cv_lib_popt_poptStuffArgs - AC_CHECK_LIB([popt], [poptStuffArgs], [popt_links=yes]) - ;; - MINGW64) - popt_libdir="/mingw64/lib" - if test "${popt_libdir}" = "/"; then - popt_libdir="" - elif test -d "${popt_libdir}"; then - LDFLAGS="-L${popt_libdir} ${LDFLAGS}" - else - continue - fi - # Avoid caching of results - ac_cv_lib_popt_poptStuffArgs="" - unset ac_cv_lib_popt_poptStuffArgs - AC_CHECK_LIB([popt], [poptStuffArgs], [popt_links=yes]) - ;; - *) - for popt_prefix in /usr "" /usr/local; do - # We could have "/usr" and "lib64" at the beginning of the - # lists. Then the first tested location would - # incidentally be the right one on 64bit systems, and - # thus work around a bug in libtool on 32bit systems: - # - # 32bit libtool doesn't know about 64bit systems, and so the - # compilation will fail when linking a 32bit library from - # /usr/lib to a 64bit binary. - # - # This hack has been confirmed to workwith a - # 32bit Debian Sarge and 64bit Fedora Core 3 system. - for ldir in lib64 "" lib; do - popt_libdir="${popt_prefix}/${ldir}" - if test "${popt_libdir}" = "/"; then - popt_libdir="" - elif test -d "${popt_libdir}"; then - LDFLAGS="-L${popt_libdir} ${LDFLAGS}" - else - continue - fi - # Avoid caching of results - ac_cv_lib_popt_poptStuffArgs="" - unset ac_cv_lib_popt_poptStuffArgs - AC_CHECK_LIB([popt], [poptStuffArgs], [popt_links=yes]) - if test "$popt_links" = yes; then break; fi - done - if test "$popt_links" = yes; then break; fi - done - ;; - esac - LDFLAGS="$LDFLAGS_save" - if test "$popt_links" = "yes"; then - if test "$popt_libdir" = ""; then - POPT_LIBS="-lpopt" - else - POPT_LIBS="-L${popt_libdir} -lpopt" - fi - have_popt=yes - elif test "$require_popt" = "yes"; then - AC_MSG_ERROR([ -* Cannot autodetect library directory containing popt -* -* Set POPT_CFLAGS and POPT_LIBS correctly. -]) - fi -elif test "x$POPT_CFLAGS" != "x" && test "x$POPT_LIBS" != "x"; then - # just use the user specified option - popt_msg="yes (user specified)" - have_popt=yes -else - AC_MSG_ERROR([ -* Fatal: Either set both POPT_CFLAGS and POPT_LIBS or neither. -]) -fi - -AC_MSG_CHECKING([if popt is functional]) -if test "$require_popt$have_popt" = "yesno"; then - AC_MSG_RESULT([no, but required]) - AC_MSG_ERROR([ -* popt library not found -* Fatal: ${PACKAGE_NAME} (${PACKAGE_TARNAME}) requires popt -* Please install it and/or set POPT_CFLAGS and POPT_LIBS. -]) -fi -AC_MSG_RESULT([${have_popt}]) - -GP_CONFIG_MSG([use popt library], [${have_popt}]) -if test "$have_popt" = "yes"; then - AC_DEFINE([HAVE_POPT],[1],[whether the popt library is available]) - GP_CONFIG_MSG([popt libs],[${POPT_LIBS}]) - GP_CONFIG_MSG([popt cppflags],[${POPT_CFLAGS}]) -fi -AM_CONDITIONAL([HAVE_POPT],[test "$have_popt" = "yes"]) -])dnl -dnl -dnl Please do not remove this: -dnl filetype: 7595380e-eff3-49e5-90ab-e40f1d544639 -dnl I use this to find all the different instances of this file which -dnl are supposed to be synchronized. -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-check-shell-environment.m4 b/gphoto-m4/gp-check-shell-environment.m4 deleted file mode 100644 index a3d6749b9..000000000 --- a/gphoto-m4/gp-check-shell-environment.m4 +++ /dev/null @@ -1,48 +0,0 @@ -dnl @synopsis GP_CHECK_SHELL_ENVIRONMENT([SHOW-LOCALE-VARS]) -dnl -dnl Check that the shell environment is sane. -dnl -dnl If SHOW-LOCALE-VARS is set to [true], print all LC_* and LANG* -dnl variables at configure time. (WARNING: This is not portable!) -dnl -dnl -AC_DEFUN([GP_CHECK_SHELL_ENVIRONMENT], -[ -# make sure "cd" doesn't print anything on stdout -if test x"${CDPATH+set}" = xset -then - CDPATH=: - export CDPATH -fi - -# make sure $() command substitution works -AC_MSG_CHECKING([for POSIX sh \$() command substitution]) -if test "x$(pwd)" = "x`pwd`" && test "y$(echo "foobar")" = "y`echo foobar`" # '''' -then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) - uname=`uname 2>&1` # '' - uname_a=`uname -a 2>&1` # '' - AC_MSG_ERROR([ - -* POSIX sh \$() command substitution does not work with this shell. -* -* You are running a very rare species of shell. Please report this -* sighting to <${PACKAGE_BUGREPORT}>: -* SHELL=${SHELL} -* uname=${uname} -* uname-a=${uname_a} -* Please also include your OS and version. -* -* Run this configure script using a better (i.e. POSIX compliant) shell. -]) -fi -dnl -m4_if([$1],[true],[dnl -printenv | grep -E '^(LC_|LANG)' -])dnl - -dnl -])dnl -dnl diff --git a/gphoto-m4/gp-config-msg.m4 b/gphoto-m4/gp-config-msg.m4 deleted file mode 100644 index cc1935182..000000000 --- a/gphoto-m4/gp-config-msg.m4 +++ /dev/null @@ -1,102 +0,0 @@ -dnl -dnl GP_CONFIG_INIT -dnl use default LHS width (called implicitly if not called explicitly) -dnl GP_CONFIG_INIT([WIDTH-OF-LHS]) -dnl explicitly set the LHS width to the given value -dnl -dnl GP_CONFIG_MSG -dnl empty output line -dnl GP_CONFIG_MSG([LHS],[RHS]) -dnl formatted output line "LHS: RHS" -dnl -dnl GP_CONFIG_OUTPUT -dnl print all the output messages we collected in the mean time -dnl -dnl Simple way to print a configuration summary at the end of ./configure. -dnl -dnl Example usage: -dnl -dnl GP_CONFIG_INIT -dnl GP_CONFIG_MSG([Source code location],[${srcdir}]) -dnl GP_CONFIG_MSG([Compiler],[${CC}]) -dnl GP_CONFIG_MSG -dnl GP_CONFIG_MSG([Feature foo],[${foo}]) -dnl GP_CONFIG_MSG([Location of bar],[${bar}]) -dnl [...] -dnl AC_OUTPUT -dnl GP_CONFIG_OUTPUT -dnl -dnl -AC_DEFUN([GP_CONFIG_INIT], -[dnl -AC_REQUIRE([GP_CHECK_SHELL_ENVIRONMENT]) -dnl the empty string must contain at least as many spaces as the substr length -dnl FIXME: let m4 determine that length -dnl (collect left parts in array and choose largest length) -m4_if([$1],[],[gp_config_len="30"],[gp_config_len="$1"]) -gp_config_empty="" -gp_config_len3="$(expr "$gp_config_len" - 3)" -n="$gp_config_len" -while test "$n" -gt 0; do - gp_config_empty="${gp_config_empty} " - n="$(expr "$n" - 1)" -done -gp_config_msg=" -Configuration (${PACKAGE_TARNAME} ${PACKAGE_VERSION}): -" -])dnl -dnl -dnl -AC_DEFUN([GP_CONFIG_MSG], -[AC_REQUIRE([GP_CONFIG_INIT])dnl -m4_if([$1],[],[ -gp_config_msg="${gp_config_msg} -" -],[$2],[],[ -gp_config_msg="${gp_config_msg} - [$1] -" -],[ -gp_config_msg_len="$(expr "[$1]" : '.*')" -if test "$gp_config_msg_len" -ge "$gp_config_len"; then - gp_config_msg_lhs="$(expr "[$1]" : "\(.\{0,${gp_config_len3}\}\)")..:" -else - gp_config_msg_lhs="$(expr "[$1]:${gp_config_empty}" : "\(.\{0,${gp_config_len}\}\)")" -fi -gp_config_msg="${gp_config_msg} ${gp_config_msg_lhs} [$2] -" -])])dnl -dnl -AC_DEFUN([GP_CONFIG_MSG_SUBDIRS],[dnl -# Message about configured subprojects -if test "x$subdirs" != "x"; then - GP_CONFIG_MSG()dnl - _subdirs="" - for sd in $subdirs; do - ssd="$(basename "$sd")" - if test "x$_subdirs" = "x"; then - _subdirs="$ssd"; - else - _subdirs="$_subdirs $ssd" - fi - done - GP_CONFIG_MSG([Subprojects],[${_subdirs}])dnl -fi -])dnl -dnl -AC_DEFUN([GP_CONFIG_OUTPUT], -[AC_REQUIRE([GP_CONFIG_INIT])dnl -AC_REQUIRE([GP_CONFIG_MSG])dnl -AC_REQUIRE([GP_CONFIG_MSG_SUBDIRS])dnl -echo "${gp_config_msg} -You may run \"make\" and \"make install\" now." -])dnl -dnl -dnl Please do not remove this: -dnl filetype: de774af3-dc3b-4b1d-b6f2-4aca35d3da16 -dnl I use this to find all the different instances of this file which -dnl are supposed to be synchronized. -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-documentation.m4 b/gphoto-m4/gp-documentation.m4 deleted file mode 100644 index d2c46f856..000000000 --- a/gphoto-m4/gp-documentation.m4 +++ /dev/null @@ -1,113 +0,0 @@ -dnl -dnl check where to install documentation -dnl -dnl determines documentation "root directory", i.e. the directory -dnl where all documentation will be placed in -dnl - -AC_DEFUN([GP_CHECK_DOC_DIR], -[ -AC_BEFORE([$0], [GP_BUILD_GTK_DOCS])dnl -AC_BEFORE([$0], [GP_CHECK_DOXYGEN])dnl - -AC_ARG_WITH([doc-dir], -[AS_HELP_STRING([--with-doc-dir=PATH], -[Where to install docs [default=autodetect]])]) - -# check for the main ("root") documentation directory -AC_MSG_CHECKING([main docdir]) - -if test "x${with_doc_dir}" != "x" -then # docdir is given as parameter - docdir="${with_doc_dir}" - AC_MSG_RESULT([${docdir} (from parameter)]) -else # otherwise invent a docdir hopefully compatible with system policy - if test -d "/usr/share/doc" - then - maindocdir='${prefix}/share/doc' - AC_MSG_RESULT([${maindocdir} (FHS style)]) - elif test -d "/usr/doc" - then - maindocdir='${prefix}/doc' - AC_MSG_RESULT([${maindocdir} (old style)]) - else - maindocdir='${datadir}/doc' - AC_MSG_RESULT([${maindocdir} (default value)]) - fi - AC_MSG_CHECKING([package docdir]) - # check whether to include package version into documentation path - # FIXME: doesn't work properly. - if ls -d /usr/{share/,}doc/make-[0-9]* > /dev/null 2>&1 - then - docdir="${maindocdir}/${PACKAGE}-${VERSION}" - AC_MSG_RESULT([${docdir} (redhat style)]) - else - docdir="${maindocdir}/${PACKAGE}" - AC_MSG_RESULT([${docdir} (default style)]) - fi -fi - -AC_SUBST([docdir]) -])dnl - -dnl -dnl check whether to build docs and where to: -dnl -dnl * determine presence of prerequisites (only gtk-doc for now) -dnl * determine destination directory for HTML files -dnl - -AC_DEFUN([GP_BUILD_GTK_DOCS], -[ -# docdir has to be determined in advance -AC_REQUIRE([GP_CHECK_DOC_DIR]) - -# --------------------------------------------------------------------------- -# gtk-doc: We use gtk-doc for building our documentation. However, we -# require the user to explicitly request the build. -# --------------------------------------------------------------------------- -try_gtkdoc=false -gtkdoc_msg="no (not requested)" -have_gtkdoc=false -AC_ARG_ENABLE([docs], -[AS_HELP_STRING([--enable-docs], -[Use gtk-doc to build documentation [default=no]])],[ - if test x$enableval = xyes; then - try_gtkdoc=true - fi -]) -if $try_gtkdoc; then - AC_PATH_PROG([GTKDOC],[gtkdoc-mkdb]) - if test -n "${GTKDOC}"; then - have_gtkdoc=true - gtkdoc_msg="yes" - else - gtkdoc_msg="no (http://www.gtk.org/rdp/download.html)" - fi -fi -AM_CONDITIONAL([ENABLE_GTK_DOC], [$have_gtkdoc]) -GP_CONFIG_MSG([build API docs with gtk-doc],[$gtkdoc_msg]) - - -# --------------------------------------------------------------------------- -# Give the user the possibility to install html documentation in a -# user-defined location. -# --------------------------------------------------------------------------- -AC_ARG_WITH([html-dir], -[AS_HELP_STRING([--with-html-dir=PATH], -[Where to install html docs [default=autodetect]])]) - -AC_MSG_CHECKING([for html dir]) -if test "x${with_html_dir}" = "x" ; then - htmldir="${docdir}/html" - AC_MSG_RESULT([${htmldir} (default)]) -else - htmldir="${with_html_dir}" - AC_MSG_RESULT([${htmldir} (from parameter)]) -fi -AC_SUBST([htmldir]) -apidocdir="${htmldir}/api" -AC_SUBST([apidocdir]) - -])dnl - diff --git a/gphoto-m4/gp-driverdir.m4 b/gphoto-m4/gp-driverdir.m4 deleted file mode 100644 index 52895c085..000000000 --- a/gphoto-m4/gp-driverdir.m4 +++ /dev/null @@ -1,79 +0,0 @@ -dnl ################################################################### -dnl Driver directory (camlibdir or iolibdir) -dnl ################################################################### -dnl -dnl Usage: -dnl GP_DRIVERDIR([camlibdir], [CAMLIBS], [camlibs]) -dnl GP_DRIVERDIR([iolibdir], [IOLIBS], [iolibs]) -dnl -dnl ################################################################### -dnl -AC_DEFUN([GP_DRIVERDIR], [dnl -AC_MSG_CHECKING([where to install ][$3][ ($1)]) -AC_ARG_VAR([$1], - [where to install ][$3][ (default: ${libdir}/${PACKAGE_TARNAME}/${PACKAGE_VERSION})]) -AS_VAR_IF([$1], [], [dnl - $1="\${libdir}/${PACKAGE_TARNAME}/${PACKAGE_VERSION}" - AC_MSG_RESULT([${$1} (default)]) -], [dnl - AC_MSG_RESULT([${$1} (set explictly)]) -]) - -dnl If you see this after 2022-12-31, please remove the following -dnl section, uncomment the one after, and send a pull request. -AC_MSG_CHECKING([for deprecated --with-$1 argument]) -AC_ARG_WITH([$1], [AS_HELP_STRING( - [--with-][$1][=<path>], - [deprecated (use ][$1][= variable instead)])dnl -], [dnl - AS_VAR_IF([$1], [], [dnl - $1="$withval" - AC_MSG_RESULT([${$1} (from DEPRECATED --with-$1)]) - ], [dnl - AS_VAR_IF([$1], ["$withval"], [dnl - # Nothing to do, $1 has already been set to this value. - ], [dnl - AC_MSG_RESULT([${withval} (differs from $1 value)]) - AC_MSG_ERROR([ -If both the $1= variable and the DEPRECATED --with-$1= argument -are used, their value MUST be the same. -]) - ]) - ]) -], [dnl - AC_MSG_RESULT([not used (very good)]) -]) - -dnl If you see this after 2022-12-31, please uncomment the following -dnl section, remove the previous one, and send a pull request. -dnl -dnl AC_ARG_WITH([$1], [AS_HELP_STRING([--with-][$1][=<path>], -dnl [DEPRECATED (use camlibdir= variable instead)])dnl -dnl ], [dnl -dnl AC_MSG_ERROR([ -dnl The --with-$1= argument is DEPRECATED. -dnl -dnl Use the $1= variable instead. -dnl ]) -dnl ]) - -AC_SUBST([$1]) - -AC_ARG_VAR([DEFAULT_][$2], - [default location to look for ][$3][ at runtime (if not given, use ${$1})]) -AC_MSG_CHECKING([default location to look for $3]) -AS_VAR_IF([DEFAULT_][$2], [], [dnl - DEFAULT_$2="\${$1}" - AC_MSG_RESULT([value of $1 (default)]) -], [dnl - AC_MSG_RESULT([${DEFAULT_$2} (set explicitly)]) -]) -AM_CPPFLAGS="$AM_CPPFLAGS -D$2=\\\"${DEFAULT_$2}\\\"" -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-gettext-hack.m4 b/gphoto-m4/gp-gettext-hack.m4 deleted file mode 100644 index 01ca92742..000000000 --- a/gphoto-m4/gp-gettext-hack.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl -dnl GP_GETTEXT_HACK -dnl -dnl gettext hack, originally designed for libexif, libgphoto2, and Co. -dnl This creates a po/Makevars file with adequate values if the -dnl po/Makevars.template is present. -dnl -dnl Example usage: -dnl GP_GETTEXT_HACK([${PACKAGE_TARNAME}-${LIBFOO_CURRENT}], -dnl [Copyright Holder], -dnl [foo-translation@example.org]) -dnl ALL_LINGUAS="de es fr" -dnl AM_GNU_GETTEXT_VERSION([0.14.1]) -dnl AM_GNU_GETTEXT([external]) -dnl AM_PO_SUBDIRS() -dnl AM_ICONV() -dnl GP_GETTEXT_FLAGS -dnl -dnl You can leave out the GP_GETTEXT_HACK parameters if you want to, -dnl GP_GETTEXT_HACK will try fall back to sensible values in that case: -dnl -dnl -AC_DEFUN([GP_GETTEXT_HACK], [dnl -AC_BEFORE([$0], [AM_GNU_GETTEXT])dnl -AC_BEFORE([$0], [AM_GNU_GETTEXT_VERSION])dnl -m4_if([$2],[],[$1="${PACKAGE_TARNAME}"],[$1="$2"]) -AC_DEFINE_UNQUOTED([$1], ["${$1}"], - [The gettext domain we're using]) -AC_SUBST([$1]) -sed_cmds="s|^DOMAIN.*|DOMAIN = ${$1}|" -m4_if([$3],[],[],[sed_cmds="${sed_cmds};s|^COPYRIGHT_HOLDER.*|COPYRIGHT_HOLDER = $3|"]) -m4_ifval([$4],[ -if test -n "$PACKAGE_BUGREPORT"; then - sed_mb="${PACKAGE_BUGREPORT}" -else - m4_pattern_allow([GP_GETTEXT_HACK])dnl - AC_MSG_ERROR([ -*** Your configure.{ac,in} is wrong. -*** Either define PACKAGE_BUGREPORT (by using the 4-parameter AC INIT syntax) -*** or give [GP_GETTEXT_HACK] the third parameter. -*** -]) -fi -],[ -sed_mb="$4" -]) -sed_cmds="${sed_cmds};s|^MSGID_BUGS_ADDRESS.*|MSGID_BUGS_ADDRESS = ${sed_mb}|" -# Not so sure whether this hack is all *that* evil... -AC_MSG_CHECKING([for po/Makevars requiring hack]) -if test -f "${srcdir}/po/Makevars.template"; then - sed "$sed_cmds" < "${srcdir}/po/Makevars.template" > "${srcdir}/po/Makevars" - AC_MSG_RESULT([yes, done.]) -else - AC_MSG_RESULT([no]) -fi -])dnl -dnl -dnl -dnl -AC_DEFUN([GP_GETTEXT_FLAGS], -[ -AC_REQUIRE([AM_GNU_GETTEXT]) -AC_REQUIRE([GP_CONFIG_INIT]) -if test "x${BUILD_INCLUDED_LIBINTL}" = "xyes"; then - AM_CFLAGS="${AM_CFLAGS} -I\$(top_srcdir)/intl" -fi -GP_CONFIG_MSG([Use translations],[${USE_NLS}]) -if test "x$USE_NLS" = "xyes" && test "${BUILD_INCLUDED_LIBINTL}"; then - GP_CONFIG_MSG([Use included libintl],[${BUILD_INCLUDED_LIBINTL}]) -fi -])dnl -dnl -dnl - -dnl Please do not remove this: -dnl filetype: 71ff3941-a5ae-4677-a369-d7cb01f92c81 -dnl I use this to find all the different instances of this file which -dnl are supposed to be synchronized. - -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-internal-docs.m4 b/gphoto-m4/gp-internal-docs.m4 deleted file mode 100644 index 8593620aa..000000000 --- a/gphoto-m4/gp-internal-docs.m4 +++ /dev/null @@ -1,29 +0,0 @@ -dnl -dnl -dnl -AC_DEFUN([GP_INTERNAL_DOCS],[dnl -# Whether to enable the internal docs build. -# -# This takes quite some time due to the generation of lots of call -# graphs, so it is disabled by default. -set_enable_internal_docs=no -AC_ARG_ENABLE([internal-docs], [dnl -AS_HELP_STRING([--enable-internal-docs], -[Build internal code docs if doxygen available])], [dnl -dnl If either --enable-foo nor --disable-foo were given, execute this. - if test "x$enableval" = xno \ - || test "x$enableval" = xoff \ - || test "x$enableval" = xfalse; - then - set_enable_internal_docs=no - elif test "x$enableval" = xyes \ - || test "x$enableval" = xon \ - || test "x$enableval" = xtrue - then - set_enable_internal_docs=yes - fi -]) -AC_MSG_CHECKING([whether to create internal code docs]) -AC_MSG_RESULT([${set_enable_internal_docs}]) -AM_CONDITIONAL([ENABLE_INTERNAL_DOCS], [test "x${set_enable_internal_docs}" = "xyes"]) -])dnl diff --git a/gphoto-m4/gp-libjpeg.m4 b/gphoto-m4/gp-libjpeg.m4 deleted file mode 100644 index 841fd0af3..000000000 --- a/gphoto-m4/gp-libjpeg.m4 +++ /dev/null @@ -1,139 +0,0 @@ -dnl #################################################################### -dnl GP_LIBJPEG -dnl #################################################################### -dnl -dnl * If --without-jpeg or --with-jpeg=no is given, build without -dnl libjpeg support. -dnl * If not explicitly disabled by --without-jpeg, autodetect libjpeg. -dnl * If any of LIBJPEG_(CFLAGS|LIBS) is explicitly given, try -dnl compile+link using that. -dnl * If compile+link works, use that. -dnl * If compile+link fails, abort with error message. -dnl * If none of LIBJPEG_(CFLAGS|LIBS) are explicitly given, try -dnl pkg-config to find libjpeg.pc. -dnl * If libjpeg.pc has been found, try compile+link. -dnl * If compile+link works, use that. -dnl * If compile+link fails, build without libjpeg. -dnl * If libjpeg.pc has not been found, try default location. -dnl * If compile+link works, use that. -dnl * If compile+link fails, build without libjpeg. -dnl -AC_DEFUN([GP_LIBJPEG], [dnl -dnl -AC_MSG_CHECKING([whether to build with libjpeg]) -AC_ARG_WITH([jpeg], [dnl - AS_HELP_STRING([--without-jpeg], - [Build without libjpeg (default: with libjpeg)]) -], [dnl just keep the with-jpeg however it is given - AS_VAR_IF([with_jpeg], [no], [], [dnl - AC_MSG_ERROR([ -Unhandled value given to --with-jpeg / --without-jpeg: '$with_jpeg' -]) - ]) -], [dnl - with_jpeg=autodetect -]) -AC_MSG_RESULT([$with_jpeg]) -dnl -AS_VAR_IF([with_jpeg], [no], [dnl Not using libjpeg, so no checks are needed - # libjpeg explictly disabled from command line - GP_CONFIG_MSG([JPEG mangling support], - [no (disabled by --without-jpeg)]) -], [dnl - have_libjpeg=no - - AC_MSG_CHECKING([for libjpeg via variables]) - AS_IF([test "x$LIBJPEG_LIBS$LIBJPEG_CFLAGS" != x], [dnl - GP_LINK_LIBJPEG_IFELSE([ - AC_MSG_RESULT([found and works]) - have_libjpeg=yes - ], [dnl - AC_MSG_RESULT([found but fails to link]) - AC_MSG_ERROR([ -libjpeg not found despite LIBJPEG_CFLAGS and/or LIBJPEG_LIBS being set. -]) - ]) - ], [dnl - AC_MSG_RESULT([no]) - ]) - - AS_VAR_IF([have_libjpeg], [no], [dnl - PKG_CHECK_MODULES([LIBJPEG], [libjpeg], [dnl - AC_MSG_CHECKING([linking with libjpeg works]) - GP_LINK_LIBJPEG_IFELSE([dnl - have_libjpeg=yes - AC_MSG_RESULT([yes]) - ], [dnl - AC_MSG_RESULT([no]) - ]) - ], [dnl - LIBJPEG_LIBS="-ljpeg" - AC_MSG_CHECKING([for libjpeg at default location]) - GP_LINK_LIBJPEG_IFELSE([dnl - have_libjpeg=yes - AC_MSG_RESULT([yes]) - ], [dnl - AC_MSG_RESULT([no]) - AS_UNSET([LIBJPEG_LIBS]) - ]) - ]) - ]) - - AS_VAR_IF([have_libjpeg], [no], [dnl - GP_CONFIG_MSG([JPEG mangling support], - [${have_libjpeg} (requires libjpeg)]) - ], [dnl - AC_DEFINE([HAVE_LIBJPEG], [1], - [define if building with libjpeg]) - GP_CONFIG_MSG([JPEG mangling support], - [${have_libjpeg}]) - ]) -]) -])dnl -dnl -dnl -dnl #################################################################### -dnl GP_LINK_LIBJPEG_IFELSE([if-true], [if-false]) -dnl Make sure we can actually compile and link against libjpeg. -dnl #################################################################### -dnl -AC_DEFUN([GP_LINK_LIBJPEG_IFELSE], [dnl -AC_LANG_PUSH([C]) -saved_CPPFLAGS="$CPPFLAGS" -saved_LIBS="$LIBS" -CPPFLAGS="$CPPFLAGS $LIBJPEG_CFLAGS" -LIBS="$LIBS $LIBJPEG_LIBS" -AC_LINK_IFELSE([AC_LANG_SOURCE([[ -#include <stddef.h> -#include <stdio.h> -#include <stdlib.h> -/* jpeglib.h fails to include all required system headers, so jpeglib.h - * must be included after stddef.h (size_t) and stdio.h (FILE). - */ -#include <jpeglib.h> - -int main(int argc, char **argv) -{ - j_decompress_ptr cinfo = NULL; - (void) argc; - (void) argv; - /* Running this will give a segfault */ - if (jpeg_start_decompress(cinfo)) { - printf("true\n"); - } else { - printf("false\n"); - } - return 0; -} -]])], [$1], [$2]) -CPPFLAGS="$saved_CPPFLAGS" -LIBS="$saved_LIBS" -AC_LANG_POP([C]) -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-libltdl.m4 b/gphoto-m4/gp-libltdl.m4 deleted file mode 100644 index db931dcd3..000000000 --- a/gphoto-m4/gp-libltdl.m4 +++ /dev/null @@ -1,127 +0,0 @@ -dnl Written by Hans Ulrich Niedermann -dnl LDFLAGS vs LIBS fix by Dan Nicholson -dnl -dnl #################################################################### -dnl GP_LIBLTDL -dnl #################################################################### -dnl -dnl We are using our own libltdl checks instead of AC_WITH_LTDL -dnl because we do not want to ship our own copy of libltdl. -dnl -dnl Look for external libltdl, not shipping internal libltdl. -AC_DEFUN([GP_LIBLTDL], [dnl -AC_ARG_VAR([LTDLINCL], [CFLAGS for compiling with libltdl]) -AC_ARG_VAR([LIBLTDL], [LIBS to add for linking against libltdl]) -dnl -have_libltdl=no -AC_MSG_CHECKING([for libltdl]) -AS_IF([test "x${LTDLINCL}${LIBLTDL}" != x], [dnl - AC_MSG_RESULT([variables given explicitly]) - - AC_MSG_CHECKING([LTDLINCL (given explicitly)]) - AC_MSG_RESULT([${LTDLINCL}]) - AC_MSG_CHECKING([LIBLTDL (given explictly)]) - AC_MSG_RESULT([${LIBLTDL}]) - - GP_LINK_LIBLTDL_IFELSE([dnl - have_libltdl=yes - ], [dnl - GP_MSG_ERROR_LIBLTDL - ]) -], [dnl - AC_MSG_RESULT([autodetecting]) - - AS_VAR_IF([have_libltdl], [no], [dnl Try default location - LTDLINCL="" - LIBLTDL="-lltdl" - AC_MSG_CHECKING([for libltdl at default location]) - GP_LINK_LIBLTDL_IFELSE([ - have_libltdl=yes - ], [dnl - AS_UNSET([LTDLINCL]) - AS_UNSET([LIBLTDL]) - ]) - AC_MSG_RESULT([$have_libltdl]) - ]) - - dnl FreeBSD packages install to /usr/local - dnl NetBSD packages install to /usr/pkg - dnl MacOSX brew packages install to `brew --prefix` - for gp_prefix in /usr/local /usr/pkg `brew --prefix 2>/dev/null`; do - AS_IF([test -d "$gp_prefix"], [dnl - AS_VAR_IF([have_libltdl], [no], [dnl - LTDLINCL="-I${gp_prefix}/include" - LIBLTDL="-L${gp_prefix}/lib -lltdl" - AC_MSG_CHECKING([for libltdl at $gp_prefix]) - GP_LINK_LIBLTDL_IFELSE([ - have_libltdl=yes - AC_MSG_RESULT([$have_libltdl]) - break - ], [dnl - AS_UNSET([LTDLINCL]) - AS_UNSET([LIBLTDL]) - AC_MSG_RESULT([$have_libltdl]) - ]) - ]) - ]) - done - - AS_VAR_IF([have_libltdl], [yes], [dnl - AC_MSG_CHECKING([LTDLINCL (autodetected)]) - AC_MSG_RESULT([${LTDLINCL}]) - AC_MSG_CHECKING([LIBLTDL (autodetected)]) - AC_MSG_RESULT([${LIBLTDL}]) - ], [dnl - GP_MSG_ERROR_LIBLTDL - ]) -]) -])dnl -dnl -dnl -dnl #################################################################### -dnl GP_MSG_ERROR_LIBLTDL -dnl #################################################################### -dnl -dnl Print the error message when libltdl has not been found to work. -dnl -AC_DEFUN([GP_MSG_ERROR_LIBLTDL], [dnl -AC_MSG_ERROR([ -${PACKAGE} requires libltdl (a part of libtool) - -Please make sure that the proper development package is installed -(may be called libltdl-dev, libtool-ltdl-devel, libltdl, etc.) and if -the autodetection fails, that the LTDLINCL and LIBLTDL variables are -set properly on the configure command line. -]) -])dnl -dnl -dnl -dnl #################################################################### -dnl GP_LINK_LIBLTDL_IFELSE -dnl #################################################################### -dnl -dnl Make sure we can actually compile and link against libltdl -dnl -AC_DEFUN([GP_LINK_LIBLTDL_IFELSE], [dnl -AC_LANG_PUSH([C]) -saved_CPPFLAGS="$CPPFLAGS" -saved_LIBS="$LIBS" -CPPFLAGS="$CPPFLAGS $LTDLINCL" -LIBS="$LIBS $LIBLTDL" -AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include <stdlib.h> /* for NULL */ -#include <ltdl.h> /* for lt_* */ -]], [[ - int ret = lt_dlforeachfile("/usr/lib:/usr/local/lib", NULL, NULL); - (void) ret; -]])], [$1], [$2]) -CPPFLAGS="$saved_CPPFLAGS" -LIBS="$saved_LIBS" -AC_LANG_POP([C]) -])dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-manual-docbook-xml.m4 b/gphoto-m4/gp-manual-docbook-xml.m4 deleted file mode 100644 index bec00c7fd..000000000 --- a/gphoto-m4/gp-manual-docbook-xml.m4 +++ /dev/null @@ -1,46 +0,0 @@ -dnl ------------------------------------------------------------------------ -dnl try to find xmlto (required for generation of man pages and html docs) -dnl ------------------------------------------------------------------------ -AC_DEFUN([GP_CHECK_DOCBOOK_XML], -[ - -AC_MSG_CHECKING([for XML catalogs]) -XML_CATALOG_FILES="`find /etc/xml /usr/share/xml /usr/share/sgml -type f \( -iname 'catalog.xml' -or -iname 'catalog' \) -print 2> /dev/null | while read file; do echo -n "$file "; done`" -if test "x$XML_CATALOG_FILES" = "x" -then - AC_MSG_RESULT([none found.]) -else - AC_MSG_RESULT([found ${XML_CATALOG_FILES}]) -fi -AC_SUBST(XML_CATALOG_FILES) - -#XML_DEBUG_CATALOG=0 -#AC_SUBST(XML_DEBUG_CATALOG) - -manual_msg="no (http://cyberelk.net/tim/xmlto/)" -try_xmlto=true -have_xmlto=false -AC_ARG_WITH(xmlto, [ --without-xmlto Don't use xmlto],[ - if test x$withval = xno; then - try_xmlto=false - fi]) -if $try_xmlto; then - AC_PATH_PROG(XMLTO,xmlto) - if test -n "${XMLTO}"; then - have_xmlto=true - manual_msg="yes" - PURE_XMLTO="$XMLTO" - if true || test "x$XML_CATALOG_FILES" = "x"; then - unset XML_CATALOG_FILES - XMLTO="${XMLTO} -m \$(top_srcdir)/src/xsl/custom.xsl" - else - XMLTO="env XML_CATALOG_FILES=\"${XML_CATALOG_FILES}\" ${XMLTO} -m ${top_srcdir}/src/xsl/custom.xsl" - fi - else - # in case anybody runs $(XMLTO) somewhere, we return false - XMLTO=false - fi -fi - -AM_CONDITIONAL(XMLTO, $have_xmlto) -]) diff --git a/gphoto-m4/gp-manual-documentation.m4 b/gphoto-m4/gp-manual-documentation.m4 deleted file mode 100644 index 717b34ea5..000000000 --- a/gphoto-m4/gp-manual-documentation.m4 +++ /dev/null @@ -1,329 +0,0 @@ -dnl -dnl check where to install documentation -dnl -dnl determines documentation "root directory", i.e. the directory -dnl where all documentation will be placed in -dnl - -AC_DEFUN([GP_CHECK_DOCDIR], -[ - -AC_ARG_WITH(doc-dir, [ --with-doc-dir=PATH Where to install docs [default=autodetect]])dnl - -# check for the main ("root") documentation directory -AC_MSG_CHECKING([main docdir]) - -if test "x${with_doc_dir}" != "x" -then # docdir is given as parameter - docdir="${with_doc_dir}" - AC_MSG_RESULT([${docdir} (from parameter)]) -else # otherwise invent a docdir hopefully compatible with system policy - if test -d "/usr/share/doc" - then - maindocdir='${prefix}/share/doc' - AC_MSG_RESULT([${maindocdir} (FHS style)]) - elif test -d "/usr/doc" - then - maindocdir='${prefix}/doc' - AC_MSG_RESULT([${maindocdir} (old style)]) - else - maindocdir='${datadir}/doc' - AC_MSG_RESULT([${maindocdir} (default value)]) - fi - AC_MSG_CHECKING(package docdir) - # check whether to include package version into documentation path - # FIXME: doesn't work properly. - if ls -d /usr/{share/,}doc/*-[[]0-9[]]* > /dev/null 2>&1 - then - docdir="${maindocdir}/${PACKAGE}-${VERSION}" - AC_MSG_RESULT([${docdir} (redhat style)]) - else - docdir="${maindocdir}/${PACKAGE}" - AC_MSG_RESULT([${docdir} (default style)]) - fi -fi - -AC_SUBST(docdir) - -])dnl - -dnl Solaris hack for grep and tr -AC_DEFUN([GP_CHECK_TR], -[ -if test -n "`echo $host_os | grep '[sS]olaris'`"; then - TR=/usr/xpg4/bin/tr - GREP=/usr/xpg4/bin/grep -else - TR=tr - GREP=grep -fi -]) - -dnl -dnl check whether to build docs and where to: -dnl -dnl * determine presence of prerequisites (only gtk-doc for now) -dnl * determine destination directory for HTML files -dnl - -AC_DEFUN([GP_BUILD_DOCS], -[ -# doc dir has to be determined in advance -AC_REQUIRE([GP_CHECK_DOCDIR]) -AC_REQUIRE([GP_CHECK_GTK_DOC]) -AC_REQUIRE([GP_CHECK_FIG2DEV]) -AC_REQUIRE([GP_CHECK_DOCBOOK_XML]) -AC_REQUIRE([GP_CHECK_TR]) -AC_REQUIRE([GP_CHECK_PSTOIMG]) -AC_REQUIRE([GP_CHECK_DOT]) -AC_REQUIRE([GP_CHECK_W3M]) - -gphoto2xml='$(top_srcdir)/src/gphoto2.xml' -AC_SUBST(gphoto2xml) - -dnl --------------------------------------------------------------------------- -dnl Give the user the possibility to install documentation in -dnl user-defined locations. -dnl --------------------------------------------------------------------------- -AC_ARG_WITH(html-dir, [ --with-html-dir=PATH Where to install html docs [default=autodetect]]) -AC_MSG_CHECKING([for html dir]) -if test "x${with_html_dir}" = "x" ; then - htmldir="${docdir}/html" - AC_MSG_RESULT([${htmldir} (default)]) -else - htmldir="${with_html_dir}" - AC_MSG_RESULT([${htmldir} (from parameter)]) -fi -AC_SUBST(htmldir) - -AC_ARG_WITH(xhtml-dir, [ --with-xhtml-dir=PATH Where to install xhtml docs [default=autodetect]]) -AC_MSG_CHECKING([for xhtml dir]) -if test "x${with_xhtml_dir}" = "x" ; then - xhtmldir="${docdir}/xhtml" - AC_MSG_RESULT([${xhtmldir} (default)]) -else - xhtmldir="${with_xhtml_dir}" - AC_MSG_RESULT([${xhtmldir} (from parameter)]) -fi -AC_SUBST(xhtmldir) - -AC_ARG_WITH(html-nochunks-dir, [ --with-html-nochunks-dir=PATH Where to install html-nochunks docs [default=autodetect]]) -AC_MSG_CHECKING([for html-nochunks dir]) -if test "x${with_html_nochunks_dir}" = "x" ; then - htmlnochunksdir="${docdir}/html-nochunks" - AC_MSG_RESULT([${htmlnochunksdir} (default)]) -else - htmlnochunksdir="${with_html_nochunks_dir}" - AC_MSG_RESULT([${htmlnochunksdir} (from parameter)]) -fi -AC_SUBST(htmlnochunksdir) - -AC_ARG_WITH(xhtml-nochunks-dir, [ --with-xhtml-nochunks-dir=PATH Where to install xhtml-nochunks docs [default=autodetect]]) -AC_MSG_CHECKING([for xhtml-nochunks dir]) -if test "x${with_xhtml_nochunks_dir}" = "x" ; then - xhtmlnochunksdir="${docdir}/xhtml-nochunks" - AC_MSG_RESULT([${xhtmlnochunksdir} (default)]) -else - xhtmlnochunksdir="${with_xhtml_nochunks_dir}" - AC_MSG_RESULT([${xhtmlnochunksdir} (from parameter)]) -fi -AC_SUBST(xhtmlnochunksdir) - -AC_ARG_WITH(xml-dir, [ --with-xml-dir=PATH Where to install xml docs [default=autodetect]]) -AC_MSG_CHECKING([for xml dir]) -if test "x${with_xml_dir}" = "x" ; then - xmldir="${docdir}/xml" - AC_MSG_RESULT([${xmldir} (default)]) -else - xmldir="${with_xml_dir}" - AC_MSG_RESULT([${xmldir} (from parameter)]) -fi -AC_SUBST(xmldir) -xmlcssdir="${xmldir}/css" -AC_SUBST(xmlcssdir) - -AC_ARG_WITH(txt-dir, [ --with-txt-dir=PATH Where to install txt docs [default=autodetect]]) -AC_MSG_CHECKING([for txt dir]) -if test "x${with_txt_dir}" = "x" ; then - txtdir="${docdir}/txt" - AC_MSG_RESULT([${txtdir} (default)]) -else - txtdir="${with_txt_dir}" - AC_MSG_RESULT([${txtdir} (from parameter)]) -fi -AC_SUBST(txtdir) - -AC_ARG_WITH(man-dir, [ --with-man-dir=PATH Where to install man docs [default=autodetect]]) -AC_MSG_CHECKING([for man dir]) -if test "x${with_man_dir}" = "x" ; then - manmandir="${docdir}/man" - AC_MSG_RESULT([${manmandir} (default)]) -else - manmandir="${with_man_dir}" - AC_MSG_RESULT([${manmandir} (from parameter)]) -fi -AC_SUBST(manmandir) - -AC_ARG_WITH(pdf-dir, [ --with-pdf-dir=PATH Where to install pdf docs [default=autodetect]]) -AC_MSG_CHECKING([for pdf dir]) -if test "x${with_pdf_dir}" = "x" ; then - pdfdir="${docdir}/pdf" - AC_MSG_RESULT([${pdfdir} (default)]) -else - pdfdir="${with_pdf_dir}" - AC_MSG_RESULT([${pdfdir} (from parameter)]) -fi -AC_SUBST(pdfdir) - -AC_ARG_WITH(ps-dir, [ --with-ps-dir=PATH Where to install ps docs [default=autodetect]]) -AC_MSG_CHECKING([for ps dir]) -if test "x${with_ps_dir}" = "x" ; then - psdir="${docdir}/ps" - AC_MSG_RESULT([${psdir} (default)]) -else - psdir="${with_ps_dir}" - AC_MSG_RESULT([${psdir} (from parameter)]) -fi -AC_SUBST(psdir) - -AC_ARG_WITH(figure-dir, [ --with-figure-dir=PATH Where to install figures [default=autodetect]]) -AC_MSG_CHECKING([for figure dir]) -if test "x${with_figure_dir}" = "x" ; then - figuredir="${docdir}/figures" - AC_MSG_RESULT([${figuredir} (default)]) -else - figuredir="${with_figure_dir}" - AC_MSG_RESULT([${figuredir} (from parameter)]) -fi -AC_SUBST(figuredir) - -AC_ARG_WITH(screenshots-dir, [ --with-screenshots-dir=PATH Where to install screenshotss [default=autodetect]]) -AC_MSG_CHECKING([for screenshots dir]) -if test "x${with_screenshots_dir}" = "x" ; then - screenshotsdir="${docdir}/screenshots" - AC_MSG_RESULT([${screenshotsdir} (default)]) -else - screenshotsdir="${with_screenshots_dir}" - AC_MSG_RESULT([${screenshotsdir} (from parameter)]) -fi -AC_SUBST(screenshotsdir) -screenshotsgtkamdir="${screenshotsdir}/gtkam" -AC_SUBST(screenshotsgtkamdir) - -doc_formats_list='man html txt ps pdf' - -# initialize have_xmlto* to false -for i in $doc_formats_list; do - d=`echo $i | $TR A-Z a-z` - eval "have_xmlto$d=false" -done - -AC_MSG_CHECKING(checking doc formats) -AC_ARG_WITH(doc_formats, - [ --with-doc-formats=<list> create doc with format in <list>; ] - [ 'all' build all doc formats; ] - [ possible formats are: ] - [ man, html, ps, pdf ], - doc_formats="$withval", doc_formats="man html txt") - -if test "$doc_formats" = "all"; then - doc_formats=$doc_formats_list -else - doc_formats=`echo $doc_formats | sed 's/,/ /g'` -fi - -# set have_xmlto* to true if requested and possible -if $have_xmlto; then - for i in $doc_formats; do - if test -n "`echo $doc_formats_list | $GREP -E \"(^| )$i( |\$)\"`"; then - eval "have_xmlto$i=true" - else - AC_ERROR(Unknown doc format $i!) - fi - done - AC_MSG_RESULT($doc_formats) -else - AC_MSG_RESULT([deactivated (requires xmlto)]) -fi - -# Make sure that xmltopdf actually works -if $have_xmltopdf; then - AC_MSG_CHECKING([whether pdf creation works]) - oldcwd="$(pwd)" - top_srcdir() { echo "$srcdir"; } - mkdir test-pdf - cd test-pdf - cat>test-db.xml<<EOF -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> -<book id="foobook"> - <bookinfo> - <title>Foo Title</title> - </bookinfo> - <chapter id="foochapter"> - <title>Foo Chapter</title> - <para> - Foo bar blah blah - <!--ulink url="https://www.hypothetical-url.invalid/with&ersand">ampersand</ulink-->. - </para> - </chapter> -</book> -EOF - ${PURE_XMLTO} pdf -o . test-db.xml --searchpath .. - if test -s test-db.pdf; then - AC_MSG_RESULT([yes, look at $(pwd)/test-db.pdf to verify]) - else - if $have_xmltopdf; then - AC_MSG_ERROR([PDF creation requested, but failed. See $(pwd) ...]) - else - AC_MSG_RESULT([no, but not requested]) - fi - fi - cd "$oldcwd" - unset top_srcdir -fi - -AM_CONDITIONAL(XMLTOHTML,$have_xmltohtml) -AM_CONDITIONAL(XMLTOMAN,$have_xmltoman) -AM_CONDITIONAL(XMLTOTXT,$have_xmltotxt) -AM_CONDITIONAL(XMLTOTXT2,$have_xmltotxt && $have_w3m) -AM_CONDITIONAL(XMLTOPDF,$have_xmltopdf) -AM_CONDITIONAL(XMLTOPS,$have_xmltops) - -# create list of supported formats -AC_MSG_CHECKING([for manual formats to re-create]) -xxx="" -manual_html="" -manual_pdf="" -manual_ps="" -if $have_xmltohtml; then - xxx="${xxx} html" -fi -if $have_xmltoman; then - xxx="${xxx} man" -fi -if $have_xmltopdf; then - xxx="${xxx} pdf" -fi -if $have_xmltops; then - xxx="${xxx} ps" -fi -if $have_xmltotxt; then - xxx="${xxx} txt" -fi -AC_SUBST(manual_html) -AC_SUBST(manual_pdf) -AC_SUBST(manual_ps) -AC_MSG_RESULT($xxx) - -if test "x$xxx" != "x" -then - if $have_fig2dev; then - fig_out="" - else - fig_out="out" - fi - manual_msg="in (${xxx} ) formats with${fig_out} figures" -fi - -])dnl diff --git a/gphoto-m4/gp-manual-fig2dev.m4 b/gphoto-m4/gp-manual-fig2dev.m4 deleted file mode 100644 index c61f2b7fe..000000000 --- a/gphoto-m4/gp-manual-fig2dev.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl fig2dev: This program is needed for processing images. If not found, -dnl documentation can still be built, but without figures. -dnl --------------------------------------------------------------------------- -AC_DEFUN([GP_CHECK_FIG2DEV], -[ - -try_fig2dev=true -have_fig2dev=false -AC_ARG_WITH(fig2dev, [ --without-fig2dev Don't use fig2dev],[ - if test "x$withval" = "xno"; then - try_fig2dev=false - fi]) -if $try_fig2dev; then - AC_PATH_PROG(FIG2DEV,fig2dev) - if test -n "${FIG2DEV}"; then - have_fig2dev=true - fi -fi -if $have_fig2dev; then - AC_SUBST(FIG2DEV) - ${FIG2DEV} -L ps > /dev/null <<EOF -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 3000 3750 270 270 3000 3750 3150 3975 -EOF - if test $? != 0; then - have_fig2dev=false - fi -fi -AM_CONDITIONAL(ENABLE_FIGURES, $have_fig2dev) - -]) diff --git a/gphoto-m4/gp-manual-graphviz.m4 b/gphoto-m4/gp-manual-graphviz.m4 deleted file mode 100644 index 08e162d49..000000000 --- a/gphoto-m4/gp-manual-graphviz.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl dot: This program is needed for processing images. If not found, -dnl documentation can still be built, but without figures. -dnl --------------------------------------------------------------------------- -AC_DEFUN([GP_CHECK_DOT], -[ - -try_dot=true -have_dot=false -AC_ARG_WITH(dot, AS_HELP_STRING([--without-dot], [Do not use dot]), [ - if test "x$withval" = "xno"; then - try_dot=false - fi]) -if $try_dot; then - AC_PATH_PROG(DOT,dot) - if test -n "${DOT}"; then - have_dot=true - fi -fi -if $have_dot; then - AC_SUBST(DOT) - AC_MSG_CHECKING([whether ${DOT} works]) - ${DOT} -Tps -o tesseract.ps 2> /dev/null <<EOF -graph tesseract { - node [[shape=point]]; - o -- {a;b;c;d;} - a -- {ab;ac;ad;} - b -- {ab;bc;bd;} - c -- {ac;bc;cd;} - d -- {ad;bd;cd;} - ab -- {abc;abd;} - ac -- {abc;acd;} - ad -- {abd;acd;} - bc -- {abc;bcd;} - bd -- {abd;bcd;} - cd -- {acd;bcd;} - {abc;abd;acd;bcd;} -- abcd; -} -EOF - if test $? != 0 || test ! -f tesseract.ps; then - have_dot=false - AC_MSG_RESULT([no (see http://www.graphviz.org/ ...)]) - else - AC_MSG_RESULT(yes) - fi -fi -AM_CONDITIONAL(ENABLE_GRAPHS, $have_dot) - -]) diff --git a/gphoto-m4/gp-manual-gtk-doc.m4 b/gphoto-m4/gp-manual-gtk-doc.m4 deleted file mode 100644 index 12ffca094..000000000 --- a/gphoto-m4/gp-manual-gtk-doc.m4 +++ /dev/null @@ -1,24 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl gtk-doc: We use gtk-doc for building our documentation. However, we -dnl require the user to explicitly request the build. -dnl --------------------------------------------------------------------------- -AC_DEFUN([GP_CHECK_GTK_DOC], -[ -try_gtkdoc=false -gtkdoc_msg="no (not requested)" -have_gtkdoc=false -AC_ARG_ENABLE(docs, [ --enable-docs Use gtk-doc to build documentation [default=no]],[ - if test x$enableval = xyes; then - try_gtkdoc=true - fi]) -if $try_gtkdoc; then - AC_PATH_PROG(GTKDOC,gtkdoc-mkdb) - if test -n "${GTKDOC}"; then - have_gtkdoc=true - gtkdoc_msg="yes" - else - gtkdoc_msg="no (http://www.gtk.org/rdp/download.html)" - fi -fi -AM_CONDITIONAL(ENABLE_GTK_DOC, $have_gtkdoc) -]) diff --git a/gphoto-m4/gp-manual-pstoimg.m4 b/gphoto-m4/gp-manual-pstoimg.m4 deleted file mode 100644 index 8d40690cd..000000000 --- a/gphoto-m4/gp-manual-pstoimg.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl pstoimg: This program is needed for processing images. If not found, -dnl documentation can still be built, but without figures. -dnl --------------------------------------------------------------------------- -AC_DEFUN([GP_CHECK_PSTOIMG], -[ -AC_REQUIRE([GP_CHECK_DOT])dnl for creating tesseract.ps - -try_pstoimg=true -have_pstoimg=false -AC_ARG_WITH(pstoimg, AS_HELP_STRING([--without-pstoimg], [Do not use pstoimg]),[ - if test "x$withval" = "xno"; then - try_pstoimg=false - fi]) -if $try_pstoimg; then - AC_PATH_PROG(PSTOIMG,pstoimg) - if test -n "${PSTOIMG}"; then - have_pstoimg=true - fi -fi -if $have_pstoimg; then - AC_SUBST(PSTOIMG) - AC_MSG_CHECKING([whether ${PSTOIMG} works]) - rm -f tesseract.png - ${PSTOIMG} -type png -scale 1.2 -antialias -crop a tesseract.ps > /dev/null - if test $? != 0 || test ! -f tesseract.png; then - have_pstoimg=false - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(yes) - fi - rm -f tesseract.png -fi -AM_CONDITIONAL(ENABLE_PSTOIMG, $have_pstoimg) - -]) diff --git a/gphoto-m4/gp-manual-w3m.m4 b/gphoto-m4/gp-manual-w3m.m4 deleted file mode 100644 index e563d7b90..000000000 --- a/gphoto-m4/gp-manual-w3m.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl w3m: This program is needed for converting HTML to text. -dnl --------------------------------------------------------------------------- -AC_DEFUN([GP_CHECK_W3M], -[ - -try_w3m=true -have_w3m=false -AC_ARG_WITH(w3m, [ --without-w3m Don't use w3m],[ - if test "x$withval" = "xno"; then - try_w3m=false - fi]) -if $try_w3m; then - AC_PATH_PROG(W3M,w3m) - if test -n "${W3M}"; then - have_w3m=true - fi -fi -if $have_w3m; then - AC_MSG_CHECKING([whether ${W3M} works]) - cat > html2text-test.xxxhtml 2> /dev/null <<EOF -<html> -<title> -<h1>HTML2TEXT Test</h1> -</title> -<body> -<p>This is a test.</p> -</body> -</html> -EOF - ${W3M} -T text/html -cols 78 -dump html2text-test.xxxhtml > html2text-test.txt - if test $? != 0 || test ! -f html2text-test.txt || test ! -s html2text-test.txt - then - have_w3m=false - AC_MSG_RESULT([no (see http://www.w3m.org/ or http://w3m.sourceforge.net/ ...)]) - W3M=false - AC_SUBST(W3M) - else - AC_MSG_RESULT([yes]) - AC_SUBST(W3M) - fi -fi -AM_CONDITIONAL([HAVE_W3M], [$have_w3m]) - -]) diff --git a/gphoto-m4/gp-packaging.m4 b/gphoto-m4/gp-packaging.m4 deleted file mode 100644 index 6ea9e0472..000000000 --- a/gphoto-m4/gp-packaging.m4 +++ /dev/null @@ -1,59 +0,0 @@ -AC_DEFUN([GPKG_CHECK_LINUX], -[ - # effective_target has to be determined in advance - AC_REQUIRE([AC_NEED_BYTEORDER_H]) - - is_linux=false - case "$effective_target" in - *linux*) - is_linux=true - ;; - esac - AM_CONDITIONAL([HAVE_LINUX], ["$is_linux"]) - - # required for docdir - # FIXME: Implicit dependency - # AC_REQUIRE(GP_CHECK_DOC_DIR) - - AC_ARG_WITH([hotplug-doc-dir], - [AS_HELP_STRING([--with-hotplug-doc-dir=PATH], - [Where to install hotplug scripts as docs [default=autodetect]])]) - - if "$is_linux"; then - AC_MSG_CHECKING([for hotplug doc dir]) - if test "x${with_hotplug_doc_dir}" != "x" - then # given as parameter - hotplugdocdir="${with_hotplug_doc_dir}" - AC_MSG_RESULT([${hotplugdocdir} (from parameter)]) - else # start at docdir - hotplugdocdir="${docdir}/linux-hotplug" - AC_MSG_RESULT([${hotplugdocdir} (default)]) - fi - else - hotplugdocdir="" - fi - - AC_ARG_WITH([hotplug-usermap-dir], - [AS_HELP_STRING([--with-hotplug-usermap-dir=PATH], - [Where to install hotplug scripts as docs [default=autodetect]])]) - - if "$is_linux"; then - AC_MSG_CHECKING([for hotplug usermap dir]) - if test "x${with_hotplug_usermap_dir}" != "x" - then # given as parameter - hotplugusermapdir="${with_hotplug_usermap_dir}" - AC_MSG_RESULT([${hotplugusermapdir} (from parameter)]) - else # start at docdir - hotplugusermapdir="${docdir}/linux-hotplug" - AC_MSG_RESULT([${hotplugusermapdir} (default)]) - fi - else - hotplugusermapdir="" - fi - - # Let us hope that automake does not create "" directories - # on non-Linux systems now. - AC_SUBST([hotplugdocdir]) - AC_SUBST([hotplugusermapdir]) -]) - diff --git a/gphoto-m4/gp-pedantic-compiler-flags.m4 b/gphoto-m4/gp-pedantic-compiler-flags.m4 deleted file mode 100644 index 1b690428c..000000000 --- a/gphoto-m4/gp-pedantic-compiler-flags.m4 +++ /dev/null @@ -1,208 +0,0 @@ -dnl #################################################################### -dnl GP_PEDANTIC_COMPILER_FLAGS & Co. -dnl #################################################################### -dnl -dnl -dnl #################################################################### -dnl GP_CONDITIONAL_COMPILE_FLAGS(FLAG_VAR, FLAGS) -dnl #################################################################### -AC_DEFUN([GP_CONDITIONAL_COMPILE_FLAGS], [dnl -dnl -# BEGIN $0($@) -dnl -m4_pushdef([the_lang], - [m4_case([$1], - [CFLAGS], [C], - [CXXFLAGS], [C++], - [m4_fatal([unhandled compiler flags variable: ][$1])])])dnl -dnl -AC_LANG_PUSH(the_lang)dnl -dnl -dnl If $2 is a warning option, normalize it, as -Wno-foo will compile -dnl successfully, regardless of whether the compiler even knows the -dnl -Wfoo warning. FIXME: Split $2 and operate on each part? -m4_pushdef([normalized_option], - [m4_bpatsubst([$2], - [^-W\(no-\)?\(error=\)?\([-_0-9a-zA-Z=]+\)$], - [-W\3])])dnl -dnl -saved_$1="${$1}" -$1="${saved_$1} normalized_option -Werror" -AC_MSG_CHECKING([whether $1 can append $2]) -AC_COMPILE_IFELSE([dnl -m4_case(the_lang, [C], [dnl -AC_LANG_SOURCE([[ -#include <stdio.h> -int main(int argc, char *argv[]) -{ - int i; - /* Use argc and argv to prevent warning about unused function params */ - for (i=0; i<argc; ++i) { - printf(" %d %s\n", i, argv[i]); - } - return 0; -} -]])dnl -], [C++], [dnl -AC_LANG_SOURCE([[ -#include <iostream> -int main(int argc, char *argv[]) -{ - int i; - /* Use argc and argv to prevent warning about unused function params */ - for (i=0; i<argc; ++i) { - std::cout << " " << i << " " << argv[i] << std::endl; - } - return 0; -} -]])dnl -], [m4_fatal([unhandled language ]the_lang)])dnl -], [dnl - AC_MSG_RESULT([yes]) - $1="${saved_$1} $2" -], [dnl - AC_MSG_RESULT([no]) - gp_have_pedantic_compiler=no - $1="$saved_$1" -]) -m4_popdef([normalized_option])dnl -AC_LANG_POP(the_lang)dnl -m4_popdef([the_lang])dnl -# END $0($@) -])dnl -dnl -dnl -dnl #################################################################### -dnl Params: -dnl $1 Depending on the language, CFLAGS or CXXFLAGS -dnl $2 The flag variable the caller wants us to set -dnl $3 The AM_CONDITIONAL the caller wants us to set -dnl $4 The -std= argument (such as -std=c++98 or -std=c99) -dnl #################################################################### -AC_DEFUN([__GP_PEDANTIC_COMPILER_FLAGS], [dnl -# BEGIN $0($@) -gp_have_pedantic_compiler=yes -GP_CONDITIONAL_COMPILE_FLAGS([$1], [$4])dnl -AS_VAR_IF([gp_have_pedantic_compiler], [yes], [dnl - GP_CONDITIONAL_COMPILE_FLAGS([$1], [-pedantic -Wall -Wextra -Werror])dnl -]) -AM_CONDITIONAL([$3], [test "x$gp_have_pedantic_compiler" = "xyes"]) -AC_SUBST([$2], ["[$]$1"]) -AC_MSG_CHECKING([whether to test pedantic ][$4]) -AM_COND_IF([$3], [dnl - AC_MSG_RESULT([yes]) -], [dnl - AC_MSG_RESULT([no]) -]) -# END $0($@) -])dnl -dnl -dnl -dnl #################################################################### -dnl Params: -dnl $1 Depending on the language, CFLAGS or CXXFLAGS -dnl $2 The variable/conditional component the caller wants us to use -dnl $3 The -std= argument (such as -std=c++98 or -std=c99) -dnl #################################################################### -m4_pattern_allow([GP_PEDANTIC_CFLAGS_])dnl -m4_pattern_allow([GP_PEDANTIC_CXXFLAGS_])dnl -m4_pattern_allow([GP_HAVE_PEDANTIC_FLAGS_])dnl -m4_pattern_allow([GP_CONDITIONAL_COMPILE_FLAGS])dnl -AC_DEFUN([_GP_PEDANTIC_COMPILER_FLAGS], [dnl -# BEGIN $0($@) -gp_compiler_flags_saved_$1="[$]$1" -$1="" -__GP_PEDANTIC_COMPILER_FLAGS([$1], - [GP_PEDANTIC_][$1][_][$2], - [GP_HAVE_PEDANTIC_FLAGS_][$2], - [$3]) -GP_PEDANTIC_$1_$2="[$]$1" -$1="[$]gp_compiler_flags_saved_$1" -# END $0($@) -])dnl -dnl -dnl -dnl #################################################################### -dnl GP_PEDANTIC_COMPILER_FLAGS(VAR_COMPONENT, LANG, std-arg) -dnl Start a new series of compiler flags -dnl #################################################################### -AC_DEFUN([GP_PEDANTIC_COMPILER_FLAGS], [dnl -# BEGIN $0($@) -AC_LANG_PUSH([$2]) -_GP_PEDANTIC_COMPILER_FLAGS(m4_case($2,[C],[CFLAGS],[C++],[CXXFLAGS],[m4_fatal([Unknown language given: ][$2])]), [$1], [$3]) -AC_LANG_POP([$2]) -# END $0($@) -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl GP_WITH_EMPTY_CONFDEFS_H -dnl -dnl Usage: -dnl GP_WITH_EMPTY_CONFDEFS_H([ -dnl GP_CONDITIONAL_COMPILE_FLAGS([CFLAGS], [-Wno-foo]) -dnl GP_CONDITIONAL_COMPILE_FLAGS([CFLAGS], [-Wno-bar]) -dnl ])dnl -dnl -dnl Since autoconf 2.63b, the macros defined by AC_DEFINE so far -dnl (mostly PACKAGE, VERSION, etc.) are in confdefs.h by now and are -dnl included using AC_LANG_SOURCE or AC_LANG_PROGRAM. -dnl -dnl We cannot use a confdefs.h with macro definitions for the pedantic -dnl compilation tests as that pedantic compilation might complain -dnl about macros being defined but not used. -dnl -dnl We also cannot just put AC_LANG_DEFINES_PROVIDED inside the -dnl program, as that will make sure the program starts with the -dnl current content of confdefs.h. -dnl -dnl In order to be able to test compile programs without any macro -dnl definitions from confdefs.ht, we save the original confdefs.h file -dnl and use an empty confdefs.h for our checks, then restore the -dnl original confdefs.h after our checks are done. -dnl -dnl Of course, we must not append to confdefs.h by e.g. calling -dnl AC_DEFINE or AC_DEFINE_UNQUOTED until the original confdefs.h has -dnl been restored, as those definitions would then be lost. -dnl -dnl #################################################################### -AC_DEFUN([GP_WITH_EMPTY_CONFDEFS_H], [dnl -m4_pushdef([AC_DEFINE], - [m4_fatal([Must not use AC_DEFINE inside $0])])dnl -m4_pushdef([AC_DEFINE_UNQUOTED], - [m4_fatal([Must not use AC_DEFINE_UNQUOTED inside $0])])dnl -cat confdefs.h -AC_MSG_NOTICE([saving original confdefs.h and creating empty confdefs.h]) -rm -f confdefs.h.saved -mv confdefs.h confdefs.h.saved -cat <<EOF >confdefs.h -/* confdefs.h forced empty for the pedantic compile tests */ -EOF -dnl -AC_MSG_CHECKING([CFLAGS value before]) -AC_MSG_RESULT([$CFLAGS]) -AC_MSG_CHECKING([CXXFLAGS value before]) -AC_MSG_RESULT([$CXXFLAGS]) -dnl -$1 -dnl -AC_MSG_CHECKING([CFLAGS value after]) -AC_MSG_RESULT([$CFLAGS]) -AC_MSG_CHECKING([CXXFLAGS value after]) -AC_MSG_RESULT([$CXXFLAGS]) -dnl -AC_MSG_NOTICE([restoring original confdefs.h]) -rm -f confdefs.h -mv confdefs.h.saved confdefs.h -cat confdefs.h -m4_popdef([AC_DEFINE_UNQUOTED])dnl -m4_popdef([AC_DEFINE])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-progs.m4 b/gphoto-m4/gp-progs.m4 deleted file mode 100644 index beae29b3e..000000000 --- a/gphoto-m4/gp-progs.m4 +++ /dev/null @@ -1,114 +0,0 @@ -dnl #################################################################### -dnl Find a number of common programs, but allow setting a variable -dnl to use a specific implementation. -dnl #################################################################### -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([GP_PROG_CMP])dnl -AC_DEFUN_ONCE([GP_PROG_CMP],[dnl -AC_ARG_VAR([CMP], [cmp file comparison command])dnl -AC_PATH_PROG([CMP], [cmp])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([GP_PROG_COMM])dnl -AC_DEFUN_ONCE([GP_PROG_COMM],[dnl -AC_ARG_VAR([COMM], [comm line by line comparison command])dnl -AC_PATH_PROG([COMM], [comm])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([GP_PROG_DIFF])dnl -AC_DEFUN_ONCE([GP_PROG_DIFF],[dnl -AC_ARG_VAR([DIFF], [diff file comparison command])dnl -AC_PATH_PROG([DIFF], [diff])dnl -dnl -dnl DIFF_MAYBE_U only contains -u for readability, so if diff does not -dnl support -u, we can still just run DIFF without -u. -AC_MSG_CHECKING([whether DIFF supports -u]) -:>gp-empty-file-a -:>gp-empty-file-b -AS_IF([diff -u gp-empty-file-a gp-empty-file-b], [dnl - AC_MSG_RESULT([yes]) - DIFF_MAYBE_U="${DIFF} -u" -], [dnl - AC_MSG_RESULT([no]) - DIFF_MAYBE_U="${DIFF}" -]) -rm -f gp-empty-file-a gp-empty-file-b -AC_SUBST([DIFF_MAYBE_U]) -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([GP_PROG_EXPR])dnl -AC_DEFUN_ONCE([GP_PROG_EXPR],[dnl -AC_ARG_VAR([EXPR], [expr expression evaluation command])dnl -AC_PATH_PROG([EXPR], [expr])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([GP_PROG_SLEEP])dnl -AC_DEFUN_ONCE([GP_PROG_SLEEP],[dnl -AC_ARG_VAR([SLEEP], [sleep delay command])dnl -AC_MSG_CHECKING([whether to sleep]) -AS_VAR_IF([SLEEP], [no], [dnl - AC_MSG_RESULT([no]) -], [dnl - AC_MSG_RESULT([yes]) - AC_PATH_PROG([SLEEP], [sleep])dnl -])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([GP_PROG_SORT])dnl -AC_DEFUN_ONCE([GP_PROG_SORT],[dnl -AC_ARG_VAR([SORT], [sort text file line sorting command])dnl -AC_PATH_PROG([SORT], [sort])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([^GP_PROG_TR\(])dnl -m4_pattern_forbid([^GP_PROG_TR$])dnl -AC_DEFUN_ONCE([GP_PROG_TR],[dnl -AC_ARG_VAR([TR], [tr string character translation command])dnl -AC_PATH_PROG([TR], [tr])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl #################################################################### -m4_pattern_forbid([^GP_PROG_UNIQ\(])dnl -m4_pattern_forbid([^GP_PROG_UNIQ$])dnl -AC_DEFUN_ONCE([GP_PROG_UNIQ],[dnl -AC_ARG_VAR([UNIQ], [uniq sorted file uniquification command])dnl -AC_PATH_PROG([UNIQ], [uniq])dnl -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-references.m4 b/gphoto-m4/gp-references.m4 deleted file mode 100644 index e468c83fe..000000000 --- a/gphoto-m4/gp-references.m4 +++ /dev/null @@ -1,48 +0,0 @@ -dnl -dnl Define external references -dnl -dnl Define once, use many times. -dnl No more URLs and Mail addresses in translated strings and stuff. -dnl - -AC_DEFUN([GP_REF],[ -AC_SUBST([$1],["$2"]) -AC_DEFINE_UNQUOTED([$1],["$2"],[$3]) -]) - -AC_DEFUN([GP_REFERENCES], -[ - -GP_REF( [URL_GPHOTO_HOME], - [http://www.gphoto.org/], - [gphoto project home page])dnl - -GP_REF( [URL_GPHOTO_PROJECT], - [https://github.com/gphoto], - [gphoto github project page]) - -GP_REF( [URL_DIGICAM_LIST], - [http://gphoto.org/proj/libgphoto2/support.php], - [camera list with support status]) - -GP_REF( [URL_JPHOTO_HOME], - [http://jphoto.sourceforge.net/], - [jphoto home page]) - -GP_REF( [URL_USB_MASSSTORAGE], - [http://www.linux-usb.org/USB-guide/x498.html], - [information about using USB mass storage]) - -GP_REF( [MAIL_GPHOTO_DEVEL], - [<gphoto-devel@lists.sourceforge.net>], - [gphoto development mailing list]) - -GP_REF( [MAIL_GPHOTO_USER], - [<gphoto-user@lists.sourceforge.net>], - [gphoto user mailing list]) - -GP_REF( [MAIL_GPHOTO_TRANSLATION], - [<gphoto-translation@lists.sourceforge.net>], - [gphoto translation mailing list]) - -]) diff --git a/gphoto-m4/gp-set.m4 b/gphoto-m4/gp-set.m4 deleted file mode 100644 index 444d71f76..000000000 --- a/gphoto-m4/gp-set.m4 +++ /dev/null @@ -1,753 +0,0 @@ -dnl ###################################################################### -dnl Set operations using shell -dnl ###################################################################### -dnl -dnl This implements a set of set operations ('set' in the sense of -dnl 'set theory') as shell code for use at configure time. At m4 time -dnl (aka autoreconf time), there already exists a set of m4_set_* -dnl macros, but we cannot use those for user specified and -dnl autodetected changes at configure time. -dnl -dnl Not all set operations are implemented, but a few basic ones we -dnl need for gp-camlibs.m4 are. -dnl -dnl * Basic definitions: -dnl -dnl * GP_SET_DEFINE -dnl * GP_SET_UNDEFINE -dnl -dnl * Operations on sets: -dnl -dnl * GP_SET_ADD -dnl * GP_SET_ADD_ALL -dnl * GP_SET_REMOVE -dnl -dnl * GP_SET_CARDINALITY -dnl * GP_SET_DIFFERENCE -dnl * GP_SET_UNION -dnl -dnl * GP_SET_FOREACH -dnl -dnl * Conditionals: -dnl -dnl * GP_SET_CONTAINS_IFELSE -dnl * GP_SET_EMPTY_IFELSE -dnl * GP_SET_EQUAL_IFELSE -dnl -dnl * GP_SET_CLEAN_FILES -dnl -dnl * Internals and debugging help: -dnl -dnl * GP_SET_CANONICALIZE -dnl * GP_SET_DUMP_ALL -dnl * GP_SET_TESTSUITE -dnl -dnl * Fill shell variables with set contents: -dnl -dnl * GP_SET_DEBUG_VAR -dnl * GP_SET_SPACE_VAR -dnl -dnl * Output AC_MSG_* for GP_SET_* sets: -dnl -dnl * GP_SET_DEBUG_MSG -dnl * GP_SET_MSG_DEBUG_RESULT -dnl -dnl * GP_SET_SPACE_MSG -dnl * GP_SET_MSG_SPACE_RESULT -dnl -dnl ###################################################################### -dnl Remarks on usage and implementation of GP_SET_* -dnl -dnl * Sets are stored in text files, one element per line. An empty -dnl file is an empty set, and empty lines mean empty elements. -dnl Non-empty files not ending with a newline are undefined behaviour. -dnl -dnl * At this time, GP_SET_* macros work with set elements -dnl consisting of a limited set of characters, but the storage -dnl format allows for a future code cleanup to allow for handling -dnl more arbitrarily called elements. -dnl -dnl * Set names given to GP_SET_ macros must be defined at m4 -dnl (autoreconf) time, not at sh (configure) time. -dnl -dnl * Every set must be declared before use with GP_SET_DEFINE so we -dnl can create an empty file for them and keep track of the name of -dnl that file for cleaning up later. -dnl -dnl * Use GP_SET_CLEAN_FILES after your last set operations to remove -dnl all left over set files. -dnl -dnl * Set text files may contain set elements in any order, and in -dnl any number. There is no difference between a set text file -dnl containing the same line seven times and one which only contains -dnl it one time. -dnl -dnl * Some set operations require or work better on sorted files, so -dnl sometimes the implementation sorts the set text files. If you -dnl need a set text file sorted for some another reason, use -dnl GP_SET_CANONICALIZE([set-name]). -dnl -dnl * Some set GP_SET_* operations are implemented using shell -dnl functions to reduce the size of the emitted sh code. The goal -dnl is for the shell functions to be as compatible with different -dnl shells as possible, but if necessary, we can revert to avoiding -dnl shell functions and just emitting the same sh code 40 times. -dnl -dnl -dnl ###################################################################### -dnl -dnl FIXME: Do we need a sh-based replacement for ${COMM} if it is not present? -dnl FIXME: Do we need to stop using shell functions? -dnl -dnl -dnl ###################################################################### -dnl Try catching unexpanded macros in the output. -dnl ###################################################################### -m4_pattern_forbid([GP_SET_])dnl -m4_pattern_forbid([_GP_SET_])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_INIT -dnl Called internally before any set operation. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_INIT], [dnl -AC_REQUIRE([AC_PROG_GREP])dnl -AC_REQUIRE([GP_PROG_SORT])dnl -AC_REQUIRE([GP_PROG_UNIQ])dnl -m4_set_empty([gp_set_all_sets], [], [dnl - m4_set_foreach([gp_set_all_sets], [elt], [dnl - m4_errprintn(__file__: __line__:[ Set gp_set_all_sets contains element ]elt)dnl - ])dnl - m4_errprintn(__file__:__line__:[ Error: gp_set_all_sets already defined])dnl - dnl m4_exit(1)dnl -])dnl -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_FILENAME([set_name]) -dnl _GP_SET_FILENAME([set_name], [extra-extension]) -dnl Convert set name to set file name. If present, add the given -dnl extra-extension to the file name in some position. -dnl ###################################################################### -AC_DEFUN([_GP_SET_FILENAME], [dnl -[gp-set-file--][$1]m4_if([$2],[],[],[.$2])])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_CHECK_INIT -dnl Implement the gp_set_shfn_check() shell function which checks that the -dnl given set exists and is in general working order. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_CHECK_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -gp_set_shfn_check () -{ - if test -f "[$]1"; then :; else - AC_MSG_ERROR(["Error: set [$]1 has not been defined yet"]) - fi -} # gp_set_shfn_check -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_CHECK([set_name]) -dnl Check that the given set exists and is in general working order. -dnl Works by calling the gp_set_shfn_check() shell function. -dnl ###################################################################### -AC_DEFUN([_GP_SET_CHECK], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_CHECK_INIT])dnl -gp_set_shfn_check "_GP_SET_FILENAME([$1])" -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_DUMP_ALL -dnl Dump all sets to stdout. Intended for helping with debugging. -dnl ###################################################################### -AC_DEFUN([GP_SET_DUMP_ALL], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -for setfile in gp-set-file--* -do - AS_ECHO(["Set file: ${setfile}"]) - ${SED} 's/^/ * <</; s/$/>>/' "${setfile}" -done -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_DEFINE([set_name]) -dnl Declare a set of given name, initializing it to an empty set. -dnl Not a shell function, as the emitted shell code is shorter than -dnl calling a shell function. -dnl ###################################################################### -AC_DEFUN([GP_SET_DEFINE], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -m4_set_add([gp_set_all_sets], [$1])dnl -: > "_GP_SET_FILENAME([$1])" -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_UNDEFINE([set_name]) -dnl Undefine a set of given name, removing its file. -dnl Not a shell function, as the emitted shell code is shorter than -dnl calling a shell function. -dnl ###################################################################### -AC_DEFUN([GP_SET_UNDEFINE], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -_GP_SET_CHECK([$1])dnl -rm -f "_GP_SET_FILENAME([$1])" -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_ADD_INIT -dnl Implement the gp_set_shfn_set_add() shell function which adds a given -dnl element to a given set. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_ADD_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_CHECK_INIT])dnl -gp_set_shfn_set_add () -{ - gp_set_shfn_check "[$]1" - AS_ECHO(["[$]2"]) >> "[$]1" -} # gp_set_shfn_set_add -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_ADD([set_name], [element]) -dnl Add the given element to the given set. Implemented by calling the -dnl gp_set_shfn_set_add() shell function. -dnl Note: Unlike m4_set_add, this does not handle IF-UNIQ and IF-DUP -dnl macro parameters. -dnl ###################################################################### -AC_DEFUN([GP_SET_ADD], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_ADD_INIT])dnl -gp_set_shfn_set_add "_GP_SET_FILENAME([$1])" "$2" -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_ADD_ALL([set_name], [element]...) -dnl Add the given elements to the given set, similar to m4_set_add_all. -dnl This can be very useful for initializing a GP_SET_* set from a -dnl m4_set_* in one go. -dnl Not a shell function, as the emitted shell code is shorter than -dnl calling a shell function. -dnl ###################################################################### -AC_DEFUN([GP_SET_ADD_ALL], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -_GP_SET_CHECK([$1])dnl -cat>>"_GP_SET_FILENAME([$1])"<<EOF -m4_foreach([myvar], [m4_shift($@)], [dnl -myvar -])dnl -EOF -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_REMOVE_INIT -dnl Implement the gp_set_shfn_remove() shell function removing a given -dnl element from a given set. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_REMOVE_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -gp_set_shfn_remove () -{ - gp_set_shfn_check "[$]1" - ${GREP} -v "^[$]2$" < "[$]1" > "[$]1.tmp" - mv -f "[$]1.tmp" "[$]1" -} # gp_set_shfn_remove -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_REMOVE([set_name], [element]) -dnl Remove a given element from a given set. -dnl Calls the gp_set_shfn_remove() shell function for the actual work. -dnl ###################################################################### -AC_DEFUN([GP_SET_REMOVE], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_REMOVE_INIT])dnl -gp_set_shfn_remove "_GP_SET_FILENAME([$1])" "$2" -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_UNION_INIT -dnl Define the gp_set_shfn_union() shell function which defines a -dnl result set as the union of 0 or more sets. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_UNION_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -dnl This functions uses the shell builtin 'shift', so it needs to store -dnl the original $1 in a local variable. -gp_set_shfn_union () -{ - local result_fname="[$]1" - gp_set_shfn_check "[$]result_fname" - if shift; then - cat "[$]@" > "[$]{result_fname}.tmp" - mv -f "[$]{result_fname}.tmp" "[$]{result_fname}" - fi -} # gp_set_shfn_union -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_UNION([result_set], [setname]...) -dnl Define result_set as the union of 0 or more setnames. -dnl Calls the gp_set_shfn_union() shell function for the actual work. -dnl ###################################################################### -AC_DEFUN([GP_SET_UNION], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_UNION_INIT])dnl -m4_set_add([gp_set_all_sets], [$1])dnl -gp_set_shfn_union m4_foreach([setname], [$@], [ "_GP_SET_FILENAME(setname)"]) -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_DIFFERENCE_INIT([result_set_fname], [set_fname]...) -dnl This uses comm(1), which is a POSIX command. We can always -dnl re-implement comm(1) with a lot of speed penalties in a bunch -dnl of nested sh loops if we run into a system which does not have -dnl comm(1) installed or where comm(1) does not work. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_DIFFERENCE_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_CHECK_INIT])dnl -AC_REQUIRE([_GP_SET_CANONICALIZE_INIT])dnl -AC_REQUIRE([GP_PROG_COMM])dnl -cat>confset_a.txt<<EOF -x -y -EOF -cat>confset_b.txt<<EOF -y -z -EOF -cat>confset_res_23.txt<<EOF -x -EOF -AC_MSG_CHECKING([whether comm -23 works]) -m4_pattern_allow([GP_SET_xyz])dnl mentioned in message strings -AS_IF([${COMM} -23 confset_a.txt confset_b.txt > confset_diff_23.txt], [dnl - AS_IF([${CMP} confset_diff_23.txt confset_res_23.txt > /dev/null 2>&1], [dnl - AC_MSG_RESULT([yes]) - rm -f confset_a.txt confset_b.txt confset_diff_23.txt confset_res_23.txt - ], [dnl - AC_MSG_RESULT([no (wrong result)]) - AC_MSG_ERROR([comm -23 must work for GP_SET_xyz difference calculations]) - ]) -], [dnl - AC_MSG_RESULT([no (does not run)]) - AC_MSG_ERROR([comm -23 must work for GP_SET_xyz difference calculations]) -]) -dnl This functions uses the shell builtin 'shift', so it needs to store -dnl the original $1 and $2 in local variables. -gp_set_shfn_difference () -{ - local result_fname="[$]1" - gp_set_shfn_check "[$]result_fname" - if shift; then - gp_set_shfn_canonicalize "[$]1" - cat "[$]1" > "[$]result_fname" - if shift; then - for gp_s - do - gp_set_shfn_canonicalize "[$]gp_s" - ${COMM} -23 "[$]{result_fname}" "[$]gp_s" > "[$]{result_fname}.tmp" - mv -f "[$]{result_fname}.tmp" "[$]{result_fname}" - done - fi - fi -} # gp_set_shfn_difference -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_DIFFERENCE([result_set], [setname]...) -dnl Define result_set as the first setname with the element of all -dnl the other sets removed from it. -dnl ###################################################################### -AC_DEFUN([GP_SET_DIFFERENCE], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_DIFFERENCE_INIT])dnl -m4_set_add([gp_set_all_sets], [$1])dnl -gp_set_shfn_difference m4_foreach([setname], [$@], [ "_GP_SET_FILENAME(setname)"]) -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_CARDINALITY_INIT -dnl Define gp_set_shfn_cardinality() shell function which writes -dnl set cardinality to stdout. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_CARDINALITY_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -gp_set_shfn_cardinality () -{ - gp_set_shfn_check "[$]1" - wc -l < "[$]1" -} # gp_set_shfn_cardinality -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_CARDINALITY([set_name]) -dnl Write set cardinality to stdout. -dnl ###################################################################### -AC_DEFUN([GP_SET_CARDINALITY], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_CARDINALITY_INIT])dnl -gp_set_shfn_cardinality "_GP_SET_FILENAME([$1])"])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_EMPTY_IFELSE([set_name], [if-empty], [if-not-empty]) -dnl Run if-empty block or if-not-empty block, depending on whether -dnl the named set is empty or not. -dnl ###################################################################### -AC_DEFUN([GP_SET_EMPTY_IFELSE], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -_GP_SET_CHECK([$1])dnl -AS_IF([test "0" -eq "$(wc -l < "_GP_SET_FILENAME([$1])")"], m4_shift($@)) -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_EQUAL_IFELSE([set_a], [set_b], [if-equal], [if-not-equal]) -dnl When set_a and set_b are equal, run the if-equal block. Otherwise, -dnl run the if-not-equal block. -dnl ###################################################################### -AC_DEFUN([GP_SET_EQUAL_IFELSE], [dnl -gp_set_shfn_canonicalize "_GP_SET_FILENAME([$1])" -gp_set_shfn_canonicalize "_GP_SET_FILENAME([$2])" -AS_IF([${CMP} "_GP_SET_FILENAME([$1])" "_GP_SET_FILENAME([$2])" > /dev/null 2>&1], - m4_shift2($@)) -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_CONTAINS_IFELSE([set_name], [element], [yes-block], [no-block]) -dnl If set_name contains element, run the yes-block. Otherwise, -dnl run the no-block. -dnl ###################################################################### -AC_DEFUN([GP_SET_CONTAINS_IFELSE], [dnl -_GP_SET_CHECK([$1])dnl -AS_IF([test "0" -lt "$(${GREP} -c "^$2\$" < "_GP_SET_FILENAME([$1])")"], - m4_shift2($@)) -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_DEBUG_VAR_INIT -dnl Define gp_set_shfn_debug_var() shell function which sets a shell -dnl variable to a string representing a human readable form for of -dnl the given set. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_DEBUG_VAR_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -gp_set_shfn_debug_var () -{ - gp_set_shfn_check "[$]1" - gp_set_shfn_canonicalize "[$]1" - local element - local gp_set_is_first=: - local gp_set_saved_ifs="$IFS" - IFS="" - while read element - do - if "$gp_set_is_first" - then - eval "[$]2=\"{ \"" - gp_set_is_first=false - else - eval "[$]2=\"\${[$]2}, \"" - fi - if test "x$element" = "x" - then - eval "[$]2=\"\${[$]2}''\"" - else - eval "[$]2=\"\${[$]2}'\$element'\"" - fi - done < "[$]1" - IFS="$gp_set_saved_ifs" - if "$gp_set_is_first" - then - eval "[$]2=\"{ }\"" - else - eval "[$]2=\"\${[$]2} }\"" - fi -} # gp_set_shfn_debug_var -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_DEBUG_VAR([set_name], [shell_var_name]) -dnl Set shell variable shell_var_name to a string representing a human -dnl readable for of the given set. -dnl ###################################################################### -AC_DEFUN([GP_SET_DEBUG_VAR], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_DEBUG_VAR_INIT])dnl -gp_set_shfn_debug_var "_GP_SET_FILENAME([$1])" "$2" -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_DEBUG_MSG([set-name]) -dnl For a given set, expand to a simple pair of AC_MSG_CHECKING and -dnl AC_MSG_RESULT showing the GP_SET_DEBUG_VAR, mostly to help with -dnl debugging. -dnl ###################################################################### -AC_DEFUN([GP_SET_DEBUG_MSG], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_MSG_CHECKING([value of set ]$1) -GP_SET_MSG_DEBUG_RESULT([$1]) -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_SPACE_MSG([set-name]) -dnl For a given set, expand to a simple pair of AC_MSG_CHECKING and -dnl AC_MSG_RESULT showing the GP_SET_SPACE_VAR, both to help with -dnl debugging gp-set.m4 and possibly for produnction use. -dnl ###################################################################### -AC_DEFUN([GP_SET_MSG], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_MSG_CHECKING([value of set ]$1) -GP_SET_MSG_RESULT([$1]) -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_SPACE_VAR([set-name], [var-name]) -dnl ###################################################################### -AC_DEFUN([GP_SET_SPACE_VAR], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -$2="" -GP_SET_FOREACH([$1], [element], [dnl -AS_IF([test "x[$]$2" = "x"], [dnl - $2="[$]element" -], [dnl - $2="[$]$2 [$]element" -]) -]) -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_MSG_RESULT([set-name]) -dnl Shortcut for setting a shell variable to a space separated list of -dnl elements, and then expanding to AC_MSG_RESULT([$shellvar]). -dnl ###################################################################### -AC_DEFUN([GP_SET_MSG_RESULT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -GP_SET_SPACE_VAR([$1], [gp_set_msg_result_var])dnl -AC_MSG_RESULT([${gp_set_msg_result_var}]) -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_MSG_DEBUG_RESULT([set-name]) -dnl Shortcut for setting a shell variable to a human readable list of -dnl elements, and then expanding to AC_MSG_RESULT([$shellvar]). -dnl ###################################################################### -AC_DEFUN([GP_SET_MSG_DEBUG_RESULT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -GP_SET_DEBUG_VAR([$1], [gp_set_msg_result_var])dnl -AC_MSG_RESULT([${gp_set_msg_result_var}]) -])dnl -dnl -dnl -dnl ###################################################################### -dnl _GP_SET_CANONICALIZE_INIT -dnl Implement the gp_set_shfn_canonicalize() shell function. -dnl ###################################################################### -AC_DEFUN_ONCE([_GP_SET_CANONICALIZE_INIT], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -gp_set_shfn_canonicalize () -{ - gp_set_shfn_check "[$]1" - ( set -e - [$]{SORT} < "[$]1" | [$]{UNIQ} > "[$]1.tmp" - mv -f "[$]1.tmp" "[$]1"; ) -} # gp_set_shfn_canonicalize -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_CANONICALIZE([set_name]) -dnl Convert the set file for set_name into a canonical form. -dnl -dnl Implementation detail: Sorts the lines, and makes them unique. -dnl ###################################################################### -AC_DEFUN([GP_SET_CANONICALIZE], [dnl -AC_REQUIRE([_GP_SET_INIT])dnl -AC_REQUIRE([_GP_SET_CANONICALIZE_INIT])dnl -gp_set_shfn_canonicalize "_GP_SET_FILENAME([$1])" -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_FOREACH([set_name], [shell-var], [shell-block]) -dnl For each element in set_name, run the shell-block with the given -dnl shell variable set to every element in turn. -dnl ###################################################################### -AC_DEFUN([GP_SET_FOREACH], [dnl -_GP_SET_CHECK([$1])dnl -gp_set_saved_ifs="$IFS" -IFS="" -while read $2 -do - IFS="$gp_set_saved_ifs" - $3 -done < "_GP_SET_FILENAME([$1])" -IFS="$gp_set_saved_ifs" -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_CLEAN_FILES -dnl Remove all the files used for storing sets. Invoke this macro near -dnl the end of configure.ac after you have finished doing anything with -dnl GP_SET_* sets. -dnl ###################################################################### -AC_DEFUN([GP_SET_CLEAN_FILES], [dnl -AC_BEFORE([_GP_SET_INIT], [$0])dnl -AC_BEFORE([GP_SET_DEFINE], [$0])dnl -AC_BEFORE([GP_SET_UNDEFINE], [$0])dnl -AC_BEFORE([GP_SET_ADD], [$0])dnl -AC_BEFORE([GP_SET_ADD_ALL], [$0])dnl -AC_BEFORE([GP_SET_REMOVE], [$0])dnl -AC_BEFORE([GP_SET_EMPTY_IFELSE], [$0])dnl -AC_BEFORE([GP_SET_EQUAL_IFELSE], [$0])dnl -AC_BEFORE([GP_SET_CONTAINS_IFELSE], [$0])dnl -AC_BEFORE([GP_SET_DEBUG_VAR], [$0])dnl -AC_BEFORE([GP_SET_SPACE_VAR], [$0])dnl -dnl -dnl GP_SET_DUMP_ALL()dnl -dnl -dnl m4_set_foreach([gp_set_all_sets], [set_name], [dnl -dnl AS_ECHO(["Set defined somewhere: set_name"]) -dnl ])dnl -dnl -[rm -f]m4_set_foreach([gp_set_all_sets], [setname], - [ "_GP_SET_FILENAME(setname)"])dnl -])dnl -dnl -dnl -dnl ###################################################################### -dnl GP_SET_TESTSUITE() -dnl Does a number of tests for the GP_SET_* macros. -dnl -dnl Should be mostly useful while debugging gp-set.m4 itself. -dnl ###################################################################### -AC_DEFUN([GP_SET_TESTSUITE], [dnl -# BEGIN $0 -_GP_SET_INIT - -GP_SET_DEFINE([foo]) -GP_SET_DEFINE([bar]) -GP_SET_DEFINE([foobar]) -GP_SET_DEFINE([everything]) - -GP_SET_DEBUG_MSG([foo]) - -GP_SET_DEFINE([bax]) -GP_SET_UNDEFINE([bax]) - -GP_SET_UNDEFINE([bar]) -GP_SET_DEFINE([bar]) - -dnl GP_SET_ADD([moo], [meh]) -GP_SET_ADD_ALL([everything], [foo], [bar], [bar ], [bla]) - -GP_SET_DUMP_ALL - -m4_set_add_all([m4testset], [a], [b c], [d e], [f], [g]) -AC_MSG_CHECKING([for value of m4 testset]) -AC_MSG_RESULT([m4_set_contents([m4testset], [, ])]) - -GP_SET_ADD_ALL([everything]m4_set_listc([m4testset])) - -GP_SET_DUMP_ALL - -GP_SET_ADD([foo], [barfoo]) -GP_SET_ADD([foo], [foobar]) -GP_SET_ADD([foo], [fox]) -GP_SET_ADD([foo], [fux]) -GP_SET_ADD([foo], [fox]) -GP_SET_ADD([foo], []) -GP_SET_ADD([foo], [fox]) -GP_SET_ADD([foo], [barfoo]) -GP_SET_ADD([foo], [ barfoo]) -GP_SET_ADD([foo], ["barfoo "]) -GP_SET_ADD([foo], []) -GP_SET_REMOVE([foo], [fox]) -GP_SET_ADD([foo], [barfoo]) - -GP_SET_ADD([foobar], [bar]) -GP_SET_ADD([foobar], [foobar]) -GP_SET_ADD([foobar], [barfoo]) - -GP_SET_DEBUG_MSG([foo]) - -GP_SET_MSG([bar]) -GP_SET_MSG([foo]) -GP_SET_MSG([foobar]) -GP_SET_MSG([everything]) - -GP_SET_DEFINE([union]) -GP_SET_UNION([union], [foo], [bar], [foobar]) -AC_MSG_CHECKING([value of union of foo bar foobar]) -GP_SET_MSG_RESULT([union]) - -GP_SET_DEFINE([difference]) -GP_SET_DIFFERENCE([difference], [foo], [bar], [foobar]) -GP_SET_MSG([difference]) - -AC_MSG_CHECKING([whether sets foo and bar are equal]) -GP_SET_EQUAL_IFELSE([foo], [bar], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) - -AC_MSG_CHECKING([whether set foo is empty]) -GP_SET_EMPTY_IFELSE([foo], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) - -AC_MSG_CHECKING([whether set bar is empty]) -GP_SET_EMPTY_IFELSE([bar], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) - -AC_MSG_CHECKING([whether set foo contains element bar]) -GP_SET_CONTAINS_IFELSE([foo], [bar], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) - -AC_MSG_CHECKING([whether set foobar contains element bar]) -GP_SET_CONTAINS_IFELSE([foobar], [bar], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) - -GP_SET_FOREACH([foobar], [gp_set_var], [dnl - AC_MSG_CHECKING([foobar element]) - AC_MSG_RESULT([${gp_set_var}]) -])dnl -GP_SET_FOREACH([foobar], [gp_set_var], [dnl - AS_ECHO([" * element ${gp_set_var}"]) -])dnl -GP_SET_FOREACH([foobar], [gp_set_var], [echo " * ELEMENT ${gp_set_var}"])dnl -AS_ECHO(["Moo."]) - -GP_SET_DUMP_ALL -# END $0 -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-sleep.m4 b/gphoto-m4/gp-sleep.m4 deleted file mode 100644 index 2c4014892..000000000 --- a/gphoto-m4/gp-sleep.m4 +++ /dev/null @@ -1,28 +0,0 @@ -dnl #################################################################### -dnl GP_SLEEP(delay_in_whole_seconds) -dnl If the SLEEP variable is set to "no" or empty or is unset, -dnl do not sleep. -dnl If the SLEEP variable is set to something else, run that something -dnl else with the given delay value. -dnl #################################################################### -AC_DEFUN_ONCE([_GP_SLEEP_INIT], [dnl -AC_REQUIRE([GP_PROG_SLEEP])dnl -AS_IF([test "x$SLEEP" != "x" && test "x$SLEEP" != "xno"], [dnl -gp_sleep=[$]SLEEP -], [dnl -gp_sleep=: -]) -])dnl -dnl -dnl -AC_DEFUN([GP_SLEEP], [dnl -AC_REQUIRE([_GP_SLEEP_INIT])dnl -$gp_sleep $1 -])dnl -dnl -dnl -dnl #################################################################### -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gp-subpackage.m4 b/gphoto-m4/gp-subpackage.m4 deleted file mode 100644 index afabd8b17..000000000 --- a/gphoto-m4/gp-subpackage.m4 +++ /dev/null @@ -1,5 +0,0 @@ -AC_DEFUN([GP_SUBPACKAGE], -[ -AC_ARG_VAR([enable_subpackage_][$1], [enable subpackage ][$1][ (true or false)]) -test "x${[enable_subpackage_][$1]}" = "x" && [enable_subpackage_][$1]=true -])dnl diff --git a/gphoto-m4/gp-udev.m4 b/gphoto-m4/gp-udev.m4 deleted file mode 100644 index ef5ecb52c..000000000 --- a/gphoto-m4/gp-udev.m4 +++ /dev/null @@ -1,9 +0,0 @@ -dnl Determines whether UDEV code should be compiled. -dnl $1 contains shell code that returns 0 if all other prerequisites (like -dnl libusb) are available. -AC_DEFUN([GP_UDEV],[dnl -if test "x${udevscriptdir}" = "x"; then udevscriptdir="\${libdir}/udev"; fi -AC_ARG_VAR([udevscriptdir],[Directory where udev scripts like check-ptp-camera will be installed]) -AC_SUBST([udevscriptdir]) -AM_CONDITIONAL([HAVE_UDEV],[if echo "$host"|grep -i linux >/dev/null ; then $1; fi ]) -])dnl diff --git a/gphoto-m4/gp-va-copy.m4 b/gphoto-m4/gp-va-copy.m4 deleted file mode 100644 index 8b1ac85c7..000000000 --- a/gphoto-m4/gp-va-copy.m4 +++ /dev/null @@ -1,57 +0,0 @@ -dnl @synopsis GP_VA_COPY -dnl -dnl Checks whether one of these compiles and links: -dnl 1. va_copy() -dnl 2. __va_copy() -dnl 3. fallback -dnl -dnl In case of 1 or 2, AC_DEFINE(HAVE_VA_COPY). -dnl In case of 2, AC_DEFINE(va_copy,__va_copy) -dnl -dnl In code, use it like this -dnl #ifdef HAVE_VA_COPY -dnl ... code with va_copy ... -dnl #else -dnl ... code without va_copy or with error ... -dnl #endif -dnl -AC_DEFUN([GP_VA_COPY],[dnl -dnl -AC_CHECK_HEADER([stdarg.h],[],[ - AC_MSG_ERROR([ -Building $PACKAGE_NAME requires <stdarg.h>. -]) -]) -dnl -have_va_copy=no -AC_TRY_LINK([ - #include <stdarg.h> -],[ - va_list a,b; - va_copy(a,b); -],[ - have_va_copy="va_copy" -],[ - AC_TRY_LINK([ - #include <stdarg.h> - ],[ - va_list a,b; - __va_copy(a,b); - ],[ - have_va_copy="__va_copy" - AC_DEFINE([va_copy],[__va_copy],[__va_copy() was the originally proposed name]) - ]) -]) -dnl -AC_MSG_CHECKING([for va_copy() or replacement]) -AC_MSG_RESULT([$have_va_copy]) -dnl -if test "x$have_va_copy" != "xno"; then - AC_DEFINE([HAVE_VA_COPY],1,[Whether we have the va_copy() function]) -fi -])dnl -dnl -dnl -dnl Local Variables: -dnl mode: autoconf -dnl End: diff --git a/gphoto-m4/gphoto-m4-sync b/gphoto-m4/gphoto-m4-sync deleted file mode 100755 index f324d4dfc..000000000 --- a/gphoto-m4/gphoto-m4-sync +++ /dev/null @@ -1,551 +0,0 @@ -#!/usr/bin/env python3 -# -# Usage: gphoto-m4-sync [--diff] <dir>... -# gphoto-m4-sync --help -# -# The gphoto-m4-sync script helps with keeping track of which files in -# which gphoto-m4 tree copy differ from the original gphoto-m4 tree. -# -# In normal operation, gphoto-m4-sync will search for gphoto-m4 -# directories anywhere in the directory trees given on the command -# line and compare the gphoto-m4 tree from which gphoto-m4-sync was -# started to those other trees. -# -# When not given a --diff options, gphoto-m4-sync will print a human -# readable report on which files are different in which gphoto-m4 -# tree. -# -# Options: -# -# --diff Print a list of 'diff' command lines to compare -# the different files instead. Pipe into something like -# "| sh | less" to execute. -# -# --help Print this help message. -# -# Exit code: -# -# 0 when no differences have been found among the gphoto-m4 trees -# 1 when any differences have been found among the gphoto-m4 trees -# 2 any other error - - -######################################################################## - - -import hashlib -import os -import sys - - -######################################################################## - - -class File(object): - - def __init__(self, tree, fname): - self.tree = tree - self.fname = fname - self.fpath = os.path.join(tree.top, fname) - - self.statinfo = os.stat(self.fpath) - - m = hashlib.sha1() - m.update(open(self.fpath, 'rb').read()) - self.digest = m.hexdigest() - - def __repr__(self): - return 'File(%s,%s)' % (repr(self.fname), repr(self.digest)) - - def __str__(self): - return '%s %s' % (self.digest, self.fname) - - -######################################################################## - - -class BaseTree(object): - - def __init__(self, top): - self.top = os.path.abspath(top) - self._files = self.__scan_files() - - def __repr__(self): - return '%s(%s)[%s]' % (self.__class__.__name__, self.top, self._files) - - def __iter__(self): - return sorted(self._files).__iter__() - - def __getitem__(self, key): - return self._files[key] - - def __scan_files(self): - files = {} - for dirpath, dirnames, filenames in os.walk(self.top, topdown=True): - try: # do not descend into these directories - dirnames.remove('.git') - except ValueError: - pass - - for fname in filenames: - # Ignore a bunch of files - if fname[-1] == '~': - continue - if fname.startswith('.git'): - continue - if fname in ['Makefile.in', 'Makefile']: - continue - - abs_fname = os.path.join(dirpath, fname) - rel_fname = os.path.relpath(abs_fname, start=self.top) - - files[rel_fname] = File(self, rel_fname) - return files - - -######################################################################## - - -class GitTree(BaseTree): - - def __init__(self, top): - path = os.path.join(top, '.git') - if not os.path.exists(path): - raise AssertionError("File or directory does not exist: %s" % - repr(path)) - super(GitTree, self).__init__(top) - - -######################################################################## - - -class NotGitTree(BaseTree): - - def __init__(self, top): - path = os.path.join(top, '.git') - if os.path.exists(path): - raise AssertionError("File or directory does exist: %s" % - repr(path)) - super(NotGitTree, self).__init__(top) - - -######################################################################## - - -def scan_tree(top): - for dirpath, dirnames, filenames in os.walk(top): - if os.path.basename(dirpath) == 'gphoto-m4': - if 'gp-camlibs.m4' not in filenames: - continue - yield (dirpath, NotGitTree(dirpath)) - - -######################################################################## - - -def print_help(): - skip_line = True - skip_lines = ['#', '# '] - for line in open(__file__, 'r'): - if line[-1] == '\n': - line = line[:-1] - - if line.startswith('#!'): - continue - elif skip_line and (line in skip_lines): - continue - elif skip_line and (line not in skip_lines): - skip_line = False - elif line == '': - break - - if not skip_line: - print(line[2:]) - - -######################################################################## - - -class ResultTable(object): - - def __init__(self): - self.lines = {} - self.files_with_differences = 0 - self.differences = 0 - - def __setitem__(self, key, value): - assert(key not in self.lines) - self.lines[key] = value - if value.file_versions > 0: - self.files_with_differences += 1 - self.differences += value.file_versions - - def __getitem__(self, key): - assert(self.files_with_differences != None) - return self.lines[key] - - def items(self): - for k in sorted(self.lines.keys()): - v = self.lines[k] - yield k,v - - def close(self): - pass - - -######################################################################## - - -class ResultLine(object): - - def __init__(self, fname): - self.fname = fname - - self.__digest_map = {} - self.__digests = {} - self.__digest_list = None - - self.__flags = {} - - self.__fpaths = {} - - def set_digest(self, index, digest): - self.__digest_map[index] = digest - self.__digests[digest] = True - - def close(self, file_versions): - self.file_versions = file_versions - self.__digest_list = sorted(self.__digests.keys()) - assert(len(self.__digest_list) > 0) - if file_versions == 0: - # All files are equal, so we do not need different characters - # to distinguish different digest values - a space will do as - # well. - self.__digest_map = {} - - def get_digest(self, index): - if self.__digest_list == None: - raise RuntimeError("You need to call ResultLine.close() before Result_Line.get_digest()") - if index in self.__digest_map: - dig = self.__digest_map[index] - idx = self.__digest_list.index(dig) - return 'abcdefghijklmnopqrstuvwxyz'[idx] - else: - return ' ' - - def set_flag(self, index, flag, fpath): - self.__flags[index] = flag - self.__fpaths[index] = fpath - - def get_flag(self, index): - return self.__flags[index] - - def get_fpath(self, index): - return self.__fpaths[index] - - -######################################################################## - - -def cmd_print_report(result_table, all_files, treelist, trees): - # Enumerate list of trees - print("Trees (0 is the original tree):") - for i, tree in enumerate(treelist): - print(" %d. %s" % (i,tree)) - print() - - # Determine maximum length of file name - fn_maxlen = 0 - for fn in all_files: - if len(fn) > fn_maxlen: - fn_maxlen = len(fn) - - fmt = " %%-%ds " % fn_maxlen - print("File table:") - - # print table head - print(fmt % '', end='') - print((' {0:-^%d}' % (3*len(treelist)-1)).format('Tree')) - print(fmt % 'file name', end='') - for i, tree in enumerate(treelist): - print(' %2d' % i, end='') - print(' file diffs') - sep_line = (' ' + - '-' * (fn_maxlen + 1 + 3*len(treelist) + 2 + len('file diffs'))) - print(sep_line) - - # print table body - for fname in sorted(all_files): - result_line = result_table[fname] - print(fmt % fname, end='') - print(" %s%s" % (result_line.get_flag(0), - result_line.get_digest(0)), end='') - - for tree_idx, tree_top in enumerate(sorted(trees.keys()), start=1): - tree = trees[tree_top] - print(" %s%s" % (result_line.get_flag(tree_idx), - result_line.get_digest(tree_idx)), end='') - - if result_line.file_versions > 0: - print(' %3d' % result_line.file_versions) - else: - print(' ok') - print(sep_line) - print() - - print("Legend:") - legend = [ - ('N', 'new file'), - ('O', 'original file'), - ('/', 'no such file'), - ('=', 'same content as the original file'), - ('<', 'file with different content is younger than original file'), - ('>', 'file with different content is older than original file'), - ] - for ch, descr in legend: - print(" %s %s" % (ch, descr)) - print(" ") - print(" Small letters identify file contents: Same letter means same content.") - print() - - # Determine exit code - exit_code = 0 - if result_table.differences > 0: - exit_code = 1 - - # Print summary - print("Summary:") - if result_table.differences > 0: - print(" About %d difference(s) found in %d file(s)." % - (result_table.differences, result_table.files_with_differences)) - print(" ") - print(" Diff commands for comparing differing files can be obtained with the") - print(" '--diff' option.") - else: - print(" All gphoto-m4 trees are equal.") - - # Finally exit. - sys.exit(exit_code) - - -######################################################################## - - -def print_diff_commands(diff_commands): - print("#!/bin/sh") - print("#") - print("# This file has been autogenerated by %s" % __file__) - print("#") - print("# List of diff commands. You can pipe these into") - print("# | sh | colordiff | less -r '+/comparing '") - print("# or") - print("# | sh | less '+/^comparing '") - print("# or") - print("# | less") - for fname, orig_dig, other_dig, orig_fpath, other_fpath in diff_commands: - if orig_fpath: - orig_label = "%s (digest '%s')" % (orig_fpath, orig_dig) - else: - orig_fpath = '/dev/null' - orig_label = '(no such file)' - - if other_dig: - other_label = "%s (digest '%s')" % (other_fpath, other_dig) - else: - other_label = other_fpath - - print() - print("""echo 'comparing fname %s'""" % fname) - print("""diff -u --label "%s" %s --label "%s" %s""" - % (orig_label, orig_fpath, - other_label, other_fpath)) - - -######################################################################## - - -def gphoto_m4_sync(dir_list, print_diffs): - - # List all files in this clone of the `gphoto-m4` repository - orig_top = os.path.dirname(os.path.abspath(__file__)) - orig_tree = GitTree(orig_top) - - # For each `gphoto-m4` directory given on the command line, find - # all files. - trees = {} - for top in dir_list: - for dirpath, tree in scan_tree(os.path.abspath(top)): - trees[dirpath] = tree - - if len(trees) == 0: - print("No gphoto-m4 trees found in directories given on command line.") - sys.exit(2) - - - # Make a list of all files within all `gphoto-m4` trees - all_files = {} - for i in orig_tree: - all_files[i] = True - for tree in trees.values(): - for i in tree: - all_files[i] = True - all_files = sorted(all_files.keys()) - - # calculate table values - diff_params = [] - result_table = ResultTable() - for fname in sorted(all_files): - result_line = ResultLine(fname) - file_diffs = 0 - if fname in orig_tree: - result_line.set_flag(0, 'O', orig_tree[fname].fpath) - orig_dig = orig_tree[fname].digest - result_line.set_digest(0, orig_dig) - else: - result_line.set_flag(0, '/', None) - orig_dig = None - - comp_digs = {} - for tree_idx, tree_top in enumerate(sorted(trees.keys()), start=1): - tree = trees[tree_top] - if fname in tree: - dig = tree[fname].digest - flag = 'N' - if orig_dig == dig: - flag = '=' - elif orig_dig: - if tree[fname].statinfo.st_mtime > orig_tree[fname].statinfo.st_mtime: - flag = '>' - elif tree[fname].statinfo.st_mtime < orig_tree[fname].statinfo.st_mtime: - flag = '<' - result_line.set_digest(tree_idx, dig) - else: - flag = '/' - - if fname in tree: - _fpath = tree[fname].fpath - else: - _fpath = None - result_line.set_flag(tree_idx, flag, _fpath) - - if orig_dig: - if result_line.get_flag(tree_idx) != '=': - file_diffs += 1 - else: - if result_line.get_flag(tree_idx) != '/': - file_diffs += 1 - - result_line.close(file_diffs) - del file_diffs - result_table[fname] = result_line - result_table.close() - - if False: - # Diff all files - (some comparisons are unnecessary) - for fname in sorted(all_files): - result_line = result_table[fname] - orig_dig = result_line.get_digest(0) - orig_fpath = result_line.get_fpath(0) - for tree_idx, tree_top in enumerate(sorted(trees.keys()), start=1): - tree = trees[tree_top] - if result_line.get_flag(0) == 'O': - if result_line.get_flag(tree_idx) not in ['=', '/']: - diff_params.append((fname, - orig_fpath, orig_dig, - result_line.get_fpath(tree_idx), - result_line.get_digest(tree_idx))) - else: - if result_line.get_flag(tree_idx) != '/': - diff_params.append((fname, - None, None, - result_line.get_fpath(tree_idx), - None)) - - # Print report - if not print_diffs: - cmd_print_report(result_table, all_files, - [orig_top] + sorted(trees.keys()), - trees) - - # Print diffs - if print_diffs: - # print("# Calculate minimum set of diff commands:") - diff_commands = [] - for fname, result_line in result_table.items(): - line_flags = [] - if result_line.file_versions > 0: - # print("# -", fname) - all_trees = [orig_tree] + [ trees[k] for k in sorted(trees.keys()) ] - for idx_a in range(len(all_trees)): - tree_a = all_trees[idx_a] - dig_a = result_line.get_digest(idx_a) - if dig_a == ' ': - continue - # print("# tree_a", tree_a) - for idx_b in range(len(all_trees)): - tree_b = all_trees[idx_b] - dig_b = result_line.get_digest(idx_b) - if dig_a == dig_b: - continue - if dig_b == ' ': - continue - # print("# tree_b", tree_b) - flag = (fname, dig_a, dig_b) - rev_flag = (fname, dig_b, dig_a) - if flag in line_flags: - pass - elif rev_flag in line_flags: - pass - else: - line_flags.append(flag) - cmd = (fname, dig_a, dig_b, - tree_a[fname].fpath, tree_b[fname].fpath) - diff_commands.append(cmd) - break - del line_flags - # print("#") - - print_diff_commands(diff_commands) - sys.exit(0) - - -####################################################################### - - -def main(args): - if (args == []): - print_help() - sys.exit(0) - - arg_diff = False - for i, arg in enumerate(args): - if arg == '--': - i += 1 - break - elif arg == '--help': - print_help() - sys.exit(0) - elif arg == '--diff': - arg_diff = True - elif arg.startswith('--'): - raise ValueError("Unhandled command line option '%s'" % arg) - else: - assert(arg[:2] != '--') - break - - dir_list = args[i:] - if False: - print("Arguments:", dir_list) - print() - - gphoto_m4_sync(dir_list, arg_diff) - - -######################################################################## - - -if __name__ == '__main__': - main(sys.argv[1:]) - - -######################################################################## diff --git a/libgphoto2_port/Makefile.am b/libgphoto2_port/Makefile.am index 9170736a9..35e1302c8 100644 --- a/libgphoto2_port/Makefile.am +++ b/libgphoto2_port/Makefile.am @@ -26,7 +26,9 @@ bin_SCRIPTS = gphoto2-port-config # The . stands for the current dir, i.e. the iolibs to build. # Make sure the iolibs are built before running tests on them. -SUBDIRS = po libgphoto2_port . tests doc gphoto-m4 +SUBDIRS = po libgphoto2_port . tests doc + +include gphoto-m4/Makefile-files ######################################################################## diff --git a/libgphoto2_port/configure.ac b/libgphoto2_port/configure.ac index 7bcb0c90a..a20ab95ee 100644 --- a/libgphoto2_port/configure.ac +++ b/libgphoto2_port/configure.ac @@ -561,7 +561,6 @@ AC_CONFIG_FILES([ gphoto2-port-config tests/Makefile doc/Makefile - gphoto-m4/Makefile ]) AC_OUTPUT |