@@ -54,7 +54,7 @@ if not defined FB2_SNAPSHOT (set FB2_SNAPSHOT=0)
54
54
55
55
:: Are we doing a snapshot build? If so we always do less work.
56
56
if " %FB2_SNAPSHOT% " == " 1" (
57
- (set FBBUILD_ISX_PACK=0)
57
+ ( set FBBUILD_ISX_PACK = 0 )
58
58
)
59
59
60
60
@@ -69,14 +69,14 @@ if "%FB2_SNAPSHOT%"=="1" (
69
69
:: let's bail out now.
70
70
71
71
@ echo o Checking for sed...
72
- (cmd /c " sed.exe --version 2>&1 > nul " ) || ( call :ERROR Could not locate sed && @ goto :EOF )
72
+ @ (cmd /c " sed.exe --version 2>&1 > nul " ) || ( call :ERROR Could not locate sed & goto :EOF )
73
73
74
74
@ echo o Checking for unix2dos...
75
- (cmd /c " unix2dos.exe --quiet --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos && @ goto :EOF )
75
+ @ (cmd /c " unix2dos.exe --quiet --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos & goto :EOF )
76
76
77
- @ for /f " usebackq tokens=*" %% c in (`where /f md5sum 2^ > nul `) do set MD5_COMMAND = %% c
78
- if defined MD5_COMMAND (
79
- @ echo o POSIX md5sum utility found at %MD5_COMMAND%
77
+ @ for /f " usebackq tokens=*" %% c in ( `where /f md5sum 2^ > nul ` ) do set MD5_COMMAND = %% c
78
+ @ if defined MD5_COMMAND (
79
+ echo o POSIX md5sum utility found at %MD5_COMMAND%
80
80
)
81
81
82
82
@ if %FBBUILD_ZIP_PACK% EQU 1 (
@@ -101,8 +101,8 @@ if defined MD5_COMMAND (
101
101
for /f " usebackq tokens=*" %%c in ( `where /f iscc 2^ > nul ` ) do set ISCC_COMMAND = %%c
102
102
)
103
103
@ if not defined ISCC_COMMAND (
104
- @ echo Required Inno Setup compiler not found
105
- @ exit /b 1
104
+ echo Required Inno Setup compiler not found
105
+ exit /b 1
106
106
)
107
107
@ echo o Inno Setup found as %ISCC_COMMAND% .
108
108
@@ -114,17 +114,17 @@ if defined MD5_COMMAND (
114
114
echo WiX is needed to build the MSI kits of the CRT runtimes.
115
115
echo .
116
116
) else (
117
- echo o WiX found at " %WIX% " .
117
+ echo o WiX found at " %WIX% " .
118
118
)
119
119
120
120
@ if not defined FB_EXTERNAL_DOCS (
121
- echo .
122
- echo The FB_EXTERNAL_DOCS environment var is not defined
123
- echo It should point to the directory containing the relevant release notes
124
- echo in adobe pdf format.
125
- echo .
121
+ echo .
122
+ echo The FB_EXTERNAL_DOCS environment var is not defined
123
+ echo It should point to the directory containing the relevant release notes
124
+ echo in adobe pdf format.
125
+ echo .
126
126
) else (
127
- echo o Package will include documentation from " %FB_EXTERNAL_DOCS% " .
127
+ echo o Package will include documentation from " %FB_EXTERNAL_DOCS% " .
128
128
)
129
129
130
130
@@ -192,7 +192,7 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
192
192
%SED_COMMAND% %% f > %FB_GEN_DIR% \readmes\%% f
193
193
)
194
194
@ for %% d in (ba cz de es fr hu it pl pt ru si ) do (
195
- if not exist %FB_GEN_DIR% \readmes\%% d ( @ mkdir %FB_GEN_DIR% \readmes\%% d )
195
+ if not exist %FB_GEN_DIR% \readmes\%% d ( mkdir %FB_GEN_DIR% \readmes\%% d )
196
196
for %%f in ( %%d \*.txt ) do (
197
197
echo Processing version strings in %%f
198
198
%SED_COMMAND% %%f > %FB_GEN_DIR% \readmes\%%f
@@ -201,6 +201,9 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
201
201
202
202
@ endlocal
203
203
204
+ :: Dump env vars to file for later testing.
205
+ @ set > %FB_ROOT_PATH% \builds\install\arch-specific\win32\test_installer\fb_build_vars_%PROCESSOR_ARCHITECTURE% .txt
206
+
204
207
:: End of SET_VERSION
205
208
:: ----------------
206
209
@ goto :EOF
@@ -232,11 +235,13 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
232
235
)
233
236
)
234
237
235
- @ where /Q implib.exe
236
- @ if not ERRORLEVEL 1 (
237
- if " %VSCMD_ARG_TGT_ARCH% " == " x86 " (
238
- echo Generating fbclient_bor.lib
238
+ @ if " %VSCMD_ARG_TGT_ARCH% " == " x86 " (
239
+ echo Generating fbclient_bor.lib
240
+ where /Q implib.exe
241
+ if not ERRORLEVEL 1 (
239
242
implib %FB_OUTPUT_DIR% \lib\fbclient_bor.lib %FB_OUTPUT_DIR% \fbclient.dll > nul
243
+ ) else (
244
+ call :ERROR implib not found & goto :EOF
240
245
)
241
246
)
242
247
@@ -289,7 +294,7 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
289
294
@ mkdir %FB_OUTPUT_DIR% \doc\sql.extensions 2 > nul
290
295
@ if ERRORLEVEL 2 ( ( call :ERROR MKDIR for doc\sql.extensions dir failed) & ( goto :EOF ) )
291
296
@ copy %FB_ROOT_PATH% \doc\sql.extensions\*.* %FB_OUTPUT_DIR% \doc\sql.extensions\ > nul
292
- @ if ERRORLEVEL 1 ( ( call :ERROR Copying doc\sql.extensions failed ) & ( goto :EOF ) )
297
+ @ if ERRORLEVEL 1 ( ( call :ERROR Copying doc\sql.extensions failed ) & ( goto :EOF ) )
293
298
294
299
:: External docs aren't necessary for a snapshot build, so we don't throw
295
300
:: an error if FB_EXTERNAL_DOCS is not defined. On the other hand,
@@ -300,15 +305,17 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
300
305
echo ... %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v
301
306
copy /Y %FB_EXTERNAL_DOCS% \%%v %FB_OUTPUT_DIR% \doc\%%v > nul
302
307
if ERRORLEVEL 1 (
303
- call :ERROR Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & @ goto :EOF
308
+ call :ERROR Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & goto :EOF
304
309
)
305
310
)
306
311
307
312
echo Copying optional pdf docs...
308
313
for %%v in ( firebird-%FB_MAJOR_VER% -quickstartguide.pdf ) do (
309
314
echo ... %%v
310
315
copy /Y %FB_EXTERNAL_DOCS% \%%v %FB_OUTPUT_DIR% \doc\%%v > nul
311
- if ERRORLEVEL 1 ( call :WARNING Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & @ goto :EOF )
316
+ if ERRORLEVEL 1 (
317
+ call :WARNING Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & goto :EOF
318
+ )
312
319
)
313
320
314
321
echo Finished copying pdf docs...
@@ -333,7 +340,7 @@ for %%v in (IPLicense.txt IDPLicense.txt ) do (
333
340
334
341
:: Walk through all docs and transform any that are not .txt, .pdf or .html to .txt
335
342
@ echo Setting .txt filetype to ascii docs.
336
- for /R %FB_OUTPUT_DIR% \doc %%v in ( * ) do (
343
+ @ for /R %FB_OUTPUT_DIR% \doc %% v in ( * ) do (
337
344
if /I not " %% ~xv" == " .md" (
338
345
if /I not " %% ~xv" == " .txt" (
339
346
if /I not " %% ~xv" == " .pdf" (
@@ -390,11 +397,11 @@ for /R %FB_OUTPUT_DIR%\doc %%v in ( * ) do (
390
397
:: grab some missing bits'n'pieces from different parts of the source tree
391
398
:: =========================================================================
392
399
@ echo Copying ib_util etc
393
- @ copy %FB_ROOT_PATH% \src\extlib\ib_util.h %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.h failed. && @ goto :EOF )
394
- @ copy %FB_ROOT_PATH% \src\misc\pascal\ib_util.pas %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.pas failed. && @ goto :EOF )
400
+ @ copy %FB_ROOT_PATH% \src\extlib\ib_util.h %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.h failed. & goto :EOF )
401
+ @ copy %FB_ROOT_PATH% \src\misc\pascal\ib_util.pas %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.pas failed. & goto :EOF )
395
402
396
403
@ echo Copying other include files required for development...
397
- set OUTPATH = %FB_OUTPUT_DIR% \include
404
+ @ set OUTPATH = %FB_OUTPUT_DIR% \include
398
405
@ copy %FB_ROOT_PATH% \src\yvalve\perf.h %OUTPATH% \ > nul
399
406
@ copy %FB_ROOT_PATH% \src\include\gen\firebird.pas %OUTPATH% \firebird\ > nul || (@ call :ERROR Failure executing copy %FB_ROOT_PATH% \src\include\gen\firebird.pas %OUTPATH% \firebird\ )
400
407
@ if ERRORLEVEL 1 goto :END
@@ -424,7 +431,7 @@ set OUTPATH=%FB_OUTPUT_DIR%\include
424
431
:: =================================================================
425
432
@ if not exist %FB_OUTPUT_DIR% \firebird.msg (
426
433
copy %FB_GEN_DIR% \firebird.msg %FB_OUTPUT_DIR% \firebird.msg > nul
427
- if ERRORLEVEL 1 ( call :ERROR Could not copy firebird.msg & goto :EOF )
434
+ if ERRORLEVEL 1 ( call :ERROR Could not copy firebird.msg & goto :EOF )
428
435
)
429
436
430
437
:: End of FB_MSG
@@ -437,7 +444,7 @@ set OUTPATH=%FB_OUTPUT_DIR%\include
437
444
:: that and they all have windows EOL
438
445
:: ===============================================
439
446
@ for /R %FB_OUTPUT_DIR% %% W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.pas *.e *.def *.rc *.md *.html ) do (
440
- unix2dos --quiet -- safe %% W || exit /b 1
447
+ unix2dos --safe %% W > nul 2 >& 1 || exit /b 1
441
448
)
442
449
443
450
:: End of SET_CRLF
@@ -627,40 +634,40 @@ popd
627
634
628
635
@ echo .
629
636
@ echo Reading command-line parameters...
630
- @ (@ call :SET_PARAMS %* )
631
- @ if ERRORLEVEL 1 (@ call :ERROR Call ing SET_PARAMS & goto :END)
637
+ @ (call :SET_PARAMS %* )
638
+ @ if ERRORLEVEL 1 (call :ERROR Call ing SET_PARAMS & goto :END)
632
639
633
640
@ echo .
634
641
@ echo Checking that all required components are available...
635
- @ (@ call :CHECK_ENVIRONMENT ) || ( @ echo Error calling CHECK_ENVIRONMENT && @ goto :END )
642
+ @ ( call :CHECK_ENVIRONMENT ) || ( echo Error calling CHECK_ENVIRONMENT & goto :END )
636
643
@ echo .
637
644
638
645
@ echo Setting version number...
639
- @ (@ call :SET_VERSION ) || (@ echo Error calling SET_VERSION && @ goto :END )
646
+ @ ( call :SET_VERSION ) || ( echo Error calling SET_VERSION & goto :END )
640
647
@ echo .
641
648
642
649
@ echo Copying additional files needed for installation, documentation etc.
643
- @ ( @ call :COPY_XTRA ) || ( @ echo Error calling COPY_XTRA && @ goto :END )
650
+ @ ( call :COPY_XTRA ) || ( echo Error calling COPY_XTRA & goto :END )
644
651
@ echo .
645
652
646
653
:: WIX is not necessary for a snapshot build, so we don't throw
647
654
:: an error if WIX is not defined. On the other hand,
648
655
:: if it is there anyway, use it.
649
656
@ if defined WIX (
650
657
echo Building MSI runtimes
651
- ( call :BUILD_CRT_MSI ) || ( echo Error calling BUILD_CRT_MSI & @ goto :END )
658
+ ( call :BUILD_CRT_MSI ) || ( echo Error calling BUILD_CRT_MSI & goto :END )
652
659
echo .
653
660
)
654
661
655
662
@ echo Prepare include directory
656
- @ ( call :INCLUDE_DIR ) || ( @ echo Error calling INCLUDE_DIR & @ goto :END )
663
+ @ ( call :INCLUDE_DIR ) || ( echo Error calling INCLUDE_DIR & goto :END )
657
664
@ echo .
658
665
659
666
@ echo Writing databases conf
660
- @ (call :DB_CONF ) || ( echo Error calling DB_CONF & goto :END )
667
+ @ ( call :DB_CONF ) || ( echo Error calling DB_CONF & goto :END )
661
668
@ echo .
662
669
@ echo Copying firebird.msg
663
- @ (call :FB_MSG ) || ( echo Error calling FB_MSG & goto :END )
670
+ @ ( call :FB_MSG ) || ( echo Error calling FB_MSG & goto :END )
664
671
@ echo .
665
672
666
673
@ echo Fix up line endings...
675
682
676
683
@ if %FBBUILD_ISX_PACK% EQU 1 (
677
684
echo Now let's compile the InnoSetup scripts
678
- ( call :ISX_PACK ) || ( echo Error calling ISX_PACK & goto :END )
685
+ ( call :ISX_PACK ) || ( echo Error calling ISX_PACK & goto :END )
679
686
echo .
680
687
)
681
688
698
705
699
706
exit /b %ERRLEV%
700
707
701
-
0 commit comments