Skip to content

Commit 27c5973

Browse files
committed
New OpenSSL Build Script
Initial commit of a quick attempt at making a build script for OpenSSL. This assumes some things present on my build VM. Appears to work at least on an Ubuntu VM as well as on a Mac as long as mingw is installed. Signed-off-by: Eric F Crist <[email protected]>
1 parent 635e935 commit 27c5973

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

distro/windows/build/build_openssl.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
#
3+
# This script clones, switches to a tag (CLI option)
4+
# then attempts to build openssl binaries
5+
6+
# make a temporary working directory
7+
tempdir=$(mktemp -d)
8+
cd "$tempdir" || exit 1
9+
10+
# clone repo
11+
git clone https://github.com/openssl/openssl.git && cd openssl
12+
13+
# check out the tag from the CLI, if nothing passed, find latest
14+
latest=$(git tag --sort=committerdate --list 'openssl-3.*' | tail -1)
15+
16+
# checkout that tag
17+
git checkout "tags/$latest"
18+
19+
# crosscompile Windows 32
20+
./Configure --cross-compile-prefix=i686-w64-mingw32- mingw
21+
make
22+
23+
# build done, save what we want
24+
mkdir "$tempdir/win32/"
25+
cp libcrypto-3.dll libssl-3.dll apps/openssl.exe "$tempdir/win32"
26+
27+
# clean our source tree
28+
make clean
29+
30+
# build 64-bit version
31+
./Configure --cross-compile-prefix=x86_64-w64-mingw32- mingw64
32+
make
33+
34+
# build done, save what we want
35+
mkdir "$tempdir/win64/"
36+
cp libcrypto-3-x64.dll libssl-3-x64.dll apps/openssl.exe "$tempdir/win64"
37+
38+
# we're done, make the zip file
39+
cd "$tempdir"
40+
zip "$latest.zip" win32/* win64/* && cp "$latest.zip" ~/
41+
42+
# remove temp dir
43+
cd /tmp/
44+
rm -rf "$tempdir"

0 commit comments

Comments
 (0)