Skip to content

Commit c4e01e6

Browse files
committed
Add optional OpenSSL build
1 parent ff57255 commit c4e01e6

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ all: libnl iw wpa_supplicant
55
libnl:
66
./build_libnl.sh
77

8+
openssl:
9+
./build_openssl.sh
10+
811
iw:
912
libnl
1013
./build_iw.sh
@@ -14,4 +17,4 @@ wpa_supplicant:
1417
./build_wpas.sh
1518

1619
clean:
17-
rm -rf *.tar.gz *.tar.xz prefix/ binaries/ libnl-3.5.0/ iw-5.8/ wpa_supplicant-2.9/
20+
rm -rf *.tar.gz *.tar.xz prefix/ binaries/ libnl-3.5.0/ openssl-1.1.1g/ iw-5.8/ wpa_supplicant-2.9/

build_openssl.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
set -e
3+
4+
openssl_tgz="openssl-1.1.1g.tar.gz"
5+
openssl_url="https://www.openssl.org/source/$openssl_tgz"
6+
openssl_dir="${openssl_tgz%.tar.gz}"
7+
8+
prefix="`pwd`/prefix"
9+
10+
# fetch source code archive
11+
[ -f "$openssl_tgz" ] || wget $openssl_url
12+
13+
# output directory
14+
[ -d "$prefix" ] || mkdir prefix
15+
16+
# unpack source files
17+
[ -d "$openssl_dir" ] || tar xf "${openssl_tgz}"
18+
19+
# build OpenSSL
20+
if ! [ -f "${prefix}/lib/libcrypto.a" ] ; then
21+
cd $openssl_dir
22+
(
23+
./config --prefix=$prefix no-shared no-stdio no-tests
24+
make -j`nproc --all`
25+
make install
26+
)
27+
fi
28+
29+
echo "OpenSSL library has been compiled"

build_wpas.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if ! [ -f "${wpas_dir}/wpa_supplicant/wpa_supplicant" ] ; then
2323
(
2424
export PKG_CONFIG_PATH="${prefix}/lib/pkgconfig"
2525
make -j`nproc --all` \
26-
LIBS+="-L${prefix}/lib -lnl-genl-3 -lnl-3" \
26+
LIBS+="-L${prefix}/lib -lnl-genl-3 -lnl-3 -lcrypto -lssl" \
2727
LDFLAGS+="-static"
2828
# binaries output directory
2929
[ -d "$binaries" ] || mkdir $binaries

0 commit comments

Comments
 (0)