I'm trying to compile PHP, but the compile fails with the error:

Code:
libtool: link: cannot find the library `/lib/libgcrypt.la' or unhandled argument `/lib/libgcrypt.la'
make: *** [sapi/cli/php] Error 1
I have libgcrypt installed in a non-standard location, but I am specifying the location with the LDFLAGS and CPPFLAGS in configure. When I make I get the error above.

This is my configure line:
Code:
LDFLAGS=-L$HOME/apps/libgcrypt/lib CPPFLAGS=-I$HOME/apps/libgcrypt/include ./configure --prefix=$HOME/apps/$PHP \
--enable-mbstring \
--enable-zip \
--enable-fpm \
--enable-ftp \
--with-openssl=$HOME/apps/openssl \
--with-openssl-dir=$HOME/apps/openssl \
--with-jpeg-dir=$HOME/apps/libjpeg-turbo \
--with-gd \
--with-freetype-dir=/usr \
--with-gettext \
--with-xmlrpc \
--with-icu-dir=$HOME/apps/icu4c \
--enable-intl \
--with-pdo-mysql=mysqlnd \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-zlib-dir=/usr \
--with-kerberos=/usr \
--with-png-dir=/usr \
--with-ldap=$HOME/apps/openldap \
--with-curl=$HOME/apps/curl \
--with-mcrypt=$HOME/apps/libmcrypt \
--with-mhash=$HOME/apps/mhash \
--with-tidy=$HOME/apps/tidy \
--with-libxml-dir=$HOME/apps/libxml2 \
--with-iconv-dir=$HOME/apps/libiconv \
--with-xsl=$HOME/apps/libxslt
I have opened this as a bug on php.net, but I'm not sure whether it is actually a bug with PHP, or I'm missing something else I need to do to make libtool look in the right place for the gcrypt lib?

Libtool version is libtool (GNU libtool) 2.4.2, PHP I'm trying to compile is 5.4.8 but I also get the same error with older versions, libgcrypt version is 1.5.0.

The directory $HOME/apps/libgcrypt is a symlink to $HOME/apps/libgcrypt-1.5.0. The file $HOME/apps/libgcrypt-1.5.0/lib/libgcrypt.la exists and the symlink isn't broken or anything.

Thanks

Dave