Windows

From MLDonkey
Revision as of 20:13, 27 March 2010 by Spiralvoice (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

The Windows Installation Howto

Important notes for Windows usage of MLDonkey

Read WindowsSpecificAnnoyances to avoid common problems.

VERY Easy Installation

The newest Stable and Experimental cores are available here.

Download the latest core and extract both files in one directory (in this example: \"c:\program files\mldonkey\"). Then create a shortcut on your desktop that points to run_mldonkey.exe in the folder c:\program files\mldonkey .

MLDonkey has two user interfaces built in, Telnet at port 4000 and a webUI at http://admin@127.0.0.1:4080
A fine GUI for MLDonkey is [Sancho]

Compile your own mlnet.exe

Cygwin Installation (unstable)

I was able to compile mldonkey using cygwin. Make sure you install all necessary development tools during your cygwin setup. You will also need cvs, openssh, and wget. Running MLDonkey�s ./configure is all what you need to do.
However, this makes it dependent on cygwin dll's. Compiling with MinGW produces a real stand-alone binary, this is the prefered way for using MLDonkey on Windows.

MinGW Installation

Install base packages

Install other libraries

tar -xjvf wget-1.9.1-mingwPORT.tar.bz2
cd wget-1.9.1/mingwPORT
cp ./wget.exe /usr/bin
./mingwPORT.sh (answer all question with yes)
MinGW ports default to compile for i686 CPU, if you want to build a i586 version you must change
CFLAGS (-O3 -s -mms-bitfields -march=i686)
for all MinGW ports to
CFLAGS (-O3 -s -mms-bitfields -march=i586)
rm /usr/bin/wget.exe
wget http://mldonkey.sourceforge.net/schlumpf/mingw/file-4.16.tar.gz -O /tmp/file-4.16.tar.gz
use ./mingwPORT.sh like for any other MinGW port
unpack the archive and add "--enable-static" in mingwPORT.configure, line 6 before "--prefix..." before executing ./mingwPORT.sh
make clean GC-static
cp libpthreadGC2.a /mingw/lib/
cp pthread.h sched.h /mingw/include/
Libgd won't find freetype, but as we know that it is installed porperly, we bluntly force it to be detected. To do so, edit the the configure script of libgd and change line 11781 to read:
ac_cv_lib_freetype_FT_Init_FreeType=yes
Now start configure:
PTHREAD_LIBS="-lpthreadGC2 -lwsock32" PTHREAD_CFLAGS="-DPTW32_STATIC_LIB" ./configure --prefix=/mingw

Now that we have Makefile, we can correct it to make it suitable for mingw. In line 233, change the line to read:
DEFS = -DHAVE_CONFIG_H -DBGDWIN32 -UNONDLL
Now patch ./gd-2.0.33/gd.h
--- ./gd.h      Sat Oct 30 12:54:58 2004
+++ ./gd.h Sun Jan 05 17:56:09 2006
@@ -22,9 +22,9 @@
 #ifndef WIN32
 #define NONDLL 1
 #endif /* WIN32 */
-
+#define NONDLL
 #ifdef NONDLL
-#define BGD_DECLARE(rt) extern rt
+#define BGD_DECLARE(rt) extern rt _stdcall
 #else
 #ifdef BGDWIN32
 #define BGD_DECLARE(rt) __declspec(dllexport) rt __stdcall
make all
make install
After installing change C:\Gnu\MinGW\bin\gdlib-config, line 74 to read from
echo -ljpeg -lfreetype -lpng12 -lz  /mingw/lib/libiconv.a
to
echo -ljpeg -lfreetype -lpng12 -lz -liconv
and line 87 from
echo "libs:       -ljpeg -lfreetype -lpng12 -lz  /mingw/lib/libiconv.a"
to
echo "libs:       -ljpeg -lfreetype -lpng12 -lz -liconv"
http://lists.gnupg.org/pipermail/gnupg-devel/2003-December/020650.html
Change the 78th line of bzlib.h to
#if defined(_WIN32) && !defined(__MINGW32__)
Then execute these commands:
make
make install PREFIX=/mingw

Install Ocaml

cd ocaml-3.10.2
patch Ocaml with this patch to get Unicode support and some Windows-related fixes (use -p0 switch for patch command)
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
cp config/Makefile.mingw config/Makefile
replace PREFIX=C:/ocamlmgw with PREFIX=C:/Gnu/ocaml
delete \"labltk\" at line OTHERLIBRARIES
cp /bin/sh.exe /bin/bash.exe
make -f Makefile.nt world
make -f Makefile.nt bootstrap
make -f Makefile.nt opt
make -f Makefile.nt opt.opt
make -f Makefile.nt install

Set paths on MinGW

export PATH=/c/GNU/ocaml/bin:/c/GNU/ocaml/lib:$PATH
export CAMLLIB=/c/GNU/ocaml/lib
export OCAMLLIB=/c/GNU/ocaml/lib
export CAMLP4LIB=/c/GNU/ocaml/lib/camlp4

You can add these commands to c:\Gnu\msys\home\<user>\.profile so they are executed everytime you open MSYS shell.

Build MLDonkey

cd mldonkey
./configure
to compile for i586 use ./configure --host=i586-pc-mingw32
make mlnet.static
strip mlnet.static
mv mlnet.static mlnet.exe

Important note: Compiling MLDonkey will fail on Windows 2000 due to limitations of cmd.exe
Replace it with 4NT or something similar (anybody knows a free alternative?)
Now you are finished, copy mlnet.exe to a directory of your choice and use it


LanguagesEnglish

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox