MacOSX: Configure curl for MacOSX

Create a new MacOSX configuration for curl:
- Add a curl_config.h created on MacOSX
- Add a find_curl_ca_bundle.sh that searches default folder from Homebrew and MacPorts for a ca bundle.
  To find the files either install OpenSSL from Homebrew or MacPorts, or Curl from MacPorts.
This commit is contained in:
Anders Hasselqvist 2016-01-16 00:12:15 +09:00 committed by KongQun Yang
parent 30bd227162
commit 8ac8190d07
3 changed files with 1073 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
#!/bin/bash -e
# Copyright 2015 Google Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
# Scan ca bundle in its common appearing locations.
paths=('/opt/local/etc/openssl/cert.pem' # macports
'/opt/local/share/curl/curl-ca-bundle.crt' # macports
'/usr/local/etc/openssl/cert.pem' # homebrew
)
for path in "${paths[@]}"; do
if test -f "$path"; then
echo "$path"
exit 0
fi
done
echo 'Failed to locate SSL CA cert.'
exit 1

View File

@ -43,6 +43,20 @@
],
},
}],
['OS == "mac"', {
'sources': [
'config/mac/curl_config.h',
],
'direct_dependent_settings': {
'defines': [
'HAVE_CONFIG_H',
'CURL_CA_BUNDLE="<!(config/mac/find_curl_ca_bundle.sh)"',
],
'include_dirs': [
'config/mac',
],
},
}],
['OS == "win"', {
'direct_dependent_settings': {
'link_settings': {