Table of Contents

Compile on Windows with SSL support

Tested with:

Fossil versionzlib version usedopenssl version usedGCC version used
1.221.2.71.0.1c4.5.2
1.231.2.71.0.1c4.5.2
1.241.2.71.0.1d4.5.2
1.301.2.8 (included with fossil)1.0.24.9.2 (TDM-GCC 4.9.2-3)

Create the compile environment

Tested with 1.30.

  1. Install TDM-GCC and choose “MinGW/TDM (32-bit)”. Install to C:\TDM-GCC-32.
  2. Install MSYS 1.0.11 to C:\msys\.
  3. Open the MSYS fstab file (C:\msys\1.0\etc\fstab) and add:
    C:/TDM-GCC-32 /mingw
  4. Download perl-5.8.8-1-msys-1.0.17-bin.tar.lzma and extract to the MSYS directory (C:\msys\1.0\). Required for compiling OpenSSL.
  5. Download libcrypt-1.1_1-3-msys-1.0.13-dll-0.tar.lzma and extract to the MSYS directory (C:\msys\1.0\). Required for compiling OpenSSL.
  6. Start MSYS.

Tested with 1.22 to 1.24.

  1. Install MinGW with mingw-get-inst.
  2. Install msys-perl:
    mingw-get install msys-perl

Get the Fossil source

  1. Download the latest fossil-src-*.tar.gz source tarball from the Fossil download page.
  2. Use 7-zip to extract the fossil-src-*.tar.gz to the home dir in MSYS (C:\msys\1.0\home\user\).

zlib

:!: Downloading and compiling zlib is not necessary for fossil > 1.24! :!:

Go to the zlib website and get the latest zlib-x.x.x.tar.gz.
Extract to root of fossil source dir.

cd zlib-x.x.x
make -f win32/Makefile.gcc

openssl

Go to the OpenSSL website and get the latest OpenSSL.
Tested with 1.30: Extract to the compat directory in the fossil source dir.
Tested with 1.22 to 1.24: Extract to root of the fossil source dir.

cd openssl-x.x.x.x
./config
make

The compile won't complete fully and complain about:

md2test.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
make[1]: ** [md2test.o] Error 1

Which can be ignored.

fossil

Open win/Makefile.mingw

Change:

# FOSSIL_ENABLE_SSL = 1

To:

FOSSIL_ENABLE_SSL = 1

:!: Changing the zlib line is not necessary for fossil > 1.24! :!:

Find and change the ZINCDIR line to point to the correct zlib directory. For example, change:

ZINCDIR = $(SRCDIR)/../zlib-1.2.6

ZLIBDIR = $(SRCDIR)/../zlib-1.2.6

To point to 1.2.7 instead:

ZINCDIR = $(SRCDIR)/../zlib-1.2.7

ZLIBDIR = $(SRCDIR)/../zlib-1.2.7

Find and change the OPENSSLINCDIR to point to the correct openssl directory.

For example, change:

OPENSSLINCDIR = $(SRCDIR)/../openssl-1.0.0g/include

OPENSSLLIBDIR = $(SRCDIR)/../openssl-1.0.0g

To point to 1.0.1c instead:

OPENSSLINCDIR = $(SRCDIR)/../openssl-1.0.1c/include

OPENSSLLIBDIR = $(SRCDIR)/../openssl-1.0.1c

Compile:

make -f win/Makefile.mingw

Afterwards you can find fossil.exe (around 3 MB) in the root of the sourcetree.