title: Building and configuring apr-util and httpd to use apr-iconv on Linux
body: <p>I'm a glutton for punishment, and to prove it, I got myself a server and tried to build the entire LAMP stack myself.  Then I ran into a problem where during a configure/make/install of httpd, I found that my compiled apr-util seemed to be not picking up apr-iconv properly.  The sequence is:</p>
  
  <ol>
  <li>configure/make/install apr-1.4.5.</li>
  <li>configure/make/install apr-iconv-1.2.1</li>
  <li>configure/make/install apr-util-1.3.12</li>
  <li>configure/make/install httpd-2.2.21</li>
  </ol>
  
  <p>All the apr's built fine, but when I tried to "make" httpd, I got this message:</p>
  
  <pre><code>make[3]: Leaving directory `/root/software/httpd-2.2.21/modules/mappers'
  make[2]: Leaving directory `/root/software/httpd-2.2.21/modules/mappers'
  make[1]: Leaving directory `/root/software/httpd-2.2.21/modules'
  Making all in support
  make[1]: Entering directory `/root/software/httpd-2.2.21/support'
  make[2]: Entering directory `/root/software/httpd-2.2.21/support'
  /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread    -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE    -I/root/software/httpd-2.2.21/srclib/pcre -I. -I/root/software/httpd-2.2.21/os/unix -I/root/software/httpd-2.2.21/server/mpm/prefork -I/root/software/httpd-2.2.21/modules/http -I/root/software/httpd-2.2.21/modules/filters -I/root/software/httpd-2.2.21/modules/proxy -I/root/software/httpd-2.2.21/include -I/root/software/httpd-2.2.21/modules/generators -I/root/software/httpd-2.2.21/modules/mappers -I/root/software/httpd-2.2.21/modules/database -I/usr/local/apr/include/apr-1 -I/root/software/apr-util-1.3.12/../apr-iconv-1.2.1/include -I/usr/include -I/root/software/httpd-2.2.21/server -I/root/software/httpd-2.2.21/modules/proxy/../generators -I/usr/local/ssl/include -I/root/software/httpd-2.2.21/modules/ssl -I/root/software/httpd-2.2.21/modules/dav/main  -prefer-non-pic -static -c htpasswd.c &amp;&amp; touch htpasswd.lo
  /usr/local/apr/build-1/libtool --silent --mode=link gcc -g -O2 -pthread     -L/usr/lib -L/usr/local/ssl/lib   -o htpasswd  htpasswd.lo   -lm /root/software/httpd-2.2.21/srclib/pcre/libpcre.la /usr/local/apr/lib/libaprutil-1.la -lgdbm /root/software/apr-util-1.3.12/../apr-iconv-1.2.1/lib/libapriconv.la -lexpat /usr/local/apr/lib/libapr-1.la -lrt -lcrypt -lpthread -ldl -lcrypt
  libtool: link: cannot find the library `/root/software/apr-util-1.3.12/../apr-iconv-1.2.1/lib/libapriconv.la' or unhandled argument `/root/software/apr-util-1.3.12/../apr-iconv-1.2.1/lib/libapriconv.la'
  make[2]: *** [htpasswd] Error 1
  make[2]: Leaving directory `/root/software/httpd-2.2.21/support'
  make[1]: *** [all-recursive] Error 1
  make[1]: Leaving directory `/root/software/httpd-2.2.21/support'
  make: *** [all-recursive] Error 1
  </code></pre>
  
  <p>The only part of the configuration I'm really not sure about is the with-apr-iconv setting in the apr-util configure script.  It seems weird to reference another source directory instead of the shared libraries.  Can anyone tell me what I'm doing wrong?</p>
  
  <h2>Server Info:</h2>
  
  <pre><code>[root@server ~]# cat /etc/*-release
  CentOS release 5.7 (Final)
  [root@server ~]# uname -m
  i686
  </code></pre>
  
  <h2>Configure scripts:</h2>
  
  <p><strong>apr-1.4.5</strong></p>
  
  <pre><code>./configure --enable-shared \
              --enable-threads \
              --enable-other-child
  </code></pre>
  
  <p><strong>apr-iconv-1.2.1</strong></p>
  
  <pre><code>./configure --with-apr=/usr/local/apr
  </code></pre>
  
  <p><strong>apr-util-1.3.12</strong></p>
  
  <pre><code>./configure --with-apr=/usr/local/apr/bin/apr-1-config \
              --with-apr-iconv=../apr-iconv-1.2.1 \
              --with-mysql=/usr \
              --with-sqlite3=/usr  \
              --with-expat=/usr \
              --with-gdbm=/usr
  </code></pre>
  
  <p><strong>httpd-2.2.21</strong></p>
  
  <pre><code>./configure --enable-authn-anon \
              --enable-v4-mapped \
              --enable-authz-owner \
              --enable-auth-digest \
              --disable-imagemap \
              --enable-dav \
              --enable-dav-fs \
              --enable-dav-lock \
              --enable-deflate \
              --enable-expires \
              --enable-headers \
              --enable-info \
              --enable-mime-magic \
              --enable-proxy \
              --enable-proxy-ajp \
              --enable-proxy-http \
              --enable-proxy-ftp \
              --enable-proxy-balancer \
              --enable-proxy-connect \
              --enable-suexec \
              --enable-rewrite \
              --enable-so \
              --enable-ssl \
              --with-ssl=/usr/local/ssl \
              --disable-userdir \
              --enable-vhost-alias \
              --with-mpm=prefork \
              --enable-mods-shared=all \
              --with-apr=/usr/local/apr/bin/apr-1-config \
              --with-apr-util=/usr/local/apr/bin/apu-1-config
  </code></pre>