title: PHP isn't linking MySQL shared library correctly on build
body: <p>I'm trying to build PHP on my new computer with this configuration:</p>
  
  <pre><code>export MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LIBS=-lresolv
  export DYLD_LIBRARY_PATH=/usr/local/mysql/lib
  ./configure --prefix=/usr/local --with-apxs2=/usr/sbin/apxs --with-ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib-dir=/usr --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-sockets --with-iodbc=/usr --with-curl=/usr --with-config-file-path=/etc --sysconfdir=/private/etc --with-mysql-sock=/var/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-openssl=/usr --with-xmlrpc --with-xsl=/usr --without-pear --with-libxml-dir=/usr --with-iconv=/usr/local --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --with-gd --with-jpeg-dir=/usr/local/Cellar --with-png-dir=/usr/X11 --with-freetype-dir=/usr/X11 --with-mcrypt=/usr/local/Cellar --enable-pcntl
  </code></pre>
  
  <p>The configuration runs fine, but when I try to run "make" it ends up at this error:</p>
  
  <pre><code>Generating phar.phar
  dyld: Library not loaded: libmysqlclient.18.dylib
    Referenced from: /Users/mdiamond/Downloads/php-5.3.8/sapi/cli/php
    Reason: image not found
  make: *** [ext/phar/phar.phar] Trace/BPT trap: 5
  </code></pre>
  
  <p>This is pretty bizarre, considering I specified "export DYLD_LIBRARY_PATH=/usr/local/mysql/lib" and libmysqlclient.18.dylib is in that path. It seems the linker is looking for libmysqlclient.18.dylib without a path (in the root?). I also ran otool on my php binary and got this:</p>
  
  <pre><code>/usr/lib/libexslt.0.dylib (compatibility version 9.0.0, current version 9.13.0)
  /usr/lib/libiodbc.2.dylib (compatibility version 4.0.0, current version 4.18.0)
  libmysqlclient.18.dylib (compatibility version 18.0.0, current version 18.0.0)
  /usr/local/lib/libmcrypt.4.dylib (compatibility version 9.0.0, current version 9.8.0)
  /usr/local/lib/libltdl.7.dylib (compatibility version 11.0.0, current version 11.0.0)
  /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.2.0)
  /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
  /usr/X11/lib/libfreetype.6.dylib (compatibility version 13.0.0, current version 13.2.0)
  /usr/X11/lib/libpng15.15.dylib (compatibility version 17.0.0, current version 17.0.0)
  /usr/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
  /usr/local/lib/libjpeg.8.dylib (compatibility version 12.0.0, current version 12.0.0)
  /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
  /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
  /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 7.0.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)
  /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 46.0.0)
  /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.3.0)
  /usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 46.1.0)
  /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
  /usr/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.24.0)
  </code></pre>
  
  <p>Note how libmysqlclient is the only library without a path. Does anyone know how I can solve this? Am I running the configure wrong?</p>