diff --git a/builds/win32/make_all.bat b/builds/win32/make_all.bat new file mode 100644 index 0000000000..d4e75d2c8e --- /dev/null +++ b/builds/win32/make_all.bat @@ -0,0 +1,97 @@ +@echo off + +:: Set env vars +@call setenvvar.bat +@if errorlevel 1 (goto :END) + +:: verify that prepare was run before +@if not exist %ROOT_PATH%\builds\win32\dbs\metadata.fdb (goto :HELP_PREP & goto :END) + +:: verify that boot was run before +@if not exist %ROOT_PATH%\gen\gpre_boot.exe (goto :HELP_BOOT & goto :END) + +::=========== +:: Read input values +@set DBG= +@set DBG_DIR=release +@set CLEAN=/build +@if "%1"=="DEBUG" ((set DBG=TRUE) && (set DBG_DIR=debug)) +@if "%2"=="DEBUG" ((set DBG=TRUE) && (set DBG_DIR=debug)) +@if "%1"=="CLEAN" (set CLEAN=/rebuild) +@if "%2"=="CLEAN" (set CLEAN=/rebuild) + +::========== +:: MAIN +@if "%DBG%"=="" ( + call :RELEASE +) else ( + call :DEBUG +) +@call :MOVE +@goto :END + +::=========== +:RELEASE +@echo Building release +if "%VS_VER%"=="msvc6" ( + @msdev %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2.dsw /MAKE "fbserver - Win32 Release" "fbguard - Win32 Release" "fb_lock_print - Win32 Release" "fb_inet_server - Win32 Release" "gbak - Win32 Release" "gpre - Win32 Release" "gsplit - Win32 Release" "gdef - Win32 Release" "gfix - Win32 Release" "gsec - Win32 Release" "gstat - Win32 Release" "instreg - Win32 Release" "instsvc - Win32 Release" "isql - Win32 Release" "qli - Win32 Release" "gds32 - Win32 Release" "fbclient - Win32 Release" "ib_udf - Win32 Release" "ib_util - Win32 Release" "intl - Win32 Release" "intlcpp - Win32 Release" %CLEAN% /OUT all.log +) else ( + @devenv %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2.sln %CLEAN% /OUT all.log +) +@goto :EOF + +::=========== +:DEBUG +@echo Building debug +if "%VS_VER%"=="msvc6" ( + @msdev %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2.dsw /MAKE "fbserver - Win32 Debug" "fbguard - Win32 Debug" "fb_lock_print - Win32 Debug" "fb_inet_server - Win32 Debug" "gbak - Win32 Debug" "gpre - Win32 Debug" "gsplit - Win32 Debug" "gdef - Win32 Debug" "gfix - Win32 Debug" "gsec - Win32 Debug" "gstat - Win32 Debug" "instreg - Win32 Debug" "instsvc - Win32 Debug" "isql - Win32 Debug" "qli - Win32 Debug" "gds32 - Win32 Debug" "fbclient - Win32 Debug" "ib_udf - Win32 Debug" "ib_util - Win32 Debug" "intl - Win32 Debug" "intlcpp - Win32 Debug" %CLEAN% /OUT all.log +) else ( + @devenv %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2.sln debug %CLEAN% /OUT all.log +) +@goto :EOF + +::=========== +:MOVE +@echo Copying files to output +@del %ROOT_PATH%\builds\win32\%VS_VER%\%DBG_DIR%\firebird\bin\*.exp 2>nul +@del %ROOT_PATH%\builds\win32\%VS_VER%\%DBG_DIR%\firebird\bin\*.lib 2>nul +@rmdir /q /s %ROOT_PATH%\output 2>nul +@mkdir %ROOT_PATH%\output +@mkdir %ROOT_PATH%\output\bin +@mkdir %ROOT_PATH%\output\intl +@mkdir %ROOT_PATH%\output\udf +@mkdir %ROOT_PATH%\output\help +@mkdir %ROOT_PATH%\output\doc +@mkdir %ROOT_PATH%\output\include +@mkdir %ROOT_PATH%\output\lib +@copy %ROOT_PATH%\builds\win32\%VS_VER%\%DBG_DIR%\firebird\bin\* %ROOT_PATH%\output\bin >nul +@copy %ROOT_PATH%\builds\win32\%VS_VER%\%DBG_DIR%\firebird\intl\* %ROOT_PATH%\output\intl >nul +@copy %ROOT_PATH%\builds\win32\%VS_VER%\%DBG_DIR%\firebird\udf\* %ROOT_PATH%\output\udf >nul +@copy %ROOT_PATH%\builds\win32\gpre.exe %ROOT_PATH%\output\bin >nul +@copy %ROOT_PATH%\builds\win32\dbs\jrd\SECURITY.FDB %ROOT_PATH%\output\security.fdb >nul +@copy %ROOT_PATH%\builds\win32\dbs\qli\HELP.fdb %ROOT_PATH%\output\help\help.fdb >nul +@copy %ROOT_PATH%\ChangeLog %ROOT_PATH%\output\doc\ChangeLog.txt >nul +@copy %ROOT_PATH%\doc\WhatsNew %ROOT_PATH%\output\doc\WhatsNew.txt >nul +@copy %ROOT_PATH%\src\jrd\ibase.h %ROOT_PATH%\output\include >nul +@copy %ROOT_PATH%\src\include\gen\iberror.h %ROOT_PATH%\output\include >nul +@copy install_super.bat %ROOT_PATH%\output\bin >nul +@copy install_classic.bat %ROOT_PATH%\output\bin >nul +@copy uninstall.bat %ROOT_PATH%\output\bin >nul + +@goto :EOF + +::============== +:HELP_PREP +@echo. +@echo You must run prepare.bat before running this script +@echo. +@goto :EOF + +::============== +:HELP_BOOT +@echo. +@echo You must run make_boot.bat before running this script +@echo. +@goto :EOF + +:END \ No newline at end of file diff --git a/builds/win32/make_boot.bat b/builds/win32/make_boot.bat new file mode 100644 index 0000000000..42c2bd5e77 --- /dev/null +++ b/builds/win32/make_boot.bat @@ -0,0 +1,121 @@ +:: +:: This bat file don't uses cd, all the paths are full paths. +:: with this convention this bat file is position independent +:: and it will be easier to move the place of somefiles. +:: + +@echo off + +:CHECK_ENV +@call setenvvar.bat +@if errorlevel 1 (goto :END) + +:: verify that prepare was run before +@if not exist %ROOT_PATH%\builds\win32\dbs\metadata.fdb (goto :HELP & goto :END) + +::=========== +:MAIN +@echo. +@echo Copy autoconfig.h +@del %ROOT_PATH%\src\include\gen\autoconfig.h 2> nul +@copy %ROOT_PATH%\src\include\gen\autoconfig_msvc.h %ROOT_PATH%\src\include\gen\autoconfig.h > nul +@echo Creating directories +@rmdir /s /q %ROOT_PATH%\gen 2>nul +@mkdir %ROOT_PATH%\gen\alice 2>nul +@mkdir %ROOT_PATH%\gen\burp 2>nul +@mkdir %ROOT_PATH%\gen\dsql 2>nul +@mkdir %ROOT_PATH%\gen\dudley 2>nul +@mkdir %ROOT_PATH%\gen\gpre 2>nul +@mkdir %ROOT_PATH%\gen\isql 2>nul +@mkdir %ROOT_PATH%\gen\jrd 2>nul +@mkdir %ROOT_PATH%\gen\msgs 2>nul +@mkdir %ROOT_PATH%\gen\qli 2>nul +@mkdir %ROOT_PATH%\gen\utilities 2>nul +@mkdir %ROOT_PATH%\gen\v5_examples 2>nul + +::provisional, copy all fdbs to the same directory to be used from preprocess +copy %ROOT_PATH%\builds\win32\dbs\metadata.fdb %ROOT_PATH%\gen\yachts.lnk > nul +copy %ROOT_PATH%\builds\win32\dbs\jrd\security.fdb %ROOT_PATH%\gen\security.fdb > nul +copy %ROOT_PATH%\builds\win32\dbs\msgs\msg.fdb %ROOT_PATH%\gen\msg.fdb > nul +copy %ROOT_PATH%\builds\win32\dbs\qli\help.fdb %ROOT_PATH%\gen\help.fdb > nul +::======= +@call :gpre_boot +::======= +@echo Preprocessing the entire source tree... +@call preprocess.bat BOOT +::======= +@call :gpre_static +::======= +@echo Preprocessing the entire source tree... +@call preprocess.bat +::======= +@call :msgs +::======= +@echo Building message file and codes header... +@%ROOT_PATH%\gen\build_msg -D %DB_PATH%/gen/msg.fdb +@%ROOT_PATH%\gen\codes %ROOT_PATH%\src\include\gen +::======= +@echo Building BLR Table +@call blrtable.bat +@call :NEXT_STEP +@goto END: + + +::=================== +:: BUILD gpre_boot +:gpre_boot +@echo. +@echo Building gpre_boot... +if "%VS_VER%"=="msvc6" ( + @msdev %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2Boot.dsw /MAKE "gpre_boot - Win32 Release" /REBUILD /OUT boot1.log +) else ( + @devenv %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2Boot.sln /project gpre_boot /rebuild /OUT boot1.log +) +@copy %ROOT_PATH%\builds\win32\%VS_VER%\release\firebird\bin\gpre_boot.exe %ROOT_PATH%\gen\ > nul +goto :EOF + +::=================== +:: BUILD gpre_static +:gpre_static +@echo. +@echo Building gpre_static... +if "%VS_VER%"=="msvc6" ( + @msdev %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2Boot.dsw /MAKE "gpre_static - Win32 Release" /REBUILD /OUT boot2.log +) else ( + @devenv %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2Boot.sln /project gpre_static /REBUILD /OUT boot2.log +) +@copy %ROOT_PATH%\builds\win32\%VS_VER%\release\firebird\bin\gpre_static.exe %ROOT_PATH%\gen\ > nul +@goto :EOF + + +::=================== +:: BUILD messages and codes +:msgs +@echo. +@echo Building build_msg and codes... +if "%VS_VER%"=="msvc6" ( + @msdev %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2Boot.dsw /MAKE "build_msg - Win32 Release" "codes - Win32 Release" /REBUILD /OUT boot3.log +) else ( + @devenv %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2Boot.sln /project build_msg /REBUILD /OUT boot3.log + @devenv %ROOT_PATH%\builds\win32\%VS_VER%\Firebird2Boot.sln /project codes /REBUILD /OUT boot4.log +) +@copy %ROOT_PATH%\builds\win32\%VS_VER%\release\build_msg\build_msg.exe %ROOT_PATH%\gen\ > nul +@copy %ROOT_PATH%\builds\win32\%VS_VER%\release\codes\codes.exe %ROOT_PATH%\gen\ > nul +@goto :EOF + +::============== +:NEXT_STEP +@echo. +@echo You may now run make_all.bat [DEBUG] [CLEAN] +@echo. +@goto :EOF + +::============== +:HELP +@echo. +@echo You must run prepare.bat before running this script +@echo. +@goto :EOF + + +:END diff --git a/builds/win32/prepare.bat b/builds/win32/prepare.bat index e6cb31541e..8b98f8462b 100644 --- a/builds/win32/prepare.bat +++ b/builds/win32/prepare.bat @@ -11,8 +11,6 @@ @echo This may not be what you intended @echo. - - ::Check if on-line help is required @if /I "%1"=="-h" (goto :HELP & goto :EOF) @if /I "%1"=="/h" (goto :HELP & goto :EOF) @@ -21,40 +19,26 @@ if "%1" NEQ "" (set FIREBIRD=%1) if "%FIREBIRD%"=="" (goto :HELP & goto :EOF) -@goto :MAIN - -:SET_DB_DIR -@cd ..\.. -@for /f "delims=" %%a in ('@cd') do (set ROOT_PATH=%%a) -@echo Setting root path to %ROOT_PATH% -@cd %~dp0 -::for /f "delims=" %%a in ('cd') do (@echo %%a) -@goto :EOF ::=========== :MAIN -call :SET_DB_DIR - -::Make sure that the db path is set to a style that wont break SED -for /f "tokens=*" %%a in ('@echo %ROOT_PATH:\=/%') do (set DB_PATH=%%a) +@call setenvvar.bat +@if errorlevel 1 (goto :END) @md dbs 2>nul -@cd dbs @echo Creating databases @"%FIREBIRD%\bin\gbak" -r %ROOT_PATH%\src\misc\metadata.gbak localhost:%DB_PATH%\builds\win32\dbs\metadata.fdb -@md jrd 2>nul +@md %ROOT_PATH%\builds\win32\dbs\jrd 2>nul @"%FIREBIRD%\bin\gbak" -r %ROOT_PATH%\src\misc\security.gbak localhost:%DB_PATH%\builds\win32\dbs\jrd\security.fdb -@md msgs 2>nul +@md %ROOT_PATH%\builds\win32\dbs\msgs 2>nul @"%FIREBIRD%\bin\gbak" -r %ROOT_PATH%\src\msgs\msg.gbak localhost:%DB_PATH%\builds\win32\dbs\msgs\msg.fdb -@md qli 2>nul +@md %ROOT_PATH%\builds\win32\dbs\qli 2>nul @"%FIREBIRD%\bin\gbak" -r %ROOT_PATH%\src\misc\help.gbak localhost:%DB_PATH%\builds\win32\dbs\qli\help.fdb -@cd .. @echo. @echo Completed Preparations for build -@echo You may now run makeX_boot.bat -@echo. where X is your version of MSVC - 6 or 7. +@echo You may now run make_boot.bat @echo. @goto :END diff --git a/builds/win32/preprocess.bat b/builds/win32/preprocess.bat index aebf18440b..a6050f3f8c 100644 --- a/builds/win32/preprocess.bat +++ b/builds/win32/preprocess.bat @@ -25,7 +25,7 @@ ::=========== :PREPROCESS @echo Processing %1/%2.epp -@del ..\..\gen\%1\%2.cpp 2>nul +@del %ROOT_PATH%\gen\%1\%2.cpp 2>nul @echo Calling GPRE for %1/%2.epp @if "%3"=="" (call :GPRE_M %1 %2) else (call :GPRE_GDS %1 %2) @echo. @@ -33,18 +33,18 @@ ::=========== :GPRE_M -@%GPRE% -n -m -raw ..\..\src\%1\%2.epp ..\..\gen\%1\%2.cpp -b localhost:%DB_PATH%/gen/ +@%GPRE% -n -m -raw %ROOT_PATH%\src\%1\%2.epp %ROOT_PATH%\gen\%1\%2.cpp -b localhost:%DB_PATH%/gen/ @goto :EOF ::=========== :GPRE_GDS -@%GPRE% -n -gds -raw -ids ..\..\src\%1\%2.epp ..\..\gen\%1\%2.cpp -b localhost:%DB_PATH%/gen/ +@%GPRE% -n -gds -raw -ids %ROOT_PATH%\src\%1\%2.epp %ROOT_PATH%\gen\%1\%2.cpp -b localhost:%DB_PATH%/gen/ goto :EOF ::=========== :BOOT_PROCESS @echo. -@set GPRE=gpre_boot -lang_internal +@set GPRE=%ROOT_PATH%\gen\gpre_boot -lang_internal @for %%i in (array, blob, metd) do @call :PREPROCESS dsql %%i @for %%i in (gpre_meta) do @call :PREPROCESS gpre %%i @goto :EOF @@ -52,7 +52,7 @@ goto :EOF ::=========== :MASTER_PROCESS @echo. -@set GPRE=gpre_static +@set GPRE=%ROOT_PATH%\gen\gpre_static @for %%i in (alice_meta) do @call :PREPROCESS alice %%i @for %%i in (backup, restore) do @call :PREPROCESS burp %%i @for %%i in (array, blob, metd) do @call :PREPROCESS dsql %%i diff --git a/builds/win32/setenvvar.bat b/builds/win32/setenvvar.bat new file mode 100644 index 0000000000..442dba27a7 --- /dev/null +++ b/builds/win32/setenvvar.bat @@ -0,0 +1,35 @@ +:: This bat set the environment values +:: ROOT_PATH dos format path of the main directory +:: DB_PATH unix format path of the main directory +:: VS_VER VisualStudio version (msvc6|msvc7) + +@echo off +::================= +:SET_DB_DIR + +@cd ..\.. +@for /f "delims=" %%a in ('@cd') do (set ROOT_PATH=%%a) +@cd %~dp0 +for /f "tokens=*" %%a in ('@echo %ROOT_PATH:\=/%') do (set DB_PATH=%%a) + +@msdev /? >nul 2>nul +@if not errorlevel 9009 ((set VS_VER=msvc6) & (goto :END)) + +@devenv /? >nul 2>nul +@if not errorlevel 9009 ((set VS_VER=msvc7) & (goto :END)) + +::=========== +:HELP +@echo. +@echo ERROR: There are not a visual studio valid version in your path. +@echo You need visual studio 6 or 7 to build Firebird +@echo. +:: set errorlevel +@exit /B 1 + +:END +@echo. +@echo vs_ver=%VS_VER% +@echo db_path=%DB_PATH% +@echo root_path=%ROOT_PATH% +@echo. \ No newline at end of file