From a6c963474864819421c7f0cdc9692e3e2188c1cf Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 4 May 2014 15:10:07 +0200 Subject: [PATCH] build: Fix opaquetest build on Windows Create 2 makefile variable to facilitate build on Windows: GENERATED_SOURCES_FILES to match files created by the code generator, and GENERATED_SOURCES_OPTION for the corresponding option to be passed to the compiler. Also adapt the makefile for the valtest sample to use these variables. --- Makefile.include | 2 +- configure.ac | 9 ++++++--- sample/opaquetest/Makefile.am | 8 ++++---- sample/valtest/Makefile.am | 16 +++++----------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Makefile.include b/Makefile.include index 2ca7942a3..c61256832 100644 --- a/Makefile.include +++ b/Makefile.include @@ -54,7 +54,7 @@ build_references = $(addprefix -r:, $(references)) $(MONO_CAIRO_LIBS) $(ASSEMBLY): generated-stamp $(SNK) $(build_sources) $(references) @rm -f $(ASSEMBLY).mdb - $(CSC) $(CSFLAGS) -keyfile:$(SNK) -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(build_references) $(GENERATED_SOURCES) $(build_sources) $(top_builddir)$(ASSEMBLYINFO) + $(CSC) $(CSFLAGS) -keyfile:$(SNK) -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(build_references) $(GENERATED_SOURCES_OPTION) $(build_sources) $(top_builddir)$(ASSEMBLYINFO) install-data-local: @if test -n '$(pkg)'; then \ diff --git a/configure.ac b/configure.ac index a04f6a9cd..05e6f2e87 100644 --- a/configure.ac +++ b/configure.ac @@ -111,7 +111,8 @@ fi if test "x$has_mono" = "xtrue"; then GACUTIL_FLAGS='/package $(PACKAGE_VERSION) /gacdir $(DESTDIR)$(prefix)/lib' -GENERATED_SOURCES=generated/*/*.cs +GENERATED_SOURCES_FILES=generated/*/*.cs +GENERATED_SOURCES_OPTION=$GENERATED_SOURCES_FILES ASSEMBLYINFO=/AssemblyInfo.cs AC_PATH_PROG(RUNTIME, mono, no) @@ -144,7 +145,8 @@ dnl Check for .NET Framework AC_PATH_PROG(CSC, csc.exe, no) CSFLAGS="-nologo -platform:x86" GACUTIL_FLAGS= -GENERATED_SOURCES="-recurse:generated\\\\*.cs" +GENERATED_SOURCES_FILES="generated\\\\*.cs" +GENERATED_SOURCES_OPTION="-recurse:$GENERATED_SOURCES_FILES" ASSEMBLYINFO=\\\\AssemblyInfo.cs AM_CONDITIONAL(ENABLE_THREADCHECK, false) enable_dotnet=yes @@ -165,7 +167,8 @@ AC_SUBST(GACUTIL) AC_SUBST(GACUTIL_FLAGS) AC_SUBST(LIB_PREFIX) AC_SUBST(LIB_SUFFIX) -AC_SUBST(GENERATED_SOURCES) +AC_SUBST(GENERATED_SOURCES_FILES) +AC_SUBST(GENERATED_SOURCES_OPTION) AC_SUBST(ASSEMBLYINFO) GTK_REQUIRED_VERSION=3.0.0 diff --git a/sample/opaquetest/Makefile.am b/sample/opaquetest/Makefile.am index 17c6aac49..f1065acbd 100644 --- a/sample/opaquetest/Makefile.am +++ b/sample/opaquetest/Makefile.am @@ -4,8 +4,8 @@ lib_LTLIBRARIES = libopaque.la assemblies=../../glib/glib-sharp.dll ../../gio/gio-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll references=$(addprefix -r:, $(assemblies)) -opaquetest.exe: OpaqueTest.cs $(GENERATED_SOURCES) $(assemblies) - $(CSC) $(CSFLAGS) -out:opaquetest.exe $(references) $(srcdir)/OpaqueTest.cs $(GENERATED_SOURCES) +opaquetest.exe: OpaqueTest.cs $(GENERATED_SOURCES_FILES) $(assemblies) + $(CSC) $(CSFLAGS) -out:opaquetest.exe $(references) $(srcdir)/OpaqueTest.cs $(GENERATED_SOURCES_OPTION) libopaque_la_SOURCES = \ opaques.c \ @@ -17,7 +17,7 @@ libopaque_la_LIBADD = $(GTK_LIBS) AM_CPPFLAGS = $(GTK_CFLAGS) -$(GENERATED_SOURCES): opaque-api.xml +$(GENERATED_SOURCES_FILES): opaque-api.xml $(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/opaque-api.xml \ --include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \ --outdir=generated --assembly-name=opaque-sharp \ @@ -32,7 +32,7 @@ install: CLEANFILES = \ opaquetest.exe \ opaquetest.exe.mdb \ - $(GENERATED_SOURCES) + $(GENERATED_SOURCES_FILES) EXTRA_DIST = \ OpaqueTest.cs \ diff --git a/sample/valtest/Makefile.am b/sample/valtest/Makefile.am index 608970274..48399eeda 100644 --- a/sample/valtest/Makefile.am +++ b/sample/valtest/Makefile.am @@ -4,14 +4,8 @@ lib_LTLIBRARIES = libvalobj.la assemblies=../../glib/glib-sharp.dll ../../gio/gio-sharp.dll ../../cairo/cairo-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll references=$(addprefix -r:, $(assemblies)) -if PLATFORM_WIN32 -VALOBJ=Gtksharp\\Valobj.cs -else -VALOBJ=Gtksharp/Valobj.cs -endif - -valtest.exe: Valtest.cs $(VALOBJ) $(assemblies) - $(CSC) $(CSFLAGS) -out:valtest.exe $(references) $(srcdir)/Valtest.cs $(VALOBJ) +valtest.exe: Valtest.cs $(GENERATED_SOURCES_FILES) $(assemblies) + $(CSC) $(CSFLAGS) -out:valtest.exe $(references) $(srcdir)/Valtest.cs $(GENERATED_SOURCES_OPTION) libvalobj_la_SOURCES = \ valobj.c \ @@ -23,10 +17,10 @@ libvalobj_la_LIBADD = $(GTK_LIBS) AM_CPPFLAGS = $(GTK_CFLAGS) -$(VALOBJ): valobj-api.xml +$(GENERATED_SOURCES_FILES): valobj-api.xml $(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/valobj-api.xml \ --include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \ - --outdir=. --assembly-name=valobj-sharp \ + --outdir=generated --assembly-name=valobj-sharp \ --schema=$(top_srcdir)/gapi.xsd api: @@ -37,7 +31,7 @@ install: CLEANFILES = \ valtest.exe \ valtest.exe.mdb \ - $(VALOBJ) + $(GENERATED_SOURCES_FILES) EXTRA_DIST = \ Valtest.cs \