Squid3.1.3でmake error
Squidの最新版をソースからビルド。configureしてmakeするとこんなエラーが。
/home/hogehoge/squid/squid-3.1.3/helpers/basic_auth/LDAP/squid_ldap_auth.c:180: undefined reference to `ber_pvt_opt_on' collect2: ld returned 1 exit status make[3]: *** [squid_ldap_auth] Error 1 make[3]: Leaving directory `/home/hogehoge/squid/squid-3.1.3/helpers/basic_auth/LDAP' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/hogehoge/squid/squid-3.1.3/helpers/basic_auth' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/hogehoge/squid/squid-3.1.3/helpers' make: *** [all-recursive] Error 1
どうも外部ACLの関連でLDAPを使うってconfigureが認識しているみたい。ビルドしようとしているプラットフォームはFedoraなのでデフォルトでOpenLDAPが入っていますが、Squidが期待しているものとバージョンが違うのかな。必要としているものを調べて追加でいれるっていう手もあるんですが、面倒なのでLDAPを外す方向で。
$ make distclean $ ./configure --enable-ssl --with-openssl=/usr/local/ssl --enable-basic-auth-helpers="MSNT NCSA PAM SMB mswin_sspi YP getpwnam multi-domain-NTLM SASL POP3 squid_radius_auth" $ make (中略) Making all in mswin_sspi make[3]: Entering directory `/home/hoge/squid/squid-3.1.3/helpers/basic_auth/mswin_sspi' gcc -DHAVE_CONFIG_H -I../../.. -I../../../include -I../../../src -I../../../include -I. -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -D_REENTRANT -Wall -g -O2 -MT mswin_auth.o -MD -MP -MF .deps/mswin_auth.Tpo -c -o mswin_auth.o mswin_auth.c mswin_auth.c:186:2: error: #error NON WINDOWS PLATFORM make[3]: *** [mswin_auth.o] Error 1 make[3]: Leaving directory `/home/hoge/squid/squid-3.1.3/helpers/basic_auth/mswin_sspi' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/hoge/squid/squid-3.1.3/helpers/basic_auth' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/hoge/squid/squid-3.1.3/helpers' make: *** [all-recursive] Error 1
あら、またエラーが。msうんたらってのもいらないか。config.logでLDAP関連を探ると、digest-auth-helpersとexternal-acl-helpersにもそれらしいものがあったので削除。configureを以下のようにして再度make。
$ ./configure --enable-ssl --enable-basic-auth-helpers="MSNT NCSA PAM SMB YP getpwnam multi-domain-NTLM SASL POP3 squid_radius_auth" --enable-digest-auth-helpers="password" --enable-external-acl-helpers="ip_user session unix_group wbinfo_group" $ make gcc -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -D_REENTRANT -Wall -g -O2 -g -o squid_session squid_session.o ../../../compat/.libs/libcompat.a /usr/lib/libstdc++.so -lm squid_session.o(.text+0x1ee): In function `main': /home/hogehoge/squid/squid-3.1.3/helpers/external_acl/session/squid_session.c:62: undefined reference to `__db185_open' collect2: ld returned 1 exit status
こんどはBerkeleyDBのなにか。libdbをリンクすればいいんでしょ?
$ export LDFLAGS='-ldb -L/usr/local/BerkeleyDB/lib' $ configure (略) $ make
とようやくmakeできました。Fedoraでも古いのだとすこしてこずるみたい。