[atk] Visual Studio builds: Adapt to the Python-fied glib-genmarshal



commit cd55690be5d0e7f62f656494d1c36954ac677ce9
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jul 12 12:27:44 2017 +0800

    Visual Studio builds: Adapt to the Python-fied glib-genmarshal
    
    glib-genmarshal is used for the Visual Studio builds, and has been
    recently converted to a Python script instead of a compiled C program.
    
    Since Visual Studio calls cmd.exe to run Custom Build steps, we need
    to call Python explicitly to run glib-genmarshal as shebang lines
    are not supported in cmd.exe, which means that Python will become a
    hard build-time requirement instead of being optional.  This also means
    that the atk.pc pkg-config file will always be generated.
    
    However, since ATK does not yet require a really recent GLib, maintain
    compatibility with older GLib by calling glib-genmarshal.exe when the
    glib-genmarshal Python script is not found.

 win32/vs10/README.txt           |    7 +++++++
 win32/vs10/atk-gen-src.props    |   20 +++++++++++++++-----
 win32/vs10/atk-install.propsin  |    7 ++++---
 win32/vs10/atk.vcxprojin        |   21 +++++++++------------
 win32/vs9/README.txt            |    6 ++++++
 win32/vs9/atk-gen-src.vsprops   |   17 +++++++++++++++--
 win32/vs9/atk-install.vspropsin |    7 ++++---
 win32/vs9/atk.vcprojin          |    4 ++--
 8 files changed, 62 insertions(+), 27 deletions(-)
---
diff --git a/win32/vs10/README.txt b/win32/vs10/README.txt
index 1efbcfa..b394757 100644
--- a/win32/vs10/README.txt
+++ b/win32/vs10/README.txt
@@ -16,6 +16,13 @@ into atk.vcxproj and atk.vcxproj.filters respectively.
 The dependencies for this package are gettext-runtime (libintl), GLib*
 and ZLib.
 
+You will also need a Python 2.7.x or 3.x installation, as Python will be
+used to run glib-genmarshal, which was converted into a Python script from
+a compiled C program, in addition to generating the atk.pc pkg-config
+file for the build.  See PythonPath (32-bit builds) or PythonPathX64 (x64
+builds) in atk-version-paths.props to see that they point to the correct paths.
+
+
 a) look for all of the dependencies (except GLib*) under
 
    http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32-bit) -OR-
diff --git a/win32/vs10/atk-gen-src.props b/win32/vs10/atk-gen-src.props
index 6abbcdc..d699f4f 100644
--- a/win32/vs10/atk-gen-src.props
+++ b/win32/vs10/atk-gen-src.props
@@ -7,13 +7,20 @@
     <GenConfigH>if not exist ..\..\config.h copy ..\..\config.h.win32 ..\..\config.h</GenConfigH>
     <GenMarshalSrc>
 cd ..\..\atk
-
-$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header &gt; atkmarshal.h
-
-$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body &gt; atkmarshal.c
-
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header &gt; atkmarshal.h
+if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--header &gt; atkmarshal.h
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body &gt; atkmarshal.c
+if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--body &gt; atkmarshal.c
 cd $(SolutionDir)
     </GenMarshalSrc>
+    <GenMarshalSrcX64>
+cd ..\..\atk
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header &gt; atkmarshal.h
+if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--header &gt; atkmarshal.h
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body &gt; atkmarshal.c
+if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--body &gt; atkmarshal.c
+cd $(SolutionDir)
+    </GenMarshalSrcX64>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>atkgensrcprops</_PropertySheetDisplayName>
@@ -25,5 +32,8 @@ cd $(SolutionDir)
     <BuildMacro Include="GenMarshalSrc">
       <Value>$(GenMarshalSrc)</Value>
     </BuildMacro>
+    <BuildMacro Include="GenMarshalSrcX64">
+      <Value>$(GenMarshalSrcX64)</Value>
+    </BuildMacro>
   </ItemGroup>
 </Project>
diff --git a/win32/vs10/atk-install.propsin b/win32/vs10/atk-install.propsin
index b790fa8..81c2dc5 100644
--- a/win32/vs10/atk-install.propsin
+++ b/win32/vs10/atk-install.propsin
@@ -18,10 +18,11 @@ copy $(BinDir)\atk-$(ApiVersion).lib $(CopyDir)\lib
 mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk
 #include "atk.vs10.headers"
 
-if exist ..\atk.pc (mkdir $(CopyDir)\lib\pkgconfig &amp; copy ..\atk.pc $(CopyDir)\lib\pkgconfig)
+mkdir $(CopyDir)\lib\pkgconfig
+copy ..\atk.pc $(CopyDir)\lib\pkgconfig
     </AtkDoInstall>
-    <AtkGenPC>if exist $(PythonPath)\python.exe $(PythonPath)\python.exe ..\atkpc.py --prefix=$(CopyDir) 
--version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)</AtkGenPC>
-    <AtkGenPCX64>if exist $(PythonPathX64)\python.exe $(PythonPathX64)\python.exe ..\atkpc.py 
--prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)</AtkGenPCX64>
+    <AtkGenPC>$(PythonPath)\python.exe ..\atkpc.py --prefix=$(CopyDir) 
--version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)</AtkGenPC>
+    <AtkGenPCX64>$(PythonPathX64)\python.exe ..\atkpc.py --prefix=$(CopyDir) 
--version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)</AtkGenPCX64>
     <AtkPCFiles>..\atk.pc</AtkPCFiles>
   </PropertyGroup>
   <ItemGroup>
diff --git a/win32/vs10/atk.vcxprojin b/win32/vs10/atk.vcxprojin
index 4f96b7c..b1c79d2 100644
--- a/win32/vs10/atk.vcxprojin
+++ b/win32/vs10/atk.vcxprojin
@@ -159,20 +159,17 @@
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\config.h.win32">
-      <Message Condition="'$(Configuration)'=='Debug'">Copying config.h from config.h.win32...</Message>
-      <Command Condition="'$(Configuration)'=='Debug'">$(GenConfigH)</Command>
-      <Outputs Condition="'$(Configuration)'=='Debug'">..\..\config.h;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)'=='Release'">Copying config.h from config.h.win32...</Message>
-      <Command Condition="'$(Configuration)'=='Release'">$(GenConfigH)</Command>
-      <Outputs Condition="'$(Configuration)'=='Release'">..\..\config.h;%(Outputs)</Outputs>
+      <Message>Copying config.h from config.h.win32...</Message>
+      <Command>$(GenConfigH)</Command>
+      <Outputs>..\..\config.h;%(Outputs)</Outputs>
     </CustomBuild>
     <CustomBuild Include="..\..\atk\atkmarshal.list">
-      <Message Condition="'$(Configuration)'=='Debug'">Generating Marshalling Sources...</Message>
-      <Command Condition="'$(Configuration)'=='Debug'">$(GenMarshalSrc)</Command>
-      <Outputs 
Condition="'$(Configuration)'=='Debug'">..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)'=='Release'">Generating Marshalling Sources...</Message>
-      <Command Condition="'$(Configuration)'=='Release'">$(GenMarshalSrc)</Command>
-      <Outputs 
Condition="'$(Configuration)'=='Release'">..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs)</Outputs>
+      <Message Condition="'$(Platform)'=='Win32'">Generating Marshalling Sources...</Message>
+      <Command Condition="'$(Platform)'=='Win32'">$(GenMarshalSrc)</Command>
+      <Outputs 
Condition="'$(Platform)'=='Win32'">..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs)</Outputs>
+      <Message Condition="'$(Platform)'=='x64'">Generating Marshalling Sources...</Message>
+      <Command Condition="'$(Platform)'=='x64'">$(GenMarshalSrcX64)</Command>
+      <Outputs 
Condition="'$(Platform)'=='x64'">..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c;%(Outputs)</Outputs>
     </CustomBuild>
   </ItemGroup>
   <ItemGroup>
diff --git a/win32/vs9/README.txt b/win32/vs9/README.txt
index ad90fe2..1798877 100644
--- a/win32/vs9/README.txt
+++ b/win32/vs9/README.txt
@@ -16,6 +16,12 @@ atk.vcproj.
 The dependencies for this package are gettext-runtime (libintl), GLib*
 and ZLib.
 
+You will also need a Python 2.7.x or 3.x installation, as Python will be
+used to run glib-genmarshal, which was converted into a Python script from
+a compiled C program, in addition to generating the atk.pc pkg-config
+file for the build.  See PythonPath (32-bit builds) or PythonPathX64 (x64
+builds) in atk-version-paths.vsprops to see that they point to the correct paths.
+
 a) look for all of the dependencies (except GLib*) under
 
    http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/ (32-bit) -OR-
diff --git a/win32/vs9/atk-gen-src.vsprops b/win32/vs9/atk-gen-src.vsprops
index 7e39862..ccfcb68 100644
--- a/win32/vs9/atk-gen-src.vsprops
+++ b/win32/vs9/atk-gen-src.vsprops
@@ -13,9 +13,22 @@
                Name="GenMarshalSrc"
                Value="
 cd ..\..\atk&#x0D;&#x0A;
-$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header &gt; 
atkmarshal.h&#x0D;&#x0A;
-$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body &gt; 
atkmarshal.c&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header &gt; 
atkmarshal.h&#x0D;&#x0A;
+if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--header &gt; atkmarshal.h&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body &gt; 
atkmarshal.c&#x0D;&#x0A;
+if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--body &gt; atkmarshal.c&#x0D;&#x0A;
 cd $(SolutionDir)&#x0D;&#x0A;
                      "
        />
+       <UserMacro
+                Name="GenMarshalSrcX64"
+                Value="
+cd ..\..\atk&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header &gt; 
atkmarshal.h&#x0D;&#x0A;
+if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--header &gt; atkmarshal.h&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python 
$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body &gt; 
atkmarshal.c&#x0D;&#x0A;
+if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list 
--body &gt; atkmarshal.c&#x0D;&#x0A;
+cd $(SolutionDir)&#x0D;&#x0A;
+                      "
+        />
 </VisualStudioPropertySheet>
diff --git a/win32/vs9/atk-install.vspropsin b/win32/vs9/atk-install.vspropsin
index aed8fd5..880dad5 100644
--- a/win32/vs9/atk-install.vspropsin
+++ b/win32/vs9/atk-install.vspropsin
@@ -19,15 +19,16 @@ copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\atk-$(ApiVersion).li
 mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk&#x0D;&#x0A;
 #include "atk.headers"
 
-if exist ..\atk.pc (mkdir $(CopyDir)\lib\pkgconfig &amp; copy ..\atk.pc $(CopyDir)\lib\pkgconfig)&#x0D;&#x0A;
+mkdir $(CopyDir)\lib\pkgconfig&#x0D;&#x0A;
+copy ..\atk.pc $(CopyDir)\lib\pkgconfig&#x0D;&#x0A;
 "
        />
        <UserMacro
                Name="AtkGenPC"
-               Value="if exist $(PythonPath)\python.exe $(PythonPath)\python.exe ..\atkpc.py 
--prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
+               Value="$(PythonPath)\python.exe ..\atkpc.py --prefix=$(CopyDir) 
--version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
        />
        <UserMacro
                Name="AtkGenPCX64"
-               Value="if exist $(PythonPathX64)\python.exe $(PythonPathX64)\python.exe ..\atkpc.py 
--prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
+               Value="$(PythonPathX64)\python.exe ..\atkpc.py --prefix=$(CopyDir) 
--version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
        />
 </VisualStudioPropertySheet>
diff --git a/win32/vs9/atk.vcprojin b/win32/vs9/atk.vcprojin
index 69c354d..a51a747 100644
--- a/win32/vs9/atk.vcprojin
+++ b/win32/vs9/atk.vcprojin
@@ -222,7 +222,7 @@
                                        <Tool
                                                Name="VCCustomBuildTool"
                                                Description="Generating Marshalling Sources..."
-                                               CommandLine="$(GenMarshalSrc)"
+                                               CommandLine="$(GenMarshalSrcX64)"
                                                Outputs="..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c"
                                        />
                                </FileConfiguration>
@@ -230,7 +230,7 @@
                                        <Tool
                                                Name="VCCustomBuildTool"
                                                Description="Generating Marshalling Sources..."
-                                               CommandLine="$(GenMarshalSrc)"
+                                               CommandLine="$(GenMarshalSrcX64)"
                                                Outputs="..\..\atk\atkmarshal.h;..\..\atk\atkmarshal.c"
                                        />
                                </FileConfiguration>


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