Psi Windows build scripts
From PsiWiki
Disclaimer: These instructions are unofficial and may or may not work for you.
This page contains scripts for building Psi on Windows platform.
Notes:
- If You were looking for scripts for building Psi-Qt4 on Windows, please consult Psi-Qt4/Windows build scripts article.
- These scripts may take the advantages of superior command-line cmd.exe found in Windows NT/2000/XP/Server 2003 and may not work properly on Windows 95/98/Me.
Contents |
Main worker script
This script does the main job compiling Psi and is called from inside other scripts. Should not be called directly from the command-line. It must be placed in makewin_build.bat file in order for other scripts to work properly.
@echo off if "%1" == "" goto NoArgs REM ----- Setup compilation and release process ----- set name=Psi for Windows set project=psi.pro set outdir=psiwin set binary=Psi.exe set system=%windir%\system if "%OS%" == "Windows_NT" set system=%system%32 REM ----- Compile and link Psi ----- echo This will compile, link and release %name%. echo STEP 1: Create Makefile for QCA title Creating Makefile for QCA... cd ..\qca qmake qca.pro > ..\psi\makewin.log if errorlevel 1 goto NoQMake echo STEP 2: Compile QCA title Compiling QCA... %MAKETOOL% >> ..\psi\makewin.log copy qca.lib ..\psi\src\ > nul cd ..\psi echo STEP 3: Create Makefile for %name% title Creating Makefile for %name%... qmake %project% > makewin.log if errorlevel 1 goto NoQMake echo STEP 4: Copy header file from QCA to %name% title Copying header file from QCA to %name%... copy ..\qca\src\qca.h cutestuff\network\ > nul echo STEP 5: Compile %name% title Compiling %name%... %MAKETOOL% >> makewin.log if errorlevel 1 goto CompileFailed echo STEP 6: Compile all %name% translations title Compiling all %name% translations... cd src lrelease src.pro >> ..\makewin.log cd .. echo STEP 7: Create Makefile for SSL/TLS plugin for %name% title Creating Makefile for SSL/TLS plugin for %name%... cd ..\qca\plugins\qca-tls qmake qca-tls.pro >> ..\..\..\psi\makewin.log echo STEP 8: Compile SSL/TLS plugin for %name% title Compiling SSL/TLS plugin for %name%... %MAKETOOL% >> ..\..\..\psi\makewin.log if errorlevel 1 goto CompileFailed cd ..\..\..\psi REM ----- Copy output to single directory ----- :Release echo STEP 9: Prepare for release of %name% title Preparing for release of %name%... if exist %outdir% rmdir /s /q %outdir% mkdir %outdir% copy src\%binary% %outdir% > nul copy %QTDIR%\bin\qt-mt*.dll %outdir% > nul copy src\tools\idle\win32\idleui.dll %outdir% > nul mkdir %outdir%\crypto copy ..\qca\plugins\qca-tls\qca-tls.dll %outdir%\crypto > nul copy ..\qca\qca.dll %outdir% > nul copy %system%\libeay32.dll %outdir% > nul copy %system%\ssleay32.dll %outdir% > nul ::if exist vslibs\*.* copy vslibs\*.* %outdir% > nul xcopy /d /e certs %outdir%\certs\ > nul xcopy /d /e iconsets %outdir%\iconsets\ > nul xcopy /d /e sound %outdir%\sound\ > nul copy COPYING %outdir% > nul win32\tod README %outdir%\Readme.txt win32\tod INSTALL %outdir%\Install.txt win32\tod KNOWN_BUGS.html %outdir%\KNOWN_BUGS.html copy lang\*.qm %outdir% > nul REM ----- Process succeeded ----- :Finished echo Seems that %name% is ready for distibution. title Done. goto End REM ----- Error handling ----- :NoArgs echo No arguments at command line. goto End :NoQMake echo Failed to run 'qmake'. Are you sure you have Qt set up? goto End :CopyFailed echo Copy failed, stopping. goto End :CompileFailed echo Compile failed, stopping. See 'makewin.log' file for details. goto End REM ----- Cleanup ----- :End set name= set project= set outdir= set binary= set system=
Compiler specific scripts
This section provides compiler-specific scripts - each compiler is provided with two scripts - one setup and one driver.
Microsoft Visual C++ 6.0 scripts
Setup script
This script sets up the environment for Microsoft Visual C++ 6.0 compiler. It must be named setup_msvc6.bat.
@echo off :: Set paths and variables for Microsoft Visual C++ 6.0 call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat" set INCLUDE=C:\Progra~1\Micros~4\include;%INCLUDE% :: Set paths for Qt 3.3.4 for VS6 set QTDIR=C:\Qt\3.3.4 set QMAKESPEC=win32-msvc set PATH=%QTDIR%\bin;%PATH% :: Set names for some tools set MAKE=nmake /nologo
Notes:
- You might need to change the location of Your Qt3 installation (C:\Qt\3.3.4 here).
- You might need to change the location of Your Microsoft Visual C++ 6.0 installation (C:\Program Files\Microsoft Visual Studio here).
- You have to replace C:\Progra~1\Micros~4 with the short path to Microsoft Visual C++ installation directory. It can be obtained by running the following command:
dir /x "%programfiles%\Microsoft Visual"
%programfiles% is usually C:\Progra~1.
Driver script
This script drives the whole build process for Microsoft Visual C++ 6.0 compiler. I prefer it to be named makewin_msvc6.bat, but any name is good.
@echo off call makewin_build.bat setup_msvc6.bat %1
You run this script to build Psi/Windows using Microsoft Visual C++ 6.0.
Microsoft Visual C++ .NET scripts
Setup script
This script sets up the environment for Microsoft Visual C++ .NET compiler. It must be named setup_msvc.net.bat.
@echo off :: Set paths and variables for Microsoft Visual C++ .NET 2003 call "%VS71COMNTOOLS%vsvars32.bat" :: Append Microsoft Platform SDK (comment out if not installed) set INCLUDE=C:\Progra~1\Micros~2\include;%INCLUDE% set LIB=C:\Progra~1\Micros~2\lib;%LIB% :: Set paths for Qt 3.3.4 for VS.NET set QTDIR=C:\Qt\3.3.4 set QMAKESPEC=win32-msvc.net set PATH=%QTDIR%\bin;%PATH% :: Set names for some tools set MAKE=nmake /nologo
Notes:
- You might need to change the location of Your Qt3 installation (C:\Qt\3.3.4 here).
- If You use Microsoft Visual C++ .NET (a.k.a. Microsoft Visual C++ .NET 2002) compiler, You need to replace %VS71COMNTOOLS% with %VSCOMNTOOLS% in order for the script to work correctly.
- If You have no Microsoft Platform SDK installed, delete following lines from the above script:
:: Append Microsoft Platform SDK (comment out if not installed) set INCLUDE=C:\Progra~1\Micros~2\include;%INCLUDE% set LIB=C:\Progra~1\Micros~2\lib;%LIB%
Otherwise, You have to replace C:\Progra~1\Micros~2 with the short path to Microsoft Platform SDK installation directory. It can be obtained by running the following command:
dir /x "%programfiles%\*Platform*"
%programfiles% is usually C:\Progra~1.
Driver script
This script drives the whole build process for Microsoft Visual C++ .NET compiler. I prefer it to be named makewin_msvc.net.bat, but any name is good.
@echo off call makewin_build.bat setup_msvc.net.bat
You run this script to build Psi/Windows using Microsoft Visual C++ .NET.
Microsoft Visual C++ .NET 2003 (x64) scripts
Setup script
This script sets up the environment for Microsoft Visual C++ .NET 2003 (x64) compiler. It must be named setup_msvc.net_x64.bat.
@echo off :: Set paths and variables for Microsoft Visual C++ .NET 2003 call "%VS71COMNTOOLS%vsvars32.bat" call "%MSSDK%\setenv.cmd" /XP64 /RETAIL set INCLUDE=G:\Progra~1\Micros~3.NET\VC7\include;%INCLUDE% :: Set paths for Qt 3.3.4 for VS.NET set QTDIR=C:\Qt\3.3.4 set QMAKESPEC=win32-msvc.net set PATH=%QTDIR%\bin;%PATH% :: Set names for some tools set MAKE=nmake /nologo
Notes:
- You might need to change the location of Your Qt3 installation (C:\Qt\3.3.4 here).
- You need to have Microsoft Platform SDK installed to be able to compile code for x64 systems using Microsoft Visual .NET 2003 compiler.
Driver script
This script drives the whole build process for Microsoft Visual C++ .NET 2003 (x64) compiler. I prefer it to be named makewin_msvc.net_x64.bat, but any name is good.
@echo off call makewin_build.bat setup_msvc.net_x64.bat
You run this script to build Psi/Windows using Microsoft Visual C++ .NET 2003 (x64).
Cleanup script
This script cleans up the source directories of Psi, QCA and QCA-TLS and prepares them for complete rebuild. I prefer it to be named makewin_clean.bat.
@echo off if not exist lang goto psiwidgets cd lang if exist *.qm del *.qm cd .. :psiwidgets if not exist libpsi\psiwidgets goto qca cd libpsi\psiwidgets if exist tmp rmdir /s /q tmp if exist *.dll del *.dll if exist *.exp del *.exp if exist *.lib del *.lib if exist moc_*.* del moc_*.* if exist *.moc del *.moc if exist *.o del *.o if exist *.obj del *.obj if exist *.so del *.so if exist *.tds del *.tds if exist Makefile del Makefile cd ..\.. :qca if not exist ..\qca goto tls cd ..\qca if exist .moc rmdir /s /q .moc if exist .obj rmdir /s /q .obj if exist .ui rmdir /s /q .ui if exist moc rmdir /s /q moc if exist obj rmdir /s /q obj if exist ui rmdir /s /q ui if exist *.dll del *.dll if exist *.exp del *.exp if exist *.lib del *.lib if exist *.moc del *.moc if exist *.o del *.o if exist *.obj del *.obj if exist *.so del *.so if exist *.tds del *.tds if exist Makefile del Makefile cd ..\psi :tls if not exist ..\qca\plugins\qca-tls goto src cd ..\qca\plugins\qca-tls if exist *.dll del *.dll if exist *.exp del *.exp if exist *.lib del *.lib if exist *.moc del *.moc if exist *.o del *.o if exist *.obj del *.obj if exist *.so del *.so if exist *.tds del *.tds if exist Makefile del Makefile cd ..\..\..\psi :src if not exist src goto win32 cd src if exist .moc rmdir /s /q .moc if exist .obj rmdir /s /q .obj if exist .ui rmdir /s /q .ui if exist moc rmdir /s /q moc if exist obj rmdir /s /q obj if exist ui rmdir /s /q ui if exist *.dll del *.dll if exist *.exe del *.exe if exist *.exp del *.exp if exist *.idb del *.idb if exist *.lib del *.lib if exist *.moc del *.moc if exist *.o del *.o if exist *.obj del *.obj if exist *.pdb del *.pdb if exist *.so del *.so if exist *.tds del *.tds if exist Makefile del Makefile if exist config.h del config.h cd .. :win32 if not exist win32 goto root cd win32 if exist *.res del *.res cd .. :root if exist psiwin rmdir /s /q psiwin if exist *.log del *.log if exist Makefile del Makefile

