borland.ps1 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. $erroractionpreference = "stop"
  2. if ("$env:CMAKE_CONFIGURATION".Contains("borland5.5")) {
  3. # Borland C++ 5.5 Free Command-line Tools
  4. # https://web.archive.org/web/20110402064356/https://www.embarcadero.com/products/cbuilder/free-compiler
  5. $filename = "bcc5.5-1"
  6. $sha256sum = "895B76F8F1AD8030F31ACE239EBC623DC7379C121A540F55F611B93F3CB9AF52"
  7. } elseif ("$env:CMAKE_CONFIGURATION".Contains("borland5.8")) {
  8. # Borland C++ Builder 2006
  9. # https://web.archive.org/web/20060303030019/https://www.borland.com/us/products/cbuilder/index.html
  10. $filename = "bcc5.8-1"
  11. $sha256sum = "C30981BFD540C933E76D82D873DEE05E7482F34F68E309065DE0D181C95F77E3"
  12. } else {
  13. throw ('unknown CMAKE_CONFIGURATION: ' + "$env:CMAKE_CONFIGURATION")
  14. }
  15. $tarball = "$filename.zip"
  16. $outdir = $pwd.Path
  17. $outdir = "$outdir\.gitlab"
  18. $ProgressPreference = 'SilentlyContinue'
  19. # This URL is only visible inside of Kitware's network. See above filename table.
  20. Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/internal/$tarball" -OutFile "$outdir\$tarball"
  21. $hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
  22. if ($hash.Hash -ne $sha256sum) {
  23. exit 1
  24. }
  25. Add-Type -AssemblyName System.IO.Compression.FileSystem
  26. [System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
  27. Move-Item -Path "$outdir\$filename" -Destination "$outdir\bcc"
  28. $tools = "bcc32", "ilink32"
  29. foreach ($tool in $tools) {
  30. $cfg = Get-Content -path "$outdir\bcc\bin\$tool.cfg.in" -Raw
  31. $cfg = $cfg -replace "@BCC_ROOT@","$outdir\bcc"
  32. $cfg | Set-Content -path "$outdir\bcc\bin\$tool.cfg"
  33. }