MSVC Builds: Use PythonDir instead of PythonPath
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 13 Jul 2017 09:31:07 +0000 (17:31 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 13 Jul 2017 09:31:07 +0000 (17:31 +0800)
If someone is building using MSBuild, we want to make sure that we do
not use an envvar that would also determine where the Python modules are
loaded.

Also, allow different Python paths depending on the Visual Studio
version that is being used for Visual Studio 201x builds, to better suit
the version of  Visual Studio that is used to build the official
releases of Python, which means the default is as follows:

-Visual Studio 2010, 2012, 2013: Python 3.4.x, which is built with 2010
-Visual Studio 2015 and 2017: Python 3.6.x, which is built with 2015.

win32/vs10/README.txt
win32/vs10/atk-gen-src.props
win32/vs10/atk-install.propsin
win32/vs10/atk-version-paths.props.in
win32/vs9/README.txt
win32/vs9/atk-gen-src.vsprops
win32/vs9/atk-install.vspropsin
win32/vs9/atk-version-paths.vsprops.in

index b394757..f9fe013 100644 (file)
@@ -19,7 +19,7 @@ and ZLib.
 You will also need a Python 2.7.x or 3.x installation, as Python will be\r
 used to run glib-genmarshal, which was converted into a Python script from\r
 a compiled C program, in addition to generating the atk.pc pkg-config\r
-file for the build.  See PythonPath (32-bit builds) or PythonPathX64 (x64\r
+file for the build.  See PythonDir (32-bit builds) or PythonDirX64 (x64\r
 builds) in atk-version-paths.props to see that they point to the correct paths.\r
 \r
 \r
index 8ed0cee..d4287cb 100644 (file)
@@ -7,17 +7,17 @@
     <GenConfigH>if not exist ..\..\config.h copy ..\..\config.h.win32 ..\..\config.h</GenConfigH>
     <GenMarshalSrc>
 cd ..\..\atk
-if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDir)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list
 if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header --output=atkmarshal.h
-if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --body --output=atkmarshal.c atkmarshal.list
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDir)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --body --output=atkmarshal.c atkmarshal.list
 if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body --output=atkmarshal.c
 cd $(SolutionDir)
     </GenMarshalSrc>
     <GenMarshalSrcX64>
 cd ..\..\atk
-if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDirX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list
 if not exist atkmarshal.h $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header --output=atkmarshal.h
-if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --body --output=atkmarshal.c atkmarshal.list
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDirX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --body --output=atkmarshal.c atkmarshal.list
 if not exist atkmarshal.c $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body --output=atkmarshal.c
 cd $(SolutionDir)
     </GenMarshalSrcX64>
index 81c2dc5..6f71d14 100644 (file)
@@ -21,8 +21,8 @@ mkdir $(CopyDir)\include\atk-$(ApiVersion)\atk
 mkdir $(CopyDir)\lib\pkgconfig
 copy ..\atk.pc $(CopyDir)\lib\pkgconfig
     </AtkDoInstall>
-    <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>
+    <AtkGenPC>$(PythonDir)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)</AtkGenPC>
+    <AtkGenPCX64>$(PythonDirX64)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)</AtkGenPCX64>
     <AtkPCFiles>..\atk.pc</AtkPCFiles>
   </PropertyGroup>
   <ItemGroup>
index 6cdbefa..1347ad2 100644 (file)
     <AtkSeparateVSDllSuffix>-1-vs$(VSVer)</AtkSeparateVSDllSuffix>
     <AtkDllPrefix>$(AtkSeparateVSDllPrefix)</AtkDllPrefix>
     <AtkDllSuffix>$(AtkSeparateVSDllSuffix)</AtkDllSuffix>
-    <PythonPath>c:\python34</PythonPath>
-    <PythonPathX64>$(PythonPath).x64</PythonPathX64>
+    <PythonDir Condition="'$(VisualStudioVersion)' == '10.0'">c:\\python34</PythonDir>
+    <PythonDir Condition="'$(VisualStudioVersion)' == '11.0'">c:\\python34</PythonDir>
+    <PythonDir Condition="'$(VisualStudioVersion)' == '12.0'">c:\\python34</PythonDir>
+    <PythonDir Condition="'$(VisualStudioVersion)' == '14.0'">c:\\python36</PythonDir>
+    <PythonDir Condition="'$(VisualStudioVersion)' == '15.0'">c:\\python36</PythonDir>
+    <PythonDirX64>$(PythonDir).x64</PythonDirX64>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>atkversionpathsprops</_PropertySheetDisplayName>
     <BuildMacro Include="AtkDllSuffix">
       <Value>$(AtkDllSuffix)</Value>
     </BuildMacro>
-    <BuildMacro Include="PythonPath">
-      <Value>$(PythonPath)</Value>
+    <BuildMacro Include="PythonDir">
+      <Value>$(PythonDir)</Value>
     </BuildMacro>
-    <BuildMacro Include="PythonPathX64">
-      <Value>$(PythonPathX64)</Value>
+    <BuildMacro Include="PythonDirX64">
+      <Value>$(PythonDirX64)</Value>
     </BuildMacro>
   </ItemGroup>
 </Project>
index 1798877..6f2cfec 100644 (file)
@@ -19,7 +19,7 @@ and ZLib.
 You will also need a Python 2.7.x or 3.x installation, as Python will be\r
 used to run glib-genmarshal, which was converted into a Python script from\r
 a compiled C program, in addition to generating the atk.pc pkg-config\r
-file for the build.  See PythonPath (32-bit builds) or PythonPathX64 (x64\r
+file for the build.  See PythonDir (32-bit builds) or PythonDirX64 (x64\r
 builds) in atk-version-paths.vsprops to see that they point to the correct paths.\r
 \r
 a) look for all of the dependencies (except GLib*) under\r
index 727811e..aef02e4 100644 (file)
@@ -9,13 +9,13 @@
                Name="GenConfigH"
                Value="if not exist ..\..\config.h copy ..\..\config.h.win32 ..\..\config.h"
        />
-       <UserMacro
+       <UserMacroh
                Name="GenMarshalSrc"
                Value="
 cd ..\..\atk&#x0D;&#x0A;
-if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPath)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDir)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list&#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 --quiet --body --output=atkmarshal.c atkmarshal.list&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDir)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --body --output=atkmarshal.c atkmarshal.list&#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;
                      "
@@ -24,9 +24,9 @@ cd $(SolutionDir)&#x0D;&#x0A;
                 Name="GenMarshalSrcX64"
                 Value="
 cd ..\..\atk&#x0D;&#x0A;
-if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonPathX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDirX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --header --output=atkmarshal.h atkmarshal.list&#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 --quiet --body --output=atkmarshal.c atkmarshal.list&#x0D;&#x0A;
+if exist $(GLibEtcInstallRoot)\bin\glib-genmarshal $(PythonDirX64)\python $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal --quiet --body --output=atkmarshal.c atkmarshal.list&#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;
                       "
index 880dad5..dcb22d4 100644 (file)
@@ -25,10 +25,10 @@ copy ..\atk.pc $(CopyDir)\lib\pkgconfig&#x0D;&#x0A;
        />
        <UserMacro
                Name="AtkGenPC"
-               Value="$(PythonPath)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
+               Value="$(PythonDir)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
        />
        <UserMacro
                Name="AtkGenPCX64"
-               Value="$(PythonPathX64)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
+               Value="$(PythonDirX64)\python.exe ..\atkpc.py --prefix=$(CopyDir) --version=$(AtkMajorVersion).$(AtkMinorVersion).$(AtkMicroVersion)"
        />
 </VisualStudioPropertySheet>
index e916d53..401bd24 100644 (file)
                Value="$(AtkSeparateVSDllSuffix)"
        />
        <UserMacro
-               Name="PythonPath"
-               Value="c:\python27"
+               Name="PythonDir"
+               Value="c:\\python27"
        />
        <UserMacro
-               Name="PythonPathX64"
-               Value="$(PythonPath).x64"
+               Name="PythonDirX64"
+               Value="$(PythonDir).x64"
        />
 </VisualStudioPropertySheet>