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

[win-pv-devel] [PATCH] Add BUILD.md and fix final package location



Microsoft helpfully removed the PackageDir property from package projects
in VS2015 so, as an interim fix, OutDir was used. This unfortunately means
that package output ends up in xencons/<arch>/package rather than just
xencons/<arch>.

This patch fixes the final package location by using python to do the
final copy (replacing what older VS used to do) and also adds a BUILD.md,
which was missing.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 BUILD.md                       | 45 ++++++++++++++++++++++++++++++++++++++++++
 build.py                       | 27 +++++++++++++++++++++++++
 vs2015/package/package.vcxproj |  2 +-
 3 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 BUILD.md

diff --git a/BUILD.md b/BUILD.md
new file mode 100644
index 0000000..1e1402f
--- /dev/null
+++ b/BUILD.md
@@ -0,0 +1,45 @@
+Building the XenCons Package
+============================
+
+First you'll need a device driver build environment for Windows 10.
+This means:
+
+*   Visual Studio 2015 (Any SKU, including Express or Community)
+*   Windows Driver Kit 10
+
+Install Visual Studio first (you only need install MFC for C++) and then
+the WDK. Set an environment variable called VS to the base of the Visual
+Studio Installation (e.g. C:\Program Files\Microsoft Visual Studio 14.0) and
+a variable called KIT to the base of the WDK
+(e.g. C:\Program Files\Windows Kits\10). Also set an environment variable
+called SYMBOL\_SERVER to point at a location where driver symbols can be
+stored. This can be local directory e.g. C:\Symbols.
+
+You will also need to acquire the DIFx re-distributable package from one
+of the older WDKs (as it appears not to be present in WDK10), so that the
+driver build can copy dpinst.exe into the output.
+Set the environment variable DPINST_REDIST to the base dpinst directory
+- the directory under which the x86 and x64 sub-directories containing
+dpinst.exe can be found
+(e.g. C:\Program Files (x86)\Windows Kits\8.1\Redist\DIFx\dpinst\EngMui)
+
+Next you'll need a 3.x version of python (which you can get from
+http://www.python.org). Make sure python.exe is somewhere on your default
+path.
+
+Now fire up a Command Prompt and navigate to the base of your git repository.
+At the prompt type:
+
+    build.py checked
+
+This will create a debug build of the driver. To create a non-debug build
+type:
+
+    build.py free
+
+Note that Static Driver Verifier is run by default as part of the build
+process. This can be very time consuming. If you don't want to run the
+verifier then you can add the 'nosdv' keyword to the end of your command
+e.g.:
+
+    build.py free nosdv
diff --git a/build.py b/build.py
index f7031ca..710b234 100644
--- a/build.py
+++ b/build.py
@@ -205,6 +205,28 @@ def build_sln(name, release, arch, debug, vs):
 
     msbuild(platform, configuration, 'Build', name + '.sln', '', vs)
 
+def copy_package(name, release, arch, debug, vs):
+    configuration = get_configuration(release, debug)
+
+    if arch == 'x86':
+        platform = 'Win32'
+    elif arch == 'x64':
+        platform = 'x64'
+
+    pattern = '/'.join([vs, ''.join(configuration.split(' ')), platform, 
'package', '*'])
+    print('Copying package from %s' % pattern)
+
+    files = glob.glob(pattern)
+
+    dst = os.path.join(name, arch)
+
+    os.makedirs(dst, exist_ok=True)
+
+    for file in files:
+        new = shutil.copy(file, dst)
+        print(new)
+
+    print('')
 
 def remove_timestamps(path):
     try:
@@ -398,8 +420,13 @@ if __name__ == '__main__':
                 'vs2013':'Windows 7',
                 'vs2015':'Windows 8' }
 
+    shutil.rmtree(driver, ignore_errors=True)
+
     build_sln(driver, release[vs], 'x86', debug[sys.argv[1]], vs)
+    copy_package(driver, release[vs], 'x86', debug[sys.argv[1]], vs)
+
     build_sln(driver, release[vs], 'x64', debug[sys.argv[1]], vs)
+    copy_package(driver, release[vs], 'x64', debug[sys.argv[1]], vs)
 
     symstore_add(driver, release[vs], 'x86', debug[sys.argv[1]], vs)
     symstore_add(driver, release[vs], 'x64', debug[sys.argv[1]], vs)
diff --git a/vs2015/package/package.vcxproj b/vs2015/package/package.vcxproj
index 2e5c0eb..a8c0727 100644
--- a/vs2015/package/package.vcxproj
+++ b/vs2015/package/package.vcxproj
@@ -30,7 +30,7 @@
     <VerifyDrivers />
     <VerifyFlags>133563</VerifyFlags>
     <IntDir>..\$(ProjectName)\$(ConfigurationName)\$(Platform)\</IntDir>
-    <OutDir>..\..\xencons\$(DDKPlatform)\</OutDir>
+    <OutDir>..\$(ConfigurationName)\$(Platform)\</OutDir>
   </PropertyGroup>
   <ItemGroup>
     <ProjectReference Include="..\xencons\xencons.vcxproj">
-- 
2.5.3


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.