From 9ae6ef5456022e17c3f84d74252d89e10ae53766 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 20 Jul 2015 12:43:58 +0800 Subject: [PATCH] MSVC Builds: Restore Using Autotools for Generating Projects Use the common autotools module in my last commit for generating the MSVC project files, which is more safe against 'make dist -jN' and supports out-of-tree builds better. https://bugzilla.gnome.org/show_bug.cgi?id=755114 --- atk/Makefile.am | 16 +++++++ build/Makefile.am | 1 - build/atk_msvc_files.py | 68 ------------------------------ build/win32/vs10/Makefile.am | 20 +++++---- build/win32/vs10/atk-install.propsin | 2 +- build/win32/vs9/Makefile.am | 18 ++++---- build/win32/vs9/atk-install.vspropsin | 2 +- tests/Makefile.am | 5 +-- tests/{testatk_vc.makin => testatk_vc.mak} | 9 +++- 9 files changed, 47 insertions(+), 94 deletions(-) delete mode 100644 build/atk_msvc_files.py rename tests/{testatk_vc.makin => testatk_vc.mak} (79%) diff --git a/atk/Makefile.am b/atk/Makefile.am index 136f06b..c194e82 100644 --- a/atk/Makefile.am +++ b/atk/Makefile.am @@ -205,6 +205,22 @@ DISTCLEANFILES = \ stamp-atkmarshal.h stamp-atkmarshal.c \ s-enum-types-h s-enum-types-c +# ---------- MSVC Project Items --------- +MSVCPROJS = atk + +atk_FILES = $(libatk_1_0_la_SOURCES) +atk_EXCLUDES = atkdummy + +atk_HEADERS_DIR = $(libatkincludedir) +atk_HEADERS_INST = $(libatkinclude_HEADERS) atkversion.h +atk_HEADERS_EXCLUDES = $(top_builddir)/atk/atkversion.h + +include $(top_srcdir)/build/Makefile.msvcproj + +dist-hook: \ + $(top_builddir)/build/win32/vs9/atk.vcproj \ + $(top_builddir)/build/win32/vs9/atk.headers + distclean-local: if test $(srcdir) = .; then :; else \ rm -f atkmarshal.h atkmarshal.c atk-enum-types.h atk-enum-types.c; \ diff --git a/build/Makefile.am b/build/Makefile.am index a9ce4fb..1c50b66 100644 --- a/build/Makefile.am +++ b/build/Makefile.am @@ -2,7 +2,6 @@ SUBDIRS = \ win32 EXTRA_DIST = \ - atk_msvc_files.py \ msvcfiles.py \ testsrules_msvc.mak \ introspection-msvc.mak \ diff --git a/build/atk_msvc_files.py b/build/atk_msvc_files.py deleted file mode 100644 index 0707ef5..0000000 --- a/build/atk_msvc_files.py +++ /dev/null @@ -1,68 +0,0 @@ -#! /usr/bin/python - -# Expand The Visual Studio Files from their templates - -import os -import optparse -import sys - -from msvcfiles import parent_dir -from msvcfiles import check_output_type -from msvcfiles import generate_src_list -from msvcfiles import gen_vs9_project -from msvcfiles import gen_vs10_project -from msvcfiles import generate_nmake_makefiles -from msvcfiles import gen_vs_inst_list - -def main(argv): - parser = optparse.OptionParser() - parser.add_option('-t', '--type', dest='output_type', metavar='string', action='store', help='Visual Studio output build file type to generate ("nmake-exe","vs9","vs10")') - opt, args = parser.parse_args(argv) - - srcroot = parent_dir(__file__) - output_type = check_output_type (opt.output_type) - if (output_type == -1): - sys.exit() - - elif (output_type == 3): - # Generate the executable list from tests/ - test_filters_progs = ['noinst_PROGRAMS'] - test_filters_conds = {} - test_src_dir = os.path.join(srcroot, 'tests') - test_progs = generate_src_list (srcroot, test_src_dir, test_filters_progs, test_filters_conds, False, None) - generate_nmake_makefiles(srcroot, test_src_dir, "test", "testatk_vc.mak", test_progs) - - elif (output_type == 1 or output_type == 2): - # Generate the ATK MSVC 2008 or 2010 project files - atk_filters_src = ['libatk_1_0_la_SOURCES'] - atk_filters_conds = {} - atk_src_dir = os.path.join(srcroot, 'atk') - atk_src_files = generate_src_list (srcroot, atk_src_dir, atk_filters_src, atk_filters_conds, True, None) - if (output_type == 1): - gen_vs9_project ('atk', srcroot, 'atk', atk_src_files) - else: - gen_vs10_project ('atk', srcroot, 'atk', atk_src_files) - - - # Generate the ATK headers list to "install" for MSVC 2008/2010 - atk_filters_h_conds = {} - atk_filters_h = ['libatkinclude_HEADERS'] - atk_h_files_raw = generate_src_list (srcroot, atk_src_dir, atk_filters_h, atk_filters_h_conds, False, None) - atk_h_files = [files.replace('/atk/', '') for files in atk_h_files_raw] - - srcdirs = ['atk'] - - inst_h_lists = [atk_h_files] - - inst_h_dirs = ['include\\atk-$(ApiVersion)\\atk'] - - if (output_type == 1): - gen_vs_inst_list ('atk', srcroot, srcdirs, inst_h_lists, inst_h_dirs, True) - else: - gen_vs_inst_list ('atk', srcroot, srcdirs, inst_h_lists, inst_h_dirs, False) - - else: - raise Exception ("Somehow your output_type is wrong.\nShould not have seen this message!") - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am index bb52f23..98a8598 100644 --- a/build/win32/vs10/Makefile.am +++ b/build/win32/vs10/Makefile.am @@ -1,20 +1,22 @@ +GENERATED_ITEMS = \ + atk.vcxproj \ + atk.vcxproj.filters \ + atk-install.props + EXTRA_DIST = \ README.txt \ atk.sln \ - atk.vcxproj \ atk.vcxprojin \ - atk.vcxproj.filters \ atk.vcxproj.filtersin \ atk-install.vcxproj \ atk-build-defines.props \ atk-gen-src.props \ - atk-install.props \ atk-install.propsin \ - atk-version-paths.props - -atk-install.props atk.vcxproj.filter: atk.vcxproj + atk-version-paths.props \ + $(GENERATED_ITEMS) -atk.vcxproj: - $(PYTHON) $(top_srcdir)/build/atk_msvc_files.py -t vs10 +atk-install.props: $(top_srcdir)/build/win32/vs10/atk-install.propsin atk.vs10.headers + $(CPP) -P - <$(top_srcdir)/build/win32/vs10/atk-install.propsin >$@ + rm atk.vs10.headers -DISTCLEANFILES = atk.vcxproj atk.vcxproj.filters atk-install.props +DISTCLEANFILES = $(GENERATED_ITEMS) diff --git a/build/win32/vs10/atk-install.propsin b/build/win32/vs10/atk-install.propsin index 546f713..96236e8 100644 --- a/build/win32/vs10/atk-install.propsin +++ b/build/win32/vs10/atk-install.propsin @@ -17,7 +17,7 @@ copy $(BinDir)\atk-$(ApiVersion).lib $(CopyDir)\lib mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk -#include "atk.vs10instfiles" +#include "atk.vs10.headers" diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am index f25c7ec..69af53f 100644 --- a/build/win32/vs9/Makefile.am +++ b/build/win32/vs9/Makefile.am @@ -1,18 +1,20 @@ +GENERATED_ITEMS = \ + atk.vcproj \ + atk-install.vsprops + EXTRA_DIST = \ README.txt \ atk.sln \ - atk.vcproj \ atk.vcprojin \ atk-install.vcproj \ atk-build-defines.vsprops \ atk-gen-src.vsprops \ - atk-install.vsprops \ atk-install.vspropsin \ - atk-version-paths.vsprops - -atk-install.vsprops: atk.vcproj + atk-version-paths.vsprops \ + $(GENERATED_ITEMS) -atk.vcproj: - $(PYTHON) $(top_srcdir)/build/atk_msvc_files.py -t vs9 +atk-install.vsprops: $(top_srcdir)/build/win32/vs9/atk-install.vspropsin atk.headers + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/atk-install.vspropsin >$@ + rm atk.headers -DISTCLEANFILES = atk.vcproj atk-install.vsprops +DISTCLEANFILES = $(GENERATED_ITEMS) diff --git a/build/win32/vs9/atk-install.vspropsin b/build/win32/vs9/atk-install.vspropsin index 0d1a105..4a44d5a 100644 --- a/build/win32/vs9/atk-install.vspropsin +++ b/build/win32/vs9/atk-install.vspropsin @@ -17,7 +17,7 @@ mkdir $(CopyDir)\lib copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\atk-$(ApiVersion).lib $(CopyDir)\lib mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk -#include "atk.vs9instfiles" +#include "atk.headers" " /> diff --git a/tests/Makefile.am b/tests/Makefile.am index c7ebc73..d2bb2fd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,9 +26,6 @@ testrelation_SOURCES = testrelation.c teststateset_SOURCES = teststateset.c testvalue_SOURCES = testvalue.c -testatk_vc.mak: testatk_vc.makin $(top_srcdir)/build/atk_msvc_files.py $(top_srcdir)/build/msvcfiles.py - $(PYTHON) $(top_srcdir)/build/atk_msvc_files.py -t nmake-exe - -EXTRA_DIST = testatk_vc.makin testatk_vc.mak +EXTRA_DIST = testatk_vc.mak DISTCLEANFILES = testatk_vc.mak diff --git a/tests/testatk_vc.makin b/tests/testatk_vc.mak similarity index 79% rename from tests/testatk_vc.makin rename to tests/testatk_vc.mak index 1bc6534..1fb1226 100644 --- a/tests/testatk_vc.makin +++ b/tests/testatk_vc.mak @@ -18,7 +18,11 @@ CFLAGS = \ EMPTY_ITEM = test_programs = \ -#include "test_progs" + testdocument$(EXEEXT) \ + testrole$(EXEEXT) \ + testrelation$(EXEEXT) \ + teststateset$(EXEEXT) \ + testvalue$(EXEEXT) \ $(EMPTY_ITEM) !if "$(VALID_CFGSET)" == "FALSE" @@ -37,7 +41,8 @@ clean: all: $(test_programs) .c$(EXEEXT): - $(CC) $(CFLAGS) $< $(LD_CFLAGS) $(LDFLAGS) $(TEST_ATK_LIBS) + $(CC) $(CFLAGS) $< $(LD_CFLAGS) $(LDFLAGS) $(TEST_ATK_LIBS) /Fe$@ + @-if exist $@.manifest mt /nologo /manifest $@.manifest /outputresource:$@;1 clean: @-del /q/f *$(EXEEXT).manifest -- 2.11.4.GIT