3 # This script runs the OpenSSL Configure script, then processes the resulting
4 # file list into our local OpensslLib.inf and OpensslLibCrypto.inf, and also
5 # takes a copy of opensslconf.h.
7 # This only needs to be done once by a developer when updating to a
8 # new version of OpenSSL (or changing options, etc.). Normal users
9 # do not need to do this, since the results are stored in the EDK2
10 # git repository for them.
12 OPENSSL_PATH
=$
(sed -n '/DEFINE OPENSSL_PATH/{s/.* \(openssl-[0-9.]*[a-z]*\)[[:space:]]*/\1/ p}' OpensslLib.inf
)
13 OPENSSL_CRYPTO_PATH
=$
(sed -n '/DEFINE OPENSSL_PATH/{s/.* \(openssl-[0-9.]*[a-z]*\)[[:space:]]*/\1/ p}' OpensslLibCrypto.inf
)
15 if [ "$OPENSSL_PATH" != "$OPENSSL_CRYPTO_PATH" ]; then
16 echo "OPENSSL_PATH diverges between OpensslLib.inf and OpensslLibCrypto.inf"
20 if ! cd "${OPENSSL_PATH}" ; then
21 echo "Cannot change to OpenSSL directory \"${OPENSSL_PATH}\""
76 echo '1,/# Autogenerated files list starts here/p'
77 echo '/# Autogenerated files list ends here/,$p'
78 echo '/# Autogenerated files list starts here/a\'
86 LIBSRC=$(echo "$LINE" | sed s/^LIBSRC=//)
87 if [ "$RELATIVE_DIRECTORY" != "ssl" ] ||
88 [ "$SSL_SELECT" = "crypto-and-ssl" ]; then
89 for FILE in $LIBSRC; do
90 if [ "$FILE" != "b_print.c" ]; then
91 echo -e ' $
(OPENSSL_PATH
)/'$RELATIVE_DIRECTORY/$FILE\\r\\
101 filelist crypto-and-ssl < "${OPENSSL_PATH}/MINFO" \
102 | sed -n -f - -i OpensslLib.inf
104 filelist crypto-only < "${OPENSSL_PATH}/MINFO" \
105 | sed -n -f - -i OpensslLibCrypto.inf
107 # We can tell Windows users to put this back manually if they can't run
108 # Configure. For now, until the git repository is fixed to store things
109 # sanely, also convert to DOS line-endings
110 unix2dos
-n "${OPENSSL_PATH}/crypto/opensslconf.h" opensslconf.h