blob: ef9a3587748c29075a5fe2bf276316720ea23c06 (
plain)
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
|
#!/bin/sh
#
# This script runs the OpenSSL Configure script, then processes the resulting
# file list into our local OpensslLib.inf and OpensslLibCrypto.inf, and also
# takes a copy of opensslconf.h.
#
# This only needs to be done once by a developer when updating to a
# new version of OpenSSL (or changing options, etc.). Normal users
# do not need to do this, since the results are stored in the EDK2
# git repository for them.
OPENSSL_PATH=$(sed -n '/DEFINE OPENSSL_PATH/{s/.* \(openssl\(-[0-9.]*[a-z]*\)*\)[[:space:]]*/\1/ p}' OpensslLib.inf)
OPENSSL_CRYPTO_PATH=$(sed -n '/DEFINE OPENSSL_PATH/{s/.* \(openssl\(-[0-9.]*[a-z]*\)*\)[[:space:]]*/\1/ p}' OpensslLibCrypto.inf)
if [ "$OPENSSL_PATH" != "$OPENSSL_CRYPTO_PATH" ]; then
echo "OPENSSL_PATH diverges between OpensslLib.inf and OpensslLibCrypto.inf"
exit 1
fi
if ! cd "${OPENSSL_PATH}" ; then
echo "Cannot change to OpenSSL directory \"${OPENSSL_PATH}\""
exit 1
fi
# no-engines \
# no-fp-api \
# no-jpake \
# no-krb5 \
# no-locking \
# no-rcs \
# no-ripemd \
# no-sct \
# no-sha0 \
./Configure UEFI \
no-asm \
no-bf \
no-camellia \
no-capieng \
no-cast \
no-cms \
no-deprecated \
no-dgram \
no-dsa \
no-dynamic-engine \
no-ec \
no-ecdh \
no-ecdsa \
no-engine \
no-err \
no-filenames \
no-hw \
no-idea \
no-mdc2 \
no-posix-io \
no-rc2 \
no-rfc3779 \
no-scrypt \
no-seed \
no-sock \
no-srp \
no-ssl \
no-stdio \
no-threads \
no-ts \
no-ui \
no-whirlpool \
|| exit 1
make files
cd -
function filelist ()
{
SSL_SELECT="$1"
echo '1,/# Autogenerated files list starts here/p'
echo '/# Autogenerated files list ends here/,$p'
echo '/# Autogenerated files list starts here/a\'
while read LINE; do
case "$LINE" in
RELATIVE_DIRECTORY=*)
eval "$LINE"
;;
LIBSRC=*)
LIBSRC=$(echo "$LINE" | sed s/^LIBSRC=//)
if [ "$RELATIVE_DIRECTORY" != "ssl" ] ||
[ "$SSL_SELECT" = "crypto-and-ssl" ]; then
for FILE in $LIBSRC; do
if [ "$FILE" != "b_print.c" ]; then
echo -e ' $(OPENSSL_PATH)/'$RELATIVE_DIRECTORY/$FILE\\r\\
fi
done
fi
;;
esac
done
echo -e \\r
}
filelist crypto-and-ssl < "${OPENSSL_PATH}/MINFO" \
| sed -n -f - -i OpensslLib.inf
filelist crypto-only < "${OPENSSL_PATH}/MINFO" \
| sed -n -f - -i OpensslLibCrypto.inf
# We can tell Windows users to put this back manually if they can't run
# Configure. For now, until the git repository is fixed to store things
# sanely, also convert to DOS line-endings
unix2dos -n "${OPENSSL_PATH}/crypto/opensslconf.h" opensslconf.h
|