From a10f9d9d9ca29839b7ffe4f83d454a7e03c63ab4 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 14 Apr 2010 03:15:06 +0000 Subject: Update windows SDK building script to eliminate most include files and to move boost dlls back into bin git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@933849 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/bld-winsdk.ps1 | 106 ++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 54 deletions(-) (limited to 'cpp') diff --git a/cpp/bld-winsdk.ps1 b/cpp/bld-winsdk.ps1 index e2fe888a3a..5b551f948b 100644 --- a/cpp/bld-winsdk.ps1 +++ b/cpp/bld-winsdk.ps1 @@ -20,55 +20,8 @@ # This script requires cmake, and 7z to be already on the path devenv should be on the path as # a result of installing Visual Studio -# Filter to extract the included files from c style #include lines -# TODO: Not used yet -function extractIncludes { - param($includedir=".", $found=@{}, $notfound=@{}) - process { - # Put original files in list if not already there - $file = $_.FullName - if (!($found.Contains($file))) { - $found[$file] = $true; - } - $content = Get-Content $_ - $filebase = $_.PSParentPath - $content | foreach { - if ($_ -match '^\s*#include\s*([<"])([^">]*)([>"])\s*') { - $included=$matches[2] - # Try to find the corresponding file in the same directory - # as the including file then try the include dir - $testpathf=Join-Path $filebase $included - $testpathi=Join-Path $includedir $included - if (Test-Path $testpathf) { - $includedfile = Get-Item $testpathf - } elseif (Test-Path $testpathi) { - $includedfile = Get-Item $testpathi - } else { - $notfound[$included] = $file - continue; - } - if (!($found.Contains($includedfile.FullName))) { - $found[$includedfile.FullName] = $file - $includedfile - } - } - } - } -} - -function getIncludeFiles { - param($base, $findall=$false) - if ($findall) { - Get-ChildItem -recurse -include *.h $base - } else { - foreach ($path in $input) { - $full=Join-Path $base $path - if (Test-Path $full) { - Get-Item $full - } - } - } -} +Set-PSDebug -strict +$ErrorActionPreference='Stop' if ($args.length -lt 1) { Write-Host 'Need to specify location of qpid src tree' @@ -87,8 +40,11 @@ if ($ver -eq $null) { $ver=Get-Content $qpid_version_file } +$randomness=[System.IO.Path]::GetRandomFileName() + $qpid_cpp_src="$qpid_src\cpp" -$install_dir="install_$([System.IO.Path]::GetRandomFileName())" +$install_dir="install_$randomness" +$preserve_dir="preserve_$randomness" $zipfile="qpid-cpp-$ver.zip" # This assumes Visual Studio 2008 @@ -101,14 +57,56 @@ devenv qpid-cpp.sln /build "Release|Win32" /project docs-user-api devenv qpid-cpp.sln /build "Release|Win32" /project INSTALL devenv qpid-cpp.sln /build "Debug|Win32" /project INSTALL -# Cut down the files to put in the zip -$removable=@( - 'bin/qpidd.exe', 'bin/qpidbroker*.*', 'plugins', +# This is kludgy until we have more than one entry as the array declaration syntax +# can't cope with just one nested array +$move1=('bin/boost/*','bin') +$move=@(0) +$move[0]=$move1 + +$preserve=( + 'include/qpid/agent', + 'include/qpid/management', + 'include/qpid/messaging', + 'include/qpid/sys/IntegerTypes.h', + 'include/qpid/sys/windows/IntegerTypes.h', 'include/qpid/sys/posix/IntegerTypes.h', + 'include/qpid/types', + 'include/qpid/CommonImportExport.h') +$removable=( + 'bin/qpidd.exe', 'bin/qpidbroker*.*', 'bin/qmfengine*.*', 'bin/qpidxarm*.*', - 'bin/boost_regex*.*') + 'bin/boost_regex*.*', 'bin/boost*.lib', + 'bin/boost', + 'conf', + 'include', + 'plugins') + +# Move some files around in the install tree +foreach ($pattern in $move) { + $target = Join-Path $install_dir $pattern[1] + $tparent = Split-Path -parent $target + New-Item -force -type directory $tparent + Move-Item -force -path "$install_dir/$($pattern[0])" -destination "$install_dir/$($pattern[1])" +} +# Copy aside the files to preserve +New-Item -path $preserve_dir -type directory +foreach ($pattern in $preserve) { + $target = Join-Path $preserve_dir $pattern + $tparent = Split-Path -parent $target + New-Item -force -type directory $tparent + Move-Item -force -path "$install_dir/$pattern" -destination "$preserve_dir/$pattern" +} +# Remove everything to remove foreach ($pattern in $removable) { Remove-Item -recurse "$install_dir/$pattern" } +# Copy back the preserved things +foreach ($pattern in $preserve) { + $target = Join-Path $install_dir $pattern + $tparent = Split-Path -parent $target + New-Item -force -type directory $tparent + Move-Item -force -path "$preserve_dir/$pattern" -destination "$install_dir/$pattern" +} +Remove-Item -recurse $preserve_dir # It would be very good to cut down on the shipped boost include files too, ideally by # starting with the qpid files and recursively noting all boost headers actually needed -- cgit v1.2.1