Wiki page
[compillingOnWindows] by
anonymous
2012-12-17 17:56:20.
D 2012-12-17T17:56:20.215
L compillingOnWindows
P c1b1ba01b67c9598c526db158d36afb3a4756421
U anonymous
W 6952
<h3>Compiling under windows <big>XP</big> with sdk compiler.</h3>
* download [http://www.microsoft.com/downloads/details.aspx?familyid=C17BA869-9671-4330-A63E-1FD44E0E2505&displaylang=en|Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1]. Install and configure.
* download [http://www.openssl.org| openssl source]
* download [http://www.nasm.us/|nasm]
* download [http://strawberryperl.com/|perl]
* install sdk
* install nasm
* install perl
* mkdir c:\msc\extra\lib, c:\msc\extra\include
* unpack ssl source. I assume c:\src\openssl
* open VIA START MENU "SDK..." > cmd shell
* make sure nasm is in the path
* cd into c:\src\openssl
* perl Configure VC-WIN32 --prefix=c:\msc\extra
* ms\do_nasm
* nmake -f ms\nt.mak
* nmake -f ms\nt.mak install
* checkout fossil. assume c:\src\fossil
* cd \src\fossil
* mkdir msc\
* cd msc
* edit ..\win\Makefile.msc to enable SSL and uncomment the SSL LIBS
* nmake -f ..\win\Makefile.msc
<h3>Compiling under windows with Digital Mars C compiler</h3>
* download [http://www.digitalmars.com/download/freecompiler.html|Digital Mars c-ompiler]. unzip to c:\
* download the [http://zlib.net/|zlib source].
* unzip it and compile
* open dosbox
* mkdir c:\DM\extra\lib, c:\DM\extra\include
* copy zlib.lib c:\DM\extra\lib
* copy zlib.h and zconf.h to c:\DM\extra\include
* checkout fossil. assume c:\src\fossil
* cd \src\fossil
* mkdir dmc\
* cd dmc
* c:\DM\bin\make -f ..\win\Makefile.dmc
<h4>Updating windows sdk dmc</h4>
With the advent of fossil having a windows service interface compiling fossil will not work. The simplest option is to replace dm/include/win32/winsvc.h.
The downside is that your headers are from 2 different versions and possible from 2 different sources. I used the files from mingw.org to update the sdk.
The recipe for the upgrade can be found on the digital mars news server.
<h3>Compiling under Wine with Digital Mars C compiler</h3>
* download [http://www.digitalmars.com/download/freecompiler.html|Digital Mars c-ompiler]. unzip to c:\
* download the [http://zlib.net/|zlib source].
* unzip it
* open dosbox "wineconsole cmd"
* compile zlib
* mkdir c:\DM\extra\lib, c:\DM\extra\include
* copy zlib.lib c:\DM\extra\lib
* copy zlib.h and zconf.h to c:\DM\extra\include
* checkout fossil. assume c:\src\fossil
* cd \src\fossil
* mkdir dmc\
* cd dmc
* c:\DM\bin\make -f ..\win\Makefile.dmc
<h3>Compiling under windows with Mingw</h3>
<h4>Installing the tools.</h4>
* download [http://sourceforge.net/projects/mingw/files/|mingw-get-inst-xx.exe]. Install it using the default <strong>c:\MingW</strong>. Make sure you tell the installer to include MSYS by checking the relevant option.
* Either build a user logon script, or change Windows' system PATH so MinGW finds its programs: C:\MinGW\bin;C:\MinGW\MSYS\1.0\bin, and reboot
* If you want <strong>https</strong> support download [http://gnuwin32.sourceforge.net/packages/openssl.htm|openssl] the binary and developer files. Extract to <strong>c:\MingW</strong>
<h4>Getting fossil source code</h4>
Log on as Anonymous, go to the Timeline section, and download the latest development source code. Just unzip the Fossil file anywhere you want (c:\src\fossil is assumed).
<h4>Compiling fossil source code</h4>
* If you want <strong>https</strong> supports
<ul><li>make -f Makefile.w32 FOSSIL_ENABLE_SSL=1 LIB="-lssl -lcrypto -lgdi32 -lmingwex -lz -lws2_32"</li> </ul>
* else, cd c:\src\fossil, and run make -f win/Makefile.mingw. The compiled fossil.exe will be available at the root in c:\src\fossil.
<h3>Compiling under windows with PellesC</h3>
* download and install [http://www.smorgasbordet.com/pellesc/index.htm|PellesC] C-compiler
* download a windows version of gnu-make([http://unxutils.sourceforge.net/])
* download the zlib source and unzip
* checkout fossil
* edit Makefile.PellesCGMake and check paths
* open dosbox
* change directory to fossil project tree
* mkdir PellesC
* cd PellesC
* <i>unxutils-path</i>\make -f ..\win\Makefile.PellesCGMake
This is tested under Windows XP with PellesC 5 and Window 7 with PellesC 6(32 & 64 bit)
<h3>Compiling under linux for windows with Mingw</h3>
This is called cross compiling. I'm using [http://www.archlinux.org/|Arch linux] distribution which
uses the package manager pacman to install packages. If you have a differen linux distribution the packages might be called different. I assume a login name of renez substitute yours were apropiate.
<h4>Installing the tools.</h4>
* Install mingw32-gccs. With Arch linux you do Pacman -S mingw32-gcc (As root!). This will be installed in <strong>/usr/i486-mingw32</strong>
* download [http://gnuwin32.sourceforge.net/packages/zlib.htm|zlib] the binary and developer files.
* If you want <strong>https</strong> support download [http://gnuwin32.sourceforge.net/packages/openssl.htm|openssl] the binary and developer files.
* Extract to <strong>/usr/i486-mingw32</strong> by: su to root
* cd <strong>/usr/i486-mingw32</strong>
* unzip ~renez/Downloads/zlib-1.2.3-bin.zip
* unzip ~renez/Downloads/zlib-1.2.3-lib.zip
* unzip ~renez/Downloads/openssl-0.9.8h-1-bin.zip
* unzip ~renez/Downloads/openssl-0.9.8h-1-lib.zip
* exit root
* download [http://www.fossil-scm.org/download.html|fossil] for linux, and copy fossil to some where in your PATH directories maybe $HOME/bin.
<h4>Getting fossil source code</h4>
* cd ; mkdir fossil; cd fossil
* clone fossil repository. e.g. fossil clone http://www.fossil-scm.org/ myclone.fossil
* mkdir src; cd src
* fossil open ../myclone.fossil
<h4>Compiling fossil source code</h4>
* If you want <strong>https</strong> supports
<ul><li>make -f Makefile.w32 TCC="i486-mingw32-gcc -Os -Wall -DFOSSIL_I18N=0 -L/usr/i486-mingw32/lib -I/usr/i486-mingw32/include -DFOSSIL_ENABLE_SSL=1 LIB="-lssl -lcrypto -lgdi32 -lmingwex -lz -lws2_32"</li> </ul>
* else make -f Makefile.w32 TCC="i486-mingw32-gcc -Os -Wall -DFOSSIL_I18N=0 -L/usr/i486-mingw32/lib -I/usr/i486-mingw32/include "
<h4>Distribution of cross compiled fossil.exe</h4>
Because you have linked against zlib and maybe ssl you need to include from <strong>/usr/i486-mingw32/bin</strong> zlib1.dll and, optional, libssl32.dll (and maybe also libeay32.dll)
<h4>testing the cross compiled fossil.exe</h4>
* copy fossil.exe and the dll's to a windows system. For testing purpose all in one directory. For production use a directory in your PATH
* fossil clone http://www.fossil-scm.org/ http.fossil
* If it has <strong>https</strong> support then fossil clone https://www.fossil-scm.org/ https.fossil
<nowiki>
<pre>
<b>test</b>
</pre>
</nowiki>
Z 96b49ac59d6a9dc9bf48d0edf20c6649