]> err.no Git - libchamplain/commitdiff
Make champlain-gtk build conditional
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Thu, 12 Feb 2009 20:34:31 +0000 (22:34 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Thu, 12 Feb 2009 20:34:31 +0000 (22:34 +0200)
Makefile.am
champlain-gtk/Makefile.am
configure.ac
demos/Makefile.am

index 7995343c86b5ec287e85d05f4d14e7dec92d43a4..97b1bb8f2088b432f08fde97ab6fe937ee59a1a2 100644 (file)
@@ -1,13 +1,17 @@
-SUBDIRS = tidy champlain champlain-gtk demos docs/reference
+SUBDIRS = tidy champlain docs/reference
 
 ACLOCAL_AMFLAGS = -I m4
 
-pcfiles = champlain-@API_VERSION@.pc champlain-gtk-@API_VERSION@.pc
+pcfiles = champlain-@API_VERSION@.pc
 
-champlain-@API_VERSION@.pc: champlain.pc
+if ENABLE_GTK
+SUBDIRS += champlain-gtk
+pcfiles += champlain-gtk-@API_VERSION@.pc
+champlain-gtk-@API_VERSION@.pc: champlain-gtk.pc
        @cp -f $< $@
+endif
 
-champlain-gtk-@API_VERSION@.pc: champlain-gtk.pc
+champlain-@API_VERSION@.pc: champlain.pc
        @cp -f $< $@
 
 pkgconfig_DATA = $(pcfiles)
@@ -16,3 +20,6 @@ pkgconfigdir = $(libdir)/pkgconfig
 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
 
 CLEANFILES = $(pcfiles)
+
+# Have the demos build at the end as they depend on optional parts
+SUBDIRS += demos
index dedeb1584346f8fa891768c8e7649900563beb6f..a6b4ed38ab6e409e18ba2bf2b4efaec31ab34d4d 100644 (file)
@@ -17,7 +17,7 @@ libchamplain_gtk_0_3_la_SOURCES = \
 
 noinst_HEADERS = champlain-view-embed.h
 
-libchamplain_gtk_0_3_la_LIBADD = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS)
+libchamplain_gtk_0_3_la_LIBADD = $(GTK_DEPS_LIBS)
 
 champlain-gtk-marshal.h: $(CHAMPLAIN_GTK_MARSHAL_LIST)
        @GLIB_GENMARSHAL@ --header --prefix=champlain_gtk_marshal $< > $(CHAMPLAIN_GTK_MARSHAL).h 
@@ -30,7 +30,7 @@ libchamplain_include_HEADERS = champlain-gtk.h champlain-view-embed.h
 
 libchamplain_gtk_0_3_la_LDFLAGS= -version-info $(LIBRARY_VERSION)
 
-AM_CPPFLAGS = $(DEPS_CFLAGS) $(CPLAIN_DEPS_CFLAGS) -I$(top_srcdir) -DCHAMPLAIN_GTK_COMPILATION
-AM_LDFLAGS = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) -export-symbols-regex ^champlain_.*
+AM_CPPFLAGS = $(GTK_DEPS_CFLAGS) -I$(top_srcdir) -DCHAMPLAIN_GTK_COMPILATION
+AM_LDFLAGS = $(GTK_DEPS_LIBS) -export-symbols-regex ^champlain_.*
 
 EXTRA_DIST = $(CHAMPLAIN_GTK_MARSHAL_LIST)
index f144e0b82ec5863109e5721933fc3fee7cf21559..a5442e5c2aa1730f5339f5b8cf6834e058fcf87e 100644 (file)
@@ -31,11 +31,9 @@ PKG_CHECK_MODULES(DEPS,
       gdk-2.0 >= 2.10,
       clutter-0.8 >= 0.8,
       clutter-cairo-0.8 >= 0.8,
-      clutter-gtk-0.8 >= 0.8,
       cairo >= 1.4,
       libsoup-2.4 >= 2.4.1,
       gio-2.0 >= 2.16
-      gtk+-2.0 >= 2.2
   ]
 )
 # check for gtk-doc
@@ -52,17 +50,40 @@ AC_ARG_ENABLE(debug,
 if test x$enable_debug = xyes; then
   AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
 fi
+
+# -----------------------------------------------------------
+# Enable debug
+# -----------------------------------------------------------
+
+AC_ARG_ENABLE(gtk,
+  AC_HELP_STRING([--disable-gtk],[Don't compile Gtk+ embedded view]),
+    enable_gtk=$enableval, enable_gtk=yes )
+
+if test x$enable_gtk = xyes; then
+  AC_SUBST(GTK_DEPS_CFLAGS)
+  AC_SUBST(GTK_DEPS_LIBS)
+  PKG_CHECK_MODULES(GTK_DEPS,
+    [   gtk+-2.0 >= 2.2
+        clutter-gtk-0.8 >= 0.8
+    ]
+  )
+
+  AC_CONFIG_FILES([champlain-gtk/Makefile
+                   champlain-gtk.pc])
+
+  AC_DEFINE(ENABLE_GTK, [], [Enable Gtk+ view code])
+fi
+
+AM_CONDITIONAL(ENABLE_GTK, test "x$enable_gtk" = "xyes")
 # -----------------------------------------------------------
 
 AC_CONFIG_FILES([Makefile
                  champlain/Makefile
-                 champlain-gtk/Makefile
                  demos/Makefile
                  tidy/Makefile
                  docs/reference/Makefile
                  docs/reference/version.xml
-                 champlain.pc
-                 champlain-gtk.pc])
+                 champlain.pc])
 AC_OUTPUT
 
 echo ""
@@ -71,4 +92,5 @@ echo ""
 echo "         Prefix: ${prefix}"
 echo " Compiler flags: ${CPPFLAGS}"
 echo "          Debug: ${enable_debug}"
+echo "      Gtk+ View: ${enable_gtk}"
 
index 8ff4f52bd4094a2c3989ebec52c415a261a1627c..710c090752e644067113924beaf5b75b655d93d0 100644 (file)
@@ -1,4 +1,4 @@
-noinst_PROGRAMS = launcher launcher-gtk animated-marker
+noinst_PROGRAMS = launcher animated-marker
 
 INCLUDES = -I$(top_srcdir)
 
@@ -11,7 +11,11 @@ launcher_LDADD = $(DEPS_LIBS) ../champlain/libchamplain-0.3.la
 animated_marker_SOURCES = animated-marker.c
 animated_marker_LDADD = $(DEPS_LIBS) ../champlain/libchamplain-0.3.la
 
+if ENABLE_GTK
+noinst_PROGRAMS += launcher-gtk
 launcher_gtk_SOURCES = launcher-gtk.c
-launcher_gtk_LDADD = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) \
+launcher_gtk_CPPFLAGS = $(GTK_DEPS_CFLAGS)
+launcher_gtk_LDADD = $(GTK_DEPS_LIBS) $(DEPS_LIBS) \
                ../champlain-gtk/libchamplain-gtk-0.3.la \
                ../champlain/libchamplain-0.3.la
+endif