1
dnl ===========================================================================
3
dnl ===========================================================================
7
dnl ---------------------------------------------------------------------------
8
dnl Macro: MYSQL_USE_BUNDLED_YASSL
11
dnl MYSQL_USE_BUNDLED_YASSL()
14
dnl Add defines so yassl is built and linked with
15
dnl ---------------------------------------------------------------------------
16
AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [
18
with_bundled_yassl="yes"
23
yassl_libs="\$(top_builddir)/extra/yassl/src/libyassl.la \
24
\$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la"
27
AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for SSL.])
28
AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for SSL.])
30
# System specific checks
31
yassl_integer_extra_cxxflags=""
32
case $host_cpu--$CXX_VERSION in
33
sparc*--*Sun*C++*5.6*)
34
# Disable inlining when compiling taocrypt/src/
35
yassl_taocrypt_extra_cxxflags="+d"
36
AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/])
39
AC_SUBST([yassl_taocrypt_extra_cxxflags])
41
# Link extra/yassl/include/openssl subdir to include/
42
yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl"
43
AC_SUBST(yassl_h_ln_cmd)
45
AC_MSG_RESULT([using bundled yaSSL])
49
dnl ---------------------------------------------------------------------------
50
dnl Macro: MYSQL_CHECK_SSL_DIR
53
dnl MYSQL_CHECK_SSL_DIR(includes, libs)
56
dnl Auxiliary macro to check for ssl at given path
58
dnl ---------------------------------------------------------------------------
60
AC_DEFUN([MYSQL_CHECK_SSL_DIR], [
63
save_CPPFLAGS="$CPPFLAGS"
65
CPPFLAGS="$ssl_incs $CPPFLAGS"
66
LIBS="$LIBS $ssl_libs"
67
AC_TRY_LINK([#include <openssl/ssl.h>],
68
[return SSL_library_init();],
69
[mysql_ssl_found="yes"],
70
[mysql_ssl_found="no"])
71
CPPFLAGS="$save_CPPFLAGS"
76
dnl ---------------------------------------------------------------------------
77
dnl Macro: MYSQL_FIND_OPENSSL
80
dnl MYSQL_FIND_OPENSSL(location)
83
dnl Search the location for OpenSSL support
85
dnl ---------------------------------------------------------------------------
86
AC_DEFUN([MYSQL_FIND_OPENSSL], [
92
openssl_include="$location/include"
95
# Don't set ssl_includes to /usr/include as this gives us a lot of
96
# compiler warnings when using gcc 3.x
97
if test "$openssl_include" != "/usr/include"
99
openssl_includes="-I$openssl_include"
103
# Try to link with openSSL libs in <location>
105
openssl_libs="-L$location/lib/ -lssl -lcrypto"
106
MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs])
108
if test "$mysql_ssl_found" == "no"
111
# BUG 764: Compile failure with OpenSSL on Red Hat Linux (krb5.h missing)
112
# Try to link with include paths to kerberos set
114
openssl_includes="$openssl_includes -I/usr/kerberos/include"
115
MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs])
118
if test "$mysql_ssl_found" == "no"
120
AC_MSG_ERROR([Could not link with SSL libs at $location])
123
# openssl-devel-0.9.6 requires dlopen() and we can't link staticly
124
# on many platforms (We should actually test this here, but it's quite
125
# hard to do as we are doing libtool for linking.)
126
case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in
128
AC_MSG_ERROR([You can't use the --all-static link option when using openssl.])
132
AC_SUBST(openssl_includes)
133
AC_SUBST(openssl_libs)
135
NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
137
AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL])
138
AC_MSG_RESULT([using openSSL from $location])
143
dnl ------------------------------------------------------------------------
144
dnl Macro: MYSQL_CHECK_SSL
149
dnl Provides the following configure options:
151
dnl Possible DIR values are:
152
dnl - no - the macro will disable use of ssl
153
dnl - bundled, empty or not specified - means use ssl lib
154
dnl bundled along with MySQL sources
155
dnl - ssl location prefix - given location prefix, the macro expects
156
dnl to find the header files in $prefix/include/, and libraries in
157
dnl $prefix/lib. If headers or libraries weren't found at $prefix, the
158
dnl macro bails out with error.
160
dnl ------------------------------------------------------------------------
161
AC_DEFUN([MYSQL_CHECK_SSL], [
163
AC_CONFIG_FILES(extra/yassl/Makefile dnl
164
extra/yassl/taocrypt/Makefile dnl
165
extra/yassl/taocrypt/benchmark/Makefile dnl
166
extra/yassl/taocrypt/src/Makefile dnl
167
extra/yassl/taocrypt/test/Makefile dnl
168
extra/yassl/src/Makefile dnl
169
extra/yassl/testsuite/Makefile)
171
AC_MSG_CHECKING(for SSL)
173
[ --with-ssl[=DIR] Include SSL support],
174
[mysql_ssl_dir="$withval"],
177
if test "$with_yassl"
179
AC_MSG_ERROR([The flag --with-yassl is deprecated, use --with-ssl])
182
if test "$with_openssl"
184
AC_MSG_ERROR([The flag --with-openssl is deprecated, use --with-ssl])
187
case "$mysql_ssl_dir" in
190
# Don't include SSL support
192
AC_MSG_RESULT([disabled])
197
# Use the bundled SSL implementation (yaSSL)
199
MYSQL_USE_BUNDLED_YASSL
204
# A location where to search for OpenSSL was specified
206
MYSQL_FIND_OPENSSL([$mysql_ssl_dir])
209
AM_CONDITIONAL([HAVE_YASSL], [ test "$with_bundled_yassl" = "yes" ])