Compilation 在OS-X Mavericks上构建squid缓存

Compilation 在OS-X Mavericks上构建squid缓存,compilation,osx-mavericks,squid,Compilation,Osx Mavericks,Squid,我正在尝试在Mavericks(10.9.1)上构建squid缓存(squid-3.4.2),并基于SquidMan常见问题进行以下配置: ./configure --prefix=/usr/local/squid --disable-eui CFLAGS=-mmacosx-version-min=10.9 --enable-pf-transparent 在kerberos帮助程序处生成失败: g++ -DHAVE_CONFIG_H -I../../.. -I../../../include

我正在尝试在Mavericks(10.9.1)上构建squid缓存(squid-3.4.2),并基于SquidMan常见问题进行以下配置:

./configure --prefix=/usr/local/squid --disable-eui CFLAGS=-mmacosx-version-min=10.9 --enable-pf-transparent
在kerberos帮助程序处生成失败:

g++ -DHAVE_CONFIG_H  -I../../.. -I../../../include -I../../../lib -I../../../src -I../../../include   -I../../../libltdl -I../../.. -I../../../include -I../../../lib -I../../../src -I../../../include   -I../../../libltdl -I.  -Werror -Qunused-arguments  -D_REENTRANT -g -O2 -march=native -std=c++0x -MT support_krb5.o -MD -MP -MF .deps/support_krb5.Tpo -c -o support_krb5.o support_krb5.cc
support_krb5.cc:47:13: error: 'krb5_cc_destroy' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            krb5_cc_destroy(kparam.context, kparam.cc);
            ^
/usr/include/krb5/krb5.h:1296:1: note: 'krb5_cc_destroy' declared here
krb5_cc_destroy (krb5_context context, krb5_ccache cache) KERBEROS_APPLE_DEPRECATED("use GSS.framework");
^
support_krb5.cc:48:9: error: 'krb5_free_context' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
        krb5_free_context(kparam.context);
        ^
/usr/include/krb5/krb5.h:1456:20: note: 'krb5_free_context' declared here
void KRB5_CALLCONV krb5_free_context
                   ^
support_krb5.cc:80:12: error: 'krb5_init_context' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
    code = krb5_init_context(&kparam.context);
           ^
/usr/include/krb5/krb5.h:1452:31: note: 'krb5_init_context' declared here
krb5_error_code KRB5_CALLCONV krb5_init_context
                              ^
support_krb5.cc:91:5: error: 'krb5_kt_default_name' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
    krb5_kt_default_name(kparam.context, buf, KT_PATH_MAX);
    ^
/usr/include/krb5/krb5.h:1702:31: note: 'krb5_kt_default_name' declared here
krb5_error_code KRB5_CALLCONV krb5_kt_default_name
                              ^
support_krb5.cc:98:12: error: 'krb5_kt_resolve' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
    code = krb5_kt_resolve(kparam.context, keytab_name, &keytab);
           ^
/usr/include/krb5/krb5.h:1698:31: note: 'krb5_kt_resolve' declared here
krb5_error_code KRB5_CALLCONV krb5_kt_resolve
                              ^
support_krb5.cc:104:12: error: 'krb5_kt_start_seq_get' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
    code = krb5_kt_start_seq_get(kparam.context, keytab, &cursor);
           ^
/usr/include/krb5/krb5.h:1435:1: note: 'krb5_kt_start_seq_get' declared here
krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab,
^
support_krb5.cc:113:20: error: 'krb5_kt_next_entry' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
    while ((code = krb5_kt_next_entry(kparam.context, keytab, &entry, &cursor)) == 0) {
                   ^
/usr/include/krb5/krb5.h:1438:1: note: 'krb5_kt_next_entry' declared here
krb5_kt_next_entry(krb5_context context, krb5_keytab keytab,
^
support_krb5.cc:117:9: error: 'krb5_copy_principal' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
        krb5_copy_principal(kparam.context, entry.principal, &principal_list[nprinc++]);
        ^
/usr/include/krb5/krb5.h:1633:31: note: 'krb5_copy_principal' declared here
krb5_error_code KRB5_CALLCONV krb5_copy_principal
                              ^
support_krb5.cc:129:20: error: 'krb5_unparse_name' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            code = krb5_unparse_name(kparam.context, entry.principal, &principal_name);
                   ^
/usr/include/krb5/krb5.h:1561:31: note: 'krb5_unparse_name' declared here
krb5_error_code KRB5_CALLCONV krb5_unparse_name
                              ^
support_krb5.cc:140:16: error: 'krb5_free_keytab_entry_contents' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
        code = krb5_free_keytab_entry_contents(kparam.context, &entry);
               ^
/usr/include/krb5/krb5.h:1709:31: note: 'krb5_free_keytab_entry_contents' declared here
krb5_error_code KRB5_CALLCONV krb5_free_keytab_entry_contents
                              ^
support_krb5.cc:156:12: error: 'krb5_kt_end_seq_get' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
    code = krb5_kt_end_seq_get(kparam.context, keytab, &cursor);
           ^
/usr/include/krb5/krb5.h:1441:1: note: 'krb5_kt_end_seq_get' declared here
krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab,
^
support_krb5.cc:175:12: error: 'krb5_cc_resolve' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
    code = krb5_cc_resolve(kparam.context, mem_cache, &kparam.cc);
           ^
/usr/include/krb5/krb5.h:1728:31: note: 'krb5_cc_resolve' declared here
krb5_error_code KRB5_CALLCONV krb5_cc_resolve
                              ^
support_krb5.cc:196:20: error: 'krb5_unparse_name' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            code = krb5_unparse_name(kparam.context, principal_list[i], &principal_name);
                   ^
/usr/include/krb5/krb5.h:1561:31: note: 'krb5_unparse_name' declared here
krb5_error_code KRB5_CALLCONV krb5_unparse_name
                              ^
support_krb5.cc:204:20: error: 'krb5_get_init_creds_keytab' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            code = krb5_get_init_creds_keytab(kparam.context, creds, principal_list[i], keytab, 0, NULL, NULL);
                   ^
/usr/include/krb5/krb5.h:2337:1: note: 'krb5_get_init_creds_keytab' declared here
krb5_get_init_creds_keytab
^
support_krb5.cc:217:20: error: 'krb5_cc_initialize' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            code = krb5_cc_initialize(kparam.context, kparam.cc, principal_list[i]);
                   ^
/usr/include/krb5/krb5.h:1292:1: note: 'krb5_cc_initialize' declared here
krb5_cc_initialize(krb5_context context, krb5_ccache cache,
^
support_krb5.cc:222:20: error: 'krb5_cc_store_cred' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            code = krb5_cc_store_cred(kparam.context, kparam.cc, creds);
                   ^
/usr/include/krb5/krb5.h:1302:1: note: 'krb5_cc_store_cred' declared here
krb5_cc_store_cred (krb5_context context, krb5_ccache cache,
^
support_krb5.cc:228:17: error: 'krb5_free_principal' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
                krb5_free_principal(kparam.context, creds->server);
                ^
/usr/include/krb5/krb5.h:1760:20: note: 'krb5_free_principal' declared here
void KRB5_CALLCONV krb5_free_principal
                   ^
support_krb5.cc:236:20: error: 'krb5_parse_name' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            code = krb5_parse_name(kparam.context, service, &creds->server);
                   ^
/usr/include/krb5/krb5.h:1549:31: note: 'krb5_parse_name' declared here
krb5_error_code KRB5_CALLCONV krb5_parse_name
                              ^
support_krb5.cc:242:20: error: 'krb5_get_credentials' is deprecated: use GSS.framework
      [-Werror,-Wdeprecated-declarations]
            code = krb5_get_credentials(kparam.context, 0, kparam.cc, creds, &tgt_creds);
                   ^
/usr/include/krb5/krb5.h:1486:31: note: 'krb5_get_credentials' declared here
krb5_error_code KRB5_CALLCONV krb5_get_credentials
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[4]: *** [support_krb5.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
我不太清楚如何解决这个问题

我最初使用squid时不需要kerberos,因此在进行一些配置挖掘后,我发现此标志将关闭构建的该部分:

--with-krb5-config=no
但是,在ldap助手构建过程中,我最终会出现错误。(我也不需要)…然后手动编辑makefile会变成一个很深的兔子洞,仍然会导致构建错误

我想让它“按原样”正确构建,而不需要进行实质性的构建更改。网上似乎没有什么知识可以帮助解决这个问题


有没有人有在os-x Mavericks上构建这个的经验?如果是这样,我需要做哪些更改?

不确定这是否有帮助,因为我仍然使用MAC OS 10.7(Lion)
make
不会抱怨kerberos,但也会因一些有关LDAP的错误而停止。拆下管路后

#define HAVE_LDAP_H 1
BUILD_HELPER="kerberos_ldap_group"
#define HAVE_MOZLDAP_LDAP_H 1
$as_echo "#define HAVE_LDAP 1" >>confdefs.h
$as_echo "#define HAVE_OPENLDAP 1" >>confdefs.h
$as_echo "#define HAVE_SUN_LDAP_SDK 1" >>confdefs.h
$as_echo "#define HAVE_MOZILLA_LDAP_SDK 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_REBINDPROC_CALLBACK 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_REBIND_PROC 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_REBIND_FUNCTION 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_SCOPE_DEFAULT 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_URL_LUD_SCHEME 1" >>confdefs.h
$as_echo "#define HAVE_LDAPSSL_CLIENT_INIT 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_URL_DESC2STR 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_URL_PARSE 1" >>confdefs.h
$as_echo "#define HAVE_LDAP_START_TLS_S 1" >>confdefs.h

通过
configure
脚本并在不使用任何命令行选项的情况下运行它,可以编译squid-3.4.2。这对我来说很有效,但仍然是一个难题。我想解决这个问题的正确方法是使用
--启用auth basic
--启用auth digest
--启用外部acl帮助程序
选项进行
配置
并列出除LDAP之外的所有帮助程序(或者至少列出您需要的所有帮助程序)。

这是Squid中一个公开的已知错误:

我尝试了以下方法绕过这些外部ACL模块,如下所示

./configure --prefix=/opt/squid --with-krb5-config=no
--disable-external-acl-helpers
我还遇到了其他问题:

在OSX 10.9.3上,以下内容对我有用

./configure CPPFLAGS='-Wno-error=deprecated-declarations' LDFLAGS='-lresolv'

显然,如果您计划进行域级身份验证(例如AD/LDAP),则会使用kerberos。您可以使用以下选项禁用帮助程序和身份验证方法
禁用身份验证--禁用外部acl帮助程序
成功编译:

--prefix=/usr/local 
--disable-auth
--with-krb5-config=no
--disable-external-acl-helpers
--disable-eui
已测试:正常

我的硬件

  • MacBoo:Pro(视网膜,15英寸,2015年年中)2.5Ghz i7
  • squid版本3.5.6
  • OSX 10.10.04
  • 苹果LLVM版本6.1.0(clang-602.0.53)(基于LLVM 3.6.0svn)

刚刚发现自制软件有一个稍旧的squid版本(3.3.11),可以在Mavericks上编译。但是,将--enable ipf transparent更改为--enable pf transparent会破坏构建。这似乎有一张罚单,但没有任何操作:这也适用于yosemite以抑制ldap不推荐警告。