[MPlayer-cygwin] Re: compile the libs on mingw

Wen-King Su wen-king at myri.com
Fri Jan 7 19:02:10 CET 2005


I have gone through the whole thing except for libregif, which I still
can't get.  I have noted some changes needed in the instructions below.
I did produce an working binary.  Thanks.
								- Wen


> Once finished this should become a howto that will explain the steps necessary to setup the toolchain to compile your own versions of MPlayer on MinGW 
> similar to the one in the packages found at http://www.mplayerhq.hu/MPlayer/releases/win32-beta
> 
> Step 1 Mingw and msys 
> Download the latest versions of MinGW and msys from
> http://www.mingw.org/download.shtml
> 
> The versions used in this document are
> MinGW-3.1.0-1.exe
> MSYS-1.0.10.exe
> 
> Then install MinGW and afterwards msys. 
> 
> Answer
> "Do you wish to continue with the post install? [yn ]"
> and
> "Do you have MinGW installed? [yn ]" 
> with y and give the path to your mingw dir in the next question. (c:/mingw if you did not alter the path during the mingw setup)
> 
> After the installation is finished, open a msys shell (you can find an icon for it on your desktop).
> 
> The following steps assume that you download the packages to your msys home dir, for me that is in c:\msys\home\useranme
> where username is my windows username.
> 
> Step 2 directx headers
> Get the directx header package at
> http://www.mplayerhq.hu/MPlayer/releases/win32-beta/contrib/dx7headers.tgz
> 
> As alternative you can also use the modified wine headers reimar posted to the cygwin list.
> 
> Extract the headers and move them to your mingw inlucde dir (c:\mingw\include)
> To do this use the following commands in your msys shell
> tar -xvvzf dx7headers.tgz
> mv *.h c:/mingw/include
> 
> Note: In this tutorial I install all packages into the mingw tree, it might probably be better to put all extra libraries and headers
> into a seperate directory and pass this directory with the --with-extraincdir and --with-extralibdir switches to configure
> Furthermore I'm using static linking to prevent problems caused by different dll versions. 
> Omitting the --disable-shared from the configure commands will help you to build smaller exes that require the various dlls to be installed. 
> 
> Step 2 ogg and vorbis
> Go to http://www.vorbis.com/download.psp
> Select "Unix / Linux" as operating system
> Then download the libvorbis and libogg .tar.gz sources
> from the Libraries section
> Also get the patch http://mplayerhq.hu/MPlayer/releases/win32-beta/contrib/libogg-mingw32.diff
> 
> extract the archive:
> 
> tar -xvvzf libogg-1.1.tar.gz
> 
> change to the dir containing the sources:
> cd libogg-1.1
> 
> Apply the mingw build patch:
> patch -p0 <../libogg-mingw32.diff
> 
> Then call configure with your mingw install dir as prefix:
> 
> ./configure --prefix=c:/mingw --disable-shared
> 
> compile the sources:
> 
> make
> 
> and install them:
> 
> make install
> 
> afterwards go back to your msys home dir:
> 
> cd
> 
> now install libvorbis in a similar way
> tar -xvvzf libvorbis-1.0.1.tar.gz
> cd libvorbis-1.0.1
> ./configure --prefix=c:/mingw --disable-shared
> make
> make install
> cd
> 
> Step 3 freetype (for osd font rendering)
> First install libiconv from 
> http://www.gnu.org/software/libiconv/
> 
> Get the sources then
> tar -xvvzf libiconv-1.9.1.tar.gz
> cd libiconv-1.9.1
> ./configure --prefix=c:/mingw --disable-shared
> make
> make install
> cd
> 
> Then get the latest freetype2 source package from
> http://sourceforge.net/project/showfiles.php?group_id=3157
> 
> tar -xvvjf freetype-2.1.9.tar.bz2
> cd freetype-2.1.9
> make
> make install
> cd
> 
> Step 4 zlib, libregif, libpng, libjpeg
> zlib is needed for some mov files with compressed headers the others to play/encode png/jpeg/gif files
> 
> Sources are available from:
> http://www.gzip.org/zlib/
> http://armory.nicewarrior.org/projects/libregif/
> http://sourceforge.net/project/showfiles.php?group_id=5624
> http://www.ijg.org/
> 
> tar -xvvzf zlib-1.2.1.tar.gz
> cd zlib-1.2.1.tar

  cd zlib-1.2.1

> ./configure --prefix=c:/mingw
> make
> make install
> cd
> 
> tar -xvvzf libpng-1.2.8-config.tar.gz
> cd libpng-1.2.8-config
> ./configure --prefix=c:/mingw --disable-shared
> make
> make install
> cd
> 
> tar -xvvzf jpegsrc.v6b.tar.gz
> cd jpeg-6b
> ./configure --prefix=/mingw/ --enable-static
> make
> cp .libs/libjpeg.a c:/mingw/lib/
> cp jpeglib.h jconfig.h jmorecfg.h c:/mingw/include/
> cd
> 
> tar -xvvzf libregif-4.1.5.tar.gz
> cd libregif-4.1.5
> ./configure --prefix=c:/mingw
> make
> make install
> cd
> 
> Step 5 lame and xvid
> 
> Get the nasm sources from http://sourceforge.net/project/showfiles.php?group_id=6208
> 
> tar -xvvzf nasm-0.98.38.tar.gz
> cd nasm-0.98.38
> ./configure --prefix=c:/mingw
> make

  mkdir c:/mingw/man/man1

  ** Default mingw/msys install does not produce the man1 directory.

> make install
> cd
> 
> Install lame from http://lame.sourceforge.net/download/download.html
> tar -xvvzf lame-3.96.1.tar.gz
> cd lame-3.96.1
> ./configure --prefix=c:/mingw --disable-shared --disable-decoder

  ./configure --prefix=z:/msys/1.0 --disable-decoder

  ** shared is disabled by default, and enabled by --enable-shared.

> make
> make install
> cd
> 
> Now get http://www.xvid.org/downloads.html
> tar -xvvzf xvidcore-1.0.3.tar.gz
> cd xvidcore-1.0.3/build/generic
> ./configure --prefix=c:/mingw --disable-shared
> make
> make install
> mv c:/mingw/lib/xvidcore.a c:/mingw/lib/libxvidcore.a
> 
> Step 6 live.com rtsp streaming support
> Get the sources
> http://www.live.com/liveMedia/public/
> 
> tar -xvvzf live.2004.12.29.tar.gz       (got some errors from tar here but the build worked nevertheless)
> cd live
> genMakefiles mingw
> make
> 
> 
> Step 7 MPlayer
> For my build I'm using a cvs checkout using cygwin, but cvs snapshots, wincvs or release tarballs should work, too.
> 
> In the cygwin shell
> cd to your msys home dir
> 
> cvs -d:pserver:anonymous at mplayerhq.hu:/cvsroot/mplayer login
> cvs -z3 -d:pserver:anonymous at mplayerhq.hu:/cvsroot/mplayer co -P main
> 
> When asked for a password, just hit enter. A directory named main will be created.
> 
> Now checkout ffmpeg
> cvs -d:pserver:anonymous at mplayerhq.hu:/cvsroot/ffmpeg login
> cvs -z3 -d:pserver:anonymous at mplayerhq.hu:/cvsroot/ffmpeg co -P main

  cvs -z3 -d:pserver:anonymous at mplayerhq.hu:/cvsroot/ffmpeg co -P ffmpeg

> and copy the libavcodec and libavformat dirs from it to the main dir
> cp -R ffmpeg/libavcodec/ ffmpeg/libavformat/ main/
> 
> All the sources should be there now.
> 
> cd main
> ./configure --enable-runtime-cpudetection --with-codecsdir=codecs --enable-static --with-livelibdir=/home/username/live
> (make sure you use the right path for the --with-livelibdir option)
> make
> 
> If everything went well your first mplayer.exe can be found in the main dir now.
> 
> 
> 02.01.2005 Sascha Sommer




More information about the MPlayer-cygwin mailing list