|
|
|
@ -123,39 +123,39 @@ Pod::Spec.new do |s| |
|
|
|
|
# for public headers and the other for implementation. Each gets its own `header_mappings_dir`, |
|
|
|
|
# making the linter happy. |
|
|
|
|
s.subspec 'Interface' do |ss| |
|
|
|
|
ss.header_mappings_dir = 'include/openssl' |
|
|
|
|
ss.source_files = 'include/openssl/*.h' |
|
|
|
|
ss.header_mappings_dir = 'src/include/openssl' |
|
|
|
|
ss.source_files = 'src/include/openssl/*.h' |
|
|
|
|
end |
|
|
|
|
s.subspec 'Implementation' do |ss| |
|
|
|
|
ss.header_mappings_dir = '.' |
|
|
|
|
ss.source_files = 'ssl/*.{h,c,cc}', |
|
|
|
|
'ssl/**/*.{h,c,cc}', |
|
|
|
|
'crypto/*.{h,c,cc}', |
|
|
|
|
'crypto/**/*.{h,c,cc}', |
|
|
|
|
ss.header_mappings_dir = 'src' |
|
|
|
|
ss.source_files = 'src/ssl/*.{h,c,cc}', |
|
|
|
|
'src/ssl/**/*.{h,c,cc}', |
|
|
|
|
'src/crypto/*.{h,c,cc}', |
|
|
|
|
'src/crypto/**/*.{h,c,cc}', |
|
|
|
|
# We have to include fiat because spake25519 depends on it |
|
|
|
|
'third_party/fiat/*.{h,c,cc}', |
|
|
|
|
'src/third_party/fiat/*.{h,c,cc}', |
|
|
|
|
# Include the err_data.c generated in prepare_command below |
|
|
|
|
'err_data.c' |
|
|
|
|
'src/err_data.c' |
|
|
|
|
|
|
|
|
|
ss.private_header_files = 'ssl/*.h', |
|
|
|
|
'ssl/**/*.h', |
|
|
|
|
'crypto/*.h', |
|
|
|
|
'crypto/**/*.h', |
|
|
|
|
'third_party/fiat/*.h' |
|
|
|
|
ss.private_header_files = 'src/ssl/*.h', |
|
|
|
|
'src/ssl/**/*.h', |
|
|
|
|
'src/crypto/*.h', |
|
|
|
|
'src/crypto/**/*.h', |
|
|
|
|
'src/third_party/fiat/*.h' |
|
|
|
|
# bcm.c includes other source files, creating duplicated symbols. Since it is not used, we |
|
|
|
|
# explicitly exclude it from the pod. |
|
|
|
|
# TODO (mxyan): Work with BoringSSL team to remove this hack. |
|
|
|
|
ss.exclude_files = 'crypto/fipsmodule/bcm.c', |
|
|
|
|
'**/*_test.*', |
|
|
|
|
'**/test_*.*', |
|
|
|
|
'**/test/*.*' |
|
|
|
|
ss.exclude_files = 'src/crypto/fipsmodule/bcm.c', |
|
|
|
|
'src/**/*_test.*', |
|
|
|
|
'src/**/test_*.*', |
|
|
|
|
'src/**/test/*.*' |
|
|
|
|
|
|
|
|
|
ss.dependency "#{s.name}/Interface", version |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
s.prepare_command = <<-END_OF_COMMAND |
|
|
|
|
# Add a module map and an umbrella header |
|
|
|
|
cat > include/openssl/umbrella.h <<EOF |
|
|
|
|
cat > src/include/openssl/umbrella.h <<EOF |
|
|
|
|
#include "ssl.h" |
|
|
|
|
#include "crypto.h" |
|
|
|
|
#include "aes.h" |
|
|
|
@ -195,7 +195,7 @@ Pod::Spec.new do |s| |
|
|
|
|
#include "x509.h" |
|
|
|
|
#include "x509v3.h" |
|
|
|
|
EOF |
|
|
|
|
cat > include/openssl/BoringSSL.modulemap <<EOF |
|
|
|
|
cat > src/include/openssl/BoringSSL.modulemap <<EOF |
|
|
|
|
framework module openssl { |
|
|
|
|
umbrella header "umbrella.h" |
|
|
|
|
textual header "arm_arch.h" |
|
|
|
@ -212,7 +212,7 @@ Pod::Spec.new do |s| |
|
|
|
|
# TODO(jtattermusch): avoid needing to run tools/buildgen/generate_projects.sh twice on update |
|
|
|
|
# TODO(jtattermusch): another pre-generated copy of err_data.c is under third_party/boringssl-with-bazel |
|
|
|
|
# investigate if we could use it. |
|
|
|
|
cat > err_data.c <<EOF |
|
|
|
|
cat > src/err_data.c <<EOF |
|
|
|
|
/* Copyright (c) 2015, Google Inc. |
|
|
|
|
* |
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any |
|
|
|
@ -1628,11 +1628,11 @@ Pod::Spec.new do |s| |
|
|
|
|
# SOME_BORINGSSL_SYMBOL" Such type of redefinition will cause "SOME_BORINGSSL_SYMBOL redefined" |
|
|
|
|
# error when using together with our prefix header. So the workaround in the below lines removes |
|
|
|
|
# all such type of #define directives. |
|
|
|
|
sed -i'.back' '/^#define \\([A-Za-z0-9_]*\\) \\1/d' include/openssl/*.h |
|
|
|
|
sed -i'.back' '/^#define \\([A-Za-z0-9_]*\\) \\1/d' src/include/openssl/*.h |
|
|
|
|
# Remove lines of the format below for the same reason above |
|
|
|
|
# #define SOME_BORINGSSL_SYMBOL \ |
|
|
|
|
# SOME_BORINGSSL_SYMBOL |
|
|
|
|
sed -i'.back' '/^#define.*\\\\$/{N;/^#define \\([A-Za-z0-9_]*\\) *\\\\\\n *\\1/d;}' include/openssl/*.h |
|
|
|
|
sed -i'.back' '/^#define.*\\\\$/{N;/^#define \\([A-Za-z0-9_]*\\) *\\\\\\n *\\1/d;}' src/include/openssl/*.h |
|
|
|
|
|
|
|
|
|
# We are renaming openssl to openssl_grpc so that there is no conflict with openssl if it exists |
|
|
|
|
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' |
|
|
|
|