From 75b61c34fad2a907becb2ab6367e6b9571091c64 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 14 Aug 2012 16:17:31 +0800 Subject: [PATCH] Update autotools for Visual C++ projects creation -Add Makefile-msvcproj.am to fill in the cmph, girepository and g-ir-compiler projects -Add various Makefile.am's under build/ to distribute the Visual C++-related files. https://bugzilla.gnome.org/show_bug.cgi?id=681820 --- Makefile-msvcproj.am | 176 +++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 3 +- build/Makefile.am | 1 + build/win32/Makefile.am | 15 ++++ build/win32/vs10/Makefile.am | 47 ++++++++++++ build/win32/vs9/Makefile.am | 30 ++++++++ configure.ac | 7 +- 7 files changed, 277 insertions(+), 2 deletions(-) create mode 100644 Makefile-msvcproj.am create mode 100644 build/Makefile.am create mode 100644 build/win32/Makefile.am create mode 100644 build/win32/vs10/Makefile.am create mode 100644 build/win32/vs9/Makefile.am diff --git a/Makefile-msvcproj.am b/Makefile-msvcproj.am new file mode 100644 index 0000000..ccc7faf --- /dev/null +++ b/Makefile-msvcproj.am @@ -0,0 +1,176 @@ +# This is to fill in Visual C++ projects for projects which add/remove +# sources from them every now and then. + +# -------------------------- +# cmph (static lib) projects +# -------------------------- +./build/win32/vs9/cmph.vcproj: $(top_srcdir)/build/win32/vs9/cmph.vcprojin + for F in `echo $(libcmph_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >cmph.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/cmph.vcprojin >$@ + rm cmph.sourcefiles + +./build/win32/vs10/cmph.vcxproj: $(top_srcdir)/build/win32/vs10/cmph.vcxprojin + for F in `echo $(libcmph_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >cmph.vs10.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/cmph.vcxprojin >$@ + rm cmph.vs10.sourcefiles + +./build/win32/vs10/cmph.vcxproj.filters: $(top_srcdir)/build/win32/vs10/cmph.vcxproj.filtersin + for F in `echo $(libcmph_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' Sources' \ + ;; \ + esac; \ + done >cmph.vs10.sourcefiles.filters + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/cmph.vcxproj.filtersin >$@ + rm cmph.vs10.sourcefiles.filters + +# ------------------------- +# girepository DLL projects +# ------------------------- +./build/win32/vs9/girepository.vcproj: $(top_srcdir)/build/win32/vs9/girepository.vcprojin ./build/win32/vs9/gir.vs9.install + for F in `echo $(libgirepository_1_0_la_SOURCES) $(libgirepository_gthash_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >girepository.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/girepository.vcprojin >$@ + rm girepository.sourcefiles + +./build/win32/vs10/girepository.vcxproj: $(top_srcdir)/build/win32/vs10/girepository.vcxprojin ./build/win32/vs10/gir.vs10.install + for F in `echo $(libgirepository_1_0_la_SOURCES) $(libgirepository_gthash_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >girepository.vs10.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/girepository.vcxprojin >$@ + rm girepository.vs10.sourcefiles + +./build/win32/vs10/girepository.vcxproj.filters: $(top_srcdir)/build/win32/vs10/girepository.vcxproj.filtersin + for F in `echo $(libgirepository_1_0_la_SOURCES) $(libgirepository_gthash_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' Sources' \ + ;; \ + esac; \ + done >girepository.vs10.sourcefiles.filters + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/girepository.vcxproj.filtersin >$@ + rm girepository.vs10.sourcefiles.filters + +# ------------------------------------ +# g-ir-compiler.exe projects +# (We integrate the +# libgirepository_internals_la_SOURCES +# and +# libgirepository_gthash_la_SOURCES +# here) +# ------------------------------------ +./build/win32/vs9/g-ir-compiler.vcproj: $(top_srcdir)/build/win32/vs9/g-ir-compiler.vcprojin + for F in `echo $(libgirepository_gthash_la_SOURCES) $(libgirepository_internals_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >g-ir-compiler.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/g-ir-compiler.vcprojin >$@ + rm g-ir-compiler.sourcefiles + +./build/win32/vs10/g-ir-compiler.vcxproj: $(top_srcdir)/build/win32/vs10/g-ir-compiler.vcxprojin + for F in `echo $(libgirepository_gthash_la_SOURCES) $(libgirepository_internals_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >g-ir-compiler.vs10.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/g-ir-compiler.vcxprojin >$@ + rm g-ir-compiler.vs10.sourcefiles + +./build/win32/vs10/g-ir-compiler.vcxproj.filters: $(top_srcdir)/build/win32/vs10/g-ir-compiler.vcxproj.filtersin + for F in `echo $(libgirepository_gthash_la_SOURCES) $(libgirepository_internals_la_SOURCES) | tr '/' '\\'`; do \ + case $$F in \ + *.c) echo ' Sources' \ + ;; \ + esac; \ + done >g-ir-compiler.vs10.sourcefiles.filters + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/g-ir-compiler.vcxproj.filtersin >$@ + rm g-ir-compiler.vs10.sourcefiles.filters + +#-------------------------------- +# Generate the "lists" of headers +# and Python scripts to install +#-------------------------------- +./build/win32/vs9/gir.vs9.install: + echo 'mkdir $$(CopyDir)\include\gobject-introspection-$$(GIApiVersion)\girepository ' >./build/win32/vs9/gir.vs9.install + echo '' >>./build/win32/vs9/gir.vs9.install + for F in `echo $(girepo_HEADERS) | tr '/' '\\'`; do \ + case $$F in \ + *.h) echo 'copy ..\..\..\'$$F' $$(CopyDir)\include\gobject-introspection-$$(GIApiVersion)\girepository ' \ + ;; \ + esac; \ + done >>./build/win32/vs9/gir.vs9.install + echo '' >>./build/win32/vs9/gir.vs9.install + echo 'mkdir $$(CopyDir)\lib\gobject-introspection\giscanner ' >>./build/win32/vs9/gir.vs9.install + echo '' >>./build/win32/vs9/gir.vs9.install + for F in `echo $(pkgpyexec_PYTHON) | tr '/' '\\'`; do \ + case $$F in \ + *.py|*.tmpl) echo 'copy ..\..\..\'$$F' $$(CopyDir)\lib\gobject-introspection\giscanner ' \ + ;; \ + esac; \ + done >>./build/win32/vs9/gir.vs9.install + +./build/win32/vs10/gir.vs10.install: + echo 'mkdir $$(CopyDir)\include\gobject-introspection-$$(GIApiVersion)\girepository' >./build/win32/vs10/gir.vs10.install + echo '' >>./build/win32/vs10/gir.vs10.install + for F in `echo $(girepo_HEADERS) | tr '/' '\\'`; do \ + case $$F in \ + *.h) echo 'copy ..\..\..\'$$F' $$(CopyDir)\include\gobject-introspection-$$(GIApiVersion)\girepository' && \ + echo '' \ + ;; \ + esac; \ + done >>./build/win32/vs10/gir.vs10.install + echo '' >>./build/win32/vs10/gir.vs10.install + echo 'mkdir $$(CopyDir)\lib\gobject-introspection\giscanner' >>./build/win32/vs10/gir.vs10.install + echo '' >>./build/win32/vs10/gir.vs10.install + for F in `echo $(pkgpyexec_PYTHON) | tr '/' '\\'`; do \ + case $$F in \ + *.py|*.tmpl) echo 'copy ..\..\..\'$$F' $$(CopyDir)\lib\gobject-introspection\giscanner' && \ + echo '' \ + ;; \ + esac; \ + done >>./build/win32/vs10/gir.vs10.install + +./build/win32/vs9/gir.vsprops: ./build/win32/vs9/gir.vs9.install $(top_srcdir)/build/win32/vs9/gir.vspropsin + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gir.vspropsin >$@ + rm ./build/win32/vs9/gir.vs9.install + +./build/win32/vs10/gir.props: ./build/win32/vs10/gir.vs10.install $(top_srcdir)/build/win32/vs10/gir.propsin + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gir.propsin >$@ + rm ./build/win32/vs10/gir.vs10.install + +GENERATED_MSVC_FILES = \ + ./build/win32/vs9/girepository.vcproj \ + ./build/win32/vs10/girepository.vcxproj \ + ./build/win32/vs10/girepository.vcxproj.filters \ + ./build/win32/vs9/g-ir-compiler.vcproj \ + ./build/win32/vs10/g-ir-compiler.vcxproj \ + ./build/win32/vs10/g-ir-compiler.vcxproj.filters \ + ./build/win32/vs9/cmph.vcproj \ + ./build/win32/vs10/cmph.vcxproj \ + ./build/win32/vs10/cmph.vcxproj.filters \ + config.h.win32 + +EXTRA_DIST += \ + ./girepository/girepository.symbols \ + $(GENERATED_MSVC_FILES) + +CLEANFILES += $(GENERATED_MSVC_FILES) diff --git a/Makefile.am b/Makefile.am index a36c200..2059b98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,11 +21,12 @@ include Makefile-giscanner.am include Makefile-examples.am include Makefile-gir.am include Makefile-tools.am +include Makefile-msvcproj.am ## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -SUBDIRS = . docs tests +SUBDIRS = . docs tests build DIST_SUBDIRS = m4 $(SUBDIRS) DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc diff --git a/build/Makefile.am b/build/Makefile.am new file mode 100644 index 0000000..0f81afe --- /dev/null +++ b/build/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = win32 diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am new file mode 100644 index 0000000..499c5cf --- /dev/null +++ b/build/win32/Makefile.am @@ -0,0 +1,15 @@ +SUBDIRS = vs9 vs10 + +EXTRA_DIST = \ + annotation.def \ + everything.def \ + foo.def \ + gengir.bat \ + gettype.def \ + gimarshallingtests.def \ + gtkfrob.def \ + Regress.def \ + sletter.def \ + testinherit.def \ + test_gir_cmd.txt \ + utility.def diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am new file mode 100644 index 0000000..0046bc4 --- /dev/null +++ b/build/win32/vs10/Makefile.am @@ -0,0 +1,47 @@ +EXTRA_DIST = \ + gobject-introspection.sln \ + girepository.vcxprojin \ + girepository.vcxproj.filtersin \ + gir.propsin \ + gir.props \ + annotation.vcxproj \ + annotation.vcxproj.filters \ + cmph-bdz-test.vcxproj \ + cmph-bdz-test.vcxproj.filters \ + cmph.vcxprojin \ + cmph.vcxproj.filtersin \ + everything.vcxproj \ + everything.vcxproj.filters \ + foo.vcxproj \ + foo.vcxproj.filters \ + g-ir-compiler.vcxprojin \ + g-ir-compiler.vcxproj.filtersin \ + g-ir-generate.vcxproj \ + g-ir-generate.vcxproj.filters \ + gettype.vcxproj \ + gettype.vcxproj.filters \ + gimarshallingtests.vcxproj \ + gimarshallingtests.vcxproj.filters \ + glib-print.vcxproj \ + glib-print.vcxproj.filters \ + gtkfrob.vcxproj \ + gtkfrob.vcxproj.filters \ + regress.vcxproj \ + regress.vcxproj.filters \ + sletter.vcxproj \ + sletter.vcxproj.filters \ + testinherit.vcxproj \ + testinherit.vcxproj.filters \ + utility.vcxproj \ + utility.vcxproj.filters \ + _giscanner.vcxproj \ + _giscanner.vcxproj.filters \ + generate_typelibs.vcxproj \ + install.vcxproj \ + README.txt + +gir.props: $(top_srcdir)/build/win32/vs10/gir.propsin gir.vs10.install + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gir.propsin >$@ + rm gir.vs10.install + +CLEANFILES = gir.props diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am new file mode 100644 index 0000000..ed82cbc --- /dev/null +++ b/build/win32/vs9/Makefile.am @@ -0,0 +1,30 @@ +EXTRA_DIST = \ + gobject-introspection.sln \ + girepository.vcprojin \ + gir.vspropsin \ + gir.vsprops \ + annotation.vcproj \ + cmph-bdz-test.vcproj \ + cmph.vcprojin \ + everything.vcproj \ + foo.vcproj \ + g-ir-compiler.vcprojin \ + g-ir-generate.vcproj \ + generate_typelibs.vcproj \ + gettype.vcproj \ + gimarshallingtests.vcproj \ + glib-print.vcproj \ + gtkfrob.vcproj \ + install.vcproj \ + regress.vcproj \ + sletter.vcproj \ + testinherit.vcproj \ + utility.vcproj \ + _giscanner.vcproj \ + README.txt + +gir.vsprops: $(top_srcdir)/build/win32/vs9/gir.vspropsin gir.vs9.install + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gir.vspropsin >$@ + rm gir.vs9.install + +CLEANFILES = gir.vsprops diff --git a/configure.ac b/configure.ac index e488cea..ca78315 100644 --- a/configure.ac +++ b/configure.ac @@ -300,7 +300,12 @@ tests/doctool/Makefile docs/Makefile docs/reference/Makefile gobject-introspection-1.0.pc -gobject-introspection-no-export-1.0.pc]) +gobject-introspection-no-export-1.0.pc +config.h.win32 +build/Makefile +build/win32/Makefile +build/win32/vs9/Makefile +build/win32/vs10/Makefile]) AC_OUTPUT echo " -- 2.7.4