[json-glib/msvc-patch: 2/4] MSVC Support with automation added (autotools part)



commit a7bdf87ec150ac7a88a850190fa79359197e552e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Apr 13 00:26:35 2011 +0800

    MSVC Support with automation added (autotools part)
    
    This updates the autotools files so that the project to compile the main
    JSON-GLib DLL will have its source files filed into the project during
    "make dist".  Plus, it enables the creation/distribution of json-version.h
    and config.h.win32 with the correct version info during "make dist".
    
    These changes will simplify the maintenance of the VS project files,
    and support for VS2010 is also added here, with similar automation support,
    too.

 Makefile.am                  |    2 +-
 build/win32/Makefile.am      |    4 ++--
 build/win32/vs10/Makefile.am |   33 +++++++++++++++++++++++++++++++++
 build/win32/vs9/Makefile.am  |    1 +
 configure.ac                 |    2 ++
 json-glib/Makefile.am        |   39 ++++++++++++++++++++++++++++++++++++++-
 6 files changed, 77 insertions(+), 4 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 6d659f4..cab1f10 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@ if ENABLE_GLIB_TEST
 SUBDIRS += tests
 endif
 
-DIST_SUBDIRS = build json-glib doc tests
+DIST_SUBDIRS = json-glib doc tests build
 
 pcfiles = json-glib-1.0.pc
 
diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am
index 9e371ac..6f2c047 100644
--- a/build/win32/Makefile.am
+++ b/build/win32/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = vs9
+SUBDIRS = vs9 vs10
 
-EXTRA_DIST = config.h.win32 json-version.h.win32
+EXTRA_DIST = config.h.win32.in config.h.win32
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am
new file mode 100644
index 0000000..1889923
--- /dev/null
+++ b/build/win32/vs10/Makefile.am
@@ -0,0 +1,33 @@
+NULL =
+
+EXTRA_DIST =	\
+	array-test.vcxproj		\
+	array-test.vcxproj.filters	\
+	builder-test.vcxproj		\
+	builder-test.vcxproj.filters	\
+	generator-test.vcxproj		\
+	generator-test.vcxproj.filters	\
+	install.vcxproj			\
+	json-glib.sln			\
+	json-glib.vcxproj		\
+	json-glib.vcxprojin		\
+	json-glib.vcxproj.filters	\
+	json-glib.vcxproj.filtersin	\
+	json-glib.props			\
+	node-test.vcxproj		\
+	node-test.vcxproj.filters	\
+	object-test.vcxproj		\
+	object-test.vcxproj.filters	\
+	parser-test.vcxproj		\
+	parser-test.vcxproj.filters	\
+	reader-test.vcxproj		\
+	reader-test.vcxproj.filters	\
+	test-serialize-boxed.vcxproj	\
+	test-serialize-boxed.vcxproj.filters	\
+	test-serialize-complex.vcxproj	\
+	test-serialize-complex.vcxproj.filters	\
+	test-serialize-full.vcxproj	\
+	test-serialize-full.vcxproj.filters	\
+	test-serialize-simple.vcxproj	\
+	test-serialize-simple.vcxproj.filters	\
+	$(NULL)
diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am
index 641c1e5..82ff2e5 100644
--- a/build/win32/vs9/Makefile.am
+++ b/build/win32/vs9/Makefile.am
@@ -7,6 +7,7 @@ EXTRA_DIST =	\
 	install.vcproj			\
 	json-glib.sln			\
 	json-glib.vcproj		\
+	json-glib.vcprojin		\
 	json-glib.vsprops		\
 	node-test.vcproj		\
 	object-test.vcproj		\
diff --git a/configure.ac b/configure.ac
index 61daaa3..8e56a01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,7 +172,9 @@ AC_CONFIG_FILES([
         build/Makefile
         build/autotools/Makefile
         build/win32/Makefile
+        build/win32/config.h.win32
         build/win32/vs9/Makefile
+        build/win32/vs10/Makefile
 
         json-glib/Makefile
         json-glib/json-version.h
diff --git a/json-glib/Makefile.am b/json-glib/Makefile.am
index 1068807..6a0f8b7 100644
--- a/json-glib/Makefile.am
+++ b/json-glib/Makefile.am
@@ -87,7 +87,7 @@ jsoninclude_DATA = \
 	$(top_srcdir)/json-glib/json-glib.h		\
 	$(NULL)
 
-EXTRA_DIST += json-version.h.in json-glib.h
+EXTRA_DIST += json-version.h.in json-glib.h json-version.h
 
 TESTS_ENVIRONMENT = srcdir="$(srcdir)" json_all_c_sources="$(source_c)"
 
@@ -118,5 +118,42 @@ endif # HAVE_INTROSPECTION
 
 EXTRA_DIST += json-glib.symbols
 
+dist-hook: ../build/win32/vs9/json-glib.vcproj ../build/win32/vs10/json-glib.vcxproj ../build/win32/vs10/json-glib.vcxproj.filters
+
+../build/win32/vs9/json-glib.vcproj: $(top_srcdir)/build/win32/vs9/json-glib.vcprojin
+	for F in $(libjson_glib_1_0_la_SOURCES); do \
+		case $$F in \
+		*.c)	echo '   <File RelativePath="..\..\..\json-glib\'$$F'" />' \
+			;; \
+		esac; \
+	done >jsonglib.sourcefiles
+	$(CPP) -P - <$(top_srcdir)/build/win32/vs9/json-glib.vcprojin >$@
+	rm jsonglib.sourcefiles
+	
+../build/win32/vs10/json-glib.vcxproj: $(top_srcdir)/build/win32/vs10/json-glib.vcxprojin
+	for F in $(libjson_glib_1_0_la_SOURCES); do \
+		case $$F in \
+		*.c)	echo '    <ClCompile Include="..\..\..\json-glib\'$$F'" />' \
+			;; \
+		esac; \
+	done >jsonglib.vs10.sourcefiles
+	$(CPP) -P - <$(top_srcdir)/build/win32/vs10/json-glib.vcxprojin >$@
+	rm jsonglib.vs10.sourcefiles
+	
+../build/win32/vs10/json-glib.vcxproj.filters: $(top_srcdir)/build/win32/vs10/json-glib.vcxproj.filtersin
+	for F in $(libjson_glib_1_0_la_SOURCES); do \
+		case $$F in \
+		*.c)	echo '    <ClCompile Include="..\..\..\json-glib\'$$F'"><Filter>Sources</Filter></ClCompile>' \
+			;; \
+		esac; \
+	done >jsonglib.vs10.sourcefiles.filters
+	$(CPP) -P - <$(top_srcdir)/build/win32/vs10/json-glib.vcxproj.filtersin >$@
+	rm jsonglib.vs10.sourcefiles.filters
+
+# Let the VS9/VS10 Project files be cleared out before they are re-expanded...
+DISTCLEANFILES += ../build/win32/vs9/json-glib.vcproj	\
+		  ../build/win32/vs10/json-glib.vcxproj	\
+		  ../build/win32/vs10/json-glib.vcxproj.filters
+
 gcov_sources = $(source_c)
 include $(top_srcdir)/build/autotools/Makefile.am.gcov



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]