Index: configure.in
===================================================================
RCS file: /cvs/gnome/pango/configure.in,v
retrieving revision 1.208
diff -u -p -r1.208 configure.in
--- configure.in	15 Aug 2005 22:45:13 -0000	1.208
+++ configure.in	1 Oct 2005 10:35:14 -0000
@@ -344,19 +344,10 @@ AC_MSG_RESULT($have_varargs)
 AM_CONDITIONAL(BUILD_OT_TESTS, test $have_varargs = yes)
 CPPFLAGS=$pango_saved_cppflags
 
+
 #
-# Allow building some or all modules included
+# Modules to build
 #
-AC_MSG_CHECKING(modules to link statically)
-
-dnl I would use AC_HELP_STRING here, but due to some bugs in m4_text_wrap,
-dnl it interprets the commas incorrectly ...
-dnl   AC_HELP_STRING([--with-included-modules=MODULE1 MODULE2 ...],
-dnl                  [build the given modules into Pango])
-AC_ARG_WITH(included_modules,
-[  --with-included-modules=MODULE1,MODULE2,...
-                          build the given modules into Pango])
-
 arabic_modules="arabic-fc"
 basic_modules="basic-fc,basic-win32,basic-x"
 hangul_modules="hangul-fc"
@@ -369,40 +360,68 @@ tibetan_modules="tibetan-fc"
 
 all_modules="$arabic_modules,$basic_modules,$hangul_modules,$hebrew_modules,$indic_modules,$khmer_modules,$syriac_modules,$thai_modules,$tibetan_modules"
 
-included_modules=""
-if test "x$with_included_modules" != xno || test "x$with_included_modules" = x ; then
+#
+# Allow building some or all modules included
+#
+AC_MSG_CHECKING(modules to link statically)
 
-   # If no modules specified, include all modules
-   if test "x$with_included_modules" = xyes ; then
-     included_modules="$all_modules"
-   else
-     included_modules="$with_included_modules"
-   fi
-fi
+dnl I would use AC_HELP_STRING here, but due to some bugs in m4_text_wrap,
+dnl it interprets the commas incorrectly ...
+dnl   AC_HELP_STRING([--with-included-modules=MODULE1 MODULE2 ...],
+dnl                  [build the given modules into Pango])
+AC_ARG_WITH(included_modules,
+[  --with-included-modules=MODULE1,MODULE2,...
+                          build the given modules into Pango @<:@default=no@:>@])
 
+included_modules=""
+case x$with_included_modules in
+	xyes)	included_modules=$all_modules ;;
+	xno|x)	included_modules="" ;;
+	*)	included_modules=$with_included_modules ;;
+esac
 AC_MSG_RESULT($included_modules)
 AM_CONDITIONAL(HAVE_INCLUDED_MODULES, test "x$included_modules" != x)
 
+#
+# Allow building only some or none of modules dynamic
+#
+AC_MSG_CHECKING(dynamic modules to build)
+
+dnl I would use AC_HELP_STRING here, but due to some bugs in m4_text_wrap,
+dnl it interprets the commas incorrectly ...
+dnl   AC_HELP_STRING([--with-included-modules=MODULE1 MODULE2 ...],
+dnl                  [build the given modules into Pango])
+AC_ARG_WITH(dynamic_modules,
+[  --with-dynamic-modules=MODULE1,MODULE2,...
+                          build the given dynamic modules @<:@default=yes@:>@])
+
+dynamic_modules=""
+case x$with_dynamic_modules in
+	xyes|x)	dynamic_modules=$all_modules ;;
+	xno)	dynamic_modules="" ;;
+	*)	dynamic_modules=$with_dynamic_modules ;;
+esac
+AC_MSG_RESULT([$dynamic_modules (those built into Pango will be excluded)])
+AM_CONDITIONAL(HAVE_DYNAMIC_MODULES, test "x$dynamic_modules" != x)
+
+
 INCLUDED_X_MODULES=
 INCLUDED_FC_MODULES=
 INCLUDED_WIN32_MODULES=
-IFS="${IFS= 	}"; pango_save_ifs="$IFS"; IFS=","
+IFS="${IFS= 	}"; pango_save_ifs="$IFS"; IFS=", "
 for module in $included_modules; do
-  if echo $indic_modules | egrep "(^| )$module(\$| )" > /dev/null; then
-    dir=indic
-  else
-    dir=`echo $module | sed "s/-.*//"`
-  fi
-
-  if echo $module | egrep -- "-fc($|,)" > /dev/null; then
-    INCLUDED_FC_MODULES="$INCLUDED_FC_MODULES \$(top_builddir)/modules/$dir/libpango-$module.la"
-  elif echo $module | egrep -- "-x($|,)" > /dev/null; then
-    INCLUDED_X_MODULES="$INCLUDED_X_MODULES \$(top_builddir)/modules/$dir/libpango-$module.la"
-  elif echo $module | egrep -- "-win32($|,)" > /dev/null; then
-    INCLUDED_WIN32_MODULES="$INCLUDED_WIN32_MODULES \$(top_builddir)/modules/$dir/libpango-$module.la"
-  else
-    AC_MSG_ERROR([the specified module $module does not exist])
-  fi
+  case $indic_modules in
+    *$module*)	dir=indic ;;
+    *)		dir=`echo $module | sed "s/-.*//"` ;;
+  esac
+  included_path="\$(top_builddir)/modules/$dir/libpango-$module.la"
+
+  case $module in
+    *-fc)	INCLUDED_FC_MODULES="$INCLUDED_FC_MODULES $included_path" ;;
+    *-x)	INCLUDED_X_MODULES="$INCLUDED_X_MODULES $included_path" ;;
+    *-win32)	INCLUDED_WIN32_MODULES="$INCLUDED_WIN32_MODULES $included_path" ;;
+    *)		AC_MSG_ERROR([specified module $module not recognized]) ;;
+  esac
 done
 IFS="$pango_save_ifs"
 
@@ -411,24 +430,30 @@ AC_SUBST(INCLUDED_FC_MODULES)
 AC_SUBST(INCLUDED_WIN32_MODULES)
 
 AM_CONDITIONAL(INCLUDE_ARABIC_FC,echo $included_modules | egrep '(^|,)arabic-fc($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_BASIC_FC,echo $included_modules | egrep '(^|,)basic-fc($|,)' > /dev/null)
 AM_CONDITIONAL(INCLUDE_BASIC_WIN32,echo $included_modules | egrep '(^|,)basic-win32($|,)' > /dev/null)
 AM_CONDITIONAL(INCLUDE_BASIC_X,echo $included_modules | egrep '(^|,)basic-x($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_HANGUL_FC,echo $included_modules | egrep '(^|,)hangul-fc($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_HEBREW_FC,echo $included_modules | egrep '(^|,)hebrew-fc($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_INDIC_FC,echo $included_modules | egrep '(^|,)indic-fc($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_KHMER_FC,echo $included_modules | egrep '(^|,)khmer-fc($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_SYRIAC_FC,echo $included_modules | egrep '(^|,)syriac-fc($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_THAI_FC,echo $included_modules | egrep '(^|,)thai-fc($|,)' > /dev/null)
-
 AM_CONDITIONAL(INCLUDE_TIBETAN_FC,echo $included_modules | egrep '(^|,)tibetan-fc($|,)' > /dev/null)
+
+AM_CONDITIONAL(DYNAMIC_ARABIC_FC,echo $dynamic_modules | egrep '(^|,)arabic-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_BASIC_FC,echo $dynamic_modules | egrep '(^|,)basic-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_BASIC_WIN32,echo $dynamic_modules | egrep '(^|,)basic-win32($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_BASIC_X,echo $dynamic_modules | egrep '(^|,)basic-x($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_HANGUL_FC,echo $dynamic_modules | egrep '(^|,)hangul-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_HEBREW_FC,echo $dynamic_modules | egrep '(^|,)hebrew-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_INDIC_FC,echo $dynamic_modules | egrep '(^|,)indic-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_KHMER_FC,echo $dynamic_modules | egrep '(^|,)khmer-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_SYRIAC_FC,echo $dynamic_modules | egrep '(^|,)syriac-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_THAI_FC,echo $dynamic_modules | egrep '(^|,)thai-fc($|,)' > /dev/null)
+AM_CONDITIONAL(DYNAMIC_TIBETAN_FC,echo $dynamic_modules | egrep '(^|,)tibetan-fc($|,)' > /dev/null)
+
+
 
 #
 # We use flockfile to implement pango_getline() - should be moved to GLib
Index: examples/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/examples/Makefile.am,v
retrieving revision 1.47
diff -u -p -r1.47 Makefile.am
--- examples/Makefile.am	1 Mar 2005 20:48:51 -0000	1.47
+++ examples/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -96,9 +96,9 @@ pango.modules: $(top_builddir)/pango/pan
 	if find ../modules -name '*.so' | grep 'so' > /dev/null ; then \
           echo "Writing a pango.modules file to use when running examples before installing Pango."; \
 	  (cd ../modules && \
-           $(top_builddir)/pango/pango-querymodules `find . -name '*.la' | grep -v \.libs` > ../examples/pango.modules ) ;\
+           $(top_builddir)/pango/pango-querymodules `find . -name '*.la' | grep -v \.libs | grep -v libpango` > ../examples/pango.modules ) ;\
 	else \
-          echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
+          echo "No dynamic modules found; will use only static modules for not-installed example programs."; \
 	  touch pango.modules; \
 	fi
 
Index: modules/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/Makefile.am,v
retrieving revision 1.27
diff -u -p -r1.27 Makefile.am
--- modules/Makefile.am	21 Jun 2005 16:02:55 -0000	1.27
+++ modules/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -42,5 +42,10 @@ included-modules:
 		( cd $$d && $(MAKE) $(AM_MAKEFLAGS) included-modules ) ; \
         done
 
-.PHONY: included-modules
+dynamic-modules:
+	@for d in $(SUBDIRS) ; do \
+		( cd $$d && $(MAKE) $(AM_MAKEFLAGS) dynamic-modules ) ; \
+        done
+
+.PHONY: included-modules dynamic-modules
 
Index: modules/arabic/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/arabic/Makefile.am,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile.am
--- modules/arabic/Makefile.am	22 Jul 2005 19:05:41 -0000	1.31
+++ modules/arabic/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -22,9 +22,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_ARABIC_FC
 noinst_LTLIBRARIES += libpango-arabic-fc.la
 else
+if DYNAMIC_ARABIC_FC
 module_LTLIBRARIES += pango-arabic-fc.la
 endif
 endif
+endif
 
 fc_sources = \
 	arabic-fc.c \
@@ -39,5 +41,6 @@ libpango_arabic_fc_la_CFLAGS = -DPANGO_M
 
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
Index: modules/basic/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/basic/Makefile.am,v
retrieving revision 1.38
diff -u -p -r1.38 Makefile.am
--- modules/basic/Makefile.am	22 Jul 2005 19:05:42 -0000	1.38
+++ modules/basic/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -25,9 +25,11 @@ INCLUDES += $(X_CFLAGS)
 if INCLUDE_BASIC_X
 noinst_LTLIBRARIES += libpango-basic-x.la
 else
+if DYNAMIC_BASIC_X
 module_LTLIBRARIES += pango-basic-x.la
 endif
 endif
+endif
 
 pango_basic_x_la_LDFLAGS = -module $(MODULE_LIBTOOL_OPTIONS)
 pango_basic_x_la_LIBADD = $(pangoxlibs)
@@ -41,9 +43,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_BASIC_FC
 noinst_LTLIBRARIES += libpango-basic-fc.la
 else
+if DYNAMIC_BASIC_FC
 module_LTLIBRARIES += pango-basic-fc.la
 endif
 endif
+endif
 
 pango_basic_fc_la_LDFLAGS = -module $(MODULE_LIBTOOL_OPTIONS)
 pango_basic_fc_la_LIBADD = $(pangoft2libs)
@@ -56,9 +60,11 @@ if HAVE_WIN32
 if INCLUDE_BASIC_WIN32
 noinst_LTLIBRARIES += libpango-basic-win32.la
 else
+if DYNAMIC_BASIC_WIN32
 module_LTLIBRARIES += pango-basic-win32.la
 endif
 endif
+endif
 
 pango_basic_win32_la_LDFLAGS = -module $(MODULE_LIBTOOL_OPTIONS)
 pango_basic_win32_la_LIBADD = $(pangowin32libs) -lgdi32
@@ -81,5 +87,6 @@ EXTRA_DIST =		\
 	tables-small.i
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
Index: modules/hangul/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/hangul/Makefile.am,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile.am
--- modules/hangul/Makefile.am	22 Jul 2005 19:05:42 -0000	1.31
+++ modules/hangul/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -22,9 +22,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_HANGUL_FC
 noinst_LTLIBRARIES += libpango-hangul-fc.la
 else
+if DYNAMIC_HANGUL_FC
 module_LTLIBRARIES += pango-hangul-fc.la
 endif
 endif
+endif
 
 fc_sources = hangul-fc.c hangul-defs.h
 
@@ -39,5 +41,6 @@ EXTRA_DIST =			\
 	tables-jamos.i
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
Index: modules/hebrew/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/hebrew/Makefile.am,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile.am
--- modules/hebrew/Makefile.am	22 Jul 2005 19:05:43 -0000	1.21
+++ modules/hebrew/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -24,9 +24,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_HEBREW_FC
 noinst_LTLIBRARIES += libpango-hebrew-fc.la
 else
+if DYNAMIC_HEBREW_FC
 module_LTLIBRARIES += pango-hebrew-fc.la
 endif
 endif
+endif
 
 hebrew_fc_sources = $(common_sources) hebrew-fc.c 
 
@@ -38,5 +40,6 @@ libpango_hebrew_fc_la_CFLAGS = -DPANGO_M
 
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
Index: modules/indic/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/indic/Makefile.am,v
retrieving revision 1.26
diff -u -p -r1.26 Makefile.am
--- modules/indic/Makefile.am	22 Jul 2005 19:05:43 -0000	1.26
+++ modules/indic/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -22,9 +22,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_INDIC_FC
 noinst_LTLIBRARIES += libpango-indic-fc.la
 else
+if DYNAMIC_INDIC_FC
 module_LTLIBRARIES += pango-indic-fc.la
 endif
 endif
+endif
 
 fc_sources =		 	\
 	indic-fc.c		\
@@ -42,6 +44,7 @@ libpango_indic_fc_la_CFLAGS = -DPANGO_MO
 
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
 
Index: modules/khmer/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/khmer/Makefile.am,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile.am
--- modules/khmer/Makefile.am	22 Jul 2005 19:05:43 -0000	1.4
+++ modules/khmer/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -22,9 +22,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_KHMER_FC
 noinst_LTLIBRARIES += libpango-khmer-fc.la
 else
+if DYNAMIC_KHMER_FC
 module_LTLIBRARIES += pango-khmer-fc.la
 endif
 endif
+endif
 
 fc_sources =		 	\
 	khmer-fc.c
@@ -37,5 +39,6 @@ libpango_khmer_fc_la_CFLAGS = -DPANGO_MO
 
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
Index: modules/syriac/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/syriac/Makefile.am,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile.am
--- modules/syriac/Makefile.am	22 Jul 2005 19:05:44 -0000	1.4
+++ modules/syriac/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -21,9 +21,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_SYRIAC_FC
 noinst_LTLIBRARIES += libpango-syriac-fc.la
 else
+if DYNAMIC_SYRIAC_FC
 module_LTLIBRARIES += pango-syriac-fc.la
 endif
 endif
+endif
 
 fc_sources = \
 	syriac-fc.c \
@@ -38,5 +40,6 @@ libpango_syriac_fc_la_CFLAGS = -DPANGO_M
 
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
Index: modules/thai/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/thai/Makefile.am,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile.am
--- modules/thai/Makefile.am	22 Jul 2005 19:05:44 -0000	1.28
+++ modules/thai/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -24,9 +24,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_THAI_FC
 noinst_LTLIBRARIES += libpango-thai-fc.la
 else
+if DYNAMIC_THAI_FC
 module_LTLIBRARIES += pango-thai-fc.la
 endif
 endif
+endif
 
 thai_fc_sources = $(common_sources) thai-fc.c thai-ot.c thai-ot.h
 
@@ -38,5 +40,6 @@ libpango_thai_fc_la_CFLAGS = -DPANGO_MOD
 
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules
Index: modules/tibetan/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/modules/tibetan/Makefile.am,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile.am
--- modules/tibetan/Makefile.am	22 Jul 2005 19:05:44 -0000	1.3
+++ modules/tibetan/Makefile.am	1 Oct 2005 10:35:14 -0000
@@ -20,9 +20,11 @@ INCLUDES += $(FREETYPE_CFLAGS)
 if INCLUDE_TIBETAN_FC
 noinst_LTLIBRARIES += libpango-tibetan-fc.la
 else
+if DYNAMIC_TIBETAN_FC
 module_LTLIBRARIES += pango-tibetan-fc.la
 endif
 endif
+endif
 
 tibetan_fc_sources = $(common_sources) tibetan-fc.c
 
@@ -34,5 +36,6 @@ libpango_tibetan_fc_la_CFLAGS = -DPANGO_
 
 
 included-modules: $(noinst_LTLIBRARIES)
+dynamic-modules: $(module_LTLIBRARIES)
 
-.PHONY: included-modules
+.PHONY: included-modules dynamic-modules

