mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
BUG#18818 configure: No longer finds OpenSSL on Mac OS X
- Implement new switch --with-ssl to configure used for both bundled yaSSL or OpenSSL BitKeeper/deleted/.del-yassl.m4~e55e55c1e863abaf: Delete: config/ac-macros/yassl.m4 BitKeeper/deleted/.del-openssl.m4~41cebd0ba8281769: Delete: config/ac-macros/openssl.m4 BUILD/SETUP.sh: Use switch --with-ssl to configure BUILD/compile-pentium-debug-openssl: Use switch --with-ssl to configure BUILD/compile-pentium-debug-yassl: Use switch --with-ssl to configure configure.in: Change to use the MYSQL_CHECK_SSL macro from ssl.m4 config/ac-macros/ssl.m4: New BitKeeper file ``config/ac-macros/ssl.m4''
This commit is contained in:
parent
40bcc3e570
commit
5c5c5e7501
7 changed files with 209 additions and 191 deletions
|
|
@ -82,8 +82,11 @@ path=`dirname $0`
|
|||
export AM_MAKEFLAGS
|
||||
AM_MAKEFLAGS="-j 4"
|
||||
|
||||
# SSL library to use.
|
||||
SSL_LIBRARY=--with-yassl
|
||||
# SSL library to use.--with-ssl will select our bundled yaSSL
|
||||
# implementation of SSL. To use openSSl you will nee too point out
|
||||
# the location of openSSL headers and lbs on your system.
|
||||
# Ex --with-ssl=/usr
|
||||
SSL_LIBRARY=--with-ssl
|
||||
|
||||
if [ "x$warning_mode" != "xpedantic" ]; then
|
||||
# Both C and C++ warnings
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ path=`dirname $0`
|
|||
extra_flags="$pentium_cflags $debug_cflags"
|
||||
extra_configs="$pentium_configs $debug_configs"
|
||||
|
||||
extra_configs="$extra_configs --with-debug=full --with-openssl"
|
||||
extra_configs="$extra_configs --with-debug=full --with-ssl=/usr"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ path=`dirname $0`
|
|||
extra_flags="$pentium_cflags $debug_cflags"
|
||||
extra_configs="$pentium_configs $debug_configs"
|
||||
|
||||
extra_configs="$extra_configs --with-debug=full --with-yassl"
|
||||
extra_configs="$extra_configs --with-debug=full --with-ssl"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
|
|
|||
|
|
@ -1,138 +0,0 @@
|
|||
AC_DEFUN([MYSQL_FIND_OPENSSL], [
|
||||
incs="$1"
|
||||
libs="$2"
|
||||
eval shrexts=\"$shrext_cmds\"
|
||||
case "$incs---$libs" in
|
||||
---)
|
||||
for d in /usr/ssl/include /usr/local/ssl/include /usr/include \
|
||||
/usr/include/ssl /opt/ssl/include /opt/openssl/include \
|
||||
/usr/local/ssl/include /usr/local/include /usr/freeware/include ; do
|
||||
if test -f $d/openssl/ssl.h ; then
|
||||
OPENSSL_INCLUDE=-I$d
|
||||
fi
|
||||
done
|
||||
|
||||
for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
|
||||
/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib \
|
||||
/usr/freeware/lib32 /usr/local/lib/ ; do
|
||||
# Test for libssl using all known library file endings
|
||||
if test -f $d/libssl.a || test -f $d/libssl.so || \
|
||||
test -f $d/libssl.sl || test -f $d/libssl.dylib ; then
|
||||
OPENSSL_LIB=$d
|
||||
fi
|
||||
done
|
||||
;;
|
||||
---* | *---)
|
||||
AC_MSG_ERROR([if either 'includes' or 'libs' is specified, both must be specified])
|
||||
;;
|
||||
* )
|
||||
if test -f $incs/openssl/ssl.h ; then
|
||||
OPENSSL_INCLUDE=-I$incs
|
||||
fi
|
||||
# Test for libssl using all known library file endings
|
||||
if test -f $d/libssl.a || test -f $d/libssl.so || \
|
||||
test -f $d/libssl.sl || test -f $d/libssl.dylib ; then
|
||||
OPENSSL_LIB=$libs
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# On RedHat 9 we need kerberos to compile openssl
|
||||
for d in /usr/kerberos/include
|
||||
do
|
||||
if test -f $d/krb5.h ; then
|
||||
OPENSSL_KERBEROS_INCLUDE="$d"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INCLUDE" ; then
|
||||
echo "Could not find an installation of OpenSSL"
|
||||
if test -n "$OPENSSL_LIB" ; then
|
||||
if test "$TARGET_LINUX" = "true"; then
|
||||
echo "Looks like you've forgotten to install OpenSSL development RPM"
|
||||
fi
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([MYSQL_CHECK_OPENSSL], [
|
||||
AC_MSG_CHECKING(for OpenSSL)
|
||||
AC_ARG_WITH([openssl],
|
||||
[ --with-openssl[=DIR] Include the OpenSSL support],
|
||||
[openssl="$withval"],
|
||||
[openssl=no])
|
||||
|
||||
AC_ARG_WITH([openssl-includes],
|
||||
[
|
||||
--with-openssl-includes=DIR
|
||||
Find OpenSSL headers in DIR],
|
||||
[openssl_includes="$withval"],
|
||||
[openssl_includes=""])
|
||||
|
||||
AC_ARG_WITH([openssl-libs],
|
||||
[
|
||||
--with-openssl-libs=DIR
|
||||
Find OpenSSL libraries in DIR],
|
||||
[openssl_libs="$withval"],
|
||||
[openssl_libs=""])
|
||||
|
||||
if test "$openssl" != "no"
|
||||
then
|
||||
if test "$openssl" != "yes"
|
||||
then
|
||||
if test -z "$openssl_includes"
|
||||
then
|
||||
openssl_includes="$openssl/include"
|
||||
fi
|
||||
if test -z "$openssl_libs"
|
||||
then
|
||||
openssl_libs="$openssl/lib"
|
||||
fi
|
||||
fi
|
||||
MYSQL_FIND_OPENSSL([$openssl_includes], [$openssl_libs])
|
||||
#force VIO use
|
||||
AC_MSG_RESULT(yes)
|
||||
openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
|
||||
# Don't set openssl_includes to /usr/include as this gives us a lot of
|
||||
# compiler warnings when using gcc 3.x
|
||||
openssl_includes=""
|
||||
if test "$OPENSSL_INCLUDE" != "-I/usr/include"
|
||||
then
|
||||
openssl_includes="$OPENSSL_INCLUDE"
|
||||
fi
|
||||
if test "$OPENSSL_KERBEROS_INCLUDE"
|
||||
then
|
||||
openssl_includes="$openssl_includes -I$OPENSSL_KERBEROS_INCLUDE"
|
||||
fi
|
||||
AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL])
|
||||
|
||||
# openssl-devel-0.9.6 requires dlopen() and we can't link staticly
|
||||
# on many platforms (We should actually test this here, but it's quite
|
||||
# hard) to do as we are doing libtool for linking.
|
||||
using_static=""
|
||||
case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in
|
||||
*-all-static*) using_static="yes" ;;
|
||||
esac
|
||||
if test "$using_static" = "yes"
|
||||
then
|
||||
echo "You can't use the --all-static link option when using openssl."
|
||||
exit 1
|
||||
fi
|
||||
NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test ! -z "$openssl_includes"
|
||||
then
|
||||
AC_MSG_ERROR(Can't have --with-openssl-includes without --with-openssl);
|
||||
fi
|
||||
if test ! -z "$openssl_libs"
|
||||
then
|
||||
AC_MSG_ERROR(Can't have --with-openssl-libs without --with-openssl);
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(openssl_libs)
|
||||
AC_SUBST(openssl_includes)
|
||||
])
|
||||
200
config/ac-macros/ssl.m4
Normal file
200
config/ac-macros/ssl.m4
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
dnl ===========================================================================
|
||||
dnl Support for SSL
|
||||
dnl ===========================================================================
|
||||
dnl
|
||||
dnl
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_USE_BUNDLED_YASSL
|
||||
dnl
|
||||
dnl SYNOPSIS
|
||||
dnl MYSQL_USE_BUNDLED_YASSL()
|
||||
dnl
|
||||
dnl DESCRIPTION
|
||||
dnl Add defines so yassl is built and linked with
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [
|
||||
|
||||
AC_CONFIG_FILES(extra/yassl/Makefile dnl
|
||||
extra/yassl/taocrypt/Makefile dnl
|
||||
extra/yassl/taocrypt/benchmark/Makefile dnl
|
||||
extra/yassl/taocrypt/src/Makefile dnl
|
||||
extra/yassl/taocrypt/test/Makefile dnl
|
||||
extra/yassl/src/Makefile dnl
|
||||
extra/yassl/testsuite/Makefile)
|
||||
|
||||
with_yassl="yes"
|
||||
|
||||
yassl_dir="yassl"
|
||||
AC_SUBST([yassl_dir])
|
||||
|
||||
yassl_libs="-L\$(top_srcdir)/extra/yassl/src -lyassl -L\$(top_srcdir)/extra/yassl/taocrypt/src -ltaocrypt"
|
||||
AC_SUBST(yassl_libs)
|
||||
yassl_includes="-I\$(top_srcdir)/extra/yassl/include"
|
||||
AC_SUBST(yassl_includes)
|
||||
|
||||
AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for SSL.])
|
||||
AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for SSL.])
|
||||
|
||||
# System specific checks
|
||||
yassl_integer_extra_cxxflags=""
|
||||
case $host_cpu--$CXX_VERSION in
|
||||
sparc*--*Sun*C++*5.6*)
|
||||
# Disable inlining when compiling taocrypt/src/
|
||||
yassl_taocrypt_extra_cxxflags="+d"
|
||||
AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/])
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([yassl_taocrypt_extra_cxxflags])
|
||||
|
||||
# Link extra/yassl/include/openssl subdir to include/
|
||||
yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl"
|
||||
AC_SUBST(yassl_h_ln_cmd)
|
||||
|
||||
AC_MSG_RESULT([using bundled yaSSL])
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_CHECK_SSL_DIR
|
||||
dnl
|
||||
dnl SYNOPSIS
|
||||
dnl MYSQL_CHECK_SSL_DIR(includes, libs)
|
||||
dnl
|
||||
dnl DESCRIPTION
|
||||
dnl Auxiliary macro to check for ssl at given path
|
||||
dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([MYSQL_CHECK_SSL_DIR], [
|
||||
ssl_incs="$1"
|
||||
ssl_libs="$2"
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
CPPFLAGS="$ssl_incs $CPPFLAGS"
|
||||
LIBS="$LIBS $ssl_libs"
|
||||
AC_TRY_LINK([#include <openssl/ssl.h>],
|
||||
[return SSL_library_init();],
|
||||
[mysql_ssl_found="yes"],
|
||||
[mysql_ssl_found="no"])
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
LIBS="$save_LIBS"
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_FIND_OPENSSL
|
||||
dnl
|
||||
dnl SYNOPSIS
|
||||
dnl MYSQL_FIND_OPENSSL(location)
|
||||
dnl
|
||||
dnl DESCRIPTION
|
||||
dnl Search the location for OpenSSL support
|
||||
dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_DEFUN([MYSQL_FIND_OPENSSL], [
|
||||
location="$1"
|
||||
|
||||
#
|
||||
# Set include paths
|
||||
#
|
||||
openssl_include="$location/include"
|
||||
openssl_includes=""
|
||||
|
||||
# Don't set ssl_includes to /usr/include as this gives us a lot of
|
||||
# compiler warnings when using gcc 3.x
|
||||
if test "$openssl_include" != "/usr/include"
|
||||
then
|
||||
openssl_includes="-I$ssl_include"
|
||||
fi
|
||||
|
||||
#
|
||||
# Try to link with openSSL libs in <location>
|
||||
#
|
||||
openssl_libs="-L$location/lib/ -lssl -lcrypto"
|
||||
MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs])
|
||||
|
||||
if test "$mysql_ssl_found" == "no"
|
||||
then
|
||||
#
|
||||
# BUG 764: Compile failure with OpenSSL on Red Hat Linux (krb5.h missing)
|
||||
# Try to link with include paths to kerberos set
|
||||
#
|
||||
openssl_includes="$openssl_includes -I/usr/kerberos/include"
|
||||
MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs])
|
||||
fi
|
||||
|
||||
if test "$mysql_ssl_found" == "no"
|
||||
then
|
||||
AC_MSG_ERROR([Could not link with SSL libs at $location])
|
||||
fi
|
||||
|
||||
# openssl-devel-0.9.6 requires dlopen() and we can't link staticly
|
||||
# on many platforms (We should actually test this here, but it's quite
|
||||
# hard to do as we are doing libtool for linking.)
|
||||
case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in
|
||||
*-all-static*)
|
||||
AC_MSG_ERROR([You can't use the --all-static link option when using openssl.])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(openssl_includes)
|
||||
AC_SUBST(openssl_libs)
|
||||
|
||||
NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
|
||||
|
||||
AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL])
|
||||
AC_MSG_RESULT([using openSSL from $location])
|
||||
])
|
||||
|
||||
|
||||
|
||||
dnl ------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_CHECK_SSL
|
||||
dnl
|
||||
dnl SYNOPSIS
|
||||
dnl MYSQL_CHECK_SSL
|
||||
dnl
|
||||
dnl Provides the following configure options:
|
||||
dnl --with-ssl=DIR
|
||||
dnl Possible DIR values are:
|
||||
dnl - no - the macro will disable use of ssl
|
||||
dnl - bundled, empty or not specified - means use ssl lib
|
||||
dnl bundled along with MySQL sources
|
||||
dnl - ssl location prefix - given location prefix, the macro expects
|
||||
dnl to find the header files in $prefix/include/, and libraries in
|
||||
dnl $prefix/lib. If headers or libraries weren't found at $prefix, the
|
||||
dnl macro bails out with error.
|
||||
dnl
|
||||
dnl ------------------------------------------------------------------------
|
||||
AC_DEFUN([MYSQL_CHECK_SSL], [
|
||||
AC_MSG_CHECKING(for SSL)
|
||||
AC_ARG_WITH([ssl],
|
||||
[ --with-ssl[=DIR] Include SSL support],
|
||||
[mysql_ssl_dir="$withval"],
|
||||
[mysql_ssl_dir=no])
|
||||
|
||||
case "$mysql_ssl_dir" in
|
||||
"no")
|
||||
#
|
||||
# Don't include SSL support
|
||||
#
|
||||
AC_MSG_RESULT([disabled])
|
||||
;;
|
||||
|
||||
"bundled"|"yes")
|
||||
#
|
||||
# Use the bundled SSL implementation (yaSSL)
|
||||
#
|
||||
MYSQL_USE_BUNDLED_YASSL
|
||||
;;
|
||||
|
||||
*)
|
||||
#
|
||||
# A location where to search for OpenSSL was specified
|
||||
#
|
||||
MYSQL_FIND_OPENSSL([$mysql_ssl_dir])
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL([HAVE_YASSL], [ test "$with_yassl" = "yes" ])
|
||||
])
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
AC_DEFUN([MYSQL_CHECK_YASSL], [
|
||||
AC_MSG_CHECKING(for yaSSL)
|
||||
AC_ARG_WITH([yassl], [ --with-yassl Include the yaSSL support],,)
|
||||
|
||||
if test "$with_yassl" = "yes"
|
||||
then
|
||||
if test "$openssl" != "no"
|
||||
then
|
||||
AC_MSG_ERROR([Cannot configure MySQL to use yaSSL and OpenSSL simultaneously.])
|
||||
fi
|
||||
AC_MSG_RESULT([using bundled yaSSL])
|
||||
AC_CONFIG_FILES(extra/yassl/Makefile dnl
|
||||
extra/yassl/taocrypt/Makefile dnl
|
||||
extra/yassl/taocrypt/benchmark/Makefile dnl
|
||||
extra/yassl/taocrypt/src/Makefile dnl
|
||||
extra/yassl/taocrypt/test/Makefile dnl
|
||||
extra/yassl/src/Makefile dnl
|
||||
extra/yassl/testsuite/Makefile)
|
||||
yassl_dir="yassl"
|
||||
yassl_libs="-L\$(top_srcdir)/extra/yassl/src -lyassl -L\$(top_srcdir)/extra/yassl/taocrypt/src -ltaocrypt"
|
||||
yassl_includes="-I\$(top_srcdir)/extra/yassl/include"
|
||||
AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.])
|
||||
AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.])
|
||||
# System specific checks
|
||||
yassl_integer_extra_cxxflags=""
|
||||
case $host_cpu--$CXX_VERSION in
|
||||
sparc*--*Sun*C++*5.6*)
|
||||
# Disable inlining when compiling taocrypt/src/
|
||||
yassl_taocrypt_extra_cxxflags="+d"
|
||||
AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/])
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([yassl_taocrypt_extra_cxxflags])
|
||||
# Link extra/yassl/include/openssl subdir to include/
|
||||
yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl"
|
||||
AC_SUBST(yassl_h_ln_cmd)
|
||||
else
|
||||
yassl_dir=""
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST(yassl_libs)
|
||||
AC_SUBST(yassl_includes)
|
||||
AC_SUBST(yassl_dir)
|
||||
AM_CONDITIONAL([HAVE_YASSL], [ test "$with_yassl" = "yes" ])
|
||||
])
|
||||
|
|
@ -36,10 +36,9 @@ sinclude(config/ac-macros/ha_berkeley.m4)
|
|||
sinclude(config/ac-macros/ha_ndbcluster.m4)
|
||||
sinclude(config/ac-macros/large_file.m4)
|
||||
sinclude(config/ac-macros/misc.m4)
|
||||
sinclude(config/ac-macros/openssl.m4)
|
||||
sinclude(config/ac-macros/readline.m4)
|
||||
sinclude(config/ac-macros/replication.m4)
|
||||
sinclude(config/ac-macros/yassl.m4)
|
||||
sinclude(config/ac-macros/ssl.m4)
|
||||
sinclude(config/ac-macros/zlib.m4)
|
||||
|
||||
# Remember to add a directory sql/share/LANGUAGE
|
||||
|
|
@ -2203,8 +2202,7 @@ MYSQL_CHECK_BIG_TABLES
|
|||
MYSQL_CHECK_MAX_INDEXES
|
||||
MYSQL_CHECK_REPLICATION
|
||||
MYSQL_CHECK_VIO
|
||||
MYSQL_CHECK_OPENSSL
|
||||
MYSQL_CHECK_YASSL
|
||||
MYSQL_CHECK_SSL
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Declare our plugin modules
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue