4
4
#
5
5
# $ c:\cygwin64\bin\bash build_windows.sh
6
6
#
7
- libxml2_version=" 2.13.5 "
8
- libxslt_version=" 1.1.42 "
9
- openssl_version=" 3.4.1 "
7
+ libxml2_version=" 2.14.3 "
8
+ libxslt_version=" 1.1.43 "
9
+ openssl_version=" 3.5.0 "
10
10
xmlsec_version=" 1.3.8-rc1"
11
11
12
12
pwd=` pwd`
@@ -24,6 +24,13 @@ zip_output_file="${distro_dir}\\xmlsec1-${xmlsec_version}-win64.zip"
24
24
PERL_PATH=" C:\\ Strawberry\\ perl\\ bin"
25
25
LOG_FILE=` cygpath " C:\\ temp\\ build-windows.log" `
26
26
27
+ CMAKE_XMLSEC_BUILDDIR=builddir
28
+ CMAKE_XMLSEC_ARCH=" x64"
29
+ CMAKE_XMLSEC_GENERATOR=" Visual Studio 17 2022"
30
+ CMAKE_XMLSEC_RUNTIME=" MultiThreadedDLL"
31
+ CMAKE_XMLSEC_CONFIG=Release
32
+ CMAKE_XMLSEC_SHARED_LIBS=OFFF
33
+
27
34
function build_libxml2 {
28
35
# check if already built
29
36
full_name=" libxml2-v${libxml2_version} "
@@ -52,14 +59,23 @@ function build_libxml2 {
52
59
tar xvfz " ${full_name} .tar.gz" 2>> " ${LOG_FILE} "
53
60
54
61
echo " *** Configuring \" ${full_name} \" ..."
55
- cd " ${full_name} \win32"
56
- cscript configure.js iconv=no zlib=no cruntime=/MD prefix=" ${libxml2_output_dir} " >> " ${LOG_FILE} "
62
+ cd " ${full_name} "
63
+ cmake -B " ${CMAKE_XMLSEC_BUILDDIR} " -A " ${CMAKE_XMLSEC_ARCH} " -G " ${CMAKE_XMLSEC_GENERATOR} " -D CMAKE_MSVC_RUNTIME_LIBRARY=" ${CMAKE_XMLSEC_RUNTIME} " -D BUILD_SHARED_LIBS=" ${CMAKE_XMLSEC_SHARED_LIBS} " -D CMAKE_PREFIX_PATH=" ${distro_dir} " -D CMAKE_INSTALL_PREFIX=" ${libxml2_output_dir} " -D LIBXML2_WITH_ICONV=OFF -D LIBXML2_WITH_PYTHON=OFF -D LIBXML2_WITH_ZLIB=OFF >> " ${LOG_FILE} "
64
+ if [ $? -ne 0 ]; then
65
+ exit $?
66
+ fi
57
67
58
68
echo " *** Building \" ${full_name} \" ..."
59
- nmake >> " ${LOG_FILE} "
69
+ cmake --build " ${CMAKE_XMLSEC_BUILDDIR} " --config " ${CMAKE_XMLSEC_CONFIG} " >> " ${LOG_FILE} "
70
+ if [ $? -ne 0 ]; then
71
+ exit $?
72
+ fi
60
73
61
74
echo " *** Installing \" ${full_name} \" ..."
62
- nmake install >> " ${LOG_FILE} "
75
+ cmake --install " ${CMAKE_XMLSEC_BUILDDIR} " --config " ${CMAKE_XMLSEC_CONFIG} " >> " ${LOG_FILE} "
76
+ if [ $? -ne 0 ]; then
77
+ exit $?
78
+ fi
63
79
64
80
echo " *** Done with \" ${full_name} \" !!!"
65
81
return 0
@@ -93,14 +109,23 @@ function build_libxslt {
93
109
tar xvfz " ${full_name} .tar.gz" 2>> " ${LOG_FILE} "
94
110
95
111
echo " *** Configuring \" ${full_name} \" ..."
96
- cd " ${full_name} \win32"
97
- cscript configure.js iconv=no zlib=no cruntime=/MD prefix=" ${libxslt_output_dir} " include=" ${libxml2_output_dir} \include\libxml2" lib=" ${libxml2_output_dir} \lib"
112
+ cd " ${full_name} "
113
+ cmake -B " ${CMAKE_XMLSEC_BUILDDIR} " -A " ${CMAKE_XMLSEC_ARCH} " -G " ${CMAKE_XMLSEC_GENERATOR} " -D CMAKE_MSVC_RUNTIME_LIBRARY=" ${CMAKE_XMLSEC_RUNTIME} " -D BUILD_SHARED_LIBS=" ${CMAKE_XMLSEC_SHARED_LIBS} " -D CMAKE_PREFIX_PATH=" ${distro_dir} " -D CMAKE_INSTALL_PREFIX=" ${libxslt_output_dir} " >> " ${LOG_FILE} "
114
+ if [ $? -ne 0 ]; then
115
+ exit $?
116
+ fi
98
117
99
118
echo " *** Building \" ${full_name} \" ..."
100
- nmake >> " ${LOG_FILE} "
119
+ cmake --build " ${CMAKE_XMLSEC_BUILDDIR} " --config " ${CMAKE_XMLSEC_CONFIG} " >> " ${LOG_FILE} "
120
+ if [ $? -ne 0 ]; then
121
+ exit $?
122
+ fi
101
123
102
124
echo " *** Installing \" ${full_name} \" ..."
103
- nmake install >> " ${LOG_FILE} "
125
+ cmake --install " ${CMAKE_XMLSEC_BUILDDIR} " --config " ${CMAKE_XMLSEC_CONFIG} " >> " ${LOG_FILE} "
126
+ if [ $? -ne 0 ]; then
127
+ exit $?
128
+ fi
104
129
105
130
echo " *** Done with \" ${full_name} \" !!!"
106
131
return 0
@@ -139,12 +164,21 @@ function build_openssl {
139
164
cd " ${full_name} "
140
165
perl Configure no-unit-test --prefix=" ${openssl_output_dir} " --release VC-WIN64A
141
166
PATH=" $OLD_PATH "
167
+ if [ $? -ne 0 ]; then
168
+ exit $?
169
+ fi
142
170
143
171
echo " *** Building \" ${full_name} \" ..."
144
172
nmake >> " ${LOG_FILE} "
173
+ if [ $? -ne 0 ]; then
174
+ exit $?
175
+ fi
145
176
146
177
echo " *** Installing \" ${full_name} \" ..."
147
178
nmake install_sw >> " ${LOG_FILE} "
179
+ if [ $? -ne 0 ]; then
180
+ exit $?
181
+ fi
148
182
149
183
echo " *** Done with \" ${full_name} \" !!!"
150
184
return 0
@@ -182,13 +216,21 @@ function build_xmlsec {
182
216
echo " *** Configuring \" ${full_name} \" ..."
183
217
cd " ${full_name_without_rc} \win32"
184
218
cscript configure.js pedantic=yes werror=yes with-dl=yes cruntime=/MD xslt=yes crypto=openssl,mscng unicode=yes prefix=" ${xmlsec_output_dir} " include=" ${libxml2_output_dir} \include;${libxml2_output_dir} \include\libxml2;${libxslt_output_dir} \include;${openssl_output_dir} \include" lib=" ${libxml2_output_dir} \lib;${libxslt_output_dir} \lib;${openssl_output_dir} \lib"
185
-
219
+ if [ $? -ne 0 ]; then
220
+ exit $?
221
+ fi
186
222
187
223
echo " *** Building \" ${full_name} \" ..."
188
224
nmake >> " ${LOG_FILE} "
225
+ if [ $? -ne 0 ]; then
226
+ exit $?
227
+ fi
189
228
190
229
echo " *** Installing \" ${full_name} \" ..."
191
230
nmake install >> " ${LOG_FILE} "
231
+ if [ $? -ne 0 ]; then
232
+ exit $?
233
+ fi
192
234
193
235
echo " *** Done with \" ${full_name} \" !!!"
194
236
return 0
@@ -219,12 +261,36 @@ function create_distro {
219
261
rm " ${LOG_FILE} "
220
262
echo " *** LOG FILE: \" ${LOG_FILE} \" "
221
263
222
- build_libxml2
223
- build_libxslt
224
- build_openssl
225
- build_xmlsec
226
- create_readme
227
- create_distro
264
+ if [ " z$1 " = " zcleanup" ] ; then
265
+ echo " *** CLEANUP ..."
266
+ rm -rf " ${libxml2_output_dir} " " ${libxslt_output_dir} " " ${openssl_output_dir} " " ${xmlsec_output_dir} "
267
+ else
268
+ echo " *** BUILD ..."
269
+ build_libxml2
270
+ if [ $? -ne 0 ]; then
271
+ exit $?
272
+ fi
273
+ build_libxslt
274
+ if [ $? -ne 0 ]; then
275
+ exit $?
276
+ fi
277
+ build_openssl
278
+ if [ $? -ne 0 ]; then
279
+ exit $?
280
+ fi
281
+ build_xmlsec
282
+ if [ $? -ne 0 ]; then
283
+ exit $?
284
+ fi
285
+ create_readme
286
+ if [ $? -ne 0 ]; then
287
+ exit $?
288
+ fi
289
+ create_distro
290
+ if [ $? -ne 0 ]; then
291
+ exit $?
292
+ fi
293
+ fi
228
294
229
295
exit 0
230
296
0 commit comments