HowTo:Cygwin Compiling
VCPP Compiling | HowTo | HowTo:Compile from CVS |
Contents
Compiling CVS Module vegastrike under Cygwin
Checkout the CVS-files
Refer to HowTo:Checkout CVS to obtain the vegastrike module.
Before Compiling
There are two ways to compile Vega Strike under Cygwin:
- In a "pure" Cygwin mode; and
- In a mingw style (no libcygwin dependency, but msvcrt.dll).
To compile like a mingw compiler, gcc just has to be invoked like this:
gcc -mno-cygwin.
It is easier to get Vega Strike to compile with gcc -mno-cygwin and with all extra libs than in a "pure" cygwin mode since OpenAL and SDL libs require gcc -mno-cygwin for instance.
Soon you will find here two tarballs containing extra-libs that VS can use. The mingw one will be the most complete (includes OpenAL, SDL, SDL_mixer, portaudio, gtk). You will just have to unpack the mingw_files.zip file in /usr/local.
If using gcc -mno-cygwin (mingw build), you may need to copy a few header files from /usr/include to /usr/include/mingw like the jpeg headers (/usr/include/j*.h). You also have to install the zlib-mingw package and you have to undef HAVE_SYS_SELECT_H in /usr/include/python2.{your_python_version}/pyconfig.h too because mingw doesn't provide a select() system function like Posix systems do.
Preparation
(Mainly extracted from CYGWIN.NOTES)
In order to compile Vega Strike under Cygwin there are a few things to check:
- make sure you have these cygwin-packages installed:
- make (Devel)
- gcc v2.x or v3.x (Devel)
- gcc-g++ (Devel)
- automake (Devel)
- autoconf (Devel)
- m4
- binutils
- X11... (XFree86)
- libpng + libpng-devel (Graphics, Libs)
- python (Interpreters)
- python-dev
- expat (Interpreters)
- jpeg (Graphics, Libs)
- libjpegXX (Graphics, Libs)
- zlib or zlib-mingw (Depending on which build type you want)
- w32api
- opengl (the cygwin package not the XFree one !! see below)
- __inetutils__ (Net)
- __glext.h__ needs to be added
- download the file glext.h from one of the locations shown below. Preferable is the one from vega-new-proj I think.
GL/GLUT
- Header files (by hellcatv)
- Other header files
See also this or this thread for more information.
- copy the glext.h to your toplevel __./src__ directory of your vegastrike dir (or to __/usr/include/GL__ ; or to __/usr/include/w32api/GL__)
- when using __libpng 1.2__, --with-png-inc=<DIR> is needed
- OpenGL might be a problem since GL libs provided with the XFree 4.x package should not be used. Instead, we have to use the cygwin OpenGL package which provides some complements to another win32 GL distro (M$, or nVidia ...). So in order to get OpenGL to work, you have to specify at configure time :
./configure --with-gl-lib-name=opengl32 --with-glu-lib-name=glu32 ........
Glut should work ok but if VS complains about not finding glut.dll just copy your /bin/glut32.dll to /bin/glut.dll
- to be sure set the data dir to you vs-data dir:
./configure --with-data-dir=<DIR> ........
- if you don't want to compile with gtk just turn it off:
./configure --enable-nogtk ...........
- This is necessary for each compiler version. (See this thread in the forum)
./configure --enable-boost-128 ...........
- You may also need to add path to png lib :
./configure --with-png-inc=/usr/include/libpng12 ......
Compiling
The compile procedure should look like the following listing depending on what extra libraries you wish to use with VS. Remember the configure part depends on above requirements. Though autoconf may not work, if so just skip it.
cd ./vegastrike aclocal autoheader autoconf automake --add-missing ./configure --with-gl-lib-name=opengl32 --with-glu-lib-name=glu32 --enable-boost-128 --enable-nogtk --with-data-dir=<DIR> make make install
Samples
- Surfdargent, sample to compile in mingw mode with libcrypto++, portaudio, openal and even gtk support :
./configure CC='gcc -mno-cygwin' CXX='g++ -mno-cygwin' --enable-debug --enable-boost-128 --with-include-dir=/usr/local/include --enable-crypto --with-png-inc=/usr/include/libpng12 --with-gl-lib-name=opengl32 --with-glu-lib-name=glu32 --enable-netcomm=portaudio --with-openal-libs=/usr/local/lib --with-al-inc=/usr/local/include
- Pontiac: See this post in the Forum.
- your sample goes here
VCPP Compiling | HowTo | HowTo:Compile from CVS |