Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

指定openssl 目录 #482

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 13 additions & 23 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ PHP_ARG_WITH(libxlsxwriter, system libxlsxwriter,
PHP_ARG_WITH(libxlsxio, system libxlsxio,
[ --with-libxlsxio=DIR Use system libxlsxio], no, no)

PHP_ARG_WITH(openssl_md5, openssl MD5,
[ --with-openssl-md5=DIR Use openssl MD5], no, no)

PHP_ARG_WITH(bundled_md5, bundled MD5,
[ --with-bundled-md5 Use bundled MD5], no, no)
PHP_ARG_WITH([openssl_dir],
[dir of openssl],
[AS_HELP_STRING([[--with-openssl-dir[=DIR]]],
[Include Openssl md5 support])], [no], [no])

PHP_ARG_ENABLE(reader, enable xlsx reader support,
[ --enable-reader Enable xlsx reader?], yes, yes)
Expand Down Expand Up @@ -88,19 +87,11 @@ if test "$PHP_XLSWRITER" != "no"; then

AC_MSG_CHECKING([Check libxlsxwriter library])

if test "$PHP_OPENSSL_MD5" != "no"; then
if test "$PHP_OPENSSL_DIR" != "no"; then
AC_MSG_RESULT([use the openssl md5 library])
for i in $PHP_OPENSSL_MD5 /usr/local /usr /usr/local/opt; do
if test -r $i/include/openssl/md5.h; then
OPENSSL_DIR=$i
AC_MSG_RESULT([found in $i])
break
fi
done

if test -z "$OPENSSL_DIR"; then
AC_MSG_ERROR([openssl library not found])
else
if test -r ${PHP_OPENSSL_DIR}/include/openssl/md5.h; then
OPENSSL_DIR=$i
AC_MSG_RESULT([found in $i])
PHP_ADD_INCLUDE($OPENSSL_DIR/include)

PHP_CHECK_LIBRARY(crypto, MD5_Init,
Expand All @@ -111,18 +102,17 @@ if test "$PHP_XLSWRITER" != "no"; then
],[
-L$OPENSSL_DIR/lib -lcrypto
])

AC_DEFINE(USE_OPENSSL_MD5, 1, [ use openssl md5 ])
else
AC_MSG_ERROR([openssl library not found])
fi

PHP_BUNDLED_MD5=no
fi

if test "$PHP_BUNDLED_MD5" != "no"; then
else
AC_MSG_RESULT([use the bundled md5 library])
xls_writer_sources="$xls_writer_sources $md5_sources"
fi



if test "$PHP_LIBXLSXWRITER" != "no"; then
for i in $PHP_LIBXLSXWRITER /usr/local /usr /usr/local/opt; do
if test -r $i/include/xlsxwriter.h; then
Expand Down