Apache2.4.2でリンクエラー

apache2.4.2上でldapを用いた基本認証を利用するためにldapとauthnz-ldapをつけてconfigureしたところ、以下の様なリンクエラー。

/usr/local/apr/build-1/libtool --silent --mode=link gcc -std=gnu99 -g -O2 -pthread        -o httpd  modules.lo buildmark.o -export-dynamic server/libmain.la modules/core/libmod_so.la modules/http/libmod_http.la server/mpm/event/libevent.la os/unix/libos.la -L/usr/local/lib -lpcre     /usr/local/apr-util/lib/libaprutil-1.la -lexpat /usr/local/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl 
server/.libs/libmain.a(exports.o):(.data+0x1590): undefined reference to `apr_ldap_ssl_init'
server/.libs/libmain.a(exports.o):(.data+0x1598): undefined reference to `apr_ldap_ssl_deinit'
server/.libs/libmain.a(exports.o):(.data+0x15a0): undefined reference to `apr_ldap_init'
server/.libs/libmain.a(exports.o):(.data+0x15a8): undefined reference to `apr_ldap_info'
server/.libs/libmain.a(exports.o):(.data+0x15b0): undefined reference to `apr_ldap_get_option'
server/.libs/libmain.a(exports.o):(.data+0x15b8): undefined reference to `apr_ldap_set_option'
server/.libs/libmain.a(exports.o):(.data+0x15c0): undefined reference to `apr_ldap_rebind_init'
server/.libs/libmain.a(exports.o):(.data+0x15c8): undefined reference to `apr_ldap_rebind_add'
server/.libs/libmain.a(exports.o):(.data+0x15d0): undefined reference to `apr_ldap_rebind_remove'
server/.libs/libmain.a(exports.o):(.data+0x15d8): undefined reference to `apr_ldap_is_ldap_url'
server/.libs/libmain.a(exports.o):(.data+0x15e0): undefined reference to `apr_ldap_is_ldaps_url'
server/.libs/libmain.a(exports.o):(.data+0x15e8): undefined reference to `apr_ldap_is_ldapi_url'
server/.libs/libmain.a(exports.o):(.data+0x15f0): undefined reference to `apr_ldap_url_parse_ext'
server/.libs/libmain.a(exports.o):(.data+0x15f8): undefined reference to `apr_ldap_url_parse'
collect2: ld returned 1 exit status
make[1]: *** [httpd] エラー 1
make[1]: ディレクトリ `/home/hoge/httpd/httpd-2.4.2' から出ます
make: *** [install-recursive] エラー 1
#

apr-utilライブラリ中にあるはずのldap関連シンボルが見えないみたいです。apr-utilをldapオプション付きでreconfigureする必要があるようです。以下のようにしてapr-utilを再コンパイル、リンクしてインストール。

$ make distclean
$ ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr  --with-ldap
(中略)
$ make
# make install

apr-utilsをインストールした後にapacheを再configureしてコンパイル、リンク。

$ make distclean
$ ./configure --with-ldap --enable-so --enable-ssl=shared --enable-ldap --enable-authnz-ldap --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
$ make
# make install