在OS-X Mavericks上构建squid-cache

时间:2014-01-03 18:12:57

标签: compilation osx-mavericks squid

我正在尝试使用基于SquidMan常见问题解答的以下配置在Mavericks(10.9.1)上构建squid-cache(squid-3.4.2):

./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上构建?如果是的话,我需要做哪些改变?

5 个答案:

答案 0 :(得分:2)

在OSX 10.9.3上,以下内容适用于我

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

答案 1 :(得分:2)

成功编译:

--prefix=/usr/local 
--disable-auth
--with-krb5-config=no
--disable-external-acl-helpers
--disable-eui

测试:确定

我的硬件

  • MacBoo:Pro(Retina,15英寸,2015年中)2.5Ghz i7
  • squid version 3.5.6
  • OSX 10.10.04
  • Apple LLVM版本6.1.0(clang-602.0.53)(基于LLVM 3.6.0svn)

答案 2 :(得分:0)

不确定,如果这有帮助,因为我还在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已编译。它对我有用,但它仍然是一个黑客。我想解决问题的正确方法是使用--enable-auth-basic的{​​{1}},--enable-auth-digest--enable-external-acl-helpers选项,并列出除LDAP之外的所有帮助程序(或者至少是您需要的所有帮助程序) )。

答案 3 :(得分:0)

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

答案 4 :(得分:-1)

这是Squid当前公开的一个已知错误:
http://bugs.squid-cache.org/show_bug.cgi?id=4023

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

./configure --prefix=/opt/squid --with-krb5-config=no
--disable-external-acl-helpers

我还遇到其他问题: http://bugs.squid-cache.org/show_bug.cgi?id=4043