11<#
22This script builds libiconv,libxml2 and libxslt
33#>
4+ Param ([switch ]$x64 )
45
56$ErrorActionPreference = " Stop"
67Import-Module Pscx
78
9+ $x64Dir = If ($x64 ) { " \x64" } Else { " " }
10+ $distname = If ($x64 ) { " win64" } Else { " win32" }
11+
812cd $PSScriptRoot
913
1014# Change theset two lines to change VS version
11- Import-VisualStudioVars - VisualStudioVersion 140 - Architecture x86
15+ if ($x64 ) {
16+ Import-VisualStudioVars - VisualStudioVersion 140 - Architecture x64
17+ } else {
18+ Import-VisualStudioVars - VisualStudioVersion 140 - Architecture x86
19+ }
1220
1321cd .\libiconv\MSVC14
1422msbuild libiconv.sln / p:Configuration= Release
15- # /p:Platform=Win32
16- # msbuild libiconv.sln /p:Configuration=Release /p:Platform=x64
17- $iconvLib = Join-Path (pwd) libiconv_static\Release
23+ $iconvLib = Join-Path (pwd) libiconv_static$x64Dir \Release
1824$iconvInc = Join-Path (pwd) ..\source\include
1925# Make sure that libiconv.(lib|exp) is included
20- Copy-Item - Force (Join-Path (pwd) Release\* ) - Destination $iconvLib
26+ Copy-Item - Force (Join-Path (pwd) .\ $x64Dir \ Release\* ) - Destination $iconvLib
2127cd ..\..
2228
2329cd .\libxml2\win32
@@ -32,6 +38,9 @@ cscript configure.js lib="$iconvLib;$xmlLib" include="$iconvInc;$xmlInc" vcmanif
3238nmake
3339cd ..\..
3440
41+ cd .\zlib
42+ nmake -f win32/ Makefile.msc
43+ cd ..
3544
3645# Bundle releases
3746Function BundleRelease ($name , $lib , $inc )
@@ -57,6 +66,7 @@ New-Item -ItemType Directory .\dist
5766Dir $iconvLib \libiconv* | Copy-Item - Force - Destination {Join-Path $iconvLib ($_.Name -replace " libiconv" , " iconv" ) }
5867Remove-Item (Join-Path $iconvLib iconv_static.tlog)
5968
60- BundleRelease " iconv-1.14.win32" (dir $iconvLib \iconv* | Where-Object {$_.Name -notmatch " ^libiconv" }) (dir $iconvInc \* )
61- BundleRelease " libxml2-2.9.4.win32" (dir $xmlLib \* ) (Get-Item $xmlInc \libxml)
62- BundleRelease " libxslt-1.1.29.win32" (dir .\libxslt\win32\bin.msvc\* ) (Get-Item .\libxslt\libxslt, .\libxslt\libexslt)
69+ BundleRelease " iconv-1.14.$distname " (dir $iconvLib \iconv* | Where-Object {$_.Name -notmatch " ^libiconv" }) (dir $iconvInc \* )
70+ BundleRelease " libxml2-2.9.4.$distname " (dir $xmlLib \* ) (Get-Item $xmlInc \libxml)
71+ BundleRelease " libxslt-1.1.29.$distname " (dir .\libxslt\win32\bin.msvc\* ) (Get-Item .\libxslt\libxslt, .\libxslt\libexslt)
72+ BundleRelease " zlib-1.2.8.$distname " (Get-Item .\zlib\* .* ) (Get-Item .\zlib\zconf.h, .\zlib\zlib.h)
0 commit comments