Skip to content

Commit 192599b

Browse files
author
Felipe \\\"Zimmerle\\\" Costa
committed
iss: Better err handling in build scripts.
Now checking for errors in every step of the build phase
1 parent e25c6b2 commit 192599b

File tree

6 files changed

+39
-2
lines changed

6 files changed

+39
-2
lines changed

iis/build_modsecurity.bat

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ set CURRENT_DIR=%cd%
1212
cd ..\apache2
1313
del *.obj *.dll *.lib
1414
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
15+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1516

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

2022
cd ..\iis
2123
nmake -f Makefile.win clean
2224
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
25+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
2326

2427
cd %CURRENT_DIR%
2528

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

39+
:build_failed
40+
@echo Problems during the building phase
41+
@goto failed
42+
3643
:failed
3744
@cd %CURRENT_DIR%
38-
@exit /B
45+
@exit /B 1
46+

iis/dependencies/build_curl.bat

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ mklink /D "curl" "%CURL_DIR%"
1111
copy /y CMakeLists.txt "%CURL_DIR%"
1212
CD "%CURL_DIR%"
1313
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True -DCURL_ZLIB=True
14+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1415
"%WORK_DIR%\fart.exe" -r -C "%WORK_DIR%\%CURL_DIR%\include\curl\curlbuild.h" LLU ULL
1516
NMAKE
16-
17+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1718
cd "%WORK_DIR%"
1819

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

30+
:build_failed
31+
@echo Problems during the building phase
32+
@goto failed
33+
2934
:failed
3035
@exit /B 1
3136

iis/dependencies/build_libxml2.bat

+6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ mklink /D "libxml2" "%LIBXML2_DIR%"
1111
fart.exe -r -i -C "%WORK_DIR%\%LIBXML2_DIR%\win32\*.*" \x2Fopt:nowin98 " "
1212
cd "%LIBXML2_DIR%\win32"
1313
CSCRIPT configure.js iconv=no vcmanifest=yes zlib=yes
14+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1415
NMAKE -f Makefile.msvc
16+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1517

1618
cd "%WORK%"
1719

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

29+
:build_failed
30+
@echo Problems during the building phase
31+
@goto failed
32+
2733
:failed
2834
@exit /B 1
2935

iis/dependencies/build_lua.bat

+7
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ mklink /D "lua" "%LUA_DIR%"
1111
cd "%LUA_DIR%\src"
1212

1313
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
14+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1415
DEL lua.obj luac.obj
1516
LINK /DLL /LTCG /DEBUG /OUT:lua5.1.dll *.obj
17+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1618
IF EXIST lua5.1.dll.manifest MT -manifest lua5.1.dll.manifest -outputresource:lua5.1.dll;2
19+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1720

1821
cd "%WORK_DIR%"
1922

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

33+
:build_failed
34+
@echo Problems during the building phase
35+
@goto failed
36+
3037
:failed
3138
@exit /B 1
3239

iis/dependencies/build_pcre.bat

+6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ mklink /D "pcre" "%PCRE_DIR%"
99

1010
cd "%PCRE_DIR%"
1111
CMAKE -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=True
12+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1213
NMAKE
14+
@if NOT (%ERRORLEVEL%) == (0) goto build_failed
1315
cd "%WORK%"
1416

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

27+
:build_failed
28+
@echo Problems during the building phase
29+
@goto failed
30+
2531
:failed
2632
@exit /B 1

iis/dependencies/build_zlib.bat

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mklink /D "zlib" "%ZLIB_DIR%"
1111

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

29+
:build_failed
30+
@echo Problems during the building phase
31+
@goto failed
32+
2833
:failed
2934
@exit /B 1

0 commit comments

Comments
 (0)