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