Difference between revisions of "HowTo:Cygwin Compiling"

From VsWiki
Jump to: navigation, search
m (linked 'compiling from cvs' in navbar)
m ([vega-bot] [replace] 4 instances of 'http://vegastrike.sourceforge.net/forums' for 'http://forums.vega-strike.org')
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{NAV_Manual |
 
{{NAV_Manual |
 
| previous=[[HowTo:VCPP Compiling|VCPP Compiling]]
 
| previous=[[HowTo:VCPP Compiling|VCPP Compiling]]
| up=[[HowTo]]
+
| up=[[HowTos]]
| next=[[HowTo:Compile from CVS]]
+
| next=[[HowTo:Compile from SVN on Linux]]
 
}}
 
}}
 +
----
 
{{attention}}
 
{{attention}}
----
+
'''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.'''
= Compiling CVS Module ''vegastrike'' under Cygwin =
+
=Compiling SVN module ''vegastrike'' under Cygwin=
== Checkout the CVS-files ==
+
==Checkout the SVN-files==
  
Refer to [[HowTo:Checkout CVS]] to obtain the ''vegastrike'' module.
+
Refer to [[HowTo:Checkout SVN]] to obtain the ''vegastrike'' module.
  
== Before Compiling ==
+
==Before compiling==
 
There are two ways to compile Vega Strike under Cygwin:
 
There are two ways to compile Vega Strike under Cygwin:
 
# In a "pure" Cygwin mode; and
 
# In a "pure" Cygwin mode; and
Line 27: Line 28:
 
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.
 
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 ==
+
==Preparation==
  
 
(Mainly extracted from CYGWIN.NOTES)
 
(Mainly extracted from CYGWIN.NOTES)
Line 54: Line 55:
 
**download the file ''glext.h'' from one of the locations shown below. Preferable is the one from ''vega-new-proj'' I think.
 
**download the file ''glext.h'' from one of the locations shown below. Preferable is the one from ''vega-new-proj'' I think.
  
=== GL/GLUT ===
+
===GL/GLUT===
 
* Header files (by hellcatv)
 
* Header files (by hellcatv)
 
** [http://vegastrike.sourceforge.net/users/hellcatv/gl.h gl.h]
 
** [http://vegastrike.sourceforge.net/users/hellcatv/gl.h gl.h]
Line 64: Line 65:
 
** or [http://oss.sgi.com/projects/ogl-sample/ABI/glext.h glext.h]
 
** or [http://oss.sgi.com/projects/ogl-sample/ABI/glext.h glext.h]
  
See also [http://vegastrike.sourceforge.net/forums/viewtopic.php?p=4084#4084 this] or [http://vegastrike.sourceforge.net/forums/viewtopic.php?p=8955#8955 this] thread for more information.
+
See also [http://forums.vega-strike.org/viewtopic.php?p=4084#4084 this] or [http://forums.vega-strike.org/viewtopic.php?p=8955#8955 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__)
 
**copy the glext.h to your toplevel __./src__ directory of your vegastrike dir (or to __/usr/include/GL__ ; or to __/usr/include/w32api/GL__)
Line 77: Line 78:
  
 
*if you don't want to compile with gtk just turn it off:
 
*if you don't want to compile with gtk just turn it off:
  ./configure --enable-nogtk ...........
+
  ./configure --disable-gtk ...........
  
*This is necessary for each compiler version. (See [http://vegastrike.sourceforge.net/forums/viewtopic.php?t=1147 this] thread in the forum)
+
*This should not be necessary anymore, but it may solve problems relating to old compilers. (See [http://forums.vega-strike.org/viewtopic.php?t=1147 this] thread in the forum)
  ./configure --enable-boost-128 ...........
+
  ./configure --with-boost=128 ...........
  
 
*You may also need to add path to png lib :
 
*You may also need to add path to png lib :
Line 86: Line 87:
 
  ./configure --with-png-inc=/usr/include/libpng12 ......
 
  ./configure --with-png-inc=/usr/include/libpng12 ......
  
== Compiling ==
+
==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.
 
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
 
  cd ./vegastrike
  aclocal
+
  ./bootstrap-sh
autoheader
+
  ./configure --with-gl-lib-name=opengl32 --with-glu-lib-name=glu32 --disable-gtk --with-data-dir=<DIR>
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
 
  make install
 
  make install
 
----
 
----
= Samples =
+
=Samples=
 
*Surfdargent, sample to compile in mingw mode with libcrypto++, portaudio, openal and even gtk support :
 
*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
+
  ./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
 
  --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
 
  --with-openal-libs=/usr/local/lib --with-al-inc=/usr/local/include
  
*Pontiac: See [http://vegastrike.sourceforge.net/forums/viewtopic.php?p=6727#6727 this post] in the Forum.
+
*Pontiac: See [http://forums.vega-strike.org/viewtopic.php?p=6727#6727 this post] in the Forum.
  
 
* your sample goes here
 
* your sample goes here
 +
 
----
 
----
 
{{NAV_Manual |
 
{{NAV_Manual |
 
| previous=[[HowTo:VCPP Compiling|VCPP Compiling]]
 
| previous=[[HowTo:VCPP Compiling|VCPP Compiling]]
| up=[[HowTo]]
+
| up=[[HowTos]]
| next=[[HowTo:Compile from CVS]]
+
| next=[[HowTo:Compile from SVN on Linux]]
 
}}
 
}}
  
[[Category:HowTo|Cygwin Compiling]]
+
[[Category:HowTos|Cygwin Compiling]]

Latest revision as of 22:29, 8 January 2013

arrow_left.png VCPP Compiling arrow_up.png HowTos HowTo:Compile from SVN on Linux arrow_right.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.

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

arrow_left.png VCPP Compiling arrow_up.png HowTos HowTo:Compile from SVN on Linux arrow_right.png