我在Mac OSX 10.12.6版上构建libcurl
时遇到了一些严重问题。在32位支持和自定义OpenSSL版本的MacOSX上构建libcurl
我需要一个具有32位体系结构支持的特定版本的静态库(7.40.0),它与特定版本的OpenSSL(1.0.2c)链接。
我发现在官方网站的源代码,并跑了这在我看来,正确的参数配置脚本:
curl-7.40.0> CPPFLAGS="-I/Users/me/Documents/Projects/3rdparty/openssl/MacOSX/openssl-1.0.2c/include/"
LDFLAGS="-L/Users/Documents/Projects/3rdparty/openssl/MacOSX/openssl-1.0.2c/"
./configure --disable-shared --build=i386-darwin --with-ssl
其中:
CPPFLAGS
声明OpenSSL的文件夹头;LDFLAGS
指定OpenSSL库的文件夹(libssl.a
,libcrypto.a
);--disable-shared
禁用动态库的构建(没有libcurl.dylib
输出);--build=i386-darwin
为Apple 32位目标体系结构配置构建;--with-ssl
启用SSL选项。
然而,这一呼吁有两个原因失败:
- 在配置输出看,我读了“
host system type
”设置为i386-darwin
,作为目标。我可以通过指定--host=x86_64-darwin
来解决这个问题; 我得到的SSL实际上是没有启用:
configure: WARNING: SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more. configure: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.
我当然可以通过指定--with-darwinssl
解决这个问题,但是当我做,我得到以下警告:
ld: warning: directory not found for option '-L/Users/me/Documents/Projects/3rdparty/openssl/MacOSX/openssl-1.0.2c'
我试图链接的OpenSSL库被忽略。
最后,如果我尝试删除CFLAGS
和LDFLAGS
的SSL(只是为了看看最简单的通话作品):
./configure --build=i386-darwin --disable-shared --with-darwinssl
当我这样做时,configure
和make
脚本有好下场的。如果我尝试包括在示例源代码curl
标题:
#import <Foundation/Foundation.h>
#include "curl/curl.h"
,并指定了XCode头搜索路径curl-7.40.0/include
目录,我得到的语义问题:
curl-7.40.0/include/curl/curlrules.h:143:6: '__curl_rule_01__' declared as an array with a negative size
curl-7.40.0/include/curl/curlrules.h:153:6: '__curl_rule_02__' declared as an array with a negative size
我发现这个问题描述here 。如果我去检查curlbuild.h
#define
s,我发现CURL_SIZEOF_LONG
是8,但是明确定义。该项目是与架构i386编译。
最后,如果我尝试更多的事情简单化,并运行一个不可知论者:
./configure --disable-shared --with-darwinssl
,并切换示例项目架构回到通用32/64位,当我联系,我收到了一堆怪异的错误:
"_ber_free", referenced from:
"_inflate", referenced from:
"_inflateEnd", referenced from:
"_inflateInit2_", referenced from:
"_inflateInit_", referenced from:
"_ldap_err2string", referenced from:
"_ldap_first_attribute", referenced from:
"_ldap_first_entry", referenced from:
"_ldap_free_urldesc", referenced from:
"_ldap_get_dn", referenced from:
"_ldap_get_values_len", referenced from:
"_ldap_init", referenced from:
"_ldap_memfree", referenced from:
"_ldap_msgfree", referenced from:
"_ldap_next_attribute", referenced from:
"_ldap_next_entry", referenced from:
"_ldap_search_s", referenced from:
"_ldap_set_option", referenced from:
"_ldap_simple_bind_s", referenced from:
"_ldap_unbind_s", referenced from:
"_ldap_url_parse", referenced from:
"_ldap_value_free_len", referenced from:
"_zlibVersion", referenced from:
我可能在这里丢失了一些明显的东西,或者错过了许多小砖块。无论哪种方式,我完全失去了,我想知道我的任务是否真的可行。
我可以“重新编译”在64位的整个应用程序,但我可能需要这个版本的libcurl
和是版本的OpenSSL,如果我甚至不能得到一个示例应用程序去有没有点切换到真实的东西(如果您对我为什么需要此配置感到好奇,请检查my other thread about libcurl
problems:Windows客户端没有连接问题并正在使用上述配置)。
您是否看到我正在做的任何明显的错误?任何帮助或照明问题将不胜感激。