Building on Windows

From Gnash Project Wiki

Jump to: navigation, search

This page is yet to be written. For the moment, try reading the article from the link below then continue with the drafted how-to.


Contents

Building on Windows (Draft)

by Mj Mendoza IV

About this draft

NOTE: This is a Work-In-Progress How-to

Sorry for using this wiki to log my gnash hacking. I do forget a lot and writing a good article for this topic could take a while.

But what the heck are wikis for? ;-)

Intro

This build configuration won't need AGG, FLTK, GStreamer, and NSPR.

Make sure you already have a working MinGW+MSYS installed. Download the latest MSYS bash (v3.1.17-4 or later), and MSYS coreutils (v5.97-3 or later).

Updating MSYS will require latest DLLs of MSYS regex (v1.20090805-2 or later), MSYS termcap (v0.20050421_1-2 or later), MSYS intl (v0.17-2-dll-8 or later), and MSYS libiconv (v1.13.1-2-dll-2 or later).

Consider this as Part II of the article above and, partly, a revision.

Installation of Recommended Packages

The packages listed here are either optional or indirect required packages to compile Gnash's required packages. Now that just sounded a little confusing. :P

Again, take it this way: The packages listed here will help your MinGW+MSYS installation to compile just about any other software that uses GNU GCC as its main toolchain.

Bison/YACC

Used for compiling Ming (not MinGW). Download the pre-compiled Bison from MinGW's SourceForge page.

Extract it at C:\msys\1.0\{here}

Flex

Nope. Not Adobe Flex.

Used for compiling Ming (again, not MinGW). Download the pre-compiled Flex from MinGW's SourceForge page.

Extract it at C:\msys\1.0\{here}

GetText

Used for translations. Download the pre-compiled GetText from MinGW's SourceForge page.

Extract it at C:\msys\1.0\{here}

libTool

Used for writing makefiles. Download the pre-compiled libTool from MinGW's SourceForge page.

Extract it at C:\msys\1.0\{here}

ZLib

ZLib is required to compile PNG. Do download the zipped ZLIB source code from ZLib.net.

Extract it at C:\msys\1.0\home\user\{here}

Open MSYS and type-in:

* cd ~/zlib-1.2.3
* configure

Place headers to C:\mingw\include\{here}

  • zlib.h
  • zconf.h

Place library to C:\mingw\lib\{here}

  • libz.a

Installation of Required Packages

Boost

Download Boost and extract it at C:\{here} so it will be C:\boost_1_42_0

Open a Command Prompt (not MSYS), then type in:

* cd c:\boost_1_42_0\tools\jam
* build_dist.bat

Wait for an error -- yes, an error, if you downloaded 1.42.0 like I did.

You will notice that you are now inside C:\boost_1_42_0\tools\jam\src. Continue, type:

* build mingw
* copy /Y bin.ntx86\bjam.exe ..\..\..\
* cd ..\..\..\
* bjam toolset=gcc libs\thread\build\
* bjam toolset=gcc libs\date_time\build\
* bjam toolset=gcc libs\serialization\build\
* bjam toolset=gcc --with-thread stage
* bjam toolset=gcc --with-date_time stage
* bjam toolset=gcc --with-serialization stage

You should now have the following files under C:\boost_1_42_0\stage\lib

  • libboost_date_time-mgw34-mt-1_42.lib
  • libboost_date_time-mgw34-mt.lib
  • libboost_date_time-mgw34-mt-d-1_42.lib
  • libboost_date_time-mgw34-mt-d.lib
  • libboost_serialization-mgw34-mt-1_42.lib
  • libboost_serialization-mgw34-mt.lib
  • libboost_serialization-mgw34-mt-d-1_42.lib
  • libboost_serialization-mgw34-mt-d.lib
  • libboost_thread-mgw34-mt-1_42.lib
  • libboost_thread-mgw34-mt.lib
  • libboost_thread-mgw34-mt-d-1_42.lib
  • libboost_thread-mgw34-mt-d.lib

CURL

Download the bzipped CURL source code for Windows from CURL.Haxx.se. I downloaded curl-7.20.0.tar.bz2.

Extract it at C:\msys\1.0\home\user\{here}

Open MSYS and type-in:

* cd ~/curl-7.20.0
* make
* make install

FFMPEG

  • Download FFMPEG instead of GStreamer.

GTK

Download GTK+ instead of FLTK.

Image File Format

GIF

Download the bzipped GIF source code from GIFLib's SourceForge page.

Compile GIF

  • Place headers to C:\msys\1.0\local\include\{here}
    • gif_lib.h
  • Place library to C:\msys\1.0\local\lib\{here}
    • libgif.a
    • libgif.la
    • libgif.lai
JPEG

Download the zipped JPEG source code for Windows from IJG.org instead from gnuWin32.

Open MSYS and compile JPEG

cd ~/jpeg-8a
configure
make
make install
PNG

Download the zipped PNG source code from libPNG's SourceForge page instead from gnuWin32.

Compile PNG

  • Place headers to C:\msys\1.0\local\include\{here}
    • ...
  • Place library to C:\msys\1.0\local\lib\{here}
    • ...

SDL

Download the gzipped SDL source code for Windows+MinGW from libSDL. You need the SDL-devel-1.2.14-mingw32.tar.gz.

Extract it at C:\msys\1.0\home\user\{here}

Open MSYS and type-in:

* cd ~/SDL-1.2.14
* make native

Gnash

Download Gnash 0.8.7 and extract it to C:\msys\1.0\home\user\{here} so it will be C:\msys\1.0\home\user\gnash-0.8.7

Compiling

Few Patching

This contains few patches to finally compile Gnash on Windows.

GnashImageJpeg.cpp:59: error: `jpeg_boolean' does not name a type

Open ~/gnash-0.8.7/libbase/GnashImageJpeg.cpp then go to line 58 where it states:

#ifdef _WIN32
typedef jpeg_boolean jpeg_bool_t;
#else
typedef jpeg::boolean jpeg_bool_t;
#endif

Change it to:

//#ifdef _WIN32
//typedef jpeg_boolean jpeg_bool_t;
//#else
typedef jpeg::boolean jpeg_bool_t;
//#endif
GnashSystemNetHeaders.h:40:24: arpa/inet.h: No such file or directory

Open ~/gnash-0.8.7/libbase/GnashSystemNetHeaders.h then go to line 29 just below these lines:

#ifndef GNASH_NET_HEADERS_H
#define GNASH_NET_HEADERS_H

Add below it to look like:

#ifndef GNASH_NET_HEADERS_H
#define GNASH_NET_HEADERS_H
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
#endif
network.cpp:1616: error: `ioctlSocket' was not declared in this scope

NOTE: Still working on properly fixing it. See Talk page.

But rsavoye said that it is only used by Cygnal. So for now, open /libnet/network.cpp and find line 1616, where it states.

#ifndef _WIN32
		ioctl(fd, FIONREAD, &bytes);
#else
		ioctlSocket(fd, FIONREAD, &bytes);
#endif

Comment it out:

#ifndef _WIN32
		ioctl(fd, FIONREAD, &bytes);
#else
		//ioctlSocket(fd, FIONREAD, &bytes);
#endif
ffmpeg/AudioDecoderFfmpeg.cpp:544: error: `avcodec_decode_audio' was not declared in this scope

Still working on it. See Talk page. open ./libmedia/ffmpeg/AudioDecoderFfmpeg.cpp

#ifdef FFMPEG_AUDIO2
# define AVCODEC_DECODE_AUDIO avcodec_decode_audio2
#else
# define AVCODEC_DECODE_AUDIO avcodec_decode_audio
#endif	

Comment it out:

//#ifdef FFMPEG_AUDIO2
# define AVCODEC_DECODE_AUDIO avcodec_decode_audio2
//#else
//# define AVCODEC_DECODE_AUDIO avcodec_decode_audio
//#endif


All Set, Patched and Ready!

Now, on to compiling. Run MSYS and type:

cd ~/gnash-0.8.7
autogen.sh
configure --enable-renderer=cairo --enable-media=ffmpeg --enable-gui=gtk --disable-npapi --disable-plugins --with-boost-incl=/c/boost_1_42_0 --with-boost-lib=/c/boost_1_42_0/stage/lib
make

Troubleshooting

PNG.H not found

Copy from C:\msys\1.0\include\{file-listed} to C:\msys\1.0\local\include\

  • png.h
  • pngconf.h

Copy from C:\msys\1.0\lib\{file-listed} to C:\msys\1.0\local\lib\

  • libpng14-14.dll
  • libpng14.a
  • libpng14.dll.a
  • libpng14.la
  • libpng14.lai
  • libpng.def
  • libpng.lib

If you are still having problem with PNG.H not being found, try to place a copy on your MinGW installation too. Copy from C:\msys\1.0\include\{file-listed} to C:\mingw\include\

  • png.h
  • pngconf.h

Copy from C:\msys\1.0\lib\{file-listed} to C:\mingw\lib\

  • libpng14-14.dll
  • libpng14.a
  • libpng14.dll.a
  • libpng14.la
  • libpng14.lai
  • libpng.def
  • libpng.lib

ZLIB.H not found

Copy from C:\msys\1.0\include\{file-listed} to C:\msys\1.0\local\include\

  • zlib.h
  • zconf.h

Copy from C:\msys\1.0\lib\{file-listed} to C:\msys\1.0\local\lib\

  • libz.a
  • libz.dll.a