Skip to content

Commit

Permalink
iss: Better err handling in build scripts.
Browse files Browse the repository at this point in the history
Now checking for errors in every step of the build
phase
  • Loading branch information
Felipe \\\"Zimmerle\\\" Costa committed Nov 6, 2013
1 parent e25c6b2 commit 192599b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
10 changes: 9 additions & 1 deletion iis/build_modsecurity.bat
Expand Up @@ -12,14 +12,17 @@ set CURRENT_DIR=%cd%
cd ..\apache2
del *.obj *.dll *.lib
NMAKE -f Makefile.win APACHE=..\iis\%DEPENDENCIES_DIR%\Apache24 PCRE=..\iis\%DEPENDENCIES_DIR%\pcre LIBXML2=..\iis\%DEPENDENCIES_DIR%\libxml2 LUA=..\iis\%DEPENDENCIES_DIR%\lua\src VERSION=VERSION_IIS
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

cd ..\mlogc
nmake -f Makefile.win clean
nmake -f Makefile.win APACHE=..\iis\%DEPENDENCIES_DIR%\Apache24 PCRE=..\iis\%DEPENDENCIES_DIR%\pcre CURL=..\iis\%DEPENDENCIES_DIR%\curl VERSION=VERSION_IIS
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

cd ..\iis
nmake -f Makefile.win clean
NMAKE -f Makefile.win APACHE=..\iis\%DEPENDENCIES_DIR%\Apache24 PCRE=..\iis\%DEPENDENCIES_DIR%\pcre LIBXML2=..\iis\%DEPENDENCIES_DIR%\libxml2 LUA=..\iis\%DEPENDENCIES_DIR%\lua\src VERSION=VERSION_IIS
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

cd %CURRENT_DIR%

Expand All @@ -33,6 +36,11 @@ exit /B 0
@echo Please specify a valid vcargs
@goto failed

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@cd %CURRENT_DIR%
@exit /B
@exit /B 1

7 changes: 6 additions & 1 deletion iis/dependencies/build_curl.bat
Expand Up @@ -11,9 +11,10 @@ mklink /D "curl" "%CURL_DIR%"
copy /y CMakeLists.txt "%CURL_DIR%"
CD "%CURL_DIR%"
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
"%WORK_DIR%\fart.exe" -r -C "%WORK_DIR%\%CURL_DIR%\include\curl\curlbuild.h" LLU ULL
NMAKE

@if NOT (%ERRORLEVEL%) == (0) goto build_failed
cd "%WORK_DIR%"

copy /y "%WORK_DIR%\%CURL_DIR%\lib\libcurl.dll" "%OUTPUT_DIR%"
Expand All @@ -26,6 +27,10 @@ exit /B 0
@echo File not found: "%SOURCE_DIR%\%CURL%"
@goto failed

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@exit /B 1

6 changes: 6 additions & 0 deletions iis/dependencies/build_libxml2.bat
Expand Up @@ -11,7 +11,9 @@ mklink /D "libxml2" "%LIBXML2_DIR%"
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
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
NMAKE -f Makefile.msvc
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

cd "%WORK%"

Expand All @@ -24,6 +26,10 @@ copy /y "%WORK_DIR%\%LIBXML2_DIR%\win32\bin.msvc\libxml2.lib" "%OUTPUT_DIR%"
@echo File not found: "%SOURCE_DIR%\%LIBXML2%"
@goto failed

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@exit /B 1

7 changes: 7 additions & 0 deletions iis/dependencies/build_lua.bat
Expand Up @@ -11,9 +11,12 @@ mklink /D "lua" "%LUA_DIR%"
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
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
DEL lua.obj luac.obj
LINK /DLL /LTCG /DEBUG /OUT:lua5.1.dll *.obj
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
IF EXIST lua5.1.dll.manifest MT -manifest lua5.1.dll.manifest -outputresource:lua5.1.dll;2
@if NOT (%ERRORLEVEL%) == (0) goto build_failed

cd "%WORK_DIR%"

Expand All @@ -27,6 +30,10 @@ copy /y "%WORK_DIR%\%LUA_DIR%\src\lua5.1.lib" "%OUTPUT_DIR%"
@echo File not found: "%SOURCE_DIR%\%LUA%"
@goto failed

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@exit /B 1

6 changes: 6 additions & 0 deletions iis/dependencies/build_pcre.bat
Expand Up @@ -9,7 +9,9 @@ mklink /D "pcre" "%PCRE_DIR%"

cd "%PCRE_DIR%"
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
NMAKE
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
cd "%WORK%"

copy /y "%WORK_DIR%\%PCRE_DIR%\pcre.dll" "%OUTPUT_DIR%"
Expand All @@ -22,5 +24,9 @@ echo "a"
@echo File not found: "%SOURCE_DIR%\%PCRE%"
@goto failed

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@exit /B 1
5 changes: 5 additions & 0 deletions iis/dependencies/build_zlib.bat
Expand Up @@ -11,6 +11,7 @@ mklink /D "zlib" "%ZLIB_DIR%"

cd "%ZLIB_DIR%"
nmake -f win32\Makefile.msc
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
SET INCLUDE=%INCLUDE%;%WORK_DIR%\%ZLIB_DIR%
SET LIB=%LIB%;%WORK_DIR%\%ZLIB_DIR%
cd "%WORK_DIR%"
Expand All @@ -25,5 +26,9 @@ copy /y "%WORK_DIR%\%ZLIB_DIR%\zdll.lib" "%OUTPUT_DIR%"
@echo File not found: "%SOURCE_DIR%\%ZLIB%"
@goto failed

:build_failed
@echo Problems during the building phase
@goto failed

:failed
@exit /B 1

0 comments on commit 192599b

Please sign in to comment.