build_libedit.bat 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. @echo off
  2. REM Copyright (C) 1994-2017 Altair Engineering, Inc.
  3. REM For more information, contact Altair at www.altair.com.
  4. REM
  5. REM This file is part of the PBS Professional ("PBS Pro") software.
  6. REM
  7. REM Open Source License Information:
  8. REM
  9. REM PBS Pro is free software. You can redistribute it and/or modify it under the
  10. REM terms of the GNU Affero General Public License as published by the Free
  11. REM Software Foundation, either version 3 of the License, or (at your option) any
  12. REM later version.
  13. REM
  14. REM PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. REM WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  16. REM PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
  17. REM
  18. REM You should have received a copy of the GNU Affero General Public License along
  19. REM with this program. If not, see <http://www.gnu.org/licenses/>.
  20. REM
  21. REM Commercial License Information:
  22. REM
  23. REM The PBS Pro software is licensed under the terms of the GNU Affero General
  24. REM Public License agreement ("AGPL"), except where a separate commercial license
  25. REM agreement for PBS Pro version 14 or later has been executed in writing with Altair.
  26. REM
  27. REM Altair’s dual-license business model allows companies, individuals, and
  28. REM organizations to create proprietary derivative works of PBS Pro and distribute
  29. REM them - whether embedded or bundled with other software - under a commercial
  30. REM license agreement.
  31. REM
  32. REM Use of Altair’s trademarks, including but not limited to "PBS™",
  33. REM "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. REM trademark licensing policies.
  35. @echo on
  36. setlocal
  37. call "%~dp0set_paths.bat" %~1
  38. cd "%BINARIESDIR%"
  39. if not defined LIBEDIT_VERSION (
  40. echo "Please set LIBEDIT_VERSION to editline version!"
  41. exit /b 1
  42. )
  43. set LIBEDIT_DIR_NAME=libedit
  44. set BUILD_TYPE=Release
  45. if %DO_DEBUG_BUILD% EQU 1 (
  46. set LIBEDIT_DIR_NAME=libedit_debug
  47. set BUILD_TYPE=Debug
  48. )
  49. if exist "%BINARIESDIR%\%LIBEDIT_DIR_NAME%" (
  50. echo "%BINARIESDIR%\%LIBEDIT_DIR_NAME% exist already!"
  51. exit /b 0
  52. )
  53. if not exist "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip" (
  54. "%CURL_BIN%" -qkL -o "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip" https://sourceforge.net/projects/mingweditline/files/wineditline-%LIBEDIT_VERSION%.zip/download
  55. if not exist "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip" (
  56. echo "Failed to download libedit"
  57. exit /b 1
  58. )
  59. )
  60. 2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
  61. "%UNZIP_BIN%" -q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip"
  62. if not %ERRORLEVEL% == 0 (
  63. echo "Failed to extract %BINARIESDIR%\wineditline-%LIBEDIT_VERSION%.zip"
  64. exit /b 1
  65. )
  66. if not exist "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%" (
  67. echo "Could not find %BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
  68. exit /b 1
  69. )
  70. 2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\build"
  71. 2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\bin32"
  72. 2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\lib32"
  73. 2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\include"
  74. mkdir "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\build"
  75. cd "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%\build" && %CMAKE_BIN% -DLIB_SUFFIX=32 -DMSVC_USE_STATIC_RUNTIME=OFF -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -G "NMake Makefiles" ..
  76. if not %ERRORLEVEL% == 0 (
  77. echo "Failed to generate makefiles for libedit"
  78. exit /b 1
  79. )
  80. nmake
  81. if not %ERRORLEVEL% == 0 (
  82. echo "Failed to compile libedit"
  83. exit /b 1
  84. )
  85. nmake install
  86. if not %ERRORLEVEL% == 0 (
  87. echo "Failed to install libedit"
  88. exit /b 1
  89. )
  90. 2>nul mkdir "%BINARIESDIR%\%LIBEDIT_DIR_NAME%" && cd "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
  91. if %ERRORLEVEL% == 0 (
  92. for %%f in (bin32 include lib32) do (
  93. robocopy /S %%f "%BINARIESDIR%\%LIBEDIT_DIR_NAME%\%%f"
  94. if %ERRORLEVEL% GTR 1 (
  95. goto exitloop
  96. ) else (
  97. set ERRORLEVEL=0
  98. )
  99. )
  100. )
  101. :exitloop
  102. if not %ERRORLEVEL% == 0 (
  103. echo "Failed to copy bin32, include and lib32 from %BINARIESDIR%\wineditline-%LIBEDIT_VERSION% to %BINARIESDIR%\%LIBEDIT_DIR_NAME%"
  104. exit /b 1
  105. )
  106. cd "%BINARIESDIR%"
  107. 2>nul rd /S /Q "%BINARIESDIR%\wineditline-%LIBEDIT_VERSION%"
  108. exit /b 0