xref: /PHP-7.0/appveyor/build_task.bat (revision 9891f11f)
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
13
14cd /D %APPVEYOR_BUILD_FOLDER%
15if %errorlevel% neq 0 exit /b 3
16
17if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
18	set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
19) else (
20	set BRANCH=master
21)
22set STABILITY=staging
23set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
24rem SDK is cached, deps info is cached as well
25echo Updating dependencies in %DEPS_DIR%
26cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
27if %errorlevel% neq 0 exit /b 3
28
29rem Something went wrong, most likely when concurrent builds were to fetch deps
30rem updates. It might be, that some locking mechanism is needed.
31if not exist "%DEPS_DIR%" (
32	cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
33)
34if %errorlevel% neq 0 exit /b 3
35
36cmd /c buildconf.bat --force
37if %errorlevel% neq 0 exit /b 3
38
39if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
40
41set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba,ftp
42if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
43
44cmd /c configure.bat ^
45	--enable-snapshot-build ^
46	--disable-debug-pack ^
47	--with-mcrypt=shared ^
48	--enable-com-dotnet=shared ^
49	--without-analyzer ^
50	--enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^
51	--with-php-build=%DEPS_DIR% ^
52	%ADD_CONF% ^
53	--with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST%
54if %errorlevel% neq 0 exit /b 3
55
56nmake /NOLOGO
57if %errorlevel% neq 0 exit /b 3
58
59exit /b 0
60
61