[glom/glom-1-14] Allow libglom to be built without building the Glom UI code too.



commit 12675943e2b38fd512001f3e96983224572e3ebd
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Dec 13 13:01:30 2010 +0100

    Allow libglom to be built without building the Glom UI code too.
    
    * configure.ac: Added an --enable-glom-ui option, defaulting to yes.
    When using --enable-glom-ui=no then only libglom will be built. This is
    useful for deployment of libglom to servers where the UI dependencies are not
    wanted.
    We still use GLOM_LIBS and GLOM_FLAGS even in libglom, instead of using
    LIBGLOM_LIBS and LIBGLOM_CFLAGS anywhere, but this does reduce duplication
    of the flags in glom's UI build.
    * Makefile.am: Do not include Makefile_glom.am if the UI should not be built.
    * Makefile_glom.am: Move the bin_programs definition to here.
    * Makefile_libglom.am: Move the LTLIBRARIES definitions to here.
    * Makefile_tests.am: Attempt, unsuccessfully, to build and run UI-dependent
    tests only when the UI was built, when running make check.
    
    This is a corrected version of the same commit from master.

 ChangeLog           |   25 +++++++++++++++++++++++++
 Makefile.am         |    8 ++++----
 Makefile_glom.am    |    2 ++
 Makefile_libglom.am |    3 +++
 Makefile_tests.am   |    1 +
 configure.ac        |   15 +++++++++++++++
 6 files changed, 50 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9f27a95..a851be1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2010-12-13  Murray Cumming  <murrayc murrayc com>
+
+	Correct my previous commit.
+
+	* configure.ac: Correct the no/yes test for --enable-glom-ui and add a comma 
+	so it actually works.
+	* Makefile_tests.am: Restore the source file lists for the python tests.
+
+2010-12-13  Murray Cumming  <murrayc murrayc com>
+
+	Allow libglom to be built without building the Glom UI code too.
+	
+	* configure.ac: Added an --enable-glom-ui option, defaulting to yes.
+	When using --enable-glom-ui=no then only libglom will be built. This is 
+	useful for deployment of libglom to servers where the UI dependencies are not 
+	wanted.
+	We still use GLOM_LIBS and GLOM_FLAGS even in libglom, instead of using 
+	LIBGLOM_LIBS and LIBGLOM_CFLAGS anywhere, but this does reduce duplication 
+	of the flags in glom's UI build.
+	* Makefile.am: Do not include Makefile_glom.am if the UI should not be built.
+	* Makefile_glom.am: Move the bin_programs definition to here.
+	* Makefile_libglom.am: Move the LTLIBRARIES definitions to here.
+	* Makefile_tests.am: Attempt, unsuccessfully, to build and run UI-dependent 
+	tests only when the UI was built, when running make check. 
+
 1.14.7:
 
 2010-11-12  Murray Cumming  <murrayc murrayc com>
diff --git a/Makefile.am b/Makefile.am
index 0c3554f..61840fe 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,12 +49,12 @@ win_resfile =
 endif
 SUFFIXES = .rc .res
 
-bin_PROGRAMS = glom/glom
-lib_LTLIBRARIES = glom/libglom/libglom- GLOM_ABI_VERSION@.la
-pyexec_LTLIBRARIES = glom/python_embed/python_module/glom_ GLOM_ABI_VERSION_UNDERLINED@.la
-
 include Makefile_libglom.am
+
+if GLOM_ENABLE_UI
 include Makefile_glom.am
+endif
+
 include Makefile_tests.am
 
 glom_python_embed_python_module_glom_ GLOM_ABI_VERSION_UNDERLINED@_la_SOURCES =		\
diff --git a/Makefile_glom.am b/Makefile_glom.am
index cb2ab37..aeb53fc 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -15,6 +15,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+bin_PROGRAMS = glom/glom
+
 glom_source_files = \
 	glom/application.cc						\
 	glom/application.h						\
diff --git a/Makefile_libglom.am b/Makefile_libglom.am
index 3c69775..8b6e665 100644
--- a/Makefile_libglom.am
+++ b/Makefile_libglom.am
@@ -15,6 +15,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+lib_LTLIBRARIES = glom/libglom/libglom- GLOM_ABI_VERSION@.la
+pyexec_LTLIBRARIES = glom/python_embed/python_module/glom_ GLOM_ABI_VERSION_UNDERLINED@.la
+
 libglom_includedir = $(includedir)/glom-$(GLOM_ABI_VERSION)/libglom
 libglom_include_HEADERS =			\
 	glom/libglom/appstate.h			\
diff --git a/Makefile_tests.am b/Makefile_tests.am
index e822ecc..6088f9a 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -153,3 +153,4 @@ tests_import_test_parsing_LDADD = $(GLOM_LIBS)
 tests_import_test_signals_LDADD = $(GLOM_LIBS)
 tests_test_glade_derived_instantiation_LDADD = $(glom_all_libs)
 tests_test_selfhosting_new_empty_LDADD = $(glom_all_libs)
+
diff --git a/configure.ac b/configure.ac
index 6039854..af7875c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,6 +77,13 @@ AS_IF([test "x$glom_host_win32" = xyes],
 
 AM_CONDITIONAL([HOST_WIN32], [test "x$glom_host_win32" = xyes])
 
+AC_ARG_ENABLE([glom-ui],
+              [AS_HELP_STRING([--enable-glom-ui],
+                              [build the glom UI application instead of just libglom [default=yes]])],
+              [glom_enable_ui=$enableval],
+              [glom_enable_ui=yes])
+AM_CONDITIONAL([GLOM_ENABLE_UI], [test "x$glom_enable_ui" = xyes])
+              
 # In most cases, you'll want all these options for the maemo build:
 #   ./configure --prefix=/usr --enable-postgesql --enable-sqlite --enable-maemo;make all install
 # And you might need to do:
@@ -94,6 +101,7 @@ AC_ARG_ENABLE([client-only],
                               [build without developer mode and self-hosting])],
               [glom_enable_client_only=$enableval],
               [glom_enable_client_only=$glom_enable_maemo])
+              
 
 # Bail out if --enable-maemo and --disable-client-only are used together.
 AS_IF([test "x$glom_enable_maemo" = xyes && test "x$glom_enable_client_only" != xyes],
@@ -171,7 +179,14 @@ AS_IF([test "x$glom_enable_maemo" = xyes],
 AS_IF([test "x$glom_maemo_launcher" = xyes],
       [REQUIRED_GLOM_LIBS="$REQUIRED_GLOM_LIBS maemo-launcher-app"])
 
+#TODO: Remove this check, because we checked again later anyway, 
+#because we add REQUIRED_LIBGLOM_LIBS to REQUIRED_GLOM_LIBS?
 PKG_CHECK_MODULES([LIBGLOM], [$REQUIRED_LIBGLOM_LIBS])
+
+#Disable the checks for UI dependencies if not building the UI:
+AS_IF([test "x$glom_enable_ui" = xno],
+      [REQUIRED_GLOM_LIBS="$REQUIRED_LIBGLOM_LIBS"])
+
 PKG_CHECK_MODULES([GLOM], [$REQUIRED_GLOM_LIBS])
 
 MM_PKG_CONFIG_SUBST([GLIB_GENMARSHAL], [--variable=glib_genmarshal glib-2.0])



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