summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2020-01-12 14:52:17 +0100
committerMarcus Meissner <marcus@jet.franken.de>2020-01-12 14:52:17 +0100
commitfa597642871e284bb1b7c86996bb58c79c9c799c (patch)
tree01684a10229dbf52aac20e54c59d1c3fa36c09c2
parent7f3dea3afdb7a9845f0e23d7a3be010d3529ace3 (diff)
downloadlibgphoto2-fa597642871e284bb1b7c86996bb58c79c9c799c.tar.gz
fixed conditional building of lumix driver.
automake method did not work, so just build an empty driver if we do not have libxml2 or libcurl fixes https://github.com/gphoto/gphoto2/issues/281 fixes https://github.com/gphoto/libgphoto2/issues/466
-rw-r--r--camlibs/lumix/Makefile-files6
-rw-r--r--camlibs/lumix/lumix.c47
2 files changed, 35 insertions, 18 deletions
diff --git a/camlibs/lumix/Makefile-files b/camlibs/lumix/Makefile-files
index d8d151ff8..1670b332b 100644
--- a/camlibs/lumix/Makefile-files
+++ b/camlibs/lumix/Makefile-files
@@ -1,13 +1,9 @@
# -*- Makefile -*-
EXTRA_DIST += lumix/README.lumix
-
noinst_DATA += lumix/README.lumix
-if BUILD_LUMIX
+
EXTRA_LTLIBRARIES += lumix.la
-else
-EXTRA_DIST += lumix/lumix.c
-endif
lumix_la_SOURCES = lumix/lumix.c
lumix_la_CFLAGS = $(AM_CFLAGS) $(NO_UNUSED_CFLAGS) $(CFLAGS) $(LIBXML2_CFLAGS) $(LIBCURL_CFLAGS)
diff --git a/camlibs/lumix/lumix.c b/camlibs/lumix/lumix.c
index eeb0a0b54..3115b0648 100644
--- a/camlibs/lumix/lumix.c
+++ b/camlibs/lumix/lumix.c
@@ -24,15 +24,20 @@
*/
#include "config.h"
+
#include <string.h>
#include <errno.h>
-#include <curl/curl.h>
+#ifdef HAVE_LIBCURL
+# include <curl/curl.h>
+#endif
#include <stdio.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
#include <stdlib.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/xmlreader.h>
+#ifdef HAVE_LIBXML2
+# include <libxml/parser.h>
+# include <libxml/tree.h>
+# include <libxml/xmlmemory.h>
+# include <libxml/xmlreader.h>
+#endif
#include <sys/socket.h>
@@ -82,6 +87,8 @@
# define N_(String) (String)
#endif
+#if defined(HAVE_LIBCURL) && defined(HAVE_LIBXML2)
+
char* CDS_Control = ":60606/Server0/CDS_control";
int ReadoutMode = 2; // this should be picked up from the settings.... 0-> JPG; 1->RAW; 2 -> Thumbnails
char* cameraShutterSpeed = "B"; // //placeholder to store the value of the shutterspeed set in camera; "B" is for bulb.
@@ -370,14 +377,6 @@ storage_info_func (CameraFilesystem *fs,
/**********************************************************************/
-int
-camera_id (CameraText *id)
-{
- strcpy(id->text, "Lumix Wifi");
-
- return GP_OK;
-}
-
static size_t
write_callback(char *contents, size_t size, size_t nmemb, void *userp)
{
@@ -1919,3 +1918,25 @@ camera_init (Camera *camera, GPContext *context)
} else
return GP_ERROR_IO;
}
+
+#else
+/* no XML2 or no CURL -> no camera here */
+int
+camera_init (Camera *camera, GPContext *context)
+{
+ return GP_OK;
+}
+
+int camera_abilities (CameraAbilitiesList *list)
+{
+ return GP_OK;
+}
+#endif
+
+int
+camera_id (CameraText *id)
+{
+ strcpy(id->text, "Lumix Wifi");
+
+ return GP_OK;
+}