I need this patch to compile the 1.4.x tree with mingw.

It results in support/globbing.C being compiled only if we're building the
XForms frontend.

configure --with-frontend='qt' leads to this in src/support/Makefile:
#GLOBBING = globbing.C globbing.h
        $(GLOBBING) $(COMPRESSION) kill.C \

configure --with-frontend='xforms qt' leads to this in
src/support/Makefile:
GLOBBING = globbing.C globbing.h
        $(GLOBBING) $(COMPRESSION) kill.C \

I think that this is the cleanest way to enable the mingw build to proceed
as <glob.h> does not exist on Windows.

The patch also results in the src/client subdirectory not being compiled on
Windows.

On a linux build, src/Makefile contains:
DIST_SUBDIRS = mathed insets graphics support frontends . client \
BUILD_CLIENT_SUBDIR_FALSE =
BUILD_CLIENT_SUBDIR_TRUE = #
#CLIENT = client
SUBDIRS = mathed insets graphics support frontends . $(CLIENT) tex2lyx

On a mingw build:
DIST_SUBDIRS = mathed insets graphics support frontends . client \
BUILD_CLIENT_SUBDIR_FALSE = #
BUILD_CLIENT_SUBDIR_TRUE =
CLIENT = client
SUBDIRS = mathed insets graphics support frontends . $(CLIENT) tex2lyx

Ok to commit?

-- 
Angus
Index: configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.47
diff -u -p -r1.47 configure.ac
--- configure.ac	11 Mar 2005 10:49:09 -0000	1.47
+++ configure.ac	24 Apr 2005 12:12:18 -0000
@@ -160,6 +160,9 @@ if echo $FRONTENDS | grep gtk | grep -v 
   FRONTENDS="xforms $FRONTENDS"
 fi
 
+### By default do not build support/globbing.C
+use_globbing=false
+
 dnl The code below is not in a macro, because this would cause big
 dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL.
 for frontend in $FRONTENDS ; do
@@ -173,6 +176,7 @@ for frontend in $FRONTENDS ; do
   XForms Frontend:\n\
       libXpm version:\t\t${XPM_VERSION}\n\
       libforms version:\t\t${XFORMS_VERSION}\n"
+	  use_globbing=true
 	  ;;
   dnl   gnome)
   dnl     XFORMS_DO_IT_ALL
@@ -219,6 +223,15 @@ dnl qt build will fail without moc or ui
 	  LYX_ERROR(Unknown frontend '$frontend');;
   esac
 done
+
+AM_CONDITIONAL(USE_GLOBBING, test x$use_globbing = xtrue)
+
+### Do not build the code in the src/client subdirectory on mingw
+case ${host} in
+*mingw*) ;;
+      *) build_client_subdir=true;;
+esac
+AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, test x$build_client_subdir = xtrue)
 
 ### Check how the files should be packaged
 LYX_USE_PACKAGING
Index: src/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Makefile.am,v
retrieving revision 1.224
diff -u -p -r1.224 Makefile.am
--- src/Makefile.am	31 Jan 2005 10:42:17 -0000	1.224
+++ src/Makefile.am	24 Apr 2005 12:12:19 -0000
@@ -4,7 +4,11 @@ DISTCLEANFILES += config.h libintl.h ver
 
 MAINTAINERCLEANFILES += $(srcdir)/config.h.in
 
-SUBDIRS = mathed insets graphics support frontends . client tex2lyx
+if BUILD_CLIENT_SUBDIR
+CLIENT = client
+endif
+
+SUBDIRS = mathed insets graphics support frontends . $(CLIENT) tex2lyx
 
 EXTRA_DIST = config.h.in stamp-h.in version.C.in \
 	Sectioning.h \
Index: src/support/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/Makefile.am,v
retrieving revision 1.91
diff -u -p -r1.91 Makefile.am
--- src/support/Makefile.am	23 Mar 2005 21:10:43 -0000	1.91
+++ src/support/Makefile.am	24 Apr 2005 12:12:19 -0000
@@ -12,6 +12,10 @@ if USE_COMPRESSION
 COMPRESSION = gzstream.C gzstream.h
 endif
 
+if USE_GLOBBING
+GLOBBING = globbing.C globbing.h
+endif
+
 BUILT_SOURCES = package.C
 
 AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES)
@@ -44,9 +48,7 @@ libsupport_la_SOURCES = \
 	fs_extras.C \
 	fs_extras.h \
 	getcwd.C \
-	globbing.C \
-	globbing.h \
-	$(COMPRESSION) kill.C \
+	$(GLOBBING) $(COMPRESSION) kill.C \
 	limited_stack.h \
 	lstrings.C \
 	lstrings.h \

Reply via email to