iis: Improves the iis build system

Now checking for common errors while building. Refactoring
on the build scripts, now there is this build_dependencies.bat
script on the iis sub-folder. By calling this script all the
dependencies should be build under the winbuild/.
This commit also removes build scripts that were not needed
anymore.
This commit is contained in:
Felipe \\\"Zimmerle\\\" Costa 2013-11-05 19:29:48 -06:00 committed by Felipe Zimmerle
parent a946a163f0
commit b277e538f2
12 changed files with 282 additions and 136 deletions

113
iis/build_dependencies.bat Normal file
View File

@ -0,0 +1,113 @@
:: Those variable should be edited as needed.
:: Use full paths.
:: General paths
@set WORK_DIR=%cd%\winbuild\build_dir
@set OUTPUT_DIR=%cd%\winbuild\release_files
@set SOURCE_DIR=%USERPROFILE%\Downloads
:: Aditional paths.
@set PATH=%PATH%;c:\work\cmake-2.8.7-win32-x86\bin;"c:\program files\7-zip"
@set PCRE=pcre-8.33.zip
@set ZLIB=zlib-1.2.8.tar.gz
@set LIBXML2=libxml2-2.9.1.tar.gz
@set LUA=lua-5.1.5.tar.gz
@set CURL=curl-7.33.0.zip
@set APACHE_SRC=httpd-2.4.6.tar.gz
@set APACHE_BIN32=httpd-2.4.6-win32-VC11.zip
@set APACHE_BIN64=httpd-2.4.6-win64-VC11.zip
@set APACHE_BIN=%APACHE_BIN32%
:: @set VCARGS32="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
:: @set VCARGS64="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
:: Do not edit bellow this line.
@set CURRENT_DIR=%cd%
@echo Cleaning directories...
if EXIST "%WORK_DIR%" @rmdir /s /q "%WORK_DIR%"
if EXIST "%OUTPUT_DIR%" @rmdir /s /q "%OUTPUT_DIR%"
@mkdir "%WORK_DIR%"
@if NOT (%ERRORLEVEL%) == (0) goto failed_to_cleanup
@mkdir "%OUTPUT_DIR%"
@if NOT (%ERRORLEVEL%) == (0) goto failed_to_cleanup
@echo Checking for vcargs... %1
@if NOT (%1) == "" call %1
@if (%ERRORLEVEL%) == (1) goto build_wrong_vcargs
@echo Starting with the depdendencies...
@echo # Apache - %HTTPD%/%APACHE24_ZIP%
@call winbuild/build_apache.bat
@if NOT (%ERRORLEVEL%) == (0) goto build_failed_apache
@cd "%CURRENT_DIR%"
echo "c"
@echo # pcre. - %PCRE%
@call winbuild/build_pcre.bat
@if NOT (%ERRORLEVEL%) == (0) goto build_failed_pcre
@cd "%CURRENT_DIR%"
echo "b"
@echo # zlib - %ZLIB%
@call winbuild/build_zlib.bat
@if NOT (%ERRORLEVEL%) == (0) goto build_failed_zlib
@cd "%CURRENT_DIR%"
@echo # libxml2 - %LIBXML2%
@call winbuild/build_libxml2.bat
@if NOT (%ERRORLEVEL%) == (0) goto build_failed_libxml2
@cd "%CURRENT_DIR%"
@echo # lua - %LUA%
@call winbuild/build_lua.bat
@if NOT (%ERRORLEVEL%) == (0) goto build_failed_lua
@cd "%CURRENT_DIR%"
@echo # curl - %CURL%
@call winbuild/build_curl.bat
@if NOT (%ERRORLEVEL%) == (0) goto build_failed_curl
@cd "%CURRENT_DIR%"
@echo All dependencies were built successfully.
@cd "%CURRENT_DIR%"
@exit /B 0
:failed_to_cleanup
@echo Failed to cleanup
@goto failed
:build_wrong_vcargs
@echo Please specify a valid vcargs
@goto failed
:build_failed_apache
@echo Failed to setup %HTTPD%/%APACHE24_ZIP%...
@goto failed
:build_failed_pcre
@echo Failed to setup %PCRE%...
@goto failed
:build_failed_zlib
@echo Failed to setup %ZLIB%...
@goto failed
:build_failed_libxml2
@echo Failed to setup %LIBXML2%...
@goto failed
:build_failed_lua
@echo Failed to setup %LUA%...
@goto failed
:build_failed_curl
@echo Failed to setup %CURL%...
@goto failed
:failed
@cd %CURRENT_DIR%
@exit /B 1

View File

@ -1,11 +0,0 @@
c:
call build_apache.bat
call build_pcre.bat
call build_zlib.bat
call build_libxml2.bat
call build_lua.bat
call build_curl.bat
call build_module.bat
cd %WORK%

View File

@ -1,6 +0,0 @@
SET APACHE24_ZIP=httpd-2.4.6-win32.zip
mkdir %DROP%
rem call vcvars32.bat
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"
call init.bat
call build.bat

View File

@ -1,8 +0,0 @@
SET APACHE24_ZIP=httpd-2.4.6-win64.zip
mkdir %DROP%
rem call vcvars64.bat
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
call init.bat
SET CL=/D "WIN64" /D "_WIN64"
call build.bat

View File

@ -1,40 +1,47 @@
cd %WORK%
rmdir /s /q %APACHE%
rmdir /s /q %HTTPD%
IF NOT DEFINED BUILD_APACHE GOTO USE_APACHE_24
7z.exe x %HTTPD%-win32-src.zip
fart.exe -r -i -C %WORK%\%HTTPD%\*.mak \x2Fmachine:x86 " "
fart.exe -r -i -C %WORK%\%HTTPD%\*.mk.win \x2Fmachine:x86 " "
copy /y %WORK%\libhttpd.mak %WORK%\%HTTPD%
copy /y %WORK%\mod_ssl.mak %WORK%\%HTTPD%\modules\ssl
copy /y %WORK%\apr.mak %WORK%\%HTTPD%\srclib\apr
copy /y %WORK%\libapr.mak %WORK%\%HTTPD%\srclib\apr
copy /y %WORK%\aprutil.mak %WORK%\%HTTPD%\srclib\apr-util
copy /y %WORK%\libaprutil.mak %WORK%\%HTTPD%\srclib\apr-util
copy /y %WORK%\dftables.mak %WORK%\%HTTPD%\srclib\pcre
copy /y %WORK%\pcre.mak %WORK%\%HTTPD%\srclib\pcre
cd %HTTPD%
nmake -f Makefile.win installr
IF NOT DEFINED FULLBUILD pause
GOTO END
:USE_APACHE_24
set APACHE=%WORK%\Apache24
del /q /f --*.*
del /q /f readme.txt
rmdir /s /q %APACHE%
7z.exe x %APACHE24_ZIP%
7z.exe x %HTTPD%.zip
:END
copy /y %APACHE%\bin\libapr-1.dll %DROP%
copy /y %APACHE%\bin\libapr-1.pdb %DROP%
copy /y %APACHE%\lib\libapr-1.lib %DROP%
copy /y %APACHE%\bin\libapriconv-1.dll %DROP%
copy /y %APACHE%\bin\libapriconv-1.pdb %DROP%
copy /y %APACHE%\lib\libapriconv-1.lib %DROP%
copy /y %APACHE%\bin\libaprutil-1.dll %DROP%
copy /y %APACHE%\bin\libaprutil-1.pdb %DROP%
copy /y %APACHE%\lib\libaprutil-1.lib %DROP%
SET HTTPD_BUILD=%WORK%\%HTTPD%
cd %WORK%
@cd "%WORK_DIR%"
@set APACHE=%WORK_DIR%\Apache24
@if NOT EXIST "%SOURCE_DIR%\%APACHE_BIN%" goto file_not_found_bin
@if NOT EXIST "%SOURCE_DIR%\%APACHE_SRC%" goto file_not_found_src
@7z.exe x "%SOURCE_DIR%\%APACHE_BIN%"
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong
@7z.exe x "%SOURCE_DIR%\%APACHE_SRC%" -so | 7z.exe x -aoa -si -ttar
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong
:: Missing: %APACHE%\bin\libapr-1.pdb %APACHE%\bin\libapr-1.lib ?
copy /y "%APACHE%\bin\libapr-1.dll" "%OUTPUT_DIR%"
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong_copy
:: Missing: %APACHE%\bin\libapriconv-1.pdb %APACHE%\lib\libapriconv-1.lib ?
copy /y "%APACHE%\bin\libapriconv-1.dll" "%OUTPUT_DIR%"
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong_copy
:: Missing: %APACHE%\bin\libaprutil-1.pdb %APACHE%\lib\libaprutil-1.lib ?
copy /y "%APACHE%\bin\libaprutil-1.dll" "%OUTPUT_DIR%"
@if NOT (%ERRORLEVEL%) == (0) goto something_went_wrong_copy
@cd "%WORK_DIR%"
@exit /B 0
:something_went_wrong_copy
@echo Something went wrong while trying to copy Apache binaries files.
@goto failed
:file_not_found_bin
@echo File not found: %SOURCE_DIR%\%APACHE_BIN%
@goto failed
:file_not_found_src
@echo File not found: %SOURCE_DIR%\%APACHE_SRC%
@goto failed
:something_went_wrong
@echo Something went wrong while unzip Apache files.
@goto failed
:failed
@exit /B 1

View File

@ -1,14 +1,29 @@
cd %WORK%
rmdir /s /q %CURL%
7z.exe x %CURL%.zip
copy /y CMakeLists.txt %CURL%
CD %CURL%
cd "%WORK_DIR%"
@if NOT EXIST "%SOURCE_DIR%\%CURL%" goto file_not_found_bin
7z.exe x "%SOURCE_DIR%\%CURL%"
set CURL_DIR=%CURL:~0,-4%
copy /y CMakeLists.txt "%CURL_DIR%"
CD "%CURL_DIR%"
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
%WORK%\fart.exe -r -C %WORK%\%CURL%\include\curl\curlbuild.h LLU ULL
"%WORK_DIR%\fart.exe" -r -C "%WORK_DIR%\%CURL_DIR%\include\curl\curlbuild.h" LLU ULL
NMAKE
IF NOT DEFINED FULLBUILD pause
cd %WORK%
copy /y %WORK%\%CURL%\libcurl.dll %DROP%
copy /y %WORK%\%CURL%\libcurl.pdb %DROP%
copy /y %WORK%\%CURL%\libcurl_imp.lib %DROP%
cd "%WORK_DIR%"
copy /y "%WORK_DIR%\%CURL_DIR%\lib\libcurl.dll" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%CURL_DIR%\lib\libcurl.pdb" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%CURL_DIR%\lib\libcurl_imp.lib" "%OUTPUT_DIR%"
exit /B 0
:file_not_found_bin
@echo File not found: "%SOURCE_DIR%\%CURL%"
@goto failed
:failed
@exit /B 1

View File

@ -1,12 +1,27 @@
cd %WORK%
rmdir /s /q %LIBXML2%
7z.exe x %LIBXML2%.zip
fart.exe -r -i -C %WORK%\%LIBXML2%\win32\*.* \x2Fopt:nowin98 " "
cd %LIBXML2%\win32
cd "%WORK_DIR%"
@if NOT EXIST "%SOURCE_DIR%\%LIBXML2%" goto file_not_found_bin
@7z.exe x "%SOURCE_DIR%\%LIBXML2%" -so | 7z.exe x -aoa -si -ttar
set LIBXML2_DIR=%LIBXML2:~0,-7%
fart.exe -r -i -C "%WORK_DIR%\%LIBXML2_DIR%\win32\*.*" \x2Fopt:nowin98 " "
cd "%LIBXML2_DIR%\win32"
CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes
NMAKE -f Makefile.msvc
IF NOT DEFINED FULLBUILD pause
cd %WORK%
copy /y %WORK%\%LIBXML2%\win32\bin.msvc\libxml2.dll %DROP%
copy /y %WORK%\%LIBXML2%\win32\bin.msvc\libxml2.lib %DROP%
cd "%WORK%"
copy /y "%WORK_DIR%\%LIBXML2_DIR%\win32\bin.msvc\libxml2.dll" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%LIBXML2_DIR%\win32\bin.msvc\libxml2.lib" "%OUTPUT_DIR%"
@exit /B 0
:file_not_found_bin
@echo File not found: "%SOURCE_DIR%\%LIBXML2%"
@goto failed
:failed
@exit /B 1

View File

@ -1,14 +1,30 @@
cd %WORK%
rmdir /s /q %LUA%
7z.exe x %LUA%.zip
CD %LUA%\src
cd "%WORK_DIR%"
@if NOT EXIST "%SOURCE_DIR%\%LUA%" goto file_not_found_bin
@7z.exe x "%SOURCE_DIR%\%LUA%" -so | 7z.exe x -aoa -si -ttar
set LUA_DIR=%LUA:~0,-7%
cd "%LUA_DIR%\src"
CL /Ox /arch:SSE2 /GF /GL /Gy /FD /EHsc /MD /Zi /TC /wd4005 /D "_MBCS" /D "LUA_CORE" /D "LUA_BUILD_AS_DLL" /D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_WIN32" /D "_WINDLL" /c *.c
DEL lua.obj luac.obj
LINK /DLL /LTCG /DEBUG /OUT:lua5.1.dll *.obj
IF EXIST lua5.1.dll.manifest MT -manifest lua5.1.dll.manifest -outputresource:lua5.1.dll;2
IF NOT DEFINED FULLBUILD pause
cd %WORK%
copy /y %WORK%\%LUA%\src\lua5.1.dll %DROP%
copy /y %WORK%\%LUA%\src\lua5.1.pdb %DROP%
copy /y %WORK%\%LUA%\src\lua5.1.lib %DROP%
cd "%WORK_DIR%"
copy /y "%WORK_DIR%\%LUA_DIR%\src\lua5.1.dll" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%LUA_DIR%\src\lua5.1.pdb" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%LUA_DIR%\src\lua5.1.lib" "%OUTPUT_DIR%"
@exit /B 0
:file_not_found_bin
@echo File not found: "%SOURCE_DIR%\%LUA%"
@goto failed
:failed
@exit /B 1

View File

@ -1,12 +1,24 @@
cd %WORK%
rmdir /s /q %PCRE%
7z.exe x %PCRE%.zip
cd %PCRE%
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
cd "%WORK_DIR%"
@if NOT EXIST "%SOURCE_DIR%\%APACHE_BIN%" goto file_not_found_bin
7z.exe x "%SOURCE_DIR%\%PCRE%"
set PCRE_DIR=%PCRE:~0,-4%
cd "%PCRE_DIR%"
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
NMAKE
IF NOT DEFINED FULLBUILD pause
cd %WORK%
cd "%WORK%"
copy /y "%WORK_DIR%\%PCRE_DIR%\pcre.dll" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%PCRE_DIR%\pcre.pdb" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%PCRE_DIR%\pcre.lib" "%OUTPUT_DIR%"
echo "a"
@exit /B 0
:file_not_found_bin
@echo File not found: "%SOURCE_DIR%\%PCRE%"
@goto failed
copy /y %WORK%\%PCRE%\pcre.dll %DROP%
copy /y %WORK%\%PCRE%\pcre.pdb %DROP%
copy /y %WORK%\%PCRE%\pcre.lib %DROP%
:failed
@exit /B 1

View File

@ -1,13 +1,26 @@
cd %WORK%
rmdir /s /q %ZLIB%
7z.exe x %ZLIB%.zip
cd %ZLIB%
cd "%WORK_DIR%"
@if NOT EXIST "%SOURCE_DIR%\%ZLIB%" goto file_not_found_bin
@7z.exe x "%SOURCE_DIR%\%ZLIB%" -so | 7z.exe x -aoa -si -ttar
set ZLIB_DIR=%ZLIB:~0,-7%
cd "%ZLIB_DIR%"
nmake -f win32\Makefile.msc
SET INCLUDE=%INCLUDE%;%WORK%\%ZLIB%
SET LIB=%LIB%;%WORK%\%ZLIB%
IF NOT DEFINED FULLBUILD pause
cd %WORK%
copy /y %WORK%\%ZLIB%\zlib1.dll %DROP%
copy /y %WORK%\%ZLIB%\zlib1.pdb %DROP%
copy /y %WORK%\%ZLIB%\zdll.lib %DROP%
SET INCLUDE=%INCLUDE%;%WORK_DIR%\%ZLIB_DIR%
SET LIB=%LIB%;%WORK_DIR%\%ZLIB_DIR%
cd "%WORK_DIR%"
copy /y "%WORK_DIR%\%ZLIB_DIR%\zlib1.dll" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%ZLIB_DIR%\zlib1.pdb" "%OUTPUT_DIR%"
copy /y "%WORK_DIR%\%ZLIB_DIR%\zdll.lib" "%OUTPUT_DIR%"
@exit /B 0
:file_not_found_bin
@echo File not found: "%SOURCE_DIR%\%ZLIB%"
@goto failed
:failed
@exit /B 1

View File

@ -1,7 +0,0 @@
set FULLBUILD=1
set DROP=c:\drop\amd64
cmd.exe /c build64.bat
set DROP=c:\drop\x86
cmd.exe /c build32.bat

View File

@ -1,13 +0,0 @@
set PATH=%PATH%;c:\work\cmake-2.8.7-win32-x86\bin;"c:\program files\7-zip"
rem set BUILD_APACHE=YES
set HTTPD=httpd-2.2.22
IF NOT DEFINED BUILD_APACHE SET HTTPD=httpd-2.4.6
set WORK=c:\work
set APACHE=c:\Apache22
set PCRE=pcre-8.33
set ZLIB=zlib-1.2.8
set LIBXML2=libxml2-2.9.1
set LUA=lua-5.1.5
set CURL=curl-7.33.0