MSVC Builds: Restore Using Autotools for Generating Projects
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 20 Jul 2015 04:43:58 +0000 (12:43 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 17 Sep 2015 01:32:56 +0000 (09:32 +0800)
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
build/Makefile.am
build/atk_msvc_files.py [deleted file]
build/win32/vs10/Makefile.am
build/win32/vs10/atk-install.propsin
build/win32/vs9/Makefile.am
build/win32/vs9/atk-install.vspropsin
tests/Makefile.am
tests/testatk_vc.mak [new file with mode: 0644]
tests/testatk_vc.makin [deleted file]

index 136f06b53bbee63e2457e68e7bbcf5ec42eee7f8..c194e829a7da089c463b0c104d5c2dc61c782855 100644 (file)
@@ -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; \
index a9ce4fb485e674183886ab55100a6210fa514c75..1c50b667647a4cce3c13c64da306af36a4c00cf8 100644 (file)
@@ -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 (file)
index 0707ef5..0000000
+++ /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))
index bb52f23af1b9151cd003a148ea43873ad93d2cf5..98a85985df175d170c23c581d88fce57894edc90 100644 (file)
@@ -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)
index 546f7134680dddd1ccbefb2e049e78bbea5ca447..96236e85d2b4393c586cf0c3b2f30e3a1a9515d5 100644 (file)
@@ -17,7 +17,7 @@ copy $(BinDir)\atk-$(ApiVersion).lib $(CopyDir)\lib
 
 mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk
 
-#include "atk.vs10instfiles"
+#include "atk.vs10.headers"
     </AtkDoInstall>
   </PropertyGroup>
   <ItemGroup>
index f25c7eceeff3404ed1e1eddff979740f5c33aeb8..69af53f18b6ffcd529c56001262ba0b0422824f4 100644 (file)
@@ -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)
index 0d1a105387d006b5daa8e93c713cfdcd81492e80..4a44d5a60568997db48e1ada0573db4a2bec2a95 100644 (file)
@@ -17,7 +17,7 @@ mkdir $(CopyDir)\lib&#x0D;&#x0A;
 copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\atk-$(ApiVersion).lib $(CopyDir)\lib&#x0D;&#x0A;
 
 mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk&#x0D;&#x0A;
-#include "atk.vs9instfiles"
+#include "atk.headers"
 "
        />
 </VisualStudioPropertySheet>
index c7ebc7386c9eeafff5953f65c868f7665b354be9..d2bb2fd7b849a31c6100a1e3ffc33c4dd219c8f7 100644 (file)
@@ -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.mak b/tests/testatk_vc.mak
new file mode 100644 (file)
index 0000000..1fb1226
--- /dev/null
@@ -0,0 +1,53 @@
+!include ..\build\testsrules_msvc.mak
+
+BUILD_PATH = ..\build\win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin
+LDFLAGS_PATH = /libpath:$(BUILD_PATH) /libpath:..\..\vs$(VSVER)\$(PLAT)\lib
+
+TEST_ATK_LIBS = atk-$(ATK_API_VERSION).lib $(GLIB_LIBS)
+
+LDFLAGS =      \
+       $(LDFLAGS_PATH) \
+       $(LDFLAGS_ARCH)
+
+CFLAGS =       \
+       $(CFLAGS_ADD) /DG_DISABLE_DEPRECATED /I..       \
+       /I..\..\vs$(VSVER)\$(PLAT)\include\glib-2.0     \
+       /I..\..\vs$(VSVER)\$(PLAT)\lib\glib-2.0\include \
+       /I..\..\vs$(VSVER)\$(PLAT)\include\glib-2.0
+
+EMPTY_ITEM =
+
+test_programs = \
+       testdocument$(EXEEXT)   \
+       testrole$(EXEEXT)       \
+       testrelation$(EXEEXT)   \
+       teststateset$(EXEEXT)   \
+       testvalue$(EXEEXT)      \
+       $(EMPTY_ITEM)
+
+!if "$(VALID_CFGSET)" == "FALSE"
+all:
+       !@-echo You need to run "nmake -f testatk_vc.mak CFG=release" or
+       !@-echo "nmake -f testatk_vc.mak CFG=debug" to use this Makefile to
+       !@-echo build the test programs.
+
+clean:
+       @-del /q/f *$(EXEEXT).manifest
+       @-del /q/f *$(EXEEXT)
+       @-del /q/f *.idb
+       @-del /q/f *.obj
+       @-del /q/f *.pdb
+!else
+all: $(test_programs)
+
+.c$(EXEEXT):
+       $(CC) $(CFLAGS) $< $(LD_CFLAGS) $(LDFLAGS) $(TEST_ATK_LIBS) /Fe$@
+       @-if exist $@.manifest mt /nologo /manifest $@.manifest /outputresource:$@;1
+
+clean:
+       @-del /q/f *$(EXEEXT).manifest
+       @-del /q/f *$(EXEEXT)
+       @-del /q/f *.idb
+       @-del /q/f *.obj
+       @-del /q/f *.pdb
+!endif
diff --git a/tests/testatk_vc.makin b/tests/testatk_vc.makin
deleted file mode 100644 (file)
index 1bc6534..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-!include ..\build\testsrules_msvc.mak
-
-BUILD_PATH = ..\build\win32\vs$(VSVER)\$(CFG)\$(PLAT)\bin
-LDFLAGS_PATH = /libpath:$(BUILD_PATH) /libpath:..\..\vs$(VSVER)\$(PLAT)\lib
-
-TEST_ATK_LIBS = atk-$(ATK_API_VERSION).lib $(GLIB_LIBS)
-
-LDFLAGS =      \
-       $(LDFLAGS_PATH) \
-       $(LDFLAGS_ARCH)
-
-CFLAGS =       \
-       $(CFLAGS_ADD) /DG_DISABLE_DEPRECATED /I..       \
-       /I..\..\vs$(VSVER)\$(PLAT)\include\glib-2.0     \
-       /I..\..\vs$(VSVER)\$(PLAT)\lib\glib-2.0\include \
-       /I..\..\vs$(VSVER)\$(PLAT)\include\glib-2.0
-
-EMPTY_ITEM =
-
-test_programs = \
-#include "test_progs"
-       $(EMPTY_ITEM)
-
-!if "$(VALID_CFGSET)" == "FALSE"
-all:
-       !@-echo You need to run "nmake -f testatk_vc.mak CFG=release" or
-       !@-echo "nmake -f testatk_vc.mak CFG=debug" to use this Makefile to
-       !@-echo build the test programs.
-
-clean:
-       @-del /q/f *$(EXEEXT).manifest
-       @-del /q/f *$(EXEEXT)
-       @-del /q/f *.idb
-       @-del /q/f *.obj
-       @-del /q/f *.pdb
-!else
-all: $(test_programs)
-
-.c$(EXEEXT):
-       $(CC) $(CFLAGS) $< $(LD_CFLAGS) $(LDFLAGS) $(TEST_ATK_LIBS)
-
-clean:
-       @-del /q/f *$(EXEEXT).manifest
-       @-del /q/f *$(EXEEXT)
-       @-del /q/f *.idb
-       @-del /q/f *.obj
-       @-del /q/f *.pdb
-!endif