[gegl] add check for libv4l2 and make the v4l2 op conditional



commit 1010179c6b52cc5649bfef25e5fbb45a0e76445a
Author: Alexia Death <alexiadeath gmail com>
Date:   Tue Dec 9 22:56:20 2014 +0200

    add check for libv4l2 and make the v4l2 op conditional

 configure.ac                              |   21 +++++++++++++++++++++
 operations/workshop/external/Makefile.am  |    7 +++++++
 operations/workshop/{ => external}/v4l2.c |    0
 po/POTFILES.in                            |    2 +-
 4 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2bbfc4e..d76650d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,7 @@ m4_define([jasper_required_version], [1.900.1])
 m4_define([lcms_required_version], [2.2])
 m4_define([lensfun_required_version], [0.2.5])
 m4_define([librsvg_required_version], [2.14.0])
+m4_define([libv4l2_required_version], [1.0.1])
 m4_define([lua_required_version], [5.1.0])
 m4_define([openexr_required_version], [0.0.0])
 m4_define([openraw_required_version], [0.0.5])
@@ -799,6 +800,25 @@ AC_SUBST(RSVG_LIBS)
 
 
 ###################
+# Check for libv4l2
+###################
+
+AC_ARG_WITH(libv4l2, [  --without-libv4l2      build without v4l2 support])
+
+have_libv4l2="no"
+if test "x$with_libv4l" != "xno"; then
+  PKG_CHECK_MODULES(V4L2, libv4l2 >= libv4l2_required_version,
+    have_libv4l2="yes",
+    have_libv4l2="no  (usable libv4l2 not found)")
+fi
+
+AM_CONDITIONAL(HAVE_V4L2, test "$have_libv4l2" = "yes")
+
+AC_SUBST(V4L2_CFLAGS) 
+AC_SUBST(V4L2_LIBS) 
+
+
+###################
 # Check for OpenEXR
 ###################
 
@@ -1258,6 +1278,7 @@ Optional dependencies:
   graphviz:        $have_graphviz
   avformat:        $have_libavformat
   V4L:             $have_v4l
+  V4L2:            $have_libv4l2
   spiro:           $spiro_ok
   EXIV:            $have_exiv2
   umfpack:         $have_umfpack
diff --git a/operations/workshop/external/Makefile.am b/operations/workshop/external/Makefile.am
index 8c79d9c..c8453b0 100644
--- a/operations/workshop/external/Makefile.am
+++ b/operations/workshop/external/Makefile.am
@@ -32,5 +32,12 @@ lens_correct_la_LIBADD = $(op_libs) $(LENSFUN_LIBS)
 lens_correct_la_CFLAGS = $(AM_CFLAGS) $(LENSFUN_CFLAGS)
 endif
 
+if HAVE_V4L2
+ops += v4l2.la
+v4l2_la_SOURCES = v4l2.c
+v4l2_la_LIBADD = $(op_libs) $(V4L2_LIBS)
+v4l2_la_CFLAGS = $(AM_CFLAGS) $(V4L2_CFLAGS)
+endif
+
 opdir = $(libdir)/gegl- GEGL_API_VERSION@
 op_LTLIBRARIES = $(ops)
diff --git a/operations/workshop/v4l2.c b/operations/workshop/external/v4l2.c
similarity index 100%
rename from operations/workshop/v4l2.c
rename to operations/workshop/external/v4l2.c
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 63497cb..cf74f9d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -208,6 +208,7 @@ operations/workshop/external/ff-save.c
 operations/workshop/external/gluas.c
 operations/workshop/external/lens-correct.c
 operations/workshop/external/line-profile.c
+operations/workshop/external/v4l2.c
 operations/workshop/gaussian-blur-iir.c
 operations/workshop/gblur-1d.c
 operations/workshop/generated/average.c
@@ -223,4 +224,3 @@ operations/workshop/kuwahara.c
 operations/workshop/mandelbrot.c
 operations/workshop/rawbayer-load.c
 operations/workshop/snn-percentile.c
-operations/workshop/v4l2.c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]