[solang] Added a compile time switch to disable the BraseroDestination



commit f053528e38bdb70153dd9c45d83415f7852da18e
Author: Debarshi Ray <rishi gnu org>
Date:   Fri Mar 5 16:06:18 2010 +0200

    Added a compile time switch to disable the BraseroDestination

 configure.ac                    |   28 +++++++++++++++++++++++++++-
 src/application/application.cpp |    6 ++++++
 src/exporter/Makefile.am        |   12 ++++++++++--
 3 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index decaa8f..91c6d6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,6 @@ if test x"$DBUS_BINDING_TOOL" = x"no"; then
 fi
 
 PKG_CHECK_MODULES(BABL, [babl])
-PKG_CHECK_MODULES(BRASERO, [libbrasero-burn >= 2.28.3])
 PKG_CHECK_MODULES(DBUS, [dbus-glib-1])
 PKG_CHECK_MODULES(GDL, [gdl-1.0])
 PKG_CHECK_MODULES(GEGLMM, [geglmm >= 0.1.0])
@@ -43,6 +42,28 @@ PKG_CHECK_MODULES(GTKIMAGEVIEW, [gtkimageview])
 PKG_CHECK_MODULES(GTKMM, [gtkmm-2.4 >= 2.8])
 PKG_CHECK_MODULES(TRACKER, [tracker-client-0.7 >= 0.7.16])
 
+AC_ARG_ENABLE(
+    [brasero-exporter],
+    [AS_HELP_STRING(
+        [--disable-brasero-exporter],
+        [disable the Brasero-based CD/DVD exporter (default=auto)])],
+    [],
+    [enable_brasero_exporter=auto])
+AS_IF([test "x$enable_brasero_exporter" != xno],
+      [PKG_CHECK_MODULES(
+           [BRASERO],
+           [libbrasero-burn >= 2.28.3],
+           [have_brasero=yes
+            AC_DEFINE([HAVE_BRASERO],
+                      [1],
+                      [Define to 1 if you have Brasero >= 2.28.3])],
+           [if test "x$enable_brasero_exporter" != xauto; then
+                AC_MSG_FAILURE(
+                    [Can't enable the Brasero-based CD/DVD exporter])
+            fi])],
+      [have_brasero=no])
+AM_CONDITIONAL([BUILD_BRASERO_EXPORTER],
+               [test "x$have_brasero" = xyes])
 
 AC_CONFIG_FILES([
 Makefile
@@ -68,3 +89,8 @@ src/renderer/Makefile
 po/Makefile.in
 ])
 AC_OUTPUT
+
+AC_MSG_RESULT([
+Building $PACKAGE_NAME with prefix=$prefix
+Brasero-based CD/DVD exporter: $have_brasero
+])
diff --git a/src/application/application.cpp b/src/application/application.cpp
index f2ee23b..6c68798 100644
--- a/src/application/application.cpp
+++ b/src/application/application.cpp
@@ -28,7 +28,11 @@
 #include <giomm.h>
 
 #include "application.h"
+
+#ifdef HAVE_BRASERO
 #include "brasero-destination.h"
+#endif // HAVE_BRASERO
+
 #include "browser-model-column-record.h"
 #include "browser-renderer.h"
 //#include "camera-source.h"
@@ -289,11 +293,13 @@ Application::init() throw()
                                                true));
     plugins_.push_back(directory_exporter);
 
+#ifdef HAVE_BRASERO
     IPhotoDestinationPtr brasero_destination(
                              new BraseroDestination());
     IPluginPtr brasero_exporter(new Exporter(brasero_destination,
                                              false));
     plugins_.push_back(brasero_exporter);
+#endif // HAVE_BRASERO
 
 //    IPhotoSourcePtr directory_source(new DirectorySource());
 //    IPluginPtr directory_importer(new Importer(directory_source, true));
diff --git a/src/exporter/Makefile.am b/src/exporter/Makefile.am
index 3ae3dbe..aae13d1 100644
--- a/src/exporter/Makefile.am
+++ b/src/exporter/Makefile.am
@@ -8,11 +8,19 @@ libexporter_la_SOURCES = \
 	photo-destination.h \
 	photo-destination.cpp \
 	photo-destination-enums.h \
-	brasero-destination.cpp \
-	brasero-destination.h \
 	directory-destination.h \
 	directory-destination.cpp
 
+if BUILD_BRASERO_EXPORTER
+libexporter_la_SOURCES += \
+	brasero-destination.cpp \
+	brasero-destination.h
+endif
+
+EXTRA_libexporter_la_SOURCES = \
+	brasero-destination.cpp \
+	brasero-destination.h
+
 AM_CPPFLAGS = \
 	-DPACKAGE_LOCALE_DIR=\""${datadir}/locale"\" \
 	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \



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