-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathREADME.windows
134 lines (110 loc) · 4.93 KB
/
README.windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Building for windows.
=====================
The following instructions are for building windows binaries, on a
Linux system. On Ubuntu systems one must install the mingw platform
first (using apt-get install g++-mingw-w64-i686).
This installs several flavors of compilers. We need the posix version
so you will need to switch via ubuntu's alternatives version:
sudo update-alternatives --config i686-w64-mingw32-g++
sudo update-alternatives --config i686-w64-mingw32-gcc
and select /usr/bin/i686-w64-mingw32-g++-posix and /usr/bin/i686-w64-mingw32-gcc-posix
# It is best to maintain a special prefix with static libraries so
# they do not pollute the system.
export PREFIX=/home/scudette/build/mingw/
export CXXFLAGS="-I$PREFIX/include"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig/"
apt-get source zlib1g
cd zlib-1.2.11.dfsg/
make -f win32/Makefile.gcc PREFIX=i686-w64-mingw32-
make -f win32/Makefile.gcc install INCLUDE_PATH=$PREFIX/include LIBRARY_PATH=$PREFIX/lib BINARY_PATH==$PREFIX/bin
cd ..
apt-get source libraptor2-dev
cd raptor2-2.0.14/
./configure --prefix=$PREFIX --enable-static --without-www LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" \
CFLAGS="-DRAPTOR_STATIC" CPPFLAGS="-DRAPTOR_STATIC" \
--host=i686-w64-mingw32 --enable-parsers="turtle ntriples" --enable-serializers="turtle ntriples"
make -j4 install
cd ..
apt-get source libtclap-dev
cd tclap-1.2.2/
./configure --prefix=$PREFIX --enable-static LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" --host=i686-w64-mingw32 \
CXXFLAGS="-static -mnop-fun-dllimport -DPCRE_STATIC"
make -j4 install
cd ..
apt-get source pcre3
cd pcre3-8.39/
./configure --prefix=$PREFIX --enable-static LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" --host=i686-w64-mingw32 \
CFLAGS="-static -mnop-fun-dllimport" --disable-cpp
cp /usr/bin/libtool ./libtool
make -j4 install
cd ..
apt-get source libpcre++-dev
cd libpcre++-0.9.5/
./autogen.sh
# The libtool that comes with it is broken and will cause a crash -
# copy the one from the system.
cp /usr/bin/libtool ./libtool
./configure --prefix=$PREFIX --enable-static LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" --host=i686-w64-mingw32 \
CXXFLAGS="-static -mnop-fun-dllimport -DPCRE_STATIC" --with-pcre-include="$PREFIX/include/"
make -j4 install
cd ..
apt-get source libsnappy-dev
cd snappy-1.1.6/
./configure --prefix=$PREFIX --enable-static LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" --host=i686-w64-mingw32 \
CXXFLAGS="-static -mnop-fun-dllimport -I$PREFIX/include/"
# Unit test will fail to build.
make -j4 install
cd ..
apt-get source liburiparser-dev
cd uriparser-0.8.4/
./configure --prefix=$PREFIX --enable-static LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" --host=i686-w64-mingw32 \
CXXFLAGS="-static -mnop-fun-dllimport -I$PREFIX/include/" --disable-test --disable-doc
# This insists on installing a binary which is not compatible with
# windows. Remove all code from tool/uriparse.c except for main().
make -j4 install
cd ..
# We need the latest yaml-cpp
git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
echo "
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 $PREFIX )
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
" > Toolchain-mingw32.cmake
cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX . -DYAML_CPP_BUILD_TESTS=no
make install -j4
cd ..
wget https://github.com/gabime/spdlog/archive/v0.17.0.tar.gz
tar -xvzf v0.17.0.tar.gz
cd spdlog-0.17.0/
cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX . && make install -j4
cd ..
export LZ4_VERSION=1.8.3
curl -L https://github.com/lz4/lz4/archive/v${LZ4_VERSION}.tar.gz -o lz4-${LZ4_VERSION}.tar.gz
tar xvzf lz4-${LZ4_VERSION}.tar.gz
cd lz4-${LZ4_VERSION}/lib
CC=i686-w64-mingw32-gcc make -j4 install
cd ..
cd aff4
./configure --prefix=$PREFIX --disable-shared --enable-static LDFLAGS="-L$PREFIX/lib -static -static-libstdc++" --host=i686-w64-mingw32 \
CXXFLAGS="-static -mnop-fun-dllimport -I$PREFIX/include/ -DRAPTOR_STATIC" --enable-static-binaries
make -j4 install-strip
cd ..
On very old versions of windows the binary might fail with a message
“unable to find strerror_s in msvcrt.dll”. This is because such old
versions do not contain the function strerror_s, but they do contain
strerror. The easiest way to fix this is to hexedit the import table
of the binary - simply find the string strerror_s and replace the _s
with null bytes. This makes the same binary work fine on older windows
versions.