|
|
|
@ -223,9 +223,18 @@ |
|
|
|
|
% endfor |
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
# Grab prefix header from Github repo |
|
|
|
|
# To avoid symbol conflict with OpenSSL, gRPC needs to rename all the BoringSSL symbols with a |
|
|
|
|
# prefix. This is done with BoringSSL's BORINGSSL_PREFIX mechanism |
|
|
|
|
# (https://github.com/google/boringssl/blob/75148d7abf12bdd1797fec3c5da9a21963703516/BUILDING.md#building-with-prefixed-symbols). |
|
|
|
|
# The required prefix header file boringssl_prefix_symbols.h is not part of BoringSSL repo at |
|
|
|
|
# this moment. It has to be generated by BoringSSL's users and be injected to BoringSSL build. |
|
|
|
|
# gRPC generates this file in script /tools/distrib/upgrade_boringssl_objc.sh. This script |
|
|
|
|
# outputs a gzip+base64 encoded version of boringssl_prefix_symbols.h because of Cocoapods' |
|
|
|
|
# limit on the 'prepare_command' field length. The encoded header is put at |
|
|
|
|
# /src/boringssl/boringssl_prefix_symbols.h.gz.b64. Here we decode the content and inject |
|
|
|
|
# the header to correcty location in BoringSSL. |
|
|
|
|
base64 -D <<EOF | gunzip > include/openssl/boringssl_prefix_symbols.h |
|
|
|
|
% for line in open("src/objective-c/boringssl_prefix_headers/boringssl_prefix_symbols.h.gz.base64", "r").readlines(): |
|
|
|
|
% for line in open("src/boringssl/boringssl_prefix_symbols.h.gz.b64", "r").readlines(): |
|
|
|
|
${line}\ |
|
|
|
|
% endfor |
|
|
|
|
EOF |
|
|
|
@ -234,7 +243,8 @@ |
|
|
|
|
find . -type f \\( -path '*.h' -or -path '*.cc' -or -path '*.c' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/;#include <openssl_grpc/;g' |
|
|
|
|
# BoringSSL include boringssl_prefix_symbols.h without any prefix, which does not match the |
|
|
|
|
|
|
|
|
|
# Xcode import style. We add it here so that Xcode knows where to find it. |
|
|
|
|
# Include of boringssl_prefix_symbols.h does not follow Xcode import style. We add the package |
|
|
|
|
# name here so that Xcode knows where to find it. |
|
|
|
|
find . -type f \\( -path '*.h' -or -path '*.cc' -or -path '*.c' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <boringssl_prefix_symbols.h>;#include <openssl_grpc/boringssl_prefix_symbols.h>;g' |
|
|
|
|
END_OF_COMMAND |
|
|
|
|
end |
|
|
|
|