Make a new windows devpack release

From CSP

The following steps needs to be done to build a new dev pack release on windows.

NOTE make sure that you select the correct version of every dependency. Latest version should be best.

Table of contents

Manual steps

Several things here is actually manual steps. A lot of visual studio project files needs to be upgraded manually. So lets execute below scripts in small batches and check that each step is working before you continue with the next.

Command prompt

Make sure that you start a Visual Studio Command Prompt. The following commands should also be available in your path.

  • cmake
  • devenv
  • scons
  • swig
  • svn
REM == Start with ==
REM Set up some paths and things to be able to build everything.

mkdir c:\csp\devpack
c:
cd \csp\devpack

mkdir out\include
mkdir out\lib
mkdir out\bin

REM Setup include and lib paths to the out directory that will contain
REM the created devpack.
set INCLUDE=%INCLUDE%;c:\csp\devpack\out\include
set LIB=%LIB%;c:\csp\devpack\out\lib
set PATH=%PATH%;c:\csp\devpack\out\bin

REM == Freetype ==

Download the latest version of freetype from http://www.freetype.org/ and unzip it into a freetype directory.

devenv /useenv freetype\builds\win32\visualc\freetype.sln /upgrade
devenv /useenv freetype\builds\win32\visualc\freetype.sln /rebuild Release
copy freetype\objs\freetype237.lib out\lib\ /y
xcopy freetype\include\freetype\*.h out\include\freetype\ /s /y
copy freetype\include\*.h out\include\ /y

REM == libjpeg ==

From http://gnuwin32.sourceforge.net/packages/jpeg.htm you can download: jpeg-6b-4-bin.zip and jpeg-6b-4-lib.zip. Unzip them to a jpeg directory.

copy jpeg\bin\jpeg62.dll out\bin\ /y
copy jpeg\include\*.h out\include\ /y
copy jpeg\lib\jpeg.lib out\lib\libjpeg.lib /y

REM == libpng ==

From http://sourceforge.net/projects/libpng/ you can download the latest png implementation and zlib implementation. Unzip it into a png and zlib directory.

devenv /useenv zlib\projects\visualc6\zlib.dsw
devenv /useenv zlib\projects\visualc6\zlib.sln /rebuild "lib release" /project zlib
copy zlib\*.h out\include\ /y
copy zlib\projects\visualc6\Win32_LIB_Release\zlib.lib out\lib\ /y

devenv /useenv png\projects\visualc71\libpng.sln /upgrade
devenv /useenv png\projects\visualc71\libpng.sln /rebuild "lib release" /project libpng
copy png\*.h out\include\ /y
copy png\projects\visualc71\Win32_LIB_Release\libpng.lib out\lib\ /y

REM == Open Scene Graph ==
REM Install cmake if you haven't done already. (Note that you may 
REM need to upgrade to get latest visual studio support)  
REM http://www.cmake.org Also make sure that cmake is in your path.

svn export http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.6.0 osg
cd osg
cmake -G "Visual Studio 9 2008" .

Start cmakesetup.exe and ensure that paths to:

  • freetype lib and header files.
  • zlib lib and header files.
  • png lib and header files.
cd ..
devenv osg\OpenSceneGraph.sln /rebuild Release
mkdir out\include
xcopy osg\include\*.* out\include\ /s /y
xcopy osg\lib\*.lib out\lib\ /y
xcopy osg\bin\*.exe out\bin\ /y
xcopy osg\bin\*.dll out\bin\ /s /y

Go to http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx and install:

  • OpenAL11CoreSDK.zip. Next step assumes that this package has been installed to: C:\Program Files\OpenAL 1.1 SDK
  • Download freealut-1.1.0.tar.gz and unzip to C:\csp\devpack\freealut
mkdir out\include\AL
copy "C:\Program Files\OpenAL 1.1 SDK\include\*.h" out\include\AL\ /y
copy "C:\Program Files\OpenAL 1.1 SDK\libs\Win32\OpenAL32.lib" out\lib\ /y
copy "%WINDIR%\system32\OpenAL32.dll" out\bin\
set INCLUDE=%INCLUDE%;c:\csp\devpack\out\include\AL

Strangely I was forced to remove the following from freealut/CMakelists.txt

SET(CMAKE_REQUIRED_INCLUDES ${OPENAL_INCLUDE_DIR})
CHECK_INCLUDE_FILES("AL/alc.h;AL/al.h" AL_HEADERS)
IF(NOT AL_HEADERS)
  MESSAGE(FATAL_ERROR "OpenAL header files not found - aborting.")
ENDIF(NOT AL_HEADERS)

Back to the script.

cmake -G "Visual Studio 9 2008" freealut
devenv freealut/Alut.sln /rebuild release /useenv
xcopy freealut\include\AL\*.h out\include\AL\ /y
copy freealut\Release\alut.lib out\lib\ /y
copy freealut\Release\alut.dll out\bin\ /y

REM == OGG ==
svn export http://svn.xiph.org/trunk/ogg/ ogg
devenv ogg\win32\vs2005\ogg.sln /upgrade

Open solution file and rename output file from libogg.lib libogg.dll to ogg.lib and ogg.dll.

devenv ogg\win32\vs2005\ogg.sln /rebuild Release /useenv
xcopy ogg\include\ogg\*.h out\include\ogg\ /y
copy ogg\win32\vs2005\Release\ogg.lib out\lib\ /y
copy ogg\win32\vs2005\Release\ogg.dll out\bin\ /y

REM == Vorbis ==
svn export http://svn.xiph.org/trunk/vorbis/ vorbis
devenv vorbis\win32\vs2005\vorbis.sln /upgrade

Open solution file and edit settings for libvorbis project. Rename output file from libvorbis.lib libvorbis.dll to vorbis.lib and vorbis.dll. Make sure that the project is importing ogg.lib instead of libogg.lib. Also edit settings for libvorbisfile project. Rename output file from libvorbisfile.lib libvorbisfile.dll to vorbisfile.lib and vorbisfile.dll. Make sure that the project is importing ogg.lib and vorbis.lib instead of libogg.lib and libvorbis.lib.

Also open vorbis\win32\VS2005\libvorbisfile\libvorbisfile.def and make sure that the library name is: LIBRARY vorbisfile

devenv vorbis\win32\vs2005\vorbis.sln /rebuild Release /project libvorbisfile /useenv
xcopy vorbis\include\vorbis\*.h out\include\vorbis\ /y
copy vorbis\win32\vs2005\Release\vorbis.lib out\lib\ /y
copy vorbis\win32\vs2005\Release\vorbisfile.lib out\lib\ /y
copy vorbis\win32\vs2005\Release\vorbis.dll out\bin\ /y
copy vorbis\win32\vs2005\Release\vorbisfile.dll out\bin\ /y

REM == Open Scene Graph Audio Layer (osgAL) ==
svn export https://osgal.svn.sourceforge.net/svnroot/osgal osgal 
devenv /useenv osgal\visualstudio\osgAL\osgAL.sln /upgrade
devenv /useenv osgal\visualstudio\osgAL\osgAL.sln /rebuild Release /project oalpp
devenv /useenv osgal\visualstudio\osgAL\osgAL.sln /rebuild Release /project "Core osgAL"
copy osgal\bin\oalpp.dll out\bin\ /y
copy osgal\bin\osgAL.dll out\bin\ /y
copy osgal\lib\oalpp.lib out\lib\ /y
copy osgal\lib\osgAL.lib out\lib\ /y
xcopy osgal\include\*. out\include\ /s /y

REM == SDL ==
svn export http://svn.libsdl.org/branches/SDL-1.2 SDL

Unzip SDL\VisualC.zip into the same folder. Also make sure that you have DirectX SDK installed. You only need headers and libs. Adjusts include and lib paths below to match your local paths.

SET INCLUDE=%INCLUDE%;C:\Program Files\Microsoft DirectX SDK (August 2008)\Include
SET LIB=%LIB%;C:\Program Files\Microsoft DirectX SDK (August 2008)\Lib\x86
copy sdl\include\sdl_config.h.default sdl\include\SDL_config.h /y
devenv /useenv sdl\visualc\sdl.sln /rebuild Release
copy sdl\visualc\sdl\release\sdl.dll out\bin\ /y
copy sdl\visualc\sdl\release\sdl.lib out\lib\ /y
copy sdl\visualc\sdlmain\release\sdlmain.lib out\lib\ /y
xcopy sdl\include\*.h out\include\SDL\ /s /y

Download the latest version of sigc++ from here: http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.0/ and unpack it in a libsigc++ directory.

echo "/* fix */" > libsigc++\MSVC_Net2003\resource.h
devenv /useenv libsigc++/MSVC_Net2003/libsigc++2_msvcNet2003.sln /upgrade
devenv /useenv libsigc++/MSVC_Net2003/libsigc++2_msvcNet2003.sln /rebuild Release /project sigc-2.0
copy "libsigc++\MSVC_Net2003\Release\sigc-2.0.dll" out\bin\ /y
copy "libsigc++\MSVC_Net2003\Release\sigc-2.0.lib" out\lib\ /y
copy "libsigc++\MSVC_Net2003\sigc++config.h" out\include\ /y
xcopy "libsigc++\sigc++\*.h" "out\include\sigc++\" /s /y

Download commoncpp2 from this sourceforge project: http://sourceforge.net/projects/gnutelephony/ As of this writing it is commoncpp2-1.5.2.tar.gz that is the latest. Extract content to the commoncpp2 folder.

devenv /useenv commoncpp2\w32\common.sln /upgrade

Now that the project has been upgraded we need to adjust the names of the dll files and libraries created. We need to manually search and replace:

CapeCommon14 -> ccgnu2 in commoncpp2\w32\ccgnu2.vcproj
CapeExtras14 -> ccext2 in commoncpp2\w32\ccext2.vcproj

Back to compilation:

devenv /useenv commoncpp2\w32\common.sln /rebuild release /project ccext2

NOTE. If you get compilation problems like this: C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(358) : error C3163: '_vsnprintf': attributes inconsistent with previous declaration C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(350) : see declaration of '_vsnprintf' . Then you must comment out the following #define vsnprintf _vsnprintf from commoncpp2\w32\cc++\config.h

xcopy commoncpp2\include\cc++\*.h out\include\cc++\ /s /y
copy "commoncpp2\w32\cc++\config.h" "out\include\cc++\" /y
copy commoncpp2\w32\release\ccgnu2.dll out\bin\ /y
copy commoncpp2\w32\release\ccext2.dll out\bin\ /y
copy commoncpp2\w32\release\ccgnu2.lib out\lib\ /y
copy commoncpp2\w32\release\ccext2.lib out\lib\ /y


Test it

Some people says that it is necessary to do testing. I am not sure. Above scripts and tweaks should work out of the box.... :-) We do it anyway:

set CSPDEVPACK=c:\csp\devpack\out
set PATH=%PATH%;c:\Program Files\Python_2.4.1;c:\Program Files\swigwin-1.3.31;%CSPDEVPACK%\bin;
set LIB=%LIB%;c:\Program Files\Python_2.4.1\libs
svn co https://csp.svn.sourceforge.net/svnroot/csp/trunk/ trunk_devpack
cd trunk_devpack\csp
scons -Q all

Create a installable package

Make sure that you have installed nullsoft install system (http://nsis.sourceforge.net/Main_Page). Start MakeNSISW and drag n drop the following file to it: trunk_devpack\csp\dist\win\devpack\devpack.nsi. The program has a habit of compiling directly after drag n drop. So start with Script menu and select Cancel compilation. Go to Tools and then Settings. Define the following variables:

VERSION=0.7
SRC=c:\csp\devpack\out

And now compile it.

Conclusion

This was really easy. Why didn't I think on document this the first time I did this......

TODO

  • Collada
  • More dependencies?