Incorporate some fixes to the meson build definition
Notably the missing gphoto2-endian.h generation was missing
This commit is contained in:
committed by
Marcus Meissner
parent
f5bb6c875c
commit
28958bc18a
8
examples/ambs-lgp2-frontend/meson.build
Normal file
8
examples/ambs-lgp2-frontend/meson.build
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
project('ambs-lgp2-frontend', 'c')
|
||||||
|
|
||||||
|
executable(
|
||||||
|
'ambs-lgp2-frontend',
|
||||||
|
'main.c',
|
||||||
|
dependencies: [ dependency('libgphoto2') ],
|
||||||
|
install: true,
|
||||||
|
)
|
||||||
305
libgphoto2/gphoto2-endian.h.in
Normal file
305
libgphoto2/gphoto2-endian.h.in
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
/* This file is generated automatically by configure */
|
||||||
|
/* It is valid only for the system type it has been
|
||||||
|
* generated for */
|
||||||
|
|
||||||
|
#ifndef GP_BYTEORDER_H
|
||||||
|
#define GP_BYTEORDER_H
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#mesondefine HAS_LE32TOH
|
||||||
|
#mesondefine HAS_NTOHL_ARPA_INET
|
||||||
|
#mesondefine HAS_NTOHL_NETINET_IN
|
||||||
|
#mesondefine HAS_SWAP32
|
||||||
|
#mesondefine HAS_BYTE_SWAP_LONG
|
||||||
|
#mesondefine HAS_NXSWAPLONG
|
||||||
|
|
||||||
|
/* extended byte swapping macros are already available */
|
||||||
|
#if HAS_LE32TOH
|
||||||
|
# include <machine/endian.h>
|
||||||
|
# define MACHINE_ENDIAN_INCLUDED
|
||||||
|
#elif HAS_NTOHL_ARPA_INET
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
# define __HAVE_NTOHL
|
||||||
|
#elif HAS_NTOHL_NETINET_IN
|
||||||
|
# include <netinet/in.h>
|
||||||
|
# define __HAVE_NTOHL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define generic byte swapping functions */
|
||||||
|
#if HAS_SWAP32
|
||||||
|
# if !MACHINE_ENDIAN_INCLUDED
|
||||||
|
# include <machine/endian.h>
|
||||||
|
# endif
|
||||||
|
# define swap16(x) bswap16(x)
|
||||||
|
# define swap32(x) bswap32(x)
|
||||||
|
# define swap64(x) bswap64(x)
|
||||||
|
#elif HAS_BYTE_SWAP_LONG
|
||||||
|
# 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))
|
||||||
|
#elif HAS_NXSWAPLONG
|
||||||
|
/* 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)
|
||||||
|
#elif WORDS_BIGENDIAN
|
||||||
|
/* 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))
|
||||||
|
#else
|
||||||
|
/* 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)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
|
||||||
|
#if WORDS_BIGENDIAN
|
||||||
|
/* 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)
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* 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)
|
||||||
|
|
||||||
|
/* Define the C99 standard length-specific integer types */
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 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. */
|
||||||
|
|
||||||
|
#if CAN_CAST_BYTES_TO_MEM
|
||||||
|
/* 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
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* GP_BYTEORDER_H */
|
||||||
@@ -39,6 +39,38 @@ libgphoto2_private_headers = files(
|
|||||||
'jpeg.h',
|
'jpeg.h',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
endian_dic = configuration_data()
|
||||||
|
|
||||||
|
# Look for NetBSD-style extended byte swapping macros
|
||||||
|
if cc.has_function('le32toh', prefix: '#include <machine/endian.h>')
|
||||||
|
endian_dic.set10('HAS_LE32TOH', true)
|
||||||
|
elif cc.has_function('ntohl', prefix: '#include <arpa/inet.h>')
|
||||||
|
endian_dic.set10('HAS_NTOHL_ARPA_INET', true)
|
||||||
|
elif cc.has_function('ntohl', prefix: '#include <netinet/in.h>')
|
||||||
|
endian_dic.set10('HAS_NTOHL_NETINET_IN', true)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if cc.has_function('swap32', prefix: '#include <machine/endian.h>')
|
||||||
|
endian_dic.set10('HAS_SWAP32', true)
|
||||||
|
elif cc.has_function('__byte_swap_long', prefix: '#include <sys/types.h>')
|
||||||
|
endian_dic.set10('HAS_BYTE_SWAP_LONG', true)
|
||||||
|
elif cc.has_function('NXSwapLong', prefix: '#include <machine/byte_order.h>')
|
||||||
|
endian_dic.set10('HAS_NXSWAPLONG', true)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# The i386 and compatibles can handle unaligned memory access,
|
||||||
|
# so use the optimized macros above to do this job
|
||||||
|
endian_dic.set('CAN_CAST_BYTES_TO_MEM', target_machine.cpu_family() in ['x86', 'x86_64'])
|
||||||
|
|
||||||
|
|
||||||
|
gphoto2_endian = configure_file(
|
||||||
|
input: 'gphoto2-endian.h.in',
|
||||||
|
output: '@BASENAME@',
|
||||||
|
configuration: endian_dic
|
||||||
|
)
|
||||||
|
|
||||||
|
libgphoto2_private_headers += gphoto2_endian
|
||||||
|
|
||||||
libgphoto2_lib = library(
|
libgphoto2_lib = library(
|
||||||
'gphoto2',
|
'gphoto2',
|
||||||
libgphoto2_sources,
|
libgphoto2_sources,
|
||||||
@@ -52,6 +84,7 @@ libgphoto2_lib = library(
|
|||||||
ltdl_dep,
|
ltdl_dep,
|
||||||
libexif_dep,
|
libexif_dep,
|
||||||
m_dep,
|
m_dep,
|
||||||
|
intl_dep,
|
||||||
libgphoto2_port_dep,
|
libgphoto2_port_dep,
|
||||||
config_dep,
|
config_dep,
|
||||||
],
|
],
|
||||||
@@ -69,6 +102,7 @@ libgphoto2_dep = declare_dependency(
|
|||||||
link_with: libgphoto2_lib,
|
link_with: libgphoto2_lib,
|
||||||
include_directories: [libgphoto2_root_inc, include_directories('.'),],
|
include_directories: [libgphoto2_root_inc, include_directories('.'),],
|
||||||
dependencies: [ libgphoto2_port_dep, config_dep ],
|
dependencies: [ libgphoto2_port_dep, config_dep ],
|
||||||
|
sources: gphoto2_endian,
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg.generate(
|
pkg.generate(
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ libgphoto2_port_lib = library(
|
|||||||
ltdl_dep,
|
ltdl_dep,
|
||||||
lockdev_dep,
|
lockdev_dep,
|
||||||
m_dep,
|
m_dep,
|
||||||
|
intl_dep,
|
||||||
config_dep,
|
config_dep,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ libusb_req = '>= 0.1.5'
|
|||||||
libusb1_req = '>= 1.0.0'
|
libusb1_req = '>= 1.0.0'
|
||||||
|
|
||||||
ltdl_dep = cc.find_library('ltdl', required : false)
|
ltdl_dep = cc.find_library('ltdl', required : false)
|
||||||
|
if not ltdl_dep.found()
|
||||||
|
ltdl_dep = cc.find_library('libltdl', required : false)
|
||||||
|
endif
|
||||||
libusb_dep = dependency('libusb', version: libusb_req, required: 'usb' in get_option('iolibs'))
|
libusb_dep = dependency('libusb', version: libusb_req, required: 'usb' in get_option('iolibs'))
|
||||||
libusb1_dep = dependency('libusb-1.0', version: libusb1_req, required: 'libusb1' in get_option('iolibs'))
|
libusb1_dep = dependency('libusb-1.0', version: libusb1_req, required: 'libusb1' in get_option('iolibs'))
|
||||||
lockdev_dep = cc.find_library('lockdev', required : false)
|
lockdev_dep = cc.find_library('lockdev', required : false)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
if target_machine.system() != 'linux'
|
if target_machine.system() != 'linux'
|
||||||
error('usbscsi is only available on linux.')
|
error('usbdiskdirect is only available on linux.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
shared_module('usbdiskdirect',
|
shared_module('usbdiskdirect',
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vcamera_dir = get_option('prefix') / get_option('datadir') / meson.project_name() / meson.project_version() / 'vcamera'
|
||||||
shared_module('vusb',
|
shared_module('vusb',
|
||||||
'vusb.c',
|
'vusb.c',
|
||||||
'vcamera.c',
|
'vcamera.c',
|
||||||
@@ -7,5 +8,9 @@ shared_module('vusb',
|
|||||||
install: true,
|
install: true,
|
||||||
dependencies: [
|
dependencies: [
|
||||||
libgphoto2_port_dep,
|
libgphoto2_port_dep,
|
||||||
|
libexif_dep,
|
||||||
],
|
],
|
||||||
)
|
c_args: [
|
||||||
|
'-DVCAMERADIR="@0@"'.format(vcamera_dir),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|||||||
21
meson.build
21
meson.build
@@ -12,7 +12,6 @@ project('libgphoto2', 'c',
|
|||||||
i18n = import('i18n')
|
i18n = import('i18n')
|
||||||
pkg = import('pkgconfig')
|
pkg = import('pkgconfig')
|
||||||
|
|
||||||
glib_req = '>= 2.76.0'
|
|
||||||
libxml_req = '>= 2.0'
|
libxml_req = '>= 2.0'
|
||||||
libcurl_req = '>= 7.1'
|
libcurl_req = '>= 7.1'
|
||||||
libgd_req = '>= 2.0'
|
libgd_req = '>= 2.0'
|
||||||
@@ -61,14 +60,13 @@ test_cflags = [
|
|||||||
|
|
||||||
common_cflags = cc.get_supported_arguments(test_cflags)
|
common_cflags = cc.get_supported_arguments(test_cflags)
|
||||||
|
|
||||||
m_dep = cc.find_library('m', required: false)
|
m_dep = cc.find_library('m', required: false)
|
||||||
glib_dep = dependency('glib-2.0', version: glib_req)
|
libxml_dep = dependency('libxml-2.0', version: libxml_req, required: 'lumix' in get_option('camlibs'))
|
||||||
gobject_dep = dependency('gobject-2.0', version: glib_req)
|
libcurl_dep = dependency('libcurl', version: libcurl_req, required: ['lumix', 'pentax'] in get_option('camlibs'))
|
||||||
libxml_dep = dependency('libxml-2.0', version: libxml_req, required: 'lumix' in get_option('camlibs'))
|
libgd_dep = dependency('gdlib', version: libgd_req, required: 'docupen' in get_option('camlibs'))
|
||||||
libcurl_dep = dependency('libcurl', version: libcurl_req, required: ['lumix', 'pentax'] in get_option('camlibs'))
|
libexif_dep = dependency('libexif', version: libexif_req, required: false)
|
||||||
libgd_dep = dependency('gdlib', version: libgd_req, required: 'docupen' in get_option('camlibs'))
|
libjpeg_dep = dependency('libjpeg', required: false)
|
||||||
libexif_dep = dependency('libexif', version: libexif_req, required: false)
|
intl_dep = dependency('intl', required: false)
|
||||||
libjpeg_dep = dependency('libjpeg', required: false)
|
|
||||||
|
|
||||||
add_project_arguments('-DMAIL_GPHOTO_DEVEL="<gphoto-devel@lists.sourceforge.net>"', language: 'c')
|
add_project_arguments('-DMAIL_GPHOTO_DEVEL="<gphoto-devel@lists.sourceforge.net>"', language: 'c')
|
||||||
|
|
||||||
@@ -150,7 +148,9 @@ endforeach
|
|||||||
add_project_arguments(common_cflags, language: 'c')
|
add_project_arguments(common_cflags, language: 'c')
|
||||||
add_project_arguments('-D_GPHOTO2_INTERNAL_CODE', language: 'c')
|
add_project_arguments('-D_GPHOTO2_INTERNAL_CODE', language: 'c')
|
||||||
add_project_arguments('-DLOCALEDIR="@0@"'.format (get_option('prefix') / get_option('localedir')), language: 'c')
|
add_project_arguments('-DLOCALEDIR="@0@"'.format (get_option('prefix') / get_option('localedir')), language: 'c')
|
||||||
add_project_arguments('-DENABLE_NLS=1', language: 'c')
|
if intl_dep.found()
|
||||||
|
add_project_arguments('-DENABLE_NLS=1', language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
libgphoto2_root_inc = include_directories('.')
|
libgphoto2_root_inc = include_directories('.')
|
||||||
|
|
||||||
@@ -168,6 +168,7 @@ config_data.set_quoted('GP_CAMLIB_SET', ' '.join(get_option('camlibs')))
|
|||||||
config_data.set_quoted('CAMLIBS', camlibs_dir)
|
config_data.set_quoted('CAMLIBS', camlibs_dir)
|
||||||
config_data.set_quoted('GETTEXT_PACKAGE_LIBGPHOTO2_PORT', 'libgphoto2_port-@0@'.format(libgphoto2_port_current_min))
|
config_data.set_quoted('GETTEXT_PACKAGE_LIBGPHOTO2_PORT', 'libgphoto2_port-@0@'.format(libgphoto2_port_current_min))
|
||||||
config_data.set_quoted('GETTEXT_PACKAGE_LIBGPHOTO2', 'libgphoto2-@0@'.format(libgphoto2_current_min))
|
config_data.set_quoted('GETTEXT_PACKAGE_LIBGPHOTO2', 'libgphoto2-@0@'.format(libgphoto2_current_min))
|
||||||
|
config_data.set10('WORDS_BIGENDIAN', target_machine.endian() == 'big')
|
||||||
|
|
||||||
config_h = configure_file(
|
config_h = configure_file(
|
||||||
output: 'config.h',
|
output: 'config.h',
|
||||||
|
|||||||
Reference in New Issue
Block a user