[aravis] build: rename configure options.



commit 5025eb4e2e9535e0f109f7692956d5fb381af9a2
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sun Apr 24 18:36:56 2011 +0200

    build: rename configure options.
    
    Use more meaningful names:
    
    --enable-viewer for the simple video viewer
    --enable-gts-plugin for the gstreamer plugin

 Makefile.am        |   12 +++++--
 configure.ac       |   95 +++++++++++++++++++++-------------------------------
 gst/Makefile.am    |    9 ++---
 tests/Makefile.am  |    4 +-
 tests/arvtest.c    |   33 +-----------------
 viewer/Makefile.am |    4 +-
 6 files changed, 55 insertions(+), 102 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 20f7d28..cb6d1b5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,14 +4,20 @@ include $(top_srcdir)/Makefile.decl
 
 ACLOCAL_AMFLAGS = -I m4
 
-DISTCHECK_CONFIGURE_FLAGS = --enable-introspection --enable-gtk-doc --enable-cairo --enable-gtk --enable-gstreamer
+DISTCHECK_CONFIGURE_FLAGS = --enable-introspection --enable-gtk-doc --enable-gst-plugin --enable-viewer
 
-SUBDIRS = src gst tests po docs
+SUBDIRS = src
 
-if ARAVIS_VIEWER
+if ARAVIS_BUILD_VIEWER
 SUBDIRS += viewer
 endif
 
+if ARAVIS_BUILD_GST_PLUGIN
+SUBDIRS += gst
+endif
+
+SUBDIRS += tests po docs
+
 aravisdocdir = ${prefix}/doc/aravis- ARAVIS_API_VERSION@
 aravisdoc_DATA = 	\
 	README		\
diff --git a/configure.ac b/configure.ac
index 128089a..d5f6bb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,55 +29,49 @@ IT_PROG_INTLTOOL([0.31.2])
 
 LT_INIT()
 
-AC_ARG_ENABLE(cairo,
-	      [  --enable-cairo          Enable cairo support],
-	      [enable_cairo=$enableval],
-	      [enable_cairo=no])
-AC_ARG_ENABLE(gtk,
-	      [  --enable-gtk            Enable gtk support],
-	      [enable_gtk=$enableval],
-	      [enable_gtk=no])
-AC_ARG_ENABLE(gstreamer,
-	      [  --enable-gstreamer      Enable gstreamer support],
-	      [enable_gstreamer=$enableval],
-	      [enable_gstreamer=no])
+AC_ARG_ENABLE(gst_plugin,
+	      [  --enable-gst-plugin     build gstreamer plugin],
+	      [enable_gst_plugin=$enableval],
+	      [enable_gst_plugin=no])
+AC_ARG_ENABLE(viewer,
+	      [  --enable-viewer         build viewer],
+	      [enable_viewer=$enableval],
+	      [enable_viewer=no])
 
 PKG_PROG_PKG_CONFIG([0.14])
 
 ARAVIS_REQUIRES="[gobject-2.0 glib-2.0 >= 2.22 gio-2.0 libxml-2.0 gthread-2.0]"
-ARAVIS_EXTRA_REQUIRES="${ARAVIS_REQUIRES}"
-
-with_cairo=no
-if test "x$enable_cairo" = "xyes"; then
-	PKG_CHECK_MODULES([CAIRO],   [cairo >= 1.2],
-			  [AC_DEFINE([ARAVIS_WITH_CAIRO], [1], [Cairo support])
-			  ARAVIS_EXTRA_REQUIRES="${ARAVIS_EXTRA_REQUIRES} [cairo >= 1.2]"
-			  with_cairo=yes],
-			  [echo -n])
-fi
-AM_CONDITIONAL(ARAVIS_WITH_CAIRO, test "x$with_cairo" = "xyes")
-
-with_gtk=no
-if test "x$enable_gtk" = "xyes"; then
-	PKG_CHECK_MODULES([GTK],   [gtk+-2.0 >= 2.12],
-			  [AC_DEFINE([ARAVIS_WITH_GTK], [1], [Gtk support])
-			  ARAVIS_EXTRA_REQUIRES="${ARAVIS_EXTRA_REQUIRES} [gtk+-2.0 >= 2.12]"
-			  with_gtk=yes],
+
+PKG_CHECK_MODULES(ARAVIS, $ARAVIS_REQUIRES)
+
+AC_SUBST(ARAVIS_CFLAGS)
+AC_SUBST(ARAVIS_LIBS)
+
+AC_SUBST(aravis_datadir, '$(datadir)/aravis-$(ARAVIS_API_VERSION)')
+
+build_viewer=no
+if test "x$enable_viewer" = "xyes"; then
+	PKG_CHECK_MODULES([ARAVIS_VIEWER],   [gtk+-2.0 >= 2.12 gstreamer-base-0.10 >= 0.10 gstreamer-app-0.10 gstreamer-interfaces-0.10],
+			  [AC_DEFINE([ARAVIS_BUILD_VIEWER], [1], [Build viewer])
+			  build_viewer=yes],
 			  [echo -n])
 fi
-AM_CONDITIONAL(ARAVIS_WITH_GTK, test "x$with_gtk" = "xyes")
-
-with_gstreamer=no
-if test "x$enable_gstreamer" = "xyes"; then
-	PKG_CHECK_MODULES([GSTREAMER],   [gstreamer-base-0.10 >= 0.10 gstreamer-app-0.10 gstreamer-interfaces-0.10],
-			  [AC_DEFINE([ARAVIS_WITH_GSTREAMER], [1], [Cairo support])
-			  ARAVIS_EXTRA_REQUIRES="${ARAVIS_EXTRA_REQUIRES} [gstreamer-base-0.10 >= 0.10 gstreamer-app-0.10 gstreamer-interfaces-0.10]"
-			  with_gstreamer=yes],
+AM_CONDITIONAL(ARAVIS_BUILD_VIEWER, test "x$build_viewer" = "xyes")
+
+AC_SUBST(ARAVIS_VIEWER_CFLAGS)
+AC_SUBST(ARAVIS_VIEWER_LIBS)
+
+build_gst_plugin=no
+if test "x$enable_gst_plugin" = "xyes"; then
+	PKG_CHECK_MODULES([ARAVIS_GST_PLUGIN],   [gstreamer-base-0.10 >= 0.10 gstreamer-app-0.10 gstreamer-interfaces-0.10],
+			  [AC_DEFINE([ARAVIS_BUILD_GST_PLUGIN], [1], [Build gstreamer plugin])
+			  build_gst_plugin=yes],
 			  [echo -n])
 fi
-AM_CONDITIONAL(ARAVIS_WITH_GSTREAMER, test "x$with_gstreamer" = "xyes")
+AM_CONDITIONAL(ARAVIS_BUILD_GST_PLUGIN, test "x$build_gst_plugin" = "xyes")
 
-AM_CONDITIONAL(ARAVIS_VIEWER, test "x$with_gtk$with_gstreamer" = "xyesyes")
+AC_SUBST(ARAVIS_GST_PLUGIN_CFLAGS)
+AC_SUBST(ARAVIS_GST_PLUGIN_LIBS)
 
 if test "x${prefix}" = "x$HOME"; then
   gstplugindir="$HOME/.gstreamer-0.10/plugins"
@@ -86,21 +80,9 @@ else
 fi
 AC_SUBST(gstplugindir)
 
-AC_SUBST(aravis_datadir, '$(datadir)/aravis-$(ARAVIS_API_VERSION)')
-
 GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
 AC_SUBST(GST_PLUGIN_LDFLAGS)
 
-PKG_CHECK_MODULES(ARAVIS, $ARAVIS_REQUIRES)
-
-AC_SUBST(ARAVIS_CFLAGS)
-AC_SUBST(ARAVIS_LIBS)
-
-PKG_CHECK_MODULES(ARAVIS_EXTRA, $ARAVIS_EXTRA_REQUIRES)
-
-AC_SUBST(ARAVIS_EXTRA_CFLAGS)
-AC_SUBST(ARAVIS_EXTRA_LIBS)
-
 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
 
 GOBJECT_INTROSPECTION_CHECK([0.10.0])
@@ -110,9 +92,9 @@ AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "
 AC_CONFIG_FILES([
 Makefile
 src/Makefile
+viewer/Makefile
 gst/Makefile
 tests/Makefile
-viewer/Makefile
 po/Makefile.in
 docs/Makefile
 docs/reference/Makefile
@@ -125,10 +107,9 @@ AC_OUTPUT
 echo ""
 echo "Configuration:"
 echo ""
-echo "	Cairo support:		$with_cairo"
-echo "	Gtk+ support:           $with_gtk"
-echo "	Gstreamer support:	$with_gstreamer"
+echo "	Build viewer:		$build_viewer"
+echo "	Build gstreamer plugin:	$build_gst_plugin"
 echo "	Compiler:		${CC}"
 echo "	Compiler flags:		${ARAVIS_CFLAGS}"
-echo "	Compiler extra flags:	${ARAVIS_EXTRA_CFLAGS}"
+echo "	Linker flags:		${ARAVIS_LIBS}"
 echo ""
diff --git a/gst/Makefile.am b/gst/Makefile.am
index 895dd0b..c6339f2 100644
--- a/gst/Makefile.am
+++ b/gst/Makefile.am
@@ -4,7 +4,7 @@ INCLUDES = \
 	-I$(top_srcdir)/src/ \
 	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
 	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
-	-DPACKAGE_DATA_DIR=\""$(datadir)"\" $(ARAVIS_EXTRA_CFLAGS) \
+	-DPACKAGE_DATA_DIR=\""$(datadir)"\" $(ARAVIS_GST_PLUGIN_CFLAGS) \
 	-DG_LOG_DOMAIN=\"Aravis\"
 
 AM_CFLAGS =\
@@ -13,13 +13,11 @@ AM_CFLAGS =\
 	 -g \
 	 -O0
 
-if ARAVIS_WITH_GSTREAMER
-
 gstplugin_LTLIBRARIES = libgstaravis- ARAVIS_API_VERSION@.la
 
 libgstaravis_ ARAVIS_API_VERSION@_la_SOURCES = gstaravis.c gstaravis.h
-libgstaravis_ ARAVIS_API_VERSION@_la_CFLAGS = $(ARAVIS_EXTRA_CFLAGS)
-libgstaravis_ ARAVIS_API_VERSION@_la_LIBADD = $(ARAVIS_EXTRA_LIBS)
+libgstaravis_ ARAVIS_API_VERSION@_la_CFLAGS = $(ARAVIS_GST_PLUGIN_CFLAGS)
+libgstaravis_ ARAVIS_API_VERSION@_la_LIBADD = $(ARAVIS_GST_PLUGIN_LIBS)
 libgstaravis_ ARAVIS_API_VERSION@_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
 libgstaravis_ ARAVIS_API_VERSION@_la_LIBTOOLFLAGS = --tag=disable-static
 
@@ -27,4 +25,3 @@ libgstaravis_ ARAVIS_API_VERSION@_ladir = $(includedir)/aravis- ARAVIS_API_VERSI
 
 noinst_HEADERS = gstaravis.h
 
-endif
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6e05b26..dd33095 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,10 +1,10 @@
 include $(top_srcdir)/Makefile.decl
 
-INCLUDES = -g -I$(top_srcdir)/src/ $(ARAVIS_EXTRA_CFLAGS)
+INCLUDES = -g -I$(top_srcdir)/src/ $(ARAVIS_CFLAGS)
 
 test_progs_ldadd = 					\
 	$(top_builddir)/src/libaravis- ARAVIS_API_VERSION@.la		\
-	$(ARAVIS_EXTRA_LIBS)
+	$(ARAVIS_LIBS)
 
 noinst_PROGRAMS = arv-test arv-genicam-test arv-evaluator-test arv-zip-test arv-camera-test
 
diff --git a/tests/arvtest.c b/tests/arvtest.c
index c881acf..c59be8f 100644
--- a/tests/arvtest.c
+++ b/tests/arvtest.c
@@ -1,7 +1,4 @@
 #include <arv.h>
-#ifdef ARAVIS_WITH_CAIRO
-#include <cairo.h>
-#endif
 #include <stdlib.h>
 
 static gboolean cancel = FALSE;
@@ -14,9 +11,6 @@ set_cancel (int signal)
 
 static char *arv_option_camera_name = NULL;
 static char *arv_option_debug_domains = NULL;
-#ifdef ARAVIS_WITH_CAIRO
-static gboolean arv_option_snaphot = FALSE;
-#endif
 static gboolean arv_option_auto_buffer = FALSE;
 static int arv_option_width = -1;
 static int arv_option_height = -1;
@@ -27,10 +21,6 @@ static const GOptionEntry arv_option_entries[] =
 {
 	{ "name",		'n', 0, G_OPTION_ARG_STRING,
 		&arv_option_camera_name,"Camera name", NULL},
-#ifdef ARAVIS_WITH_CAIRO
-	{ "snapshot",		's', 0, G_OPTION_ARG_NONE,
-		&arv_option_snaphot,	"Snapshot", NULL},
-#endif
 	{ "auto",		'a', 0, G_OPTION_ARG_NONE,
 		&arv_option_auto_buffer,	"AutoBufferSize", NULL},
 	{ "width", 		'w', 0, G_OPTION_ARG_INT,
@@ -61,9 +51,6 @@ main (int argc, char **argv)
 	GError *error = NULL;
 	char memory_buffer[100000];
 	int i;
-#ifdef ARAVIS_WITH_CAIRO
-	gboolean snapshot_done = FALSE;
-#endif
 
 	g_thread_init (NULL);
 	g_type_init ();
@@ -213,26 +200,8 @@ main (int argc, char **argv)
 
 			do  {
 				buffer = arv_stream_pop_buffer (stream);
-				if (buffer != NULL) {
-#ifdef ARAVIS_WITH_CAIRO
-					if (arv_option_snaphot &&
-					    !snapshot_done &&
-					    buffer->status == ARV_BUFFER_STATUS_SUCCESS) {
-						snapshot_done = TRUE;
-
-						cairo_surface_t *surface;
-
-						surface = cairo_image_surface_create_for_data (buffer->data,
-											       CAIRO_FORMAT_A8,
-											       buffer->width,
-											       buffer->height,
-											       buffer->width);
-						cairo_surface_write_to_png (surface, "test.png");
-						cairo_surface_destroy (surface);
-					}
-#endif
+				if (buffer != NULL)
 					arv_stream_push_buffer (stream, buffer);
-				}
 			} while (buffer != NULL);
 		} while (!cancel);
 
diff --git a/viewer/Makefile.am b/viewer/Makefile.am
index 68748e3..f68108b 100644
--- a/viewer/Makefile.am
+++ b/viewer/Makefile.am
@@ -6,7 +6,7 @@ INCLUDES = \
 	-I$(top_srcdir)/src \
 	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
 	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
-	-DPACKAGE_DATA_DIR=\""$(datadir)"\" $(ARAVIS_EXTRA_CFLAGS) \
+	-DPACKAGE_DATA_DIR=\""$(datadir)"\" $(ARAVIS_VIEWER_CFLAGS) \
 	-DARAVIS_DATA_DIR=\""$(aravis_datadir)"\" \
 	-DG_LOG_DOMAIN=\"Aravis\"
 
@@ -18,7 +18,7 @@ arv_viewer_ ARAVIS_API_VERSION@_SOURCES = arvviewer.c	\
 		     arvfeaturewidget.c \
 		     arvfeaturewidget.h
 
-arv_viewer_ ARAVIS_API_VERSION@_LDADD = $(ARAVIS_EXTRA_LIBS) $(top_builddir)/src/libaravis- ARAVIS_API_VERSION@.la
+arv_viewer_ ARAVIS_API_VERSION@_LDADD = $(ARAVIS_VIEWER_LIBS) $(top_builddir)/src/libaravis- ARAVIS_API_VERSION@.la
 arv_viewer_ ARAVIS_API_VERSION@dir = $(aravis_datadir)
 arv_viewer_ ARAVIS_API_VERSION@_DATA = arv-viewer.ui
 



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