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



commit 9c43ec9965b006190c667f9afe66b913089a8943
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   |  140 +++++++++++++++++++++++++++++++--------------------
 configure.ac        |   15 ++++++
 6 files changed, 135 insertions(+), 58 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0245d15..34fd5b8 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.16.2:
 
 2010-11-25  Murray Cumming  <murrayc murrayc com>
diff --git a/Makefile.am b/Makefile.am
index cb27044..92717be 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 bc5c1da..e4350a7 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 cdb43d2..b86fcf9 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -18,26 +18,17 @@
 check_PROGRAMS =						\
 	glom/libglom/test_connectionpool			\
 	glom/libglom/example_document_load \
-	glom/libglom/test_sharedptr_layoutitem			\
-	glom/utility_widgets/test_flowtable			\
-	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/import/test_parsing \
-	tests/import/test_signals \
-	tests/test_glade_derived_instantiation \
-	tests/glade_toplevels_instantiation \
 	tests/test_selfhosting_new_empty \
-	tests/test_selfhosting_new_from_example
+	tests/test_selfhosting_new_from_example \
+	tests/import/test_parsing \
+	tests/import/test_signals
 
 TESTS =	tests/test_document_load	\
   tests/test_document_autosave	\
@@ -45,21 +36,12 @@ 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
-	
-# These hang most of the time, but not always:
-#	tests/import/test_parsing \
-#	tests/import/test_signals
+	tests/test_selfhosting_new_from_example \
+	tests/import/test_parsing \
+	tests/import/test_signals
 
 # We also set this in Makefile.am, with +=,
 # but this is the first use, where we must use =
@@ -75,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
@@ -83,42 +65,104 @@ 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:
+dist_noinst_DATA = tests/import/data/albums.csv
+
+# Let the .cc source code know about this path:
+glom_defines = \
+-DGLOM_TESTS_IMPORT_DATA_NOTINSTALLED=\""$(abs_top_srcdir)/tests/import/data/"\"
+
 tests_import_test_parsing_SOURCES =	\
 	glom/import_csv/csv_parser.cc	\
 	glom/import_csv/csv_parser.h	\
 	tests/import/utils.cc\
 	tests/import/utils.h\
 	tests/import/test_parsing.cc
+
+
 tests_import_test_signals_SOURCES =	\
 	glom/import_csv/csv_parser.cc	\
 	glom/import_csv/csv_parser.h	\
 	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/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	\
 	glom/utility_widgets/test_flowtable.cc
 glom_utility_widgets_test_flowtable_LDADD = $(GLOM_LIBS)
 
+glom_mode_data_test_flowtablewithfields_SOURCES =	\
+	$(glom_source_files) \
+	glom/mode_data/test_flowtablewithfields.cc
+glom_mode_data_test_flowtablewithfields_LDADD = $(glom_all_libs)
+
+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
+
+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:
@@ -135,26 +179,14 @@ glom_utility_widgets_test_flowtable_LDADD = $(GLOM_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 a49774d..b732be2 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]