From 7c2d39e755b1e6aa7cd0477b092ed16bb5e82735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Thu, 5 Dec 2024 17:38:22 +0100 Subject: [PATCH] Add Meson build system --- .editorconfig | 4 + camlibs/adc65/adc65.c | 17 +- camlibs/adc65/meson.build | 11 ++ camlibs/agfa-cl20/agfa_cl20.c | 14 +- camlibs/agfa-cl20/meson.build | 11 ++ camlibs/aox/library.c | 14 +- camlibs/aox/meson.build | 12 ++ camlibs/ax203/meson.build | 23 +++ camlibs/barbie/meson.build | 10 ++ camlibs/canon/meson.build | 21 +++ camlibs/casio/meson.build | 18 ++ camlibs/clicksmart310/library.c | 15 +- camlibs/clicksmart310/meson.build | 14 ++ camlibs/digigr8/library.c | 14 +- camlibs/digigr8/meson.build | 14 ++ camlibs/digita/meson.build | 14 ++ camlibs/dimera/meson.build | 13 ++ camlibs/directory/meson.build | 10 ++ camlibs/docupen/meson.build | 17 ++ camlibs/enigma13/meson.build | 10 ++ camlibs/fuji/meson.build | 12 ++ camlibs/gsmart300/gsmart300.c | 19 +- camlibs/gsmart300/library.c | 14 +- camlibs/gsmart300/meson.build | 14 ++ camlibs/hp215/meson.build | 12 ++ camlibs/iclick/library.c | 14 +- camlibs/iclick/meson.build | 12 ++ camlibs/jamcam/meson.build | 12 ++ camlibs/jd11/meson.build | 14 ++ camlibs/jl2005a/library.c | 16 +- camlibs/jl2005a/meson.build | 13 ++ camlibs/jl2005c/library.c | 15 +- camlibs/jl2005c/meson.build | 19 ++ camlibs/kodak/dc120/meson.build | 13 ++ camlibs/kodak/dc210/dc210.c | 15 +- camlibs/kodak/dc210/meson.build | 13 ++ camlibs/kodak/dc240/meson.build | 13 ++ camlibs/kodak/dc3200/meson.build | 13 ++ camlibs/kodak/ez200/meson.build | 10 ++ camlibs/kodak/meson.build | 5 + camlibs/konica/meson.build | 45 +++++ camlibs/largan/lmini/meson.build | 14 ++ camlibs/largan/meson.build | 1 + camlibs/lg_gsm/library.c | 14 +- camlibs/lg_gsm/meson.build | 13 ++ camlibs/lumix/meson.build | 12 ++ camlibs/mars/library.c | 15 +- camlibs/mars/meson.build | 13 ++ camlibs/meson.build | 5 + camlibs/minolta/dimagev/meson.build | 20 +++ camlibs/minolta/meson.build | 1 + camlibs/mustek/meson.build | 22 +++ camlibs/panasonic/coolshot/meson.build | 12 ++ camlibs/panasonic/l859/meson.build | 11 ++ camlibs/panasonic/meson.build | 31 ++++ camlibs/pccam300/library.c | 16 +- camlibs/pccam300/meson.build | 12 ++ camlibs/pccam300/pccam300.c | 16 +- camlibs/pccam600/meson.build | 12 ++ camlibs/pentax/meson.build | 31 ++++ camlibs/polaroid/meson.build | 39 ++++ camlibs/ptp2/meson.build | 30 ++++ camlibs/ptp2/ptp.c | 20 +-- camlibs/ptp2/usb.c | 19 +- camlibs/quicktake1x0/meson.build | 15 ++ camlibs/ricoh/meson.build | 23 +++ camlibs/samsung/meson.build | 10 ++ camlibs/sierra/meson.build | 20 +++ camlibs/sipix/meson.build | 33 ++++ camlibs/smal/meson.build | 14 ++ camlibs/smal/smal.c | 14 +- camlibs/smal/ultrapocket.c | 17 +- camlibs/sonix/library.c | 16 +- camlibs/sonix/meson.build | 13 ++ camlibs/sonydscf1/meson.build | 13 ++ camlibs/sonydscf55/meson.build | 12 ++ camlibs/soundvision/meson.build | 15 ++ camlibs/spca50x/meson.build | 19 ++ camlibs/sq905/library.c | 14 +- camlibs/sq905/meson.build | 13 ++ camlibs/st2205/meson.build | 15 ++ camlibs/stv0674/meson.build | 13 ++ camlibs/stv0680/meson.build | 21 +++ camlibs/sx330z/meson.build | 12 ++ camlibs/template/meson.build | 10 ++ camlibs/topfield/meson.build | 18 ++ camlibs/toshiba/meson.build | 1 + camlibs/toshiba/pdrm11/meson.build | 12 ++ camlibs/tp6801/meson.build | 13 ++ doc/meson.build | 60 +++++++ examples/meson.build | 107 +++++++++++ libgphoto2/meson.build | 86 +++++++++ libgphoto2_port/disk/meson.build | 9 + libgphoto2_port/libgphoto2_port/meson.build | 66 +++++++ libgphoto2_port/libusb1/meson.build | 10 ++ libgphoto2_port/meson.build | 80 +++++++++ libgphoto2_port/po/meson.build | 1 + libgphoto2_port/ptpip/meson.build | 9 + libgphoto2_port/serial/meson.build | 10 ++ libgphoto2_port/tests/meson.build | 27 +++ libgphoto2_port/usb/meson.build | 10 ++ libgphoto2_port/usbdiskdirect/meson.build | 14 ++ libgphoto2_port/usbscsi/meson.build | 13 ++ libgphoto2_port/vusb/meson.build | 11 ++ meson.build | 188 ++++++++++++++++++++ meson_options.txt | 38 ++++ po/meson.build | 1 + tests/meson.build | 76 ++++++++ 108 files changed, 1857 insertions(+), 303 deletions(-) create mode 100644 camlibs/adc65/meson.build create mode 100644 camlibs/agfa-cl20/meson.build create mode 100644 camlibs/aox/meson.build create mode 100644 camlibs/ax203/meson.build create mode 100644 camlibs/barbie/meson.build create mode 100644 camlibs/canon/meson.build create mode 100644 camlibs/casio/meson.build create mode 100644 camlibs/clicksmart310/meson.build create mode 100644 camlibs/digigr8/meson.build create mode 100644 camlibs/digita/meson.build create mode 100644 camlibs/dimera/meson.build create mode 100644 camlibs/directory/meson.build create mode 100644 camlibs/docupen/meson.build create mode 100644 camlibs/enigma13/meson.build create mode 100644 camlibs/fuji/meson.build create mode 100644 camlibs/gsmart300/meson.build create mode 100644 camlibs/hp215/meson.build create mode 100644 camlibs/iclick/meson.build create mode 100644 camlibs/jamcam/meson.build create mode 100644 camlibs/jd11/meson.build create mode 100644 camlibs/jl2005a/meson.build create mode 100644 camlibs/jl2005c/meson.build create mode 100644 camlibs/kodak/dc120/meson.build create mode 100644 camlibs/kodak/dc210/meson.build create mode 100644 camlibs/kodak/dc240/meson.build create mode 100644 camlibs/kodak/dc3200/meson.build create mode 100644 camlibs/kodak/ez200/meson.build create mode 100644 camlibs/kodak/meson.build create mode 100644 camlibs/konica/meson.build create mode 100644 camlibs/largan/lmini/meson.build create mode 100644 camlibs/largan/meson.build create mode 100644 camlibs/lg_gsm/meson.build create mode 100644 camlibs/lumix/meson.build create mode 100644 camlibs/mars/meson.build create mode 100644 camlibs/meson.build create mode 100644 camlibs/minolta/dimagev/meson.build create mode 100644 camlibs/minolta/meson.build create mode 100644 camlibs/mustek/meson.build create mode 100644 camlibs/panasonic/coolshot/meson.build create mode 100644 camlibs/panasonic/l859/meson.build create mode 100644 camlibs/panasonic/meson.build create mode 100644 camlibs/pccam300/meson.build create mode 100644 camlibs/pccam600/meson.build create mode 100644 camlibs/pentax/meson.build create mode 100644 camlibs/polaroid/meson.build create mode 100644 camlibs/ptp2/meson.build create mode 100644 camlibs/quicktake1x0/meson.build create mode 100644 camlibs/ricoh/meson.build create mode 100644 camlibs/samsung/meson.build create mode 100644 camlibs/sierra/meson.build create mode 100644 camlibs/sipix/meson.build create mode 100644 camlibs/smal/meson.build create mode 100644 camlibs/sonix/meson.build create mode 100644 camlibs/sonydscf1/meson.build create mode 100644 camlibs/sonydscf55/meson.build create mode 100644 camlibs/soundvision/meson.build create mode 100644 camlibs/spca50x/meson.build create mode 100644 camlibs/sq905/meson.build create mode 100644 camlibs/st2205/meson.build create mode 100644 camlibs/stv0674/meson.build create mode 100644 camlibs/stv0680/meson.build create mode 100644 camlibs/sx330z/meson.build create mode 100644 camlibs/template/meson.build create mode 100644 camlibs/topfield/meson.build create mode 100644 camlibs/toshiba/meson.build create mode 100644 camlibs/toshiba/pdrm11/meson.build create mode 100644 camlibs/tp6801/meson.build create mode 100644 doc/meson.build create mode 100644 examples/meson.build create mode 100644 libgphoto2/meson.build create mode 100644 libgphoto2_port/disk/meson.build create mode 100644 libgphoto2_port/libgphoto2_port/meson.build create mode 100644 libgphoto2_port/libusb1/meson.build create mode 100644 libgphoto2_port/meson.build create mode 100644 libgphoto2_port/po/meson.build create mode 100644 libgphoto2_port/ptpip/meson.build create mode 100644 libgphoto2_port/serial/meson.build create mode 100644 libgphoto2_port/tests/meson.build create mode 100644 libgphoto2_port/usb/meson.build create mode 100644 libgphoto2_port/usbdiskdirect/meson.build create mode 100644 libgphoto2_port/usbscsi/meson.build create mode 100644 libgphoto2_port/vusb/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 po/meson.build create mode 100644 tests/meson.build diff --git a/.editorconfig b/.editorconfig index b29a4fdd3a..8efa084d37 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,3 +5,7 @@ insert_final_newline = true trim_trailing_whitespace = true charset = utf-8 indent_style = tab + +[{meson.build,meson_options.txt}] +indent_size = 2 +indent_style = space \ No newline at end of file diff --git a/camlibs/adc65/adc65.c b/camlibs/adc65/adc65.c index 933b318224..eaa0d53e94 100644 --- a/camlibs/adc65/adc65.c +++ b/camlibs/adc65/adc65.c @@ -6,6 +6,8 @@ * * http://www.psnw.com/~smokeserpent/code/ */ +#include "config.h" + #include #include #include @@ -13,20 +15,7 @@ #include #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define _(String) (String) -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #define GP_MODULE "adc65" diff --git a/camlibs/adc65/meson.build b/camlibs/adc65/meson.build new file mode 100644 index 0000000000..506cf1df4e --- /dev/null +++ b/camlibs/adc65/meson.build @@ -0,0 +1,11 @@ +shared_module( + 'adc65', + 'adc65.c', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/agfa-cl20/agfa_cl20.c b/camlibs/agfa-cl20/agfa_cl20.c index c986f90a3a..33c808443d 100644 --- a/camlibs/agfa-cl20/agfa_cl20.c +++ b/camlibs/agfa-cl20/agfa_cl20.c @@ -33,19 +33,7 @@ #include #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #define GP_MODULE diff --git a/camlibs/agfa-cl20/meson.build b/camlibs/agfa-cl20/meson.build new file mode 100644 index 0000000000..43b50d68e7 --- /dev/null +++ b/camlibs/agfa-cl20/meson.build @@ -0,0 +1,11 @@ +shared_module( + 'agfa_cl20', + 'agfa_cl20.c', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/aox/library.c b/camlibs/aox/library.c index 4180545f57..4c57b4f181 100644 --- a/camlibs/aox/library.c +++ b/camlibs/aox/library.c @@ -31,19 +31,7 @@ #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "aox.h" #include diff --git a/camlibs/aox/meson.build b/camlibs/aox/meson.build new file mode 100644 index 0000000000..69260d3e01 --- /dev/null +++ b/camlibs/aox/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'aox', + 'library.c', + 'aox.c', + 'aox.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/ax203/meson.build b/camlibs/ax203/meson.build new file mode 100644 index 0000000000..ff13fabcce --- /dev/null +++ b/camlibs/ax203/meson.build @@ -0,0 +1,23 @@ +shared_module( + 'ax203', + 'library.c', + 'ax203.c', + 'ax203.h', + 'ax203_decode_yuv.c', + 'ax203_decode_yuv_delta.c', + 'ax203_compress_jpeg.c', + 'jpeg_memsrcdest.h', + 'jpeg_memsrcdest.c', + 'tinyjpeg.c', + 'tinyjpeg.h', + 'tinyjpeg-internal.h', + 'jidctflt.c', + dependencies: [ + libgphoto2_dep, + libjpeg_dep, + libgd_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/barbie/meson.build b/camlibs/barbie/meson.build new file mode 100644 index 0000000000..869733dea3 --- /dev/null +++ b/camlibs/barbie/meson.build @@ -0,0 +1,10 @@ +shared_module( + 'barbie', + 'barbie.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/canon/meson.build b/camlibs/canon/meson.build new file mode 100644 index 0000000000..d37bf966d3 --- /dev/null +++ b/camlibs/canon/meson.build @@ -0,0 +1,21 @@ +shared_module( + 'canon', + 'canon.c', + 'canon.h', + 'library.c', + 'library.h', + 'serial.c', + 'serial.h', + 'usb.c', + 'usb.h', + 'crc.c', + 'crc.h', + 'util.c', + 'util.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/casio/meson.build b/camlibs/casio/meson.build new file mode 100644 index 0000000000..8f4453f23d --- /dev/null +++ b/camlibs/casio/meson.build @@ -0,0 +1,18 @@ +shared_module( + 'casio_qv', + 'casio-qv.c', + 'casio-qv-commands.c', + 'casio-qv-commands.h', + 'camtojpeg.c', + 'camtojpeg.h', + 'cam2jpgtab.h', + 'jpegtab_f.h', + 'ycctoppm.c', + 'ycctoppm.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/clicksmart310/library.c b/camlibs/clicksmart310/library.c index e4d9272246..fcf02abe4c 100644 --- a/camlibs/clicksmart310/library.c +++ b/camlibs/clicksmart310/library.c @@ -29,20 +29,7 @@ #define JPEG_QCIF_FORMAT 0x22 #define JPEG_CIF_FORMAT 0x21 -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -# define ngettext(String1,String2,Count) ((Count==1)?String1:String2) -#endif +#include "libgphoto2/i18n.h" #include "clicksmart.h" #define GP_MODULE "clicksmart310" diff --git a/camlibs/clicksmart310/meson.build b/camlibs/clicksmart310/meson.build new file mode 100644 index 0000000000..d2eb641900 --- /dev/null +++ b/camlibs/clicksmart310/meson.build @@ -0,0 +1,14 @@ +shared_module( + 'clicksmart310', + 'library.c', + 'clicksmart.c', + 'clicksmart.h', + 'spca50x-jpeg-header.h', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/digigr8/library.c b/camlibs/digigr8/library.c index 9b65c18952..fd7dee99d2 100644 --- a/camlibs/digigr8/library.c +++ b/camlibs/digigr8/library.c @@ -32,19 +32,7 @@ #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "digigr8.h" diff --git a/camlibs/digigr8/meson.build b/camlibs/digigr8/meson.build new file mode 100644 index 0000000000..7bca4a9279 --- /dev/null +++ b/camlibs/digigr8/meson.build @@ -0,0 +1,14 @@ +shared_module( + 'digigr8', + 'library.c', + 'digigr8.c', + 'digigr8.h', + 'digi_postprocess.c', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/digita/meson.build b/camlibs/digita/meson.build new file mode 100644 index 0000000000..3bafdc4167 --- /dev/null +++ b/camlibs/digita/meson.build @@ -0,0 +1,14 @@ +shared_module( + 'digita', + 'digita.c', + 'serial.c', + 'usb.c', + 'commands.c', + 'digita.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/dimera/meson.build b/camlibs/dimera/meson.build new file mode 100644 index 0000000000..1ac969a75c --- /dev/null +++ b/camlibs/dimera/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'dimera3500', + 'dimera3500.c', + 'mesalib.c', + 'mesalib.h', + 'dimeratab.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/directory/meson.build b/camlibs/directory/meson.build new file mode 100644 index 0000000000..d122a55c79 --- /dev/null +++ b/camlibs/directory/meson.build @@ -0,0 +1,10 @@ +shared_module( + 'directory', + 'directory.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/docupen/meson.build b/camlibs/docupen/meson.build new file mode 100644 index 0000000000..cabefbbb82 --- /dev/null +++ b/camlibs/docupen/meson.build @@ -0,0 +1,17 @@ +shared_module( + 'docupen', + 'cache.c', + 'calibration.c', + 'docupen.c', + 'docupen.h', + 'huffman.c', + 'huffman.h', + 'image.c', + dependencies: [ + libgphoto2_dep, + libgd_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/enigma13/meson.build b/camlibs/enigma13/meson.build new file mode 100644 index 0000000000..5771461ee7 --- /dev/null +++ b/camlibs/enigma13/meson.build @@ -0,0 +1,10 @@ +shared_module( + 'enigma13', + 'enigma13.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/fuji/meson.build b/camlibs/fuji/meson.build new file mode 100644 index 0000000000..fad345a12a --- /dev/null +++ b/camlibs/fuji/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'fuji', + 'library.c', + 'fuji.c', + 'fuji.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/gsmart300/gsmart300.c b/camlibs/gsmart300/gsmart300.c index dd7a0c2137..2b38496924 100644 --- a/camlibs/gsmart300/gsmart300.c +++ b/camlibs/gsmart300/gsmart300.c @@ -38,24 +38,7 @@ #include "gsmart300.h" #include "gsmart300-jpeg-header.h" -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION #define sleep(x) diff --git a/camlibs/gsmart300/library.c b/camlibs/gsmart300/library.c index 6609440cdc..bdfc9027e7 100644 --- a/camlibs/gsmart300/library.c +++ b/camlibs/gsmart300/library.c @@ -35,19 +35,7 @@ #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "gsmart300.h" diff --git a/camlibs/gsmart300/meson.build b/camlibs/gsmart300/meson.build new file mode 100644 index 0000000000..91e200444c --- /dev/null +++ b/camlibs/gsmart300/meson.build @@ -0,0 +1,14 @@ +shared_module( + 'gsmart300', + 'library.c', + 'gsmart300.c', + 'gsmart300.h', + 'gsmart300-jpeg-header.h', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/hp215/meson.build b/camlibs/hp215/meson.build new file mode 100644 index 0000000000..326ea66aa7 --- /dev/null +++ b/camlibs/hp215/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'hp215', + 'hp215.c', + 'hp215.h', + 'crctab.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/iclick/library.c b/camlibs/iclick/library.c index 1b5ce959d1..4225046e86 100644 --- a/camlibs/iclick/library.c +++ b/camlibs/iclick/library.c @@ -33,19 +33,7 @@ #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "iclick.h" diff --git a/camlibs/iclick/meson.build b/camlibs/iclick/meson.build new file mode 100644 index 0000000000..f57887180c --- /dev/null +++ b/camlibs/iclick/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'iclick', + 'library.c', + 'iclick.c', + 'iclick.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/jamcam/meson.build b/camlibs/jamcam/meson.build new file mode 100644 index 0000000000..06b3330dbe --- /dev/null +++ b/camlibs/jamcam/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'jamcam', + 'library.c', + 'library.h', + 'jamcam.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/jd11/meson.build b/camlibs/jd11/meson.build new file mode 100644 index 0000000000..3fae33a90e --- /dev/null +++ b/camlibs/jd11/meson.build @@ -0,0 +1,14 @@ +shared_module( + 'jd11', + 'jd11.c', + 'decomp.c', + 'decomp.h', + 'serial.c', + 'serial.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/jl2005a/library.c b/camlibs/jl2005a/library.c index 33579b2dd6..01d57de5db 100644 --- a/camlibs/jl2005a/library.c +++ b/camlibs/jl2005a/library.c @@ -29,21 +29,7 @@ #include - - -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "jl2005a.h" #include diff --git a/camlibs/jl2005a/meson.build b/camlibs/jl2005a/meson.build new file mode 100644 index 0000000000..8c61f1629e --- /dev/null +++ b/camlibs/jl2005a/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'jl2005a', + 'library.c', + 'jl2005a.c', + 'jl2005a.h', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/jl2005c/library.c b/camlibs/jl2005c/library.c index d0f953a928..edb5a7ce10 100644 --- a/camlibs/jl2005c/library.c +++ b/camlibs/jl2005c/library.c @@ -28,20 +28,7 @@ #include "jl2005bcd_decompress.h" #include - -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "jl2005c.h" #include diff --git a/camlibs/jl2005c/meson.build b/camlibs/jl2005c/meson.build new file mode 100644 index 0000000000..be2d684d8b --- /dev/null +++ b/camlibs/jl2005c/meson.build @@ -0,0 +1,19 @@ +shared_module( + 'jl2005c', + 'library.c', + 'jl2005c.c', + 'jpeg_memsrcdest.c', + 'jpeg_memsrcdest.h', + 'jl2005bcd_decompress.c', + 'jl2005bcd_decompress.h', + 'jl2005c.h', + 'img_enhance.c', + 'img_enhance.h', + dependencies: [ + libgphoto2_dep, + libjpeg_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/kodak/dc120/meson.build b/camlibs/kodak/dc120/meson.build new file mode 100644 index 0000000000..943eb3ceb1 --- /dev/null +++ b/camlibs/kodak/dc120/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'kodak_dc120', + 'library.c', + 'library.h', + 'dc120.c', + 'dc120.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/kodak/dc210/dc210.c b/camlibs/kodak/dc210/dc210.c index 27748aefbe..a377ad54e2 100644 --- a/camlibs/kodak/dc210/dc210.c +++ b/camlibs/kodak/dc210/dc210.c @@ -29,20 +29,7 @@ #include #include -#ifdef ENABLE_NLS -# include -# undef _ -# ifdef gettext_noop -# define _(String) dgettext (PACKAGE, String) -# define N_(String) gettext_noop (String) -# else -# define _(String) (String) -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "dc210.h" diff --git a/camlibs/kodak/dc210/meson.build b/camlibs/kodak/dc210/meson.build new file mode 100644 index 0000000000..5b2c8a7864 --- /dev/null +++ b/camlibs/kodak/dc210/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'kodak_dc210', + 'library.c', + 'library.h', + 'dc210.c', + 'dc210.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/kodak/dc240/meson.build b/camlibs/kodak/dc240/meson.build new file mode 100644 index 0000000000..f75133eead --- /dev/null +++ b/camlibs/kodak/dc240/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'kodak_dc240', + 'library.c', + 'library.h', + 'dc240.c', + 'dc240.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/kodak/dc3200/meson.build b/camlibs/kodak/dc3200/meson.build new file mode 100644 index 0000000000..32a171ae90 --- /dev/null +++ b/camlibs/kodak/dc3200/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'kodak_dc3200', + 'library.c', + 'library.h', + 'dc3200.c', + 'dc3200.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/kodak/ez200/meson.build b/camlibs/kodak/ez200/meson.build new file mode 100644 index 0000000000..aa78fc48e7 --- /dev/null +++ b/camlibs/kodak/ez200/meson.build @@ -0,0 +1,10 @@ +shared_module( + 'kodak_ez200', + 'ez200.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/kodak/meson.build b/camlibs/kodak/meson.build new file mode 100644 index 0000000000..de2247b685 --- /dev/null +++ b/camlibs/kodak/meson.build @@ -0,0 +1,5 @@ +subdir('dc120') +subdir('dc210') +subdir('dc240') +subdir('dc3200') +subdir('ez200') \ No newline at end of file diff --git a/camlibs/konica/meson.build b/camlibs/konica/meson.build new file mode 100644 index 0000000000..9e4ef8421f --- /dev/null +++ b/camlibs/konica/meson.build @@ -0,0 +1,45 @@ + +konica_localization_dir = camlibs_dir_suffix / 'konica' +install_data( + files( + 'localization/english', + 'localization/french', + 'localization/german', + 'localization/japanese', + 'localization/korean', + 'localization/spanish', + ), + install_dir: konica_localization_dir, +) + +shared_module( + 'konica', + 'lowlevel.c', + 'lowlevel.h', + 'konica.c', + 'konica.h', + 'library.c', + dependencies: [ + libgphoto2_dep, + ], + c_args: [ + '-DLOCALIZATION="@0@"'.format(konica_localization_dir), + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +shared_module( + 'konica_qm150', + 'qm150.c', + dependencies: [ + libgphoto2_dep, + ], + c_args: [ + '-DLOCALIZATION="@0@"'.format(konica_localization_dir), + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/largan/lmini/meson.build b/camlibs/largan/lmini/meson.build new file mode 100644 index 0000000000..723e4434b3 --- /dev/null +++ b/camlibs/largan/lmini/meson.build @@ -0,0 +1,14 @@ +shared_module( + 'largan', + 'largan.c', + 'lmini.c', + 'lmini.h', + 'lmini_ccd.c', + 'lmini_ccd.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/largan/meson.build b/camlibs/largan/meson.build new file mode 100644 index 0000000000..882ec972dd --- /dev/null +++ b/camlibs/largan/meson.build @@ -0,0 +1 @@ +subdir('lmini') \ No newline at end of file diff --git a/camlibs/lg_gsm/library.c b/camlibs/lg_gsm/library.c index 47a3ab6d54..5ee9f0c15f 100644 --- a/camlibs/lg_gsm/library.c +++ b/camlibs/lg_gsm/library.c @@ -26,19 +26,7 @@ #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "lg_gsm.h" #include diff --git a/camlibs/lg_gsm/meson.build b/camlibs/lg_gsm/meson.build new file mode 100644 index 0000000000..0f71ad3cf0 --- /dev/null +++ b/camlibs/lg_gsm/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'lg_gsm', + 'library.c', + 'lg_gsm.c', + 'lg_gsm.h', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/lumix/meson.build b/camlibs/lumix/meson.build new file mode 100644 index 0000000000..85eab008d8 --- /dev/null +++ b/camlibs/lumix/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'lumix', + 'lumix.c', + dependencies: [ + libgphoto2_dep, + libxml_dep, + libcurl_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/mars/library.c b/camlibs/mars/library.c index 68d0c867c1..302f61e0e2 100644 --- a/camlibs/mars/library.c +++ b/camlibs/mars/library.c @@ -30,20 +30,7 @@ #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -# define ngettext(String1,String2,Count) ((Count==1)?String1:String2) -#endif +#include "libgphoto2/i18n.h" #include "mars.h" #include diff --git a/camlibs/mars/meson.build b/camlibs/mars/meson.build new file mode 100644 index 0000000000..c86027fcbc --- /dev/null +++ b/camlibs/mars/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'mars', + 'library.c', + 'mars.c', + 'mars.h', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/meson.build b/camlibs/meson.build new file mode 100644 index 0000000000..fb89b930cd --- /dev/null +++ b/camlibs/meson.build @@ -0,0 +1,5 @@ +camlib_paths = [] +foreach camlib : get_option('camlibs') + subdir(camlib) + camlib_paths += meson.current_build_dir() / camlib +endforeach \ No newline at end of file diff --git a/camlibs/minolta/dimagev/meson.build b/camlibs/minolta/dimagev/meson.build new file mode 100644 index 0000000000..445cb96dd8 --- /dev/null +++ b/camlibs/minolta/dimagev/meson.build @@ -0,0 +1,20 @@ +shared_module( + 'dimagev', + 'capture.c', + 'data.c', + 'delete.c', + 'dimagev.c', + 'dimagev.h', + 'download.c', + 'info.c', + 'packet.c', + 'status.c', + 'upload.c', + 'util.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/minolta/meson.build b/camlibs/minolta/meson.build new file mode 100644 index 0000000000..007940406f --- /dev/null +++ b/camlibs/minolta/meson.build @@ -0,0 +1 @@ +subdir('dimagev') \ No newline at end of file diff --git a/camlibs/mustek/meson.build b/camlibs/mustek/meson.build new file mode 100644 index 0000000000..ab934f568b --- /dev/null +++ b/camlibs/mustek/meson.build @@ -0,0 +1,22 @@ +shared_module( + 'mustek', + 'mdc800.c', + 'core.c', + 'image.c', + 'io.c', + 'rs232.c', + 'usb.c', + 'core.h', + 'image.h', + 'io.h', + 'mdc800_spec.h', + 'print.h', + 'rs232.h', + 'usb.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/panasonic/coolshot/meson.build b/camlibs/panasonic/coolshot/meson.build new file mode 100644 index 0000000000..bd560f8cf7 --- /dev/null +++ b/camlibs/panasonic/coolshot/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'panasonic_coolshot', + 'coolshot.c', + 'library.c', + 'library.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/panasonic/l859/meson.build b/camlibs/panasonic/l859/meson.build new file mode 100644 index 0000000000..c7e170f9e0 --- /dev/null +++ b/camlibs/panasonic/l859/meson.build @@ -0,0 +1,11 @@ +shared_module( + 'panasonic_l859', + 'l859.c', + 'l859.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/panasonic/meson.build b/camlibs/panasonic/meson.build new file mode 100644 index 0000000000..23a0700011 --- /dev/null +++ b/camlibs/panasonic/meson.build @@ -0,0 +1,31 @@ +shared_module( + 'panasonic_dc1000', + 'dc1000.c', + 'dc1000.h', + 'dc.c', + 'dc.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +shared_module( + 'panasonic_dc1580', + 'dc1580.c', + 'dc1580.h', + 'dc.c', + 'dc.h', + 'dc1000.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +subdir('coolshot') +subdir('l859') \ No newline at end of file diff --git a/camlibs/pccam300/library.c b/camlibs/pccam300/library.c index 0ca017a538..6bf09e41b7 100644 --- a/camlibs/pccam300/library.c +++ b/camlibs/pccam300/library.c @@ -36,21 +36,7 @@ #include #include -#define GP_MODULE "pccam300" - -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #define GP_MODULE "pccam300" diff --git a/camlibs/pccam300/meson.build b/camlibs/pccam300/meson.build new file mode 100644 index 0000000000..49caa1b55f --- /dev/null +++ b/camlibs/pccam300/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'pccam300', + 'pccam300.c', + 'pccam300.h', + 'library.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/pccam300/pccam300.c b/camlibs/pccam300/pccam300.c index 8ecf508c54..a9c281094f 100644 --- a/camlibs/pccam300/pccam300.c +++ b/camlibs/pccam300/pccam300.c @@ -35,21 +35,9 @@ #include #include -#define GP_MODULE "pccam300" +#include "libgphoto2/i18n.h" -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#define GP_MODULE "pccam300" /* * waits until the status value is 0 or 8. diff --git a/camlibs/pccam600/meson.build b/camlibs/pccam600/meson.build new file mode 100644 index 0000000000..7005325633 --- /dev/null +++ b/camlibs/pccam600/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'pccam600', + 'pccam600.c', + 'pccam600.h', + 'library.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/pentax/meson.build b/camlibs/pentax/meson.build new file mode 100644 index 0000000000..1ea4eef1d5 --- /dev/null +++ b/camlibs/pentax/meson.build @@ -0,0 +1,31 @@ +shared_module( + 'pentax', + 'library.c', + 'pslr.c', + 'pslr_enum.c', + 'pslr_log.c', + 'pslr_lens.c', + 'pslr_model.c', + 'pslr_utils.c', + 'pslr.h', + 'pslr_enum.h', + 'pslr_lens.h', + 'pslr_log.h', + 'pslr_model.h', + 'pslr_scsi.h', + 'pslr_utils.h', + 'js0n.c', + 'js0n.h', + dependencies: [ + libgphoto2_dep, + libxml_dep, + libcurl_dep, + ], + c_args: [ + '-DLIBGPHOTO2', + '-DPKTDATADIR="/"', + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/polaroid/meson.build b/camlibs/polaroid/meson.build new file mode 100644 index 0000000000..f5f1861106 --- /dev/null +++ b/camlibs/polaroid/meson.build @@ -0,0 +1,39 @@ +shared_module( + 'polaroid_pdc320', + 'pdc320.c', + 'pdc320.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +shared_module( + 'polaroid_pdc640', + 'pdc640.c', + 'jd350e.h', + 'jd350e.c', + 'jd350e_red.h', + 'jd350e_blue.h', + 'dlink350f.c', + 'dlink350f.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +shared_module( + 'polaroid_pdc700', + 'pdc700.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/ptp2/meson.build b/camlibs/ptp2/meson.build new file mode 100644 index 0000000000..cb1c571503 --- /dev/null +++ b/camlibs/ptp2/meson.build @@ -0,0 +1,30 @@ +shared_module( + 'ptp2', + 'ptp.c', + 'ptp.h', + 'chdk_ptp.h', + 'chdk_live_view.h', + 'library.c', + 'usb.c', + 'ptp-bugs.h', + 'ptp-private.h', + 'ptpip.c', + 'config.c', + 'music-players.h', + 'device-flags.h', + 'olympus-wrap.c', + 'olympus-wrap.h', + 'chdk.c', + 'fujiptpip.c', + 'ptpip-private.h', + 'array.h', + dependencies: [ + libgphoto2_dep, + libxml_dep, + libjpeg_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c index 34f583d375..70d6a8b1fc 100644 --- a/camlibs/ptp2/ptp.c +++ b/camlibs/ptp2/ptp.c @@ -41,27 +41,9 @@ # include #endif +#include "libgphoto2/i18n.h" #include "libgphoto2_port/compiletime-assert.h" -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif - #define CHECK_PTP_RC(RESULT) do { uint16_t r = (RESULT); if (r != PTP_RC_OK) return r; } while(0) #ifndef MIN diff --git a/camlibs/ptp2/usb.c b/camlibs/ptp2/usb.c index 929ef638c0..a7f91ffe22 100644 --- a/camlibs/ptp2/usb.c +++ b/camlibs/ptp2/usb.c @@ -36,24 +36,7 @@ #include #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #define CONTEXT_BLOCK_SIZE 200000 diff --git a/camlibs/quicktake1x0/meson.build b/camlibs/quicktake1x0/meson.build new file mode 100644 index 0000000000..4cbf77d0e9 --- /dev/null +++ b/camlibs/quicktake1x0/meson.build @@ -0,0 +1,15 @@ +shared_module( + 'quicktake1x0', + 'quicktake1x0.c', + 'qtk-thumbnail-decoder.c', + 'qtkt-decoder.c', + 'qtkn-decoder.c', + 'qtk-helpers.c', + 'quicktake1x0.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/ricoh/meson.build b/camlibs/ricoh/meson.build new file mode 100644 index 0000000000..e67eecd028 --- /dev/null +++ b/camlibs/ricoh/meson.build @@ -0,0 +1,23 @@ +shared_module( + 'ricoh', + 'library.c', + 'ricoh.c', + 'ricoh.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +shared_module( + 'ricoh_g3', + 'g3.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/samsung/meson.build b/camlibs/samsung/meson.build new file mode 100644 index 0000000000..5e85293aba --- /dev/null +++ b/camlibs/samsung/meson.build @@ -0,0 +1,10 @@ +shared_module( + 'samsung', + 'samsung.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/sierra/meson.build b/camlibs/sierra/meson.build new file mode 100644 index 0000000000..82cd6e4e40 --- /dev/null +++ b/camlibs/sierra/meson.build @@ -0,0 +1,20 @@ +shared_module( + 'sierra', + 'sierra.c', + 'sierra.h', + 'library.c', + 'library.h', + 'sierra-usbwrap.c', + 'sierra-usbwrap.h', + 'sierra-desc.h', + 'sierra-desc.c', + 'nikon-desc.c', + 'olympus-desc.c', + 'epson-desc.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/sipix/meson.build b/camlibs/sipix/meson.build new file mode 100644 index 0000000000..38e802fa42 --- /dev/null +++ b/camlibs/sipix/meson.build @@ -0,0 +1,33 @@ +shared_module( + 'sipix_blink', + 'blink.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +shared_module( + 'sipix_blink2', + 'blink2.c', + dependencies: [ + libgphoto2_dep, + libjpeg_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) + +shared_module( + 'sipix_web2', + 'web2.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/smal/meson.build b/camlibs/smal/meson.build new file mode 100644 index 0000000000..6fb372f743 --- /dev/null +++ b/camlibs/smal/meson.build @@ -0,0 +1,14 @@ +shared_module( + 'smal', + 'smal.c', + 'smal.h', + 'ultrapocket.c', + 'ultrapocket.h', + dependencies: [ + libgphoto2_dep, + config_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/smal/smal.c b/camlibs/smal/smal.c index b1aae6a0be..db8a860881 100644 --- a/camlibs/smal/smal.c +++ b/camlibs/smal/smal.c @@ -30,19 +30,7 @@ #include "smal.h" #include "ultrapocket.h" -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" int camera_id (CameraText *id) diff --git a/camlibs/smal/ultrapocket.c b/camlibs/smal/ultrapocket.c index 483681e03d..3f6ac59929 100644 --- a/camlibs/smal/ultrapocket.c +++ b/camlibs/smal/ultrapocket.c @@ -32,6 +32,8 @@ #include #include +#include "libgphoto2/i18n.h" + #include "ultrapocket.h" #include "smal.h" @@ -41,21 +43,6 @@ #define GP_MODULE "Smal Ultrapocket" -#include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif - static const char *BayerTileNames[8] = { "RGGB", "GRBG", diff --git a/camlibs/sonix/library.c b/camlibs/sonix/library.c index 2f034e7115..13259d71cb 100644 --- a/camlibs/sonix/library.c +++ b/camlibs/sonix/library.c @@ -30,21 +30,7 @@ #include - -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -# define ngettext(String1,String2,Count) ((Count==1)?String1:String2) -#endif +#include "libgphoto2/i18n.h" #include #include "sonix.h" diff --git a/camlibs/sonix/meson.build b/camlibs/sonix/meson.build new file mode 100644 index 0000000000..c05bed8949 --- /dev/null +++ b/camlibs/sonix/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'sonix', + 'library.c', + 'sonix.c', + 'sonix.h', + 'sakar-avi-header.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/sonydscf1/meson.build b/camlibs/sonydscf1/meson.build new file mode 100644 index 0000000000..3df61a6e36 --- /dev/null +++ b/camlibs/sonydscf1/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'sony_dscf1', + 'command.c', + 'command.h', + 'sonydscf1.c', + 'pmp.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/sonydscf55/meson.build b/camlibs/sonydscf55/meson.build new file mode 100644 index 0000000000..76ee4777b7 --- /dev/null +++ b/camlibs/sonydscf55/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'sony_dscf55', + 'sony.c', + 'sony.h', + 'camera.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/soundvision/meson.build b/camlibs/soundvision/meson.build new file mode 100644 index 0000000000..e843961009 --- /dev/null +++ b/camlibs/soundvision/meson.build @@ -0,0 +1,15 @@ +shared_module( + 'soundvision', + 'soundvision.c', + 'agfa_cl18.c', + 'tiger_fastflicks.c', + 'commands.c', + 'commands.h', + 'soundvision.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/spca50x/meson.build b/camlibs/spca50x/meson.build new file mode 100644 index 0000000000..823ed5ae8c --- /dev/null +++ b/camlibs/spca50x/meson.build @@ -0,0 +1,19 @@ +shared_module( + 'spca50x', + 'spca50x.c', + 'spca50x.h', + 'spca50x-flash.c', + 'spca50x-flash.h', + 'spca50x-sdram.c', + 'spca50x-sdram.h', + 'library.c', + 'spca50x-jpeg-header.h', + 'spca50x-registers.h', + 'spca50x-avi-header.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/sq905/library.c b/camlibs/sq905/library.c index ad52e216b7..1d9f921a7f 100644 --- a/camlibs/sq905/library.c +++ b/camlibs/sq905/library.c @@ -32,19 +32,7 @@ #include -#ifdef ENABLE_NLS -# include -# undef _ -# define _(String) dgettext (PACKAGE, String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define _(String) (String) -# define N_(String) (String) -#endif +#include "libgphoto2/i18n.h" #include "sq905.h" diff --git a/camlibs/sq905/meson.build b/camlibs/sq905/meson.build new file mode 100644 index 0000000000..e3ce265b1d --- /dev/null +++ b/camlibs/sq905/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'sq905', + 'library.c', + 'sq905.c', + 'sq905.h', + 'postprocess.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/st2205/meson.build b/camlibs/st2205/meson.build new file mode 100644 index 0000000000..2c77601a3f --- /dev/null +++ b/camlibs/st2205/meson.build @@ -0,0 +1,15 @@ +shared_module( + 'st2205', + 'library.c', + 'st2205.c', + 'st2205.h', + 'st2205_decode.c', + 'st2205_tables.c', + dependencies: [ + libgphoto2_dep, + libgd_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/stv0674/meson.build b/camlibs/stv0674/meson.build new file mode 100644 index 0000000000..697515dbc2 --- /dev/null +++ b/camlibs/stv0674/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'stv0674', + 'library.c', + 'library.h', + 'stv0674.c', + 'stv0674.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/stv0680/meson.build b/camlibs/stv0680/meson.build new file mode 100644 index 0000000000..f73dace987 --- /dev/null +++ b/camlibs/stv0680/meson.build @@ -0,0 +1,21 @@ +shared_module( + 'stv0680', + 'stv0680.c', + 'stv0680.h', + 'library.c', + 'library.h', + 'stv0680-bayer.c', + 'stv0680-bayer.h', + 'sharpen.c', + 'sharpen.h', + 'saturate.c', + 'saturate.h', + 'demosaic_sharpen.h', + 'demosaic_sharpen.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/sx330z/meson.build b/camlibs/sx330z/meson.build new file mode 100644 index 0000000000..9badba6069 --- /dev/null +++ b/camlibs/sx330z/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'sx330z', + 'library.c', + 'sx330z.c', + 'sx330z.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/template/meson.build b/camlibs/template/meson.build new file mode 100644 index 0000000000..c7cf190866 --- /dev/null +++ b/camlibs/template/meson.build @@ -0,0 +1,10 @@ +shared_module( + 'template', + 'template.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/topfield/meson.build b/camlibs/topfield/meson.build new file mode 100644 index 0000000000..a6689d5506 --- /dev/null +++ b/camlibs/topfield/meson.build @@ -0,0 +1,18 @@ +shared_module( + 'topfield', + 'crc16.c', + 'crc16.h', + 'tf_bytes.c', + 'tf_bytes.h', + 'mjd.c', + 'mjd.h', + 'puppy.c', + 'usb_io.h', + 'usb_io.c', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/toshiba/meson.build b/camlibs/toshiba/meson.build new file mode 100644 index 0000000000..89ccf309b3 --- /dev/null +++ b/camlibs/toshiba/meson.build @@ -0,0 +1 @@ +subdir('pdrm11') \ No newline at end of file diff --git a/camlibs/toshiba/pdrm11/meson.build b/camlibs/toshiba/pdrm11/meson.build new file mode 100644 index 0000000000..646bd20f6c --- /dev/null +++ b/camlibs/toshiba/pdrm11/meson.build @@ -0,0 +1,12 @@ +shared_module( + 'toshiba_pdrm11', + 'library.c', + 'pdrm11.c', + 'pdrm11.h', + dependencies: [ + libgphoto2_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/camlibs/tp6801/meson.build b/camlibs/tp6801/meson.build new file mode 100644 index 0000000000..a8d9d658ab --- /dev/null +++ b/camlibs/tp6801/meson.build @@ -0,0 +1,13 @@ +shared_module( + 'tp6801', + 'library.c', + 'tp6801.c', + 'tp6801.h', + dependencies: [ + libgphoto2_dep, + libgd_dep, + ], + name_prefix: '', + install: true, + install_dir: camlibs_dir, +) \ No newline at end of file diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000000..73639fc64d --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,60 @@ +install_man( + 'libgphoto2.3', + 'libgphoto2_port.3', +) + +if get_option('docs') + doxygen = find_program('doxygen', required : false) + if doxygen.found() + cdata = configuration_data() + cdata.set('top_srcdir', meson.project_source_root()) + cdata.set('PACKAGE_NAME', 'libgphoto2 photo camera library') + cdata.set('PACKAGE_TARNAME', meson.project_name()) + cdata.set('PACKAGE_VERSION', meson.project_version()) + cdata.set('DOXYGEN_OUTPUT_DIR', meson.current_build_dir()) + cdata.set('HTML_APIDOC_DIR', 'html') + if find_program('dot', required : false).found() + cdata.set('HAVE_DOT', 'YES') + else + cdata.set('HAVE_DOT', 'NO') + endif + cdata_internals = cdata + cdata_internals.set('HTML_APIDOC_INTERNALS_DIR', 'html-internals') + + datadir = join_paths(get_option('datadir'), 'doc', meson.project_name()) + + doxyfile = configure_file( + input: 'Doxyfile.in', + output: 'Doxyfile', + configuration: cdata, + install: false + ) + + html_target = custom_target( + 'docs', + input: doxyfile, + output: 'html', + command: [doxygen, '@INPUT@'], + install: true, + install_dir: datadir + ) + + if get_option('docs-internal') + doxyfile_internals = configure_file( + input: 'Doxyfile-internals.in', + output: 'Doxyfile-internals', + configuration: cdata_internals, + install: false + ) + + html_internals_target = custom_target( + 'docs-internals', + input: doxyfile_internals, + output: 'html-internals', + command: [doxygen, '@INPUT@'], + install: true, + install_dir: datadir + ) + endif + endif +endif \ No newline at end of file diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 0000000000..a90f475f17 --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,107 @@ +executable( + 'sample-autodetect', + 'sample-autodetect.c', + 'samples.h', + 'context.c', + 'config.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-multi-detect', + 'sample-multi-detect.c', + 'samples.h', + 'autodetect.c', + 'context.c', + 'config.c', + dependencies: libgphoto2_dep, +) + +executable( + 'lunkwill-canon-capture', + 'lunkwill-canon-capture.c', + 'samples.h', + 'context.c', + 'config.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-owner', + 'sample-owner.c', + 'samples.h', + 'context.c', + 'config.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-photobooth', + 'sample-photobooth.c', + 'samples.h', + 'context.c', + 'config.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-preview', + 'preview.c', + 'samples.h', + 'context.c', + 'config.c', + 'focus.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-tether', + 'sample-tether.c', + 'samples.h', + 'context.c', + 'config.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-afl', + 'sample-afl.c', + 'samples.h', + 'context.c', + 'autodetect.c', + dependencies: libgphoto2_dep, +) + +executable( + 'best-iso', + 'best-iso.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-capture', + 'sample-capture.c', + 'samples.h', + 'context.c', + 'config.c', + 'focus.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-trigger-capture', + 'sample-trigger-capture.c', + 'samples.h', + 'context.c', + 'config.c', + dependencies: libgphoto2_dep, +) + +executable( + 'sample-justfocus', + 'sample-justfocus.c', + 'samples.h', + 'context.c', + 'focus.c', + dependencies: libgphoto2_dep, +) \ No newline at end of file diff --git a/libgphoto2/meson.build b/libgphoto2/meson.build new file mode 100644 index 0000000000..fe832a5386 --- /dev/null +++ b/libgphoto2/meson.build @@ -0,0 +1,86 @@ +libgphoto2_sources = files( + 'gphoto2-abilities-list.c', + 'ahd_bayer.c', + 'bayer.c', + 'gphoto2-camera.c', + 'gphoto2-context.c', + 'exif.c', + 'gphoto2-file.c', + 'gphoto2-filesys.c', + 'gamma.c', + 'jpeg.c', + 'gphoto2-list.c', + 'gphoto2-result.c', + 'gphoto2-version.c', + 'gphoto2-setting.c', + 'gphoto2-widget.c', +) + +libgphoto2_headers = files( + '../gphoto2/gphoto2-abilities-list.h', + '../gphoto2/gphoto2-camera.h', + '../gphoto2/gphoto2-context.h', + '../gphoto2/gphoto2-file.h', + '../gphoto2/gphoto2-filesys.h', + '../gphoto2/gphoto2-library.h', + '../gphoto2/gphoto2-list.h', + '../gphoto2/gphoto2-result.h', + '../gphoto2/gphoto2-setting.h', + '../gphoto2/gphoto2-version.h', + '../gphoto2/gphoto2-widget.h', + '../gphoto2/gphoto2.h', +) + +libgphoto2_private_headers = files( + 'bayer.h', + 'bayer-types.h', + 'exif.h', + 'gamma.h', + 'jpeg.h', +) + +libgphoto2_lib = library( + 'gphoto2', + libgphoto2_sources, + libgphoto2_headers, + libgphoto2_private_headers, + include_directories: libgphoto2_root_inc, + version: '@0@.@1@.@2@'.format(libgphoto2_current_min, libgphoto2_age, libgphoto2_revision), + soversion: libgphoto2_current_min, + install: true, + dependencies: [ + ltdl_dep, + libexif_dep, + m_dep, + libgphoto2_port_dep, + config_dep, + ], + c_args: [ + '-D_GPHOTO2_INTERNAL_CODE', + ] +) + +install_headers( + libgphoto2_headers, + subdir: 'gphoto2', +) + +libgphoto2_dep = declare_dependency( + link_with: libgphoto2_lib, + include_directories: [libgphoto2_root_inc, include_directories('.'),], + dependencies: [ libgphoto2_port_dep, config_dep ], +) + +pkg.generate( + libgphoto2_lib, + filebase: 'libgphoto2', + description: 'Device-independent access to serial, USB, and other ports', + url: 'http://gphoto.org/proj/libgphoto2/', + subdirs: 'gphoto2', + version: meson.project_version(), + requires: [ libgphoto2_port_lib ], + variables: [ + 'VERSION=@0@'.format(meson.project_version()), + 'driverdir=${libdir}/@0@'.format(iolibs_dir_suffix), + ], +) \ No newline at end of file diff --git a/libgphoto2_port/disk/meson.build b/libgphoto2_port/disk/meson.build new file mode 100644 index 0000000000..5ba8634ab0 --- /dev/null +++ b/libgphoto2_port/disk/meson.build @@ -0,0 +1,9 @@ +shared_module('disk', + 'disk.c', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libgphoto2_port_dep, + ], +) \ No newline at end of file diff --git a/libgphoto2_port/libgphoto2_port/meson.build b/libgphoto2_port/libgphoto2_port/meson.build new file mode 100644 index 0000000000..b63ccf710a --- /dev/null +++ b/libgphoto2_port/libgphoto2_port/meson.build @@ -0,0 +1,66 @@ +libgphoto2_port_sources = files( + 'gphoto2-port-info-list.c', + 'gphoto2-port-locking.c', + 'gphoto2-port-log.c', + 'gphoto2-port-portability.c', + 'gphoto2-port-result.c', + 'gphoto2-port-version.c', + 'gphoto2-port.c', +) + +libgphoto2_port_headers = files( + '../gphoto2/gphoto2-port-info-list.h', + '../gphoto2/gphoto2-port-locking.h', + '../gphoto2/gphoto2-port-log.h', + '../gphoto2/gphoto2-port-portability.h', + '../gphoto2/gphoto2-port-result.h', + '../gphoto2/gphoto2-port-version.h', + '../gphoto2/gphoto2-port.h', +) + +libgphoto2_port_private_headers = files( + 'gphoto2-port-info.h', + 'i18n.h', + 'compiletime-assert.h', +) + +libgphoto2_port_lib = library( + 'gphoto2_port', + libgphoto2_port_sources, + libgphoto2_port_headers, + libgphoto2_port_private_headers, + include_directories: [libgphoto2_root_inc, libgphoto2_port_root_inc], + version: '@0@.@1@.@2@'.format(libgphoto2_port_current_min, libgphoto2_port_age, libgphoto2_port_revision), + soversion: libgphoto2_port_current_min, + install: true, + dependencies: [ + ltdl_dep, + lockdev_dep, + m_dep, + config_dep, + ], +) + +install_headers( + libgphoto2_port_headers, + subdir: 'gphoto2', +) + +libgphoto2_port_dep = declare_dependency( + link_with: libgphoto2_port_lib, + include_directories: libgphoto2_port_root_inc, + dependencies: config_dep, +) + +pkg.generate( + libgphoto2_port_lib, + filebase: 'libgphoto2_port', + description: 'Device-independent access to serial, USB, and other ports', + url: 'http://gphoto.org/proj/libgphoto2/', + subdirs: 'gphoto2', + version: libgphoto2_port_version, + variables: [ + 'VERSION=@0@'.format(libgphoto2_port_version), + 'driverdir=${libdir}/@0@'.format(iolibs_dir_suffix), + ], +) \ No newline at end of file diff --git a/libgphoto2_port/libusb1/meson.build b/libgphoto2_port/libusb1/meson.build new file mode 100644 index 0000000000..cb2045165b --- /dev/null +++ b/libgphoto2_port/libusb1/meson.build @@ -0,0 +1,10 @@ +shared_module('usb1', + 'libusb1.c', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libusb1_dep, + libgphoto2_port_dep, + ], +) \ No newline at end of file diff --git a/libgphoto2_port/meson.build b/libgphoto2_port/meson.build new file mode 100644 index 0000000000..1a4f460025 --- /dev/null +++ b/libgphoto2_port/meson.build @@ -0,0 +1,80 @@ +libusb_req = '>= 0.1.5' +libusb1_req = '>= 1.0.0' + +ltdl_dep = cc.find_library('ltdl', required : false) +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')) +lockdev_dep = cc.find_library('lockdev', required : false) + +if libusb_dep.found() + add_project_arguments('-DHAVE_LIBUSB=1', language: 'c') +endif + +if libusb1_dep.found() + add_project_arguments('-DHAVE_LIBUSB1=1', language: 'c') + if cc.has_function('libusb_strerror', dependencies: libusb1_dep, prefix: '#include') + add_project_arguments('-DHAVE_LIBUSB_STRERROR=1', language: 'c') + endif + if cc.has_function('libusb_wrap_sys_device', dependencies: libusb1_dep, prefix: '#include') + add_project_arguments('-DHAVE_LIBUSB_WRAP_SYS_DEVICE=1', language: 'c') + endif + if cc.compiles(''' +#include +enum libusb_option opt = LIBUSB_OPTION_NO_DEVICE_DISCOVERY; +''', dependencies: libusb1_dep, name: 'Has LIBUSB_OPTION_NO_DEVICE_DISCOVERY') + add_project_arguments('-DHAVE_LIBUSB_OPTION_NO_DEVICE_DISCOVERY1', language: 'c') + endif +endif + +if ltdl_dep.found() + add_project_arguments('-DHAVE_LTDL=1', language: 'c') +endif + +if lockdev_dep.found() + add_project_arguments('-DHAVE_LOCKDEV=1', language: 'c') +endif + +if cc.has_header('ttylock.h') + add_project_arguments('-DHAVE_TTYLOCK=1', language: 'c') +endif + +if cc.has_header('regex.h') + add_project_arguments('-DHAVE_REGEX=1', language: 'c') + if cc.has_function('re_compile_pattern', prefix: '#include ') + add_project_arguments('-DHAVE_GNU_REGEX=1', language: 'c') + endif +endif + +if 'serial' in get_option('iolibs') + add_project_arguments('-DHAVE_SERIAL=1', language: 'c') +endif + +# 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 +libgphoto2_port_root_inc = include_directories('.') + +headers = ['stdlib.h', 'unistd.h', 'stdio.h', 'errno.h', 'sys/time.h', + 'sys/param.h', 'sys/select.h', 'termios.h', 'sgetty.h', 'ttold.h', 'ioctl-types.h', + 'fcntl.h', 'sgtty.h', 'sys/ioctl.h', 'sys/time.h', 'termio.h', 'unistd.h', + 'endian.h', 'byteswap.h', 'asm/io.h', 'mntent.h', 'sys/mntent.h', 'sys/mnttab.h', + 'scsi/sg.h', 'limits.h', 'sys/file.h', 'lockdev.h', 'ttylock.h', +] +foreach header : headers + if cc.has_header(header) + add_project_arguments('-DHAVE_@0@=1'.format(header.replace('.', '_').replace('/', '_').to_upper()), language: 'c') + endif +endforeach + +add_project_arguments('-DURL_USB_MASSSTORAGE="http://www.linux-usb.org/USB-guide/x498.html"', language: 'c') + +subdir('libgphoto2_port') + +iolib_paths = [] +foreach iolib : get_option('iolibs') + subdir(iolib) + iolib_paths += meson.current_build_dir() / iolib +endforeach + +subdir('tests') +subdir('po') \ No newline at end of file diff --git a/libgphoto2_port/po/meson.build b/libgphoto2_port/po/meson.build new file mode 100644 index 0000000000..b9a217f7dd --- /dev/null +++ b/libgphoto2_port/po/meson.build @@ -0,0 +1 @@ +i18n.gettext('libgphoto2_port-12', preset: 'glib') \ No newline at end of file diff --git a/libgphoto2_port/ptpip/meson.build b/libgphoto2_port/ptpip/meson.build new file mode 100644 index 0000000000..5d5c9c41d2 --- /dev/null +++ b/libgphoto2_port/ptpip/meson.build @@ -0,0 +1,9 @@ +shared_module('ptpip', + 'ptpip.c', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libgphoto2_port_dep, + ], +) \ No newline at end of file diff --git a/libgphoto2_port/serial/meson.build b/libgphoto2_port/serial/meson.build new file mode 100644 index 0000000000..687cac5470 --- /dev/null +++ b/libgphoto2_port/serial/meson.build @@ -0,0 +1,10 @@ +shared_module('serial', + 'unix.c', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libgphoto2_port_dep, + lockdev_dep, + ], +) \ No newline at end of file diff --git a/libgphoto2_port/tests/meson.build b/libgphoto2_port/tests/meson.build new file mode 100644 index 0000000000..3c00b3e218 --- /dev/null +++ b/libgphoto2_port/tests/meson.build @@ -0,0 +1,27 @@ +test_gp_port_exe = executable( + 'test-gp-port', + 'test-gp-port.c', + dependencies: libgphoto2_port_dep +) + +test( + 'test-gp-port', + test_gp_port_exe, + env: [ + 'LTDL_LIBRARY_PATH=@0@'.format(':'.join(iolib_paths)), + ] +) + +test_port_list_exe = executable( + 'test-port-list', + 'test-port-list.c', + dependencies: libgphoto2_port_dep +) + +test( + 'test-port-list', + test_port_list_exe, + env: [ + 'LTDL_LIBRARY_PATH=@0@'.format(':'.join(iolib_paths)), + ] +) \ No newline at end of file diff --git a/libgphoto2_port/usb/meson.build b/libgphoto2_port/usb/meson.build new file mode 100644 index 0000000000..05f1d3bc21 --- /dev/null +++ b/libgphoto2_port/usb/meson.build @@ -0,0 +1,10 @@ +shared_module('usb', + 'libusb.c', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libusb_dep, + libgphoto2_port_dep, + ], +) \ No newline at end of file diff --git a/libgphoto2_port/usbdiskdirect/meson.build b/libgphoto2_port/usbdiskdirect/meson.build new file mode 100644 index 0000000000..d21a2c108b --- /dev/null +++ b/libgphoto2_port/usbdiskdirect/meson.build @@ -0,0 +1,14 @@ +if target_machine.system() != 'linux' + error('usbscsi is only available on linux.') +endif + +shared_module('usbdiskdirect', + 'linux.c', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libgphoto2_port_dep, + lockdev_dep, + ], +) \ No newline at end of file diff --git a/libgphoto2_port/usbscsi/meson.build b/libgphoto2_port/usbscsi/meson.build new file mode 100644 index 0000000000..a0dc03111e --- /dev/null +++ b/libgphoto2_port/usbscsi/meson.build @@ -0,0 +1,13 @@ +if target_machine.system() != 'linux' + error('usbscsi is only available on linux.') +endif + +shared_module('usbscsi', + 'linux.c', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libgphoto2_port_dep, + ], +) \ No newline at end of file diff --git a/libgphoto2_port/vusb/meson.build b/libgphoto2_port/vusb/meson.build new file mode 100644 index 0000000000..aeb517c1f2 --- /dev/null +++ b/libgphoto2_port/vusb/meson.build @@ -0,0 +1,11 @@ +shared_module('vusb', + 'vusb.c', + 'vcamera.c', + 'vcamera.h', + name_prefix: '', + install_dir: iolibs_dir, + install: true, + dependencies: [ + libgphoto2_port_dep, + ], +) \ No newline at end of file diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000..d353affd7f --- /dev/null +++ b/meson.build @@ -0,0 +1,188 @@ +project('libgphoto2', 'c', + version : '2.5.31.1', + meson_version : '>= 1.4.0', + default_options : [ + 'buildtype=debugoptimized', + 'warning_level=3', + 'c_std=gnu99' + ], + license: 'LGPL-2.1-or-later' +) + +i18n = import('i18n') +pkg = import('pkgconfig') + +glib_req = '>= 2.76.0' +libxml_req = '>= 2.0' +libcurl_req = '>= 7.1' +libgd_req = '>= 2.0' +libexif_req = '>= 0.6.13' + +# Versioning: +# - AGE (Micro): Increment if any interfaces have been added; set to 0 +# if any interfaces have been removed. Removal has +# precedence over adding, so set to 0 if both happened. +# It denotes upward compatibility. +# - REVISION (Minor): Increment any time the source changes; set to +# 0 if you incremented CURRENT. +# - CURRENT (Major): Increment if the interface has changes. AGE is always +# *changed* at the same time. +# +# To summarize. Any interface *change* increment CURRENT. If that interface +# change does not break upward compatibility (ie it is an addition), +# increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed, +# REVISION is set to 0, otherwise REVISION is incremented. +libgphoto2_age = 3 +libgphoto2_revision = 0 +libgphoto2_current = 9 +libgphoto2_current_min = libgphoto2_current - libgphoto2_age + +libgphoto2_port_name = 'libgphoto2_port' +libgphoto2_port_version = '0.12.2' + +libgphoto2_port_age = 2 +libgphoto2_port_revision = 0 +libgphoto2_port_current = 14 +libgphoto2_port_current_min = libgphoto2_port_current - libgphoto2_port_age + +cc = meson.get_compiler('c') +add_project_arguments('-DHAVE_CC="@0@"'.format(cc.get_id()), language: 'c') + +test_cflags = [ + '-Werror=unknown-warning-option', + '-Werror=incompatible-pointer-types', + '-Werror=implicit', + '-Werror=int-conversion', + '-Wno-error=reserved-identifier', + '-Wno-error=documentation-deprecated-sync', + '-Wno-unused-parameter', + '-Wno-unused', +] + +common_cflags = cc.get_supported_arguments(test_cflags) + +m_dep = cc.find_library('m', required: false) +glib_dep = dependency('glib-2.0', version: glib_req) +gobject_dep = dependency('gobject-2.0', version: glib_req) +libxml_dep = dependency('libxml-2.0', version: libxml_req, required: 'lumix' in get_option('camlibs')) +libcurl_dep = dependency('libcurl', version: libcurl_req, required: ['lumix', 'pentax'] in get_option('camlibs')) +libgd_dep = dependency('gdlib', version: libgd_req, required: 'docupen' in get_option('camlibs')) +libexif_dep = dependency('libexif', version: libexif_req, required: false) +libjpeg_dep = dependency('libjpeg', required: false) + +add_project_arguments('-DMAIL_GPHOTO_DEVEL=""', language: 'c') + +if cc.has_function('va_copy', prefix: '#include ') + add_project_arguments('-DHAVE_VA_COPY=1', language: 'c') +elif cc.has_function('__va_copy', prefix: '#include ') + add_project_arguments('-Dva_copy=__va_copy', language: 'c') + add_project_arguments('-DHAVE_VA_COPY=1', language: 'c') +endif + +if cc.has_function('strncpy', prefix: '#include ') + add_project_arguments('-DHAVE_STRNCPY=1', language: 'c') +endif + +if (libcurl_dep.found()) + add_project_arguments('-DHAVE_LIBCURL=1', language: 'c') +endif + +if (libgd_dep.found()) + add_project_arguments('-DHAVE_LIBGD=1', language: 'c') +endif + +if (libexif_dep.found()) + add_project_arguments('-DHAVE_LIBEXIF=1', language: 'c') + if (cc.has_member('ExifData', 'ifd', dependencies: libexif_dep, prefix: '#include ')) + add_project_arguments('-DHAVE_LIBEXIF_IFD=1', language: 'c') + endif +endif + +if (libxml_dep.found()) + add_project_arguments('-DHAVE_LIBXML2=1', language: 'c') +elif ('ptp2' in get_option('camlibs')) + message('ptp2 is built without libxml2 support.') +endif + +if (libjpeg_dep.found()) + jpeg_test = '''#include +#include +#include +/* 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 + +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; +} +''' + if not cc.links(jpeg_test, dependencies: libjpeg_dep, name: 'Make sure we can actually compile and link against libjpeg.') + warning('Unable to use libjpeg') + libjpeg_dep = disabler() + else + add_project_arguments('-DHAVE_LIBJPEG=1', language: 'c') + endif +endif + +headers = [ + 'sys/param.h', 'sys/mman.h', 'sys/select.h', 'locale.h', 'memory.h', + 'getopt.h', 'unistd.h', 'mcheck.h', 'limits.h', 'sys/time.h', 'langinfo.h', + 'stdio.h', 'stdlib.h', 'string.h', +] + +foreach header : headers + if cc.has_header(header) + add_project_arguments('-DHAVE_@0@=1'.format(header.replace('.', '_').replace('/', '_').to_upper()), language: 'c') + endif +endforeach + +add_project_arguments(common_cflags, 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('-DENABLE_NLS=1', language: 'c') + +libgphoto2_root_inc = include_directories('.') + +iolibs_dir_suffix = libgphoto2_port_name / libgphoto2_port_version +iolibs_dir = get_option('prefix') / get_option('libdir') / iolibs_dir_suffix + +camlibs_dir_suffix = meson.project_name() / meson.project_version() +camlibs_dir = get_option('prefix') / get_option('libdir') / camlibs_dir_suffix + +config_data = configuration_data() +config_data.set_quoted('PACKAGE_VERSION', meson.project_version()) +config_data.set_quoted('IOLIB_LIST', ' '.join(get_option('iolibs'))) +config_data.set_quoted('IOLIBS', iolibs_dir) +config_data.set_quoted('GP_CAMLIB_SET', ' '.join(get_option('camlibs'))) +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', 'libgphoto2-@0@'.format(libgphoto2_current_min)) + +config_h = configure_file( + output: 'config.h', + configuration: config_data, +) + +config_dep = declare_dependency( + include_directories: include_directories('.'), + sources: config_h +) + +subdir('libgphoto2_port') +subdir('libgphoto2') +subdir('camlibs') +subdir('doc') +subdir('po') +subdir('tests') +subdir('examples') \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..c1ce5e27ee --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,38 @@ +option( + 'iolibs', + type : 'array', + choices : [ + 'disk', 'vusb', 'ptpip', 'serial', 'libusb1', 'usb', 'usbdiskdirect', 'usbscsi' + ], + value : [ + 'disk', 'ptpip', 'serial', 'libusb1', 'usb', 'usbdiskdirect', 'usbscsi' + ] +) +option( + 'camlibs', + type : 'array', + choices : [ + 'adc65', 'agfa-cl20', 'aox', 'ax203', 'barbie', 'canon', 'casio', + 'clicksmart310', 'digigr8', 'digita', 'dimera', 'directory', 'docupen', + 'enigma13', 'fuji', 'gsmart300', 'hp215', 'iclick', 'jamcam', 'jd11', + 'jl2005a', 'jl2005c', 'kodak', 'konica', 'largan', 'lg_gsm', 'lumix', + 'mars', 'minolta', 'mustek', 'panasonic', 'pccam300', 'pccam600', 'pentax', + 'polaroid', 'ptp2', 'quicktake1x0', 'ricoh', 'samsung', 'sierra', 'sipix', + 'smal', 'sonix', 'sonydscf1', 'sonydscf55', 'soundvision', 'spca50x', + 'sq905', 'st2205', 'stv0674', 'stv0680', 'sx330z', 'topfield', 'toshiba', + 'tp6801', + ], + value : [ + 'adc65', 'agfa-cl20', 'aox', 'ax203', 'barbie', 'canon', 'casio', + 'clicksmart310', 'digigr8', 'digita', 'dimera', 'directory', 'docupen', + 'enigma13', 'fuji', 'gsmart300', 'hp215', 'iclick', 'jamcam', 'jd11', + 'jl2005a', 'jl2005c', 'kodak', 'konica', 'largan', 'lg_gsm', 'lumix', + 'mars', 'minolta', 'mustek', 'panasonic', 'pccam300', 'pccam600', 'pentax', + 'polaroid', 'ptp2', 'quicktake1x0', 'ricoh', 'samsung', 'sierra', 'sipix', + 'smal', 'sonix', 'sonydscf1', 'sonydscf55', 'soundvision', 'spca50x', + 'sq905', 'st2205', 'stv0674', 'stv0680', 'sx330z', 'topfield', 'toshiba', + 'tp6801', + ] +) +option('docs', type : 'boolean', value : false) +option('docs-internal', type : 'boolean', value : false) \ No newline at end of file diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000000..ab89f79158 --- /dev/null +++ b/po/meson.build @@ -0,0 +1 @@ +i18n.gettext('libgphoto2-6', preset: 'glib') \ No newline at end of file diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 0000000000..ef7b88bbd3 --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,76 @@ +test_i18n_exe = executable( + 'test-i18n', + 'test-i18n.c', + dependencies: libgphoto2_dep, +) + +test( + 'test-i18n', + test_i18n_exe, +) + +test_endian_exe = executable( + 'test-endian', + 'test-endian.c', + dependencies: libgphoto2_dep, +) + +test( + 'test-endian', + test_endian_exe, +) + +print_libgphoto2_version_exe = executable( + 'print-libgphoto2-version', + 'print-libgphoto2-version.c', + dependencies: libgphoto2_dep, +) + +test( + 'print-libgphoto2-version', + print_libgphoto2_version_exe, +) + +test_gphoto2_exe = executable( + 'test-gphoto2', + 'test-gphoto2.c', + dependencies: libgphoto2_dep, +) + +test( + 'test-gphoto2', + test_gphoto2_exe, +) + +test_filesys_exe = executable( + 'test-filesys', + 'test-filesys.c', + dependencies: libgphoto2_dep, +) + +test( + 'test-filesys', + test_filesys_exe, +) + +test_camera_list_exe = executable( + 'test-camera-list', + 'test-camera-list.c', + dependencies: libgphoto2_dep, +) + +test( + 'test-camera-list', + test_camera_list_exe, +) + +test_init_localedir_exe = executable( + 'test-init-localedir', + 'test-init-localedir.c', + dependencies: libgphoto2_dep, +) + +test( + 'test-init-localedir', + test_init_localedir_exe, +) \ No newline at end of file