build_task.bat 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. @echo off
  2. if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
  3. if %errorlevel% neq 0 exit /b 3
  4. if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
  5. if %errorlevel% neq 0 exit /b 3
  6. if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
  7. if %errorlevel% neq 0 exit /b 3
  8. if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
  9. if %errorlevel% neq 0 exit /b 3
  10. if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
  11. if %errorlevel% neq 0 exit /b 3
  12. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL
  13. if %errorlevel% neq 0 exit /b 3
  14. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL
  15. if %errorlevel% neq 0 exit /b 3
  16. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL
  17. if %errorlevel% neq 0 exit /b 3
  18. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL
  19. if %errorlevel% neq 0 exit /b 3
  20. if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL
  21. if %errorlevel% neq 0 exit /b 3
  22. if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL
  23. if %errorlevel% neq 0 exit /b 3
  24. cd /D %APPVEYOR_BUILD_FOLDER%
  25. if %errorlevel% neq 0 exit /b 3
  26. if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
  27. set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
  28. ) else (
  29. set BRANCH=master
  30. )
  31. set STABILITY=staging
  32. set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
  33. rem SDK is cached, deps info is cached as well
  34. echo Updating dependencies in %DEPS_DIR%
  35. cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% --crt %PHP_BUILD_CRT%
  36. if %errorlevel% neq 0 exit /b 3
  37. rem Something went wrong, most likely when concurrent builds were to fetch deps
  38. rem updates. It might be, that some locking mechanism is needed.
  39. if not exist "%DEPS_DIR%" (
  40. cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
  41. )
  42. if %errorlevel% neq 0 exit /b 3
  43. cmd /c buildconf.bat --force
  44. if %errorlevel% neq 0 exit /b 3
  45. if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
  46. if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
  47. set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_firebird,interbase,ldap,imap,ftp
  48. if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
  49. cmd /c configure.bat ^
  50. --enable-snapshot-build ^
  51. --disable-debug-pack ^
  52. --enable-com-dotnet=shared ^
  53. --without-analyzer ^
  54. --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^
  55. --with-php-build=%DEPS_DIR% ^
  56. %ADD_CONF% ^
  57. --with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST%
  58. if %errorlevel% neq 0 exit /b 3
  59. nmake /NOLOGO
  60. if %errorlevel% neq 0 exit /b 3
  61. exit /b 0