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
|
ekhtml ( http://ekhtml.sourceforge.net/ || Github mirror: https://github.com/hilbix/ekhtml )
0.3.3-pre 2004-06-12 (from Github mirror, hash 0092d9d)
Libgpg-error ( https://gnupg.org/download/ || git://git.gnupg.org/libgpg-error.git )
1.18
Libgcrypt ( https://gnupg.org/download/ || git://git.gnupg.org/libgcrypt.git )
1.6.3
libotr ( https://otr.cypherpunks.ca/ )
4.1.0-dev (hash 03e3cad)
HOW_TO_UPDATE_DEPENDENCIES
in theory, it's possible to use MSYS + MSVC to do the following, but I've used GCC for convenience as my MSVC didn't want to :P
I've used MSYS2 and its own GCC (used 32bit as reference in hope that it will work for 64bit as well)
- ekhtml (clean checkout from Git repo mentioned above)
- run MSYS and navigate to ekhtml root
./autogen.sh
make
- make failed on me, so I had to do ekhtml_mktables myself (make somehow failed to setup include dirs)
cd src
gcc -g -O2 -I../include ekhtml_mktables.c -o ekhtml_mktables
./ekhtml_mktables > ../include/ekhtml_tables.h
- copy .c and .h files from include/ and src/ to our ekhtml
- ekhtml_config.h: see CONVERT_CONFIG_H_FROM_GCC_TO_MSVC
- Libgpg-error (from tarball)
- run MSYS
tar xvf libgpg-error-1.18.tar.bz2
cd libgpg-error-1.18
./configure
make
- copy .c,.h,.def,.rc files from src/ to our Libgpg-error
- copy src/gpg-error-config to our Libgpg-error
since we don't build Libgpg-error but include it directly into Libgcrypt, config.h isn't really needed
- Libgcrypt (from tarball)
- run MSYS from MirOTR directory
tar xvf libgcrypt-1.6.3.tar.bz2
cd libgcrypt-1.6.3
export GPG_ERROR_CONFIG=$(pwd)/../Libgpg-error/gpg-error-config
./configure
- copy .c and .h files from cipher/ to our Libgcrypt
- copy .c and .h files from compat/ to our Libgcrypt
- copy mpi/ and random/ to our Libgcrypt
- copy .c,.h,.def,.m4 and libgcrypt-config from src/ to our Libgcrypt
- cipher/cipher-ccm.c: replace "tmp[blocksize];" with "tmp[16];" as MSVC is quite dumb
- cipher/stribog.c: replace "u64 Z[8] = {};" with "u64 Z[8] = {0};"
- random/rndw32.c: line 891 "DWORD minimumWorkingSetSize, maximumWorkingSetSize;", replace DWORD with proper SIZE_T to fix 64bit problem (patch submitted to Libgcrypt)
- copy config.h to our Libgcrypt custom/
- config.h: see CONVERT_CONFIG_H_FROM_GCC_TO_MSVC
- libotr (from Git hash 03e3cad)
- run MSYS from checked out Git repository inside MirOTR directory (or change relative paths below)
export ACLOCAL_PATH=$ACLOCAL_PATH:$(pwd)/../Libgcrypt/src
export LIBGCRYPT_CONFIG=$(pwd)/../Libgcrypt/src/libgcrypt-config
./bootstrap
./configure --with-pic
- copy files found in our "read/" folder
- copy .c and .h files from src/ to our libotr
- src/message.c: fix C99 at line 472 by declaring "now" before "fragment_and_send()" and assign after its call
- src/instag.c: fix C99 at line 93 by moving "if (!instf) return gcry_error(GPG_ERR_NO_ERROR);" down a bit
- src/proto.c: add snprintf define after last include
#define snprintf _snprintf /* Miranda NG modification */
- copy config.h to our libotr custom/
- config.h: see CONVERT_CONFIG_H_FROM_GCC_TO_MSVC
- if libotr's protocol changed, adapt our version string in MirOTR's otr.h
CONVERT_CONFIG_H_FROM_GCC_TO_MSVC
convert from GCC configured config to MSVC settings
- define disabling ( simply comment them out or replace with /* #undef <define> */ )
// generic
HAVE_INTTYPES_H
HAVE_STRINGS_H
HAVE_UNISTD_H
// needed for Libgcrypt
HAVE_BUILTIN_BSWAP32
HAVE_BUILTIN_BSWAP64
HAVE_CLOCK_GETTIME
HAVE_GCC_ASM_VOLATILE_MEMORY
HAVE_GCC_ATTRIBUTE_ALIGNED
HAVE_GCC_INLINE_ASM_AVX
HAVE_GCC_INLINE_ASM_AVX2
HAVE_GCC_INLINE_ASM_BMI2
HAVE_GCC_INLINE_ASM_PCLMUL
HAVE_GCC_INLINE_ASM_SSSE3
HAVE_GETPAGESIZE
HAVE_GETTIMEOFDAY
HAVE_VLA
- replacing (first line is "find", indented line is "replace by")
/* #undef inline */
#define inline __inline
- see CUSTOM_CONFIG_H_MODIFICATIONS
CUSTOM_CONFIG_H_MODIFICATIONS
we do some Miranda NG / MSVC related modifications to *config.h files
simply append:
/* Miranda NG modifications */
#define GPGRT_ENABLE_ES_MACROS 1
#include <string.h>
#define strdup _strdup
#define stricmp _stricmp
#define snprintf _snprintf
#ifdef _WIN64
# define __x86_64__ 1
#else
# define __i386__ 1
#endif
|