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



commit 8cd48c5a02146b0551dc68382b6013061b5be0b8
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.

 ChangeLog           |   17 +++++++++
 Makefile.am         |    8 ++--
 Makefile_glom.am    |    2 +
 Makefile_libglom.am |    3 ++
 Makefile_tests.am   |  101 +++++++++++++++++++++++++++------------------------
 configure.ac        |   18 ++++++++--
 po/POTFILES.in      |    2 -
 7 files changed, 95 insertions(+), 56 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b83912c..da4045f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 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. 
+
+2010-12-13  Murray Cumming  <murrayc murrayc com>
+
   Fix the build with latest gtkmm.
   
 	* glom/mode_design/print_layouts/window_print_layout_edit.cc:
diff --git a/Makefile.am b/Makefile.am
index c6462dd..2ab51d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,12 +54,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 6e2e039..28c026f 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 37c6b81..668599a 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
+
 include $(top_srcdir)/glom/libglom/filelist.am
 
 libglom_includedir = $(includedir)/glom-$(GLOM_ABI_VERSION)/libglom
diff --git a/Makefile_tests.am b/Makefile_tests.am
index 72630f4..ebf2b43 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -18,23 +18,13 @@
 check_PROGRAMS =						\
 	glom/libglom/test_connectionpool			\
 	glom/libglom/example_document_load \
-	glom/libglom/test_sharedptr_layoutitem			\
-	glom/utility_widgets/test_flowtable			\
-	glom/mode_data/test_flowtablewithfields \
-	glom/test_pyembed					\
+	glom/libglom/test_sharedptr_layoutitem		\
 	tests/test_document_load			\
 	tests/test_document_autosave			\
 	tests/test_parsing_time			\
 	tests/test_signal_reemit			\
 	tests/test_load_python_library\
 	tests/test_python_module \
-	tests/test_python_execute_func \
-	tests/test_python_execute_func_bad_syntax \
-	tests/test_python_execute_func_date \
-	tests/test_python_execute_func_change_result_type \
-	tests/test_python_execute_script \
-	tests/test_glade_derived_instantiation \
-	tests/glade_toplevels_instantiation \
 	tests/test_selfhosting_new_empty \
 	tests/test_selfhosting_new_from_example \
 	tests/import/test_parsing \
@@ -46,15 +36,8 @@ TESTS =	tests/test_document_load	\
 	tests/test_signal_reemit \
 	tests/test_dtd_file_validation.sh \
 	tests/test_glade_file_validation.sh \
-	tests/test_glade_toplevels_instantiation.sh \
-	tests/test_glade_derived_instantiation \
 	tests/test_load_python_library \
 	tests/test_python_module \
-	tests/test_python_execute_func \
-	tests/test_python_execute_func_bad_syntax \
-	tests/test_python_execute_func_date \
-	tests/test_python_execute_func_change_result_type \
-	tests/test_python_execute_script \
 	tests/test_selfhosting_new_empty \
 	tests/test_selfhosting_new_from_example \
 	tests/import/test_parsing \
@@ -74,7 +57,7 @@ tests_ldadd = glom/libglom/libglom-$(GLOM_ABI_VERSION).la
 glom_libglom_test_connectionpool_SOURCES = glom/libglom/test_connectionpool.cc
 glom_libglom_example_document_load_SOURCES = glom/libglom/example_document_load.cc
 glom_libglom_test_sharedptr_layoutitem_SOURCES = glom/libglom/test_sharedptr_layoutitem.cc
-glom_test_pyembed_SOURCES = glom/test_pyembed.cc
+
 
 tests_test_document_load_SOURCES = tests/test_document_load.cc
 tests_test_document_autosave_SOURCES = tests/test_document_autosave.cc
@@ -82,16 +65,7 @@ tests_test_parsing_time_SOURCES = tests/test_parsing_time.cc
 tests_test_signal_reemit_SOURCES = tests/test_signal_reemit.cc
 tests_test_load_python_library_SOURCES = tests/test_load_python_library.cc
 tests_test_python_module_SOURCES = tests/test_python_module.cc
-tests_test_python_execute_func_SOURCES = tests/test_python_execute_func.cc \
-	glom/python_embed/glom_python.cc
-tests_test_python_execute_func_bad_syntax_SOURCES = tests/test_python_execute_func_bad_syntax.cc \
-	glom/python_embed/glom_python.cc
-tests_test_python_execute_func_date_SOURCES = tests/test_python_execute_func_date.cc \
-	glom/python_embed/glom_python.cc
-tests_test_python_execute_func_change_result_type_SOURCES = tests/test_python_execute_func_change_result_type.cc \
-	glom/python_embed/glom_python.cc
-tests_test_python_execute_script_SOURCES = tests/test_python_execute_script.cc \
-	glom/python_embed/glom_python.cc
+
 
 
 # Distribute the tests data:
@@ -115,14 +89,54 @@ tests_import_test_signals_SOURCES =	\
 	tests/import/utils.cc\
 	tests/import/utils.h\
 	tests/import/test_signals.cc
-tests_test_glade_derived_instantiation_SOURCES = tests/test_glade_derived_instantiation.cc $(glom_source_files)
 tests_test_selfhosting_new_empty_SOURCES = tests/test_selfhosting_new_empty.cc $(glom_source_files)
 tests_test_selfhosting_new_from_example_SOURCES = tests/test_selfhosting_new_from_example.cc $(glom_source_files)
 
+
 glom_libglom_test_connectionpool_LDADD = $(tests_ldadd)
 glom_libglom_example_document_load_LDADD = $(tests_ldadd)
 glom_libglom_test_sharedptr_layoutitem_LDADD = $(tests_ldadd)
 
+tests_test_parsing_time_LDADD = $(tests_ldadd)
+tests_test_document_load_LDADD = $(tests_ldadd)
+tests_test_document_autosave_LDADD = $(tests_ldadd)
+tests_test_signal_reemit_LDADD = $(LIBGLOM_LIBS)
+tests_test_load_python_library_LDADD = $(LIBGLOM_LIBS) -ldl
+tests_test_python_module_LDADD = $(tests_ldadd) $(PYTHON_LIBS)
+tests_import_test_parsing_LDADD = $(GLOM_LIBS)
+tests_import_test_signals_LDADD = $(GLOM_LIBS)
+tests_test_selfhosting_new_empty_LDADD = $(glom_all_libs)
+tests_test_selfhosting_new_from_example_LDADD = $(glom_all_libs)
+
+
+
+
+# UI Tests:
+
+if GLOM_ENABLE_UI
+
+# TODO: Shouldn't test_pyembed be non-UI?
+check_PROGRAMS += \
+	glom/utility_widgets/test_flowtable			\
+	glom/mode_data/test_flowtablewithfields \
+	glom/test_pyembed \
+	tests/test_glade_derived_instantiation \
+	tests/glade_toplevels_instantiation \
+	tests/test_python_execute_func \
+	tests/test_python_execute_func_bad_syntax \
+	tests/test_python_execute_func_date \
+	tests/test_python_execute_func_change_result_type \
+	tests/test_python_execute_script
+
+TESTS += \
+	tests/test_glade_toplevels_instantiation.sh \
+	tests/test_glade_derived_instantiation \
+	tests/test_python_execute_func \
+	tests/test_python_execute_func_bad_syntax \
+	tests/test_python_execute_func_date \
+	tests/test_python_execute_func_change_result_type \
+	tests/test_python_execute_script
+
 glom_utility_widgets_test_flowtable_SOURCES =	\
 	glom/utility_widgets/flowtable.cc	\
 	glom/utility_widgets/flowtable.h	\
@@ -139,6 +153,11 @@ glom_mode_data_test_flowtablewithfields_SOURCES =	\
 	glom/mode_data/test_flowtablewithfields.cc
 glom_mode_data_test_flowtablewithfields_LDADD = $(glom_all_libs)
 
+tests_test_python_execute_func_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
+tests_test_python_execute_func_bad_syntax_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
+tests_test_python_execute_func_date_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
+tests_test_python_execute_func_change_result_type_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
+tests_test_python_execute_script_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
 
 # You must remove PlaceholderGlom::get_application() to avoid having to specify
 # a huge set of .cc files when building this test:
@@ -155,25 +174,13 @@ glom_mode_data_test_flowtablewithfields_LDADD = $(glom_all_libs)
 #	glom/utility_widgets/placeholder-glom.cc \
 #	glom/utility_widgets/test_flowtable_dnd.cc
 
+tests_test_glade_derived_instantiation_SOURCES = tests/test_glade_derived_instantiation.cc $(glom_source_files)
+tests_test_glade_derived_instantiation_LDADD = $(glom_all_libs)
+
 tests_glade_toplevels_instantiation_SOURCES = tests/glade_toplevels_instantiation.cc
 tests_glade_toplevels_instantiation_LDADD = $(tests_ldadd) $(GLOM_LIBS)
 
-
+glom_test_pyembed_SOURCES = glom/test_pyembed.cc
 glom_test_pyembed_LDADD = $(LIBGLOM_LIBS) $(PYTHON_LIBS)
 
-tests_test_parsing_time_LDADD = $(tests_ldadd)
-tests_test_document_load_LDADD = $(tests_ldadd)
-tests_test_document_autosave_LDADD = $(tests_ldadd)
-tests_test_signal_reemit_LDADD = $(LIBGLOM_LIBS)
-tests_test_load_python_library_LDADD = $(LIBGLOM_LIBS) -ldl
-tests_test_python_module_LDADD = $(tests_ldadd) $(PYTHON_LIBS)
-tests_test_python_execute_func_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
-tests_test_python_execute_func_bad_syntax_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
-tests_test_python_execute_func_date_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
-tests_test_python_execute_func_change_result_type_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
-tests_test_python_execute_script_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
-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)
-tests_test_selfhosting_new_from_example_LDADD = $(glom_all_libs)
+endif #GLOM_ENABLE_UI
diff --git a/configure.ac b/configure.ac
index 2e0b755..f972c02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,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:
@@ -97,6 +104,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],
@@ -174,11 +182,15 @@ 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])
-PKG_CHECK_MODULES([GLOM], [$REQUIRED_GLOM_LIBS])
 
-AC_MSG_WARN([$REQUIRED_LIBGLOM_LIBS])
-AC_MSG_WARN([$REQUIRED_GLOM_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])
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 00e5bd7..fa69055 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -133,6 +133,4 @@ glom/utility_widgets/layoutwidgetbase.cc
 glom/utility_widgets/layoutwidgetmenu.cc
 glom/utility_widgets/layoutwidgetutils.cc
 glom/utility_widgets/notebooklabelglom.cc
-glom/utility_widgets/gimpruler/libgimpbase/gimpbaseenums.c
-glom/utility_widgets/gimpruler/libgimpbase/gimputils.c
 glom/xsl_utils.cc



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