Skip to content

Instantly share code, notes, and snippets.

@shinnya
Last active Aug 25, 2016
Embed
What would you like to do?
This is excerpt from configure for PHP and describes how configure script decides OPENSSL_LIBDIR.
# If you specify --with-openssl-dir=yes, pkg-config is used and found_openssl is set to true.
if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
found_openssl=yes
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
else
as_fn_error $? "OpenSSL version 0.9.6 or greater required." "$LINENO" 5
fi
if test -n "$OPENSSL_LIBS"; then
(Omitted)
# If you specify --with-openssl-dir=/usr, $found_openssl is "no".
if test "$found_openssl" = "no"; then
if test "$PHP_OPENSSL_DIR" = "yes"; then
PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
# If you specify --with-openssl-dir=/usr, $PHP_OPENSSL_DIR is "/usr".
# If you specify --with-libdir=lib64, $PHP_LIBDIR is "lib64" and its default values is "lib".
for i in $PHP_OPENSSL_DIR; do
if test -r $i/include/openssl/evp.h; then
OPENSSL_INCDIR=$i/include
fi
if test -r $i/$PHP_LIBDIR/libssl.a -o -r $i/$PHP_LIBDIR/libssl.$SHLIB_SUFFIX_NAME; then
OPENSSL_LIBDIR=$i/$PHP_LIBDIR
fi
test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
done
if test -z "$OPENSSL_INCDIR"; then
as_fn_error $? "Cannot find OpenSSL's <evp.h>" "$LINENO" 5
fi
if test -z "$OPENSSL_LIBDIR"; then
as_fn_error $? "Cannot find OpenSSL's libraries" "$LINENO" 5
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment