HowTo:Cygwin Compiling

From VsWiki

Jump to: navigation, search
main.php?g2_view=core.DownloadItem&g2_itemId=6604&g2_serialNumber=1&ext=.png VCPP Compiling main.php?g2_view=core.DownloadItem&g2_itemId=6608&g2_serialNumber=1&ext=.png HowTos HowTo:Compile from SVN main.php?g2_view=core.DownloadItem&g2_itemId=6606&g2_serialNumber=1&ext=.png

Notice: Cygwin is not known to be working with current versions of Vega Strike. It is strongly reccomended that you seek out alternative methods for compiling.

Contents

Compiling SVN module vegastrike under Cygwin

Checkout the SVN-files

Refer to HowTo:Checkout SVN to obtain the vegastrike module.

Before compiling

There are two ways to compile Vega Strike under Cygwin:

  1. In a "pure" Cygwin mode; and
  2. 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

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 --disable-gtk ...........
  • This should not be necessary anymore, but it may solve problems relating to old compilers. (See this thread in the forum)
./configure --with-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
./bootstrap-sh
./configure --with-gl-lib-name=opengl32 --with-glu-lib-name=glu32 --disable-gtk --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 --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
  • your sample goes here

main.php?g2_view=core.DownloadItem&g2_itemId=6604&g2_serialNumber=1&ext=.png VCPP Compiling main.php?g2_view=core.DownloadItem&g2_itemId=6608&g2_serialNumber=1&ext=.png HowTos HowTo:Compile from SVN main.php?g2_view=core.DownloadItem&g2_itemId=6606&g2_serialNumber=1&ext=.png
Personal tools