-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathbuild-linux-openssl3-i686-w64-mingw32-gcc
More file actions
executable file
·59 lines (51 loc) · 1.81 KB
/
build-linux-openssl3-i686-w64-mingw32-gcc
File metadata and controls
executable file
·59 lines (51 loc) · 1.81 KB
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
#!/bin/sh -eux
# Copyright (c) 2022-2025 Yubico AB. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# SPDX-License-Identifier: BSD-2-Clause
# XXX defining CC and cross-compiling confuses OpenSSL's build.
unset CC
sudo mkdir /fakeroot
sudo chmod 755 /fakeroot
cat << EOF > /tmp/mingw.cmake
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH /fakeroot)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
EOF
# Build and install libcbor.
git clone --depth=1 https://github.com/pjk/libcbor -b v0.14.0
cd libcbor
mkdir build
(cd build && cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/mingw.cmake \
-DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/fakeroot ..)
make -j"$(nproc)" -C build
sudo make -C build install
cd ..
# Build and install OpenSSL 3.5.6.
git clone --branch openssl-3.5.6 \
--depth=1 https://github.com/openssl/openssl
cd openssl
./Configure mingw --prefix=/fakeroot --openssldir=/fakeroot/openssl \
--cross-compile-prefix=i686-w64-mingw32- --libdir=lib
make -j"$(nproc)"
sudo make install_sw
cd ..
# Build and install zlib.
git clone --depth=1 https://github.com/madler/zlib -b v1.3.1
cd zlib
make -fwin32/Makefile.gcc PREFIX=i686-w64-mingw32-
sudo make -fwin32/Makefile.gcc PREFIX=i686-w64-mingw32- DESTDIR=/fakeroot \
INCLUDE_PATH=/include LIBRARY_PATH=/lib BINARY_PATH=/bin install
cd ..
# Build and install libfido2.
export PKG_CONFIG_PATH=/fakeroot/lib/pkgconfig
mkdir build
(cd build && cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/mingw.cmake \
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/fakeroot ..)
make -C build 2>&1
sudo make -C build install