From 5e70f6eb45c751f6dbf2dfe1551f860f1bcf1994 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 25 Aug 2005 20:59:21 +0000 Subject: [PATCH] 2005-08-25 Mike Kestner * configure.in.in : add PLATFORM_WIN32 conditional. Borrow mono's libtool s/cyg// hack. Improve/relocate System.Drawing check. * Makefile.include : add gapi-cdecl-insert handling for win32. * glib/Makefile.am : add gapi-cdecl-insert handling for win32. * gtkdotnet/Makefile.am : s/-r:System.Drawing/-r:System.Drawing.dll/. * sample/DrawingSample.cs : remove C# 2.0-isms. * sample/Makefile.am : s/-r:System.Drawing/-r:System.Drawing.dll/. svn path=/trunk/gtk-sharp/; revision=48859 --- ChangeLog | 10 ++++++++++ Makefile.include | 14 ++++++++++++-- configure.in.in | 33 ++++++++++++++++++++++++++------- glib/Makefile.am | 16 +++++++++++++--- gtkdotnet/Makefile.am | 18 ++++++++++++++---- sample/DrawingSample.cs | 6 +++--- sample/Makefile.am | 2 +- 7 files changed, 79 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 35d4f2be1..60b2beeb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-08-25 Mike Kestner + + * configure.in.in : add PLATFORM_WIN32 conditional. Borrow mono's + libtool s/cyg// hack. Improve/relocate System.Drawing check. + * Makefile.include : add gapi-cdecl-insert handling for win32. + * glib/Makefile.am : add gapi-cdecl-insert handling for win32. + * gtkdotnet/Makefile.am : s/-r:System.Drawing/-r:System.Drawing.dll/. + * sample/DrawingSample.cs : remove C# 2.0-isms. + * sample/Makefile.am : s/-r:System.Drawing/-r:System.Drawing.dll/. + 2005-08-25 Mike Kestner * bootstrap : bump version to 2.5.90.99 diff --git a/Makefile.include b/Makefile.include index ac08da8df..26fc94593 100644 --- a/Makefile.include +++ b/Makefile.include @@ -40,12 +40,22 @@ generated-stamp: $(API) $(INCLUDE_API) $(top_builddir)/generator/gapi_codegen.ex $(SNK): $(top_srcdir)/$(SNK) cp $(top_srcdir)/$(SNK) . -build_sources = $(addprefix $(srcdir)/, $(sources)) $(top_builddir)/AssemblyInfo.cs +AssemblyInfo.cs: $(top_srcdir)/AssemblyInfo.cs + cp $(top_srcdir)/AssemblyInfo.cs . + +build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs build_references = $(addprefix /r:, $(references)) +if PLATFORM_WIN32 +GAPI_CDECL_INSERT=$(top_srcdir)/gapi-cdecl-insert --keyfile=$(SNK) $(ASSEMBLY) +else +GAPI_CDECL_INSERT= +endif + $(ASSEMBLY): generated-stamp $(SNK) $(build_sources) $(references) @rm -f $(ASSEMBLY).mdb - $(CSC) $(CSFLAGS) -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(build_references) $(build_sources) $(GENERATED_SOURCES) + $(CSC) $(CSFLAGS) -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(build_references) $(GENERATED_SOURCES) $(build_sources) + $(GAPI_CDECL_INSERT) install-data-local: @if test -n '$(pkg)'; then \ diff --git a/configure.in.in b/configure.in.in index 7c873b9b4..b20f12d71 100644 --- a/configure.in.in +++ b/configure.in.in @@ -11,6 +11,20 @@ AC_SUBST(API_VERSION) PACKAGE_VERSION=gtk-sharp-2.0 AC_SUBST(PACKAGE_VERSION) +case "$host" in + *-*-mingw*|*-*-cygwin*) + platform_win32=yes + AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32]) + CC="gcc -mno-cygwin -g" + HOST_CC="gcc" + ;; + *) + platform_win32=no + ;; +esac + +AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes) + AC_CHECK_TOOL(CC, gcc, gcc) AC_PROG_CC AM_PROG_CC_STDC @@ -34,6 +48,11 @@ AC_HEADER_STDC AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL +if test x$platform_win32 = xyes; then + # Get rid of 'cyg' prefixes in library names + sed -e "s/\/cyg\//\/\//" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool +fi + # not 64 bit clean in cross-compile AC_CHECK_SIZEOF(void *, 4) @@ -81,10 +100,17 @@ else LIB_PREFIX=.so LIB_SUFFIX= fi +SDCHECK="`$GACUTIL /l |grep ^System.Drawing, | head -n1 |cut -f1 -d','`" +if test "x$SDCHECK" = "xSystem.Drawing"; then + enable_dotnet=yes +else + enable_dotnet=no +fi else AC_PATH_PROG(CSC, csc.exe, no) GACUTIL_FLAGS= GENERATED_SOURCES=generated\\\\*.cs +enable_dotnet=yes if test x$CSC = "xno"; then AC_MSG_ERROR([You need to install either mono or .Net]) @@ -105,13 +131,6 @@ if test "x$GACUTIL" = "xno" ; then AC_MSG_ERROR([No gacutil tool found]) fi -SDCHECK="`$GACUTIL /l |grep ^System.Drawing, | head -n1 |cut -f1 -d','`" -if test "x$SDCHECK" = "xSystem.Drawing"; then - enable_dotnet=yes -else - enable_dotnet=no -fi - AC_SUBST(RUNTIME) AC_SUBST(CSC) AC_SUBST(GACUTIL) diff --git a/glib/Makefile.am b/glib/Makefile.am index fe5e6db3e..76a87624e 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -55,7 +55,7 @@ sources = \ Value.cs \ WeakObject.cs -build_sources = $(addprefix $(srcdir)/, $(sources)) ../AssemblyInfo.cs +build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs dist_sources = $(sources) EXTRA_DIST = \ @@ -66,9 +66,19 @@ EXTRA_DIST = \ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk cp $(top_srcdir)/gtk-sharp.snk . -$(ASSEMBLY): $(build_sources) gtk-sharp.snk +AssemblyInfo.cs: $(top_srcdir)/AssemblyInfo.cs + cp $(top_srcdir)/AssemblyInfo.cs . + +if PLATFORM_WIN32 +GAPI_CDECL_INSERT=$(top_srcdir)/gapi-cdecl-insert --keyfile=gtk-sharp.snk $(ASSEMBLY) +else +GAPI_CDECL_INSERT= +endif + +$(ASSEMBLY): $(build_sources) gtk-sharp.snk AssemblyInfo.cs @rm -f $(ASSEMBLY).mdb - $(CSC) $(CSFLAGS) /nowarn:0612 /out:$(ASSEMBLY) /target:library $(references) $(build_sources) + $(CSC) $(CSFLAGS) -nowarn:0169,0612,0618 -out:$(ASSEMBLY) -target:library $(references) $(build_sources) + $(GAPI_CDECL_INSERT) install-data-local: @if test -n '$(TARGET)'; then \ diff --git a/gtkdotnet/Makefile.am b/gtkdotnet/Makefile.am index 13ff72095..31071d546 100644 --- a/gtkdotnet/Makefile.am +++ b/gtkdotnet/Makefile.am @@ -13,12 +13,12 @@ CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb gtk-sharp.snk DISTCLEANFILES = $(ASSEMBLY).config references = ../glib/glib-sharp.dll ../pango/pango-sharp.dll ../gdk/gdk-sharp.dll -build_references = $(addprefix -r:, $(references)) -r:System.Drawing +build_references = $(addprefix -r:, $(references)) -r:System.Drawing.dll sources = \ Graphics.cs -build_sources = $(addprefix $(srcdir)/, $(sources)) ../AssemblyInfo.cs +build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs EXTRA_DIST = \ $(sources) \ @@ -29,9 +29,19 @@ EXTRA_DIST = \ gtk-sharp.snk: $(top_srcdir)/gtk-sharp.snk cp $(top_srcdir)/gtk-sharp.snk . -$(ASSEMBLY): $(build_sources) $(references) gtk-sharp.snk +AssemblyInfo.cs: $(top_srcdir)/AssemblyInfo.cs + cp $(top_srcdir)/AssemblyInfo.cs . + +if PLATFORM_WIN32 +GAPI_CDECL_INSERT=$(top_srcdir)/gapi-cdecl-insert --keyfile=gtk-sharp.snk $(ASSEMBLY) +else +GAPI_CDECL_INSERT= +endif + +$(ASSEMBLY): $(build_sources) $(references) gtk-sharp.snk AssemblyInfo.cs @rm -f $(ASSEMBLY).mdb - $(CSC) $(CSFLAGS) /nowarn:0612 /out:$(ASSEMBLY) /target:library $(build_references) $(build_sources) + $(CSC) $(CSFLAGS) -nowarn:0169,0612,0618 -out:$(ASSEMBLY) -target:library $(build_references) $(build_sources) + $(GAPI_CDECL_INSERT) install-data-local: @if test -n '$(TARGET)'; then \ diff --git a/sample/DrawingSample.cs b/sample/DrawingSample.cs index 37bc118af..2db68934c 100644 --- a/sample/DrawingSample.cs +++ b/sample/DrawingSample.cs @@ -18,11 +18,11 @@ class X { // Event-based drawing b = new DrawingArea (); - b.ExposeEvent += ExposeHandler; - b.SizeAllocated += SizeAllocatedHandler; + b.ExposeEvent += new ExposeEventHandler (ExposeHandler); + b.SizeAllocated += new SizeAllocatedHandler (SizeAllocatedHandler); Button c = new Button ("Quit"); - c.Clicked += quit; + c.Clicked += new EventHandler (quit); MovingText m = new MovingText (); diff --git a/sample/Makefile.am b/sample/Makefile.am index 31132223e..63facd88c 100755 --- a/sample/Makefile.am +++ b/sample/Makefile.am @@ -113,7 +113,7 @@ vte-example.exe: $(srcdir)/VteTest.cs $(assemblies) custom-cellrenderer.exe: $(srcdir)/CustomCellRenderer.cs $(assemblies) $(CSC) /debug /out:custom-cellrenderer.exe $(references) $(srcdir)/CustomCellRenderer.cs -dotnet_references = $(references) $(addprefix -r:, $(DOTNET_ASSEMBLY)) -r:System.Drawing +dotnet_references = $(references) $(addprefix -r:, $(DOTNET_ASSEMBLY)) -r:System.Drawing.dll drawing-sample.exe: $(srcdir)/DrawingSample.cs $(assemblies) $(DOTNET_ASSEMBLIES) $(CSC) /debug /out:drawing-sample.exe $(dotnet_references) $(srcdir)/DrawingSample.cs