From a24e8ab569599c0ed5782211383a23b85e3ad45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 3 Feb 2005 19:40:14 +0000 Subject: **BUGFIX** Documentation about Win32 platform. Do we attract more developers? :-) (marked as bugfix, because it belongs to stable branch too) CVS patchset: 7380 CVS date: 2005/02/03 19:40:14 --- doc/Makefile.am | 3 +- doc/README.MINGWCROSS | 198 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/README.WIN32 | 147 +++++++++++++++++++++++++++++++++++++ doc/faq/faq.sgml | 10 +++ 4 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 doc/README.MINGWCROSS create mode 100644 doc/README.WIN32 (limited to 'doc') diff --git a/doc/Makefile.am b/doc/Makefile.am index 09b84aa0d..af97e86b2 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -4,7 +4,8 @@ SUBDIRS = man hackersguide faq docs_DATA = README README.dvb README.dxr3 \ README.freebsd README.irix README.network_dvd README.opengl \ - README.solaris README.syncfb README_xxmc.html + README.solaris README.syncfb README_xxmc.html README.MINGWCROSS \ + README.WIN32 EXTRA_DIST = $(docs_DATA) diff --git a/doc/README.MINGWCROSS b/doc/README.MINGWCROSS new file mode 100644 index 000000000..b23e61c1c --- /dev/null +++ b/doc/README.MINGWCROSS @@ -0,0 +1,198 @@ +Introduction +------------ + +MinGW is short for the Minimalist GNU Windows. It's package which allows you +to use GCC and other GNU tools to compile native windows programs. + +In this case "native" means programs which don't require extra DLLs like +cygwin DLL. Mingw32 programs use DLLs supplied with all current Win32 +platforms. Thus the programs are light weight and easy to distribute. + + +This document describes by shell commands how to compile and install MinGW +cross development tools on Unix host and how to use it for building windows +version of xine. + + +Download +-------- + + MinGW packages: + + http://mingw.org/download.shtml + + 1) binutils (sources) + 2) gcc-core, gcc-c++ (sources) + 3) w32api, mingw-runtime (binaries and sources) + + DirectX headers (tested with version 7): + + http://www.google.com/search?hl=cs&q=win32-dx7headers.tgz + http://www.google.com/search?q=dx7adxf.exe + + +Build +----- + +In following text are used symbols PREFIX and USER with this meaning: + + PREFIX .... directory of the mingw cross environtment + USER ...... current user + + +1. compile binutils + + tar xzf binutils-2.13.90-20030111-1-src.tar.gz + mkdir bin + cd bin + ../binutils-2.13.90-20030111-1-src/configure \ + --target=i386-mingw32 \ + --prefix=PREFIX + make + su + make install + exit + + +2. add PREFIX/bin into PATH + + ... + + +3. compile compiler (gcc-core, gcc-c++) + + # + # it's always good doing things under unprivileged user, + # this commands ensure write permission to target + # + su + chmod g+w PREFIX{/lib,/i386-mingw32{/,/lib}} + chown root:USER PREFIX{/lib,/i386-mingw32{/,/lib}} + exit + + # + # prepare runtime environment from binaries + # + mkdir runtime + cd runtime + tar xzf ../w32api-2.5.tar.gz + tar xzf ../mingw-runtime-3.3.tar.gz + cd .. + + # + # compile and install the compiler + # + # if you'll want rerun this step, I recommend delete + # PREFIX/i386-mingw32/sys-include + # + tar xzf gcc-core-3.3.1-20030804-1-src.tar.gz + tar xzf gcc-g++-3.3.1-20030804-1-src.tar.gz + mkdir gcc-bin + cd gcc-bin + ../gcc-3.3.1-20030804-1/configure \ + --disable-shared \ + --enable-static \ + --target=i386-mingw32 \ + --with-headers=../runtime/include \ + --with-libs=../runtime/lib \ + --prefix=PREFIX + make + su + make install + exit + + # + # set the permissions back + # + su + chmod -R g-w PREFIX + chown -R root:root PREFIX + exit + + +4. recompile w32api and mingw-runtime from sources (optional) + + # + # installing must be into PREFIX/i386-mingw32 + # + tar xzf w32api-2.5-src.tar.gz + cd w32api-2.5 + ./configure --prefix=PREFIX/i386-mingw32 --host=i386-mingw32 + make + su + make install + exit + + # + # installing must be into PREFIX/i386-mingw32 + # + tar xzf mingw-runtime-3.3-src.tar.gz + cd mingw-runtime-3.3 + # copying w32api headers into ./include (because of a bug in runtime + # package) + ... + # compiling + CC=i386-mingw32-gcc \ + DLLTOOL=i386-mingw32-dlltool \ + AR=i386-mingw32-ar \ + AS=i386-mingw32-as \ + RANLIB=i386-mingw32-ranlib \ + ./configure --prefix=PREFIX/i386-mingw32 --target=i386-mingw32 + make + su + make install + exit + + +5. install DirectX headers and other libraries + su + cd PREFIX/include + # untar dx7headers.tar.gz + ... + exit + + +Using MinGW cross development tools +----------------------------------- + +We can build xine library for Windows by this way: + + # + # configure for mingw cross compiling + # (the build option is needed only for forcing cross compilation mode) + # + ./configure \ + --host=i386-mingw32 \ + --build=i686-debian-linux \ + --disable-freetype \ + --disable-vcd \ + --with-dxheaders=/mingw32/include/dx7headers + + # + # build system isn't fully prepared for cross compiling, so it's needed + # manually or by patch disable plugins in Makefiles depending on wrongly + # detected libraries + # + ... + + # + # compile + # + make + + # + # install + # + make install DESTDIR=/tmp/xine-lib-mingwcross + rm /tmp/xine-lib-mingwcross/bin/plugins{/,/post}/*.a + + # + # if we want to use xine library in M$ compilers, we will need some tools from + # M$ Visual C: LIB.EXE, LINK.EXE, MSPDB60.DLL and wine + # + # create libxine-1.lib file + # + cd /lib + cp ../bin/libxine-1.dll . + wine LIB.EXE /machine:i386 /def:libxine-1.def + rm libxine-1.dll diff --git a/doc/README.WIN32 b/doc/README.WIN32 new file mode 100644 index 000000000..3a722897e --- /dev/null +++ b/doc/README.WIN32 @@ -0,0 +1,147 @@ +Introduction +------------ + +This document describes how to build xine library under Windows. + + +Download +-------- +Checkout source code from CVS (under Windows can be used CygWin or another tool). You will need 'xine-lib' (the library) and 'xine-win32' (testing Windows frontend). + + +Build +----- + +There are three different ports on Windows: + 1) MinGW (the simplest and recommended) + 1) CygWin + 3) M$ Visual C, or maybe .NET (recommended for debugging) + + +1. MinGW port +------------- +This is the best way. Final library is 100% native Windows with all optimizations. + +Also you can use cross-build from comfortable unix-like system. See README.MINGWCROSS for more information. + +Requirements for compilation under Windows: + a) MinGW installed on Windows + b) LIB.EXE, LINK.EXE and MSPDB60.DLL from M$ Visual C + (necessary only for usability created xine library by M$ compilers) + +How to build: + # + # configure for building in MinGW under Windows + # + ./configure --with-dxheaders=DIRECTORY + + # + # compile + # + make + + # + # install and manually remove the static plugins + # + make install DESTDIR=/tmp/xine-lib + rm /tmp/xine-lib/bin/plugins/*.a + rm /tmp/xine-lib/bin/plugins/post/*.a + +Prepare xine library for using in M$ compilers too: + # run terminal window (MinGW for example) + ... + # creating libxine-1.lib file + cd /lib + cp ../bin/libxine-1.dll . + /VC98/BIN/LIB.EXE /machine:i386 /def:libxine-1.def + rm libxine-1.dll + + +2. CygWin port +-------------- +This is the second way. Created library won't be 100% windows native: it will contains some additional emulation code and I'm not sure, if can be used with M$ compilers. + +It's possible to use CygWin for cross-compiling with MinGW. + +How to build: + # + # configure + # + ./configure --with-dxheaders=DIRECTORY + + # + # compile + # + make + + # + # install + # + make install DESTDIR=/tmp/xine-lib + + +3. M$ Visual C port +------------------- +This build system is different from the one, used for all other platforms, but we partially keep it up to date - just for experimental reasons, but only if we have access to some M$ computer. + +Reasons, why not to use this port: + - can't compile included ffmpeg (important multi-decoder in xine) + - can't compile new assembler code (it means degradation of power) + - never 100% up to date + - somebody must buy the OS and compiler + +Reasons, why to use this port: + - obtaining backtrace after crash, debugging + +How to build xine in M$ Visual C: + - Set up MSVC to look for DirectX headers. + + - Open up the xine.dsw workspace/project in MSVC. + + - Unless you have a project file to build css you must select Cancel when prompted for the libdvdcss.dsp file. + + - Click on the FileView tab. + + - Build the following projects in this order: + libxinesuppt + libxine + libdvdnav + + - Next build any desired plugins (decoders/demuxers ...). The ao_out_directx and vo_out_directx are required for Win32. There is an option to use the vo_out_sdl but a sdl.dll must be present for that to take place. There have also been some issues observed with the directX video driver on some machines. + + - If you want ffmpeg decoder plugin, you must use precompiled version. If you want to compile it, you should have the files LIB.EXE, LINK.EXE and MSPDB60.DLL from the Visual C++. + Under MinGW you can compile ffmpeg for xine by this way: + + # + # for cross-compiling add "--cross-prefix=i386-mingw32-" and "--disable-mmx" + # + ./configure \ + --enable-gpl \ + --enable-pp \ + --enable-shared \ + --disable-zlib \ + --enable-mingw32 + make + make install prefix=/tmp/ffmpeg + cp avcodec/avcodec.def /tmp/ffmpeg + # + # for cross-compiling finalize linking by running this command + # + wine LIB.EXE /machine:i386 /def:avcodec.def + +Status +------ + +There remains many of work yet on Windows port. + +Limitations: + - doesn't work under Win95/98 (DirectX? win32-pthreads?) + - file > 1GB doesn't work (MinGW problem?) + - missing full Win32 frontend + - build system isn't fully tuned for cross-compiling + +Bugs: + - use GetCurrentDirectory(SIZE, STR) because of changing volume drive! + - random crashes + - seeking doesn't work with testing frontend + - non-seekable input plugins crash diff --git a/doc/faq/faq.sgml b/doc/faq/faq.sgml index d98504635..273aa305e 100644 --- a/doc/faq/faq.sgml +++ b/doc/faq/faq.sgml @@ -422,6 +422,16 @@ + + How to compile xine for Windows? + + For compiling xine under MinGW, CygWin or MS Visual C see README.WIN32. + + + For cross-compiling xine under MinGW from comfortable unix-like environment see README.MINGWCROSS. + + + -- cgit v1.2.3