[Gtk-sharp-list] cygwin csc with autotools part 1

John Luke jluke@users.sourceforge.net
Wed, 02 Jun 2004 18:31:12 -0400


This is a multi-part message in MIME format.
--------------010700030401050806050101
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello all,

 I have attached the first part of making gtk# compile on cygwin with 
the regular autotools build.
Note that this does not even get to the unmanaged part yet and is 
incomplete.  You need to do two things to get it to work:
1. add the path to csc.exe to your path before running autogen.sh
2. disable strong-name verification for the gtk# assemblies before make 
install

Unfortunately I had to split the compile, install, uninstall commands 
into .NET and mono specific versions because the gacutil is not 
compatible and csc could not handle generated/*.cs correctly.
Apologies if I broke anything on the linux side, and I am not sure 
distcheck still works with this.
If it is ok someone else will have to commit it for me.

P.S. using a combination of autogen.sh, make -f makefile.win32 and make 
install might work ok

--------------010700030401050806050101
Content-Type: text/plain;
 name="cygwincsc.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cygwincsc.patch"

? cygwincsc.patch
Index: ChangeLog
===================================================================
RCS file: /mono/gtk-sharp/ChangeLog,v
retrieving revision 1.838
diff -u -r1.838 ChangeLog
--- ChangeLog	1 Jun 2004 18:31:19 -0000	1.838
+++ ChangeLog	2 Jun 2004 22:15:08 -0000
@@ -1,3 +1,19 @@
+2004-06-02  John Luke
+	
+	* configure.in: add ENABLE_MONO conditional
+	* atk/Makefile.am:
+	* gdk/Makefile.am:
+	* glade/Makefile.am:
+	* glib/Makefile.am:
+	* pango/Makefile.am:
+	* gtk/Makefile.am: split the compile, install, and uninstall commands
+	into mono and csc versions based on ENABLE_MONO condition
+	* parser/Makefile.am: remove libxml2 stuff
+	* sample/Makefile.am: use csc compatible switches,
+	and disable drawing-sample.exe when not on mono
+	* sample/test/Makefile.am:
+	* sample/GtkDemo/Makefile.am: use /out: instead of -o 
+
 2004-06-01  Jeroen Zwartepoorte  <jeroen@xs4all.nl>
 
 	* sample/CustomWidget.cs: Add custom widget sample.
Index: configure.in
===================================================================
RCS file: /mono/gtk-sharp/configure.in,v
retrieving revision 1.73
diff -u -r1.73 configure.in
--- configure.in	31 May 2004 18:49:31 -0000	1.73
+++ configure.in	2 Jun 2004 22:15:09 -0000
@@ -176,6 +176,7 @@
 VTE_REQUIRED_VERSION=0.11.10
 PKG_CHECK_MODULES(VTE_DEPENDENCIES, vte >= $VTE_REQUIRED_VERSION, enable_vte=yes, enable_vte=no)
 
+AM_CONDITIONAL(ENABLE_MONO, test "x$enable_mono" = "xyes")
 AM_CONDITIONAL(ENABLE_LIBART, test "x$enable_libart" = "xyes")
 AM_CONDITIONAL(ENABLE_GNOME, test "x$enable_gnome" = "xyes")
 AM_CONDITIONAL(ENABLE_GLADE, test "x$enable_glade" = "xyes")
Index: atk/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/atk/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- atk/Makefile.am	27 May 2004 02:06:03 -0000	1.9
+++ atk/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -47,17 +47,35 @@
 	cp $(top_srcdir)/gtk-sharp.pub .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.pub
-	$(CSC) --unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+if ENABLE_MONO
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+else
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) /recurse:*.cs
+endif
 
 install-data-local:
+if ENABLE_MONO
 	@if test -n '$(TARGET)'; then						\
 	  echo "$(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
 	  $(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
 	fi
+else
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /i $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /i $(ASSEMBLY) /f || exit 1;	\
+	fi
+endif
 
 uninstall-local:
+if ENABLE_MONO
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	fi
+else
 	@if test -n '$(TARGET)'; then						\
-	  echo "$(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
-	  $(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f || exit 1;	\
 	fi
+endif
 
Index: gdk/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/gdk/Makefile.am,v
retrieving revision 1.11
diff -u -r1.11 Makefile.am
--- gdk/Makefile.am	27 May 2004 02:06:04 -0000	1.11
+++ gdk/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -85,17 +85,35 @@
 	cp $(top_srcdir)/gtk-sharp.pub .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.pub
-	$(CSC) --unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+if ENABLE_MONO
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+else
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) /recurse:*.cs
+endif
 
 install-data-local:
+if ENABLE_MONO
 	@if test -n '$(TARGET)'; then						\
 	  echo "$(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
 	  $(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
 	fi
+else
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /i $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /i $(ASSEMBLY) /f || exit 1;	\
+	fi
+endif
 
 uninstall-local:
+if ENABLE_MONO
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	fi
+else
 	@if test -n '$(TARGET)'; then						\
-	  echo "$(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
-	  $(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f || exit 1;	\
 	fi
+endif
 
Index: glade/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/glade/Makefile.am,v
retrieving revision 1.8
diff -u -r1.8 Makefile.am
--- glade/Makefile.am	27 May 2004 02:06:04 -0000	1.8
+++ glade/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -61,17 +61,35 @@
 	cp $(top_srcdir)/gtk-sharp.pub .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.pub
-	$(CSC) --unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+if ENABLE_MONO
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+else
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) /recurse:*.cs
+endif
 
 install-data-local:
+if ENABLE_MONO
 	@if test -n '$(TARGET)'; then						\
 	  echo "$(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
 	  $(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
 	fi
+else
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /i $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /i $(ASSEMBLY) /f || exit 1;	\
+	fi
+endif
 
 uninstall-local:
+if ENABLE_MONO
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	fi
+else
 	@if test -n '$(TARGET)'; then						\
-	  echo "$(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
-	  $(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f || exit 1;	\
 	fi
+endif
 
Index: glib/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/glib/Makefile.am,v
retrieving revision 1.8
diff -u -r1.8 Makefile.am
--- glib/Makefile.am	19 May 2004 18:57:27 -0000	1.8
+++ glib/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -60,14 +60,28 @@
 	$(CSC) /out:$(ASSEMBLY) /target:library $(references) $(build_sources)
 
 install-data-local:
+if ENABLE_MONO
 	@if test -n '$(TARGET)'; then						\
 	  echo "$(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
 	  $(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
 	fi
+else
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /i $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /i $(ASSEMBLY) /f || exit 1;	\
+	fi
+endif
 
 uninstall-local:
+if ENABLE_MONO
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	fi
+else
 	@if test -n '$(TARGET)'; then						\
-	  echo "$(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
-	  $(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f || exit 1;	\
 	fi
+endif
 
Index: gtk/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/gtk/Makefile.am,v
retrieving revision 1.16
diff -u -r1.16 Makefile.am
--- gtk/Makefile.am	28 May 2004 15:05:36 -0000	1.16
+++ gtk/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -116,13 +116,24 @@
 	cp $(top_srcdir)/gtk-sharp.pub .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.pub
-	$(CSC) --unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+if ENABLE_MONO
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+else
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) /recurse:*.cs
+endif
 
 install-data-local:
+if ENABLE_MONO
 	@if test -n '$(TARGET)'; then						\
 	  echo "$(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
 	  $(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
 	fi
+else
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /i $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /i $(ASSEMBLY) /f || exit 1;	\
+	fi
+endif
 
 uninstall-local:
 	@if test -n '$(TARGET)'; then						\
Index: pango/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/pango/Makefile.am,v
retrieving revision 1.7
diff -u -r1.7 Makefile.am
--- pango/Makefile.am	27 May 2004 02:06:04 -0000	1.7
+++ pango/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -50,17 +50,35 @@
 	cp $(top_srcdir)/gtk-sharp.pub .
 
 $(ASSEMBLY): $(build_sources) generated-stamp gtk-sharp.pub
-	$(CSC) --unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+if ENABLE_MONO
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) generated/*.cs
+else
+	$(CSC) /unsafe /out:$(ASSEMBLY) /target:library $(references) $(build_sources) /recurse:*.cs
+endif
 
 install-data-local:
+if ENABLE_MONO
 	@if test -n '$(TARGET)'; then						\
 	  echo "$(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
 	  $(GACUTIL) /i $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
 	fi
+else
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /i $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /i $(ASSEMBLY) /f || exit 1;	\
+	fi
+endif
 
 uninstall-local:
+if ENABLE_MONO
+	@if test -n '$(TARGET)'; then						\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	fi
+else
 	@if test -n '$(TARGET)'; then						\
-	  echo "$(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir)";	\
-	  $(GACUTIL) /u $(ASSEMBLY_NAME) /package $(PACKAGE) /root $(DESTDIR)$(libdir) || exit 1;	\
+	  echo "$(GACUTIL) /u $(ASSEMBLY) /f";	\
+	  $(GACUTIL) /u $(ASSEMBLY) /f || exit 1;	\
 	fi
+endif
 
Index: parser/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/parser/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- parser/Makefile.am	25 May 2004 21:27:41 -0000	1.2
+++ parser/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -23,11 +23,5 @@
 gapi-fixup.exe: $(build_sources)
 	$(CSC) /out:gapi-fixup.exe $(build_sources)
 
-INCLUDES = $(GLIB_CFLAGS) $(XML_CFLAGS)
 
-bin_PROGRAMS = gapi_format_xml
-
-gapi_format_xml_SOURCES = formatXml.c
-
-gapi_format_xml_LDADD = $(GLIB_LIBS) $(XML_LIBS)
 
Index: sample/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/sample/Makefile.am,v
retrieving revision 1.6
diff -u -r1.6 Makefile.am
--- sample/Makefile.am	1 Jun 2004 18:31:20 -0000	1.6
+++ sample/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -27,7 +27,7 @@
 TARGETS = custom-cellrenderer.exe gtk-hello-world.exe button.exe calendar.exe subclass.exe menu.exe size.exe scribble.exe treeviewdemo.exe managedtreeviewdemo.exe testdnd.exe drawing-sample.exe custom-widget.exe $(GNOME_TARGETS) $(GLADE_TARGETS) $(VTE_TARGETS)
 
 assemblies=../glib/glib-sharp.dll ../pango/pango-sharp.dll ../atk/atk-sharp.dll ../gdk/gdk-sharp.dll ../gtk/gtk-sharp.dll $(GNOME_ASSEMBLY) $(GLADE_ASSEMBLY) $(VTE_ASSEMBLY)
-references=$(addprefix -r , $(assemblies))
+references=$(addprefix /r:, $(assemblies))
 
 noinst_SCRIPTS = $(TARGETS)
 CLEANFILES = $(TARGETS)
@@ -81,16 +81,20 @@
 	$(CSC) -out:cairo-sample.exe $(references) -r:Mono.Cairo $(srcdir)/CairoSample.cs
 
 testdnd.exe: $(srcdir)/TestDnd.cs $(assemblies)
-	$(CSC) -debug+ --unsafe -out:testdnd.exe $(references) $(srcdir)/TestDnd.cs
+	$(CSC) -debug+ /unsafe -out:testdnd.exe $(references) $(srcdir)/TestDnd.cs
 
 vte-example.exe: $(srcdir)/VteTest.cs $(assemblies)
-	$(CSC) -debug+ --unsafe -out:vte-example.exe $(references) $(srcdir)/VteTest.cs
+	$(CSC) -debug+ /unsafe -out:vte-example.exe $(references) $(srcdir)/VteTest.cs
 
 custom-cellrenderer.exe: $(srcdir)/CustomCellRenderer.cs $(assemblies)
 	$(CSC) -debug+ -out:custom-cellrenderer.exe $(references) $(srcdir)/CustomCellRenderer.cs
 
 drawing-sample.exe: $(srcdir)/DrawingSample.cs $(srcdir)/sysdraw.cs $(assemblies)
-	$(CSC) -debug+ -out:drawing-sample.exe $(references) $(srcdir)/DrawingSample.cs $(srcdir)/sysdraw.cs -r:System.Drawing
+if ENABLE_MONO
+	$(CSC) -debug+ -out:drawing-sample.exe $(references) $(srcdir)/DrawingSample.cs $(srcdir)/sysdraw.cs -r:System.Drawing.dll
+else
+
+endif
 
 custom-widget.exe: $(srcdir)/CustomWidget.cs $(assemblies)
 	$(CSC) -debug+ -out:custom-widget.exe $(references) $(srcdir)/CustomWidget.cs
Index: sample/GtkDemo/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/sample/GtkDemo/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- sample/GtkDemo/Makefile.am	7 May 2004 14:22:20 -0000	1.2
+++ sample/GtkDemo/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -28,5 +28,5 @@
 build_sources = $(addprefix $(srcdir)/, $(sources))
 
 GtkDemo.exe: $(build_sources) $(assemblies)
-	$(CSC) -g /out:GtkDemo.exe $(build_sources) $(references)
+	$(CSC) /debug /out:GtkDemo.exe $(build_sources) $(references)
 
Index: sample/test/Makefile.am
===================================================================
RCS file: /mono/gtk-sharp/sample/test/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- sample/test/Makefile.am	7 May 2004 14:22:20 -0000	1.2
+++ sample/test/Makefile.am	2 Jun 2004 22:15:09 -0000
@@ -26,5 +26,5 @@
 build_sources = $(addprefix $(srcdir)/, $(sources))
 
 WidgetViewer.exe: $(build_sources) $(assemblies)
-	$(CSC) -o WidgetViewer.exe $(references) $(build_sources)
+	$(CSC) /out:WidgetViewer.exe $(references) $(build_sources)
 

--------------010700030401050806050101--