diff options
Diffstat (limited to 'config/ac-macros')
-rw-r--r-- | config/ac-macros/maintainer.m4 | 64 | ||||
-rw-r--r-- | config/ac-macros/plugins.m4 | 64 | ||||
-rw-r--r-- | config/ac-macros/ssl.m4 | 11 |
3 files changed, 125 insertions, 14 deletions
diff --git a/config/ac-macros/maintainer.m4 b/config/ac-macros/maintainer.m4 new file mode 100644 index 00000000000..1b7df75d6f7 --- /dev/null +++ b/config/ac-macros/maintainer.m4 @@ -0,0 +1,64 @@ +# +# Control aspects of the development environment which are +# specific to MySQL maintainers and developers. +# +AC_DEFUN([MY_MAINTAINER_MODE], [ + AC_MSG_CHECKING([whether to enable the maintainer-specific development environment]) + AC_ARG_ENABLE([mysql-maintainer-mode], + [AS_HELP_STRING([--enable-mysql-maintainer-mode], + [Enable a MySQL maintainer-specific development environment])], + [USE_MYSQL_MAINTAINER_MODE=$enableval], + [USE_MYSQL_MAINTAINER_MODE=no]) + AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE]) +]) + +# Set warning options required under maintainer mode. +AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [ + # Setup GCC warning options. + AS_IF([test "$GCC" = "yes"], [ + C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror" + CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter" + ]) + + # Test whether the warning options work. + # Test C options + AS_IF([test -n "$C_WARNINGS"], [ + save_CFLAGS="$CFLAGS" + AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}]) + AC_LANG_PUSH(C) + CFLAGS="$CFLAGS ${C_WARNINGS}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes], + [myac_c_warning_flags=no]) + AC_LANG_POP() + AC_MSG_RESULT([$myac_c_warning_flags]) + CFLAGS="$save_CFLAGS" + ]) + + # Test C++ options + AS_IF([test -n "$CXX_WARNINGS"], [ + save_CXXFLAGS="$CXXFLAGS" + AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}]) + AC_LANG_PUSH(C++) + CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes], + [myac_cxx_warning_flags=no]) + AC_LANG_POP() + AC_MSG_RESULT([$myac_cxx_warning_flags]) + CXXFLAGS="$save_CXXFLAGS" + ]) + + # Set compile flag variables. + AS_IF([test "$myac_c_warning_flags" = "yes"], [ + AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}" + AC_SUBST([AM_CFLAGS])]) + AS_IF([test "$myac_cxx_warning_flags" = "yes"], [ + AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}" + AC_SUBST([AM_CXXFLAGS])]) +]) + + +# Set compiler flags required under maintainer mode. +AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [ + AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"], + [MY_MAINTAINER_MODE_WARNINGS]) +]) diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index f74c4daba61..cfc70d188a9 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -26,7 +26,7 @@ AC_DEFUN([MYSQL_PLUGIN],[ [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__], m4_default([$2], [$1 plugin]), m4_default([$3], [plugin for $1]), - m4_default([$4], []), + m4_default([[$4]], []), ) ]) @@ -61,7 +61,7 @@ dnl dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_STORAGE_ENGINE],[ - MYSQL_PLUGIN([$1], [$3], [$4], [[$5]]) + MYSQL_PLUGIN([$1], [$3], [$4], [$5]) MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) ifelse([$2],[no],[],[ _MYSQL_LEGACY_STORAGE_ENGINE( @@ -203,6 +203,30 @@ AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[ dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_PLUGIN_WITHOUT +dnl +dnl SYNOPSIS +dnl MYSQL_PLUGIN_WITHOUT([name]) +dnl +dnl DESCRIPTION +dnl Exclude the plugin from being built, as if --without-plugin-name +dnl was specified. +dnl If the plugin was selected manually by --with-plugin-name, +dnl excluding it here will abort the configure script with an error, +dnl otherwise plugin will be silently disabled. +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_PLUGIN_WITHOUT],[ + MYSQL_REQUIRE_PLUGIN([$1]) + if test "X[$with_plugin_]$1" = Xyes; then + AC_MSG_ERROR([Plugin $1 cannot be built]) + else + [with_plugin_]$1=no + fi +]) + +dnl --------------------------------------------------------------------------- dnl Macro: MYSQL_PLUGIN_DEPENDS dnl dnl SYNOPSIS @@ -343,7 +367,7 @@ AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ m4_ifdef([$5],[ - AH_TEMPLATE($5, [Include ]$4[ into mysqld]) + AH_TEMPLATE($5, [Include ]$3[ into mysqld]) ]) AC_MSG_CHECKING([whether to use ]$3) mysql_use_plugin_dir="" @@ -351,10 +375,10 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ if test "X[$mysql_plugin_]$2" = Xyes -a \ "X[$with_plugin_]$2" != Xno -o \ "X[$with_plugin_]$2" = Xyes; then - AC_MSG_RESULT([error]) + __MYSQL_EMIT_CHECK_RESULT($3,[error]) AC_MSG_ERROR([disabled]) fi - AC_MSG_RESULT([no]) + __MYSQL_EMIT_CHECK_RESULT($3,[no]) ],[ # Plugin is not disabled, determine if it should be built, @@ -365,7 +389,7 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ # Plugin directory was removed after autoconf was run; treat # this as a disabled plugin if test "X[$with_plugin_]$2" = Xyes; then - AC_MSG_RESULT([error]) + __MYSQL_EMIT_CHECK_RESULT($3,[error]) AC_MSG_ERROR([disabled]) fi @@ -376,7 +400,7 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ m4_ifdef([$9],[ if test "X[$with_plugin_]$2" = Xno; then - AC_MSG_RESULT([error]) + __MYSQL_EMIT_CHECK_RESULT($3,[error]) AC_MSG_ERROR([cannot disable mandatory plugin]) fi [mysql_plugin_]$2=yes @@ -391,11 +415,19 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ fi ;; esac + # Similarly, disable shared plugins when configured with --disable-shared + # as libtool will not be able to produce them + if test "X[$enable_shared]" = Xno; then + if test "X[$mysql_plugin_]$2" != Xyes -a \ + "X[$with_plugin_]$2" != Xyes; then + [with_plugin_]$2=no + fi + fi ]) if test "X[$with_plugin_]$2" = Xno; then - AC_MSG_RESULT([no]) + __MYSQL_EMIT_CHECK_RESULT($3,[no]) else m4_ifdef([$8],m4_ifdef([$7],[],[[with_plugin_]$2=''])) if test "X[$mysql_plugin_]$2" != Xyes -a \ @@ -408,16 +440,16 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ AC_SUBST([plugin_]$2[_shared_target], "$8") AC_SUBST([plugin_]$2[_static_target], [""]) [with_plugin_]$2=yes - AC_MSG_RESULT([plugin]) + __MYSQL_EMIT_CHECK_RESULT($3,[plugin]) m4_ifdef([$6],[ else [mysql_plugin_]$2=no - AC_MSG_RESULT([no]) + __MYSQL_EMIT_CHECK_RESULT($3,[no]) fi ]) ],[ [with_plugin_]$2=no - AC_MSG_RESULT([no]) + __MYSQL_EMIT_CHECK_RESULT($3,[no]) ]) else m4_ifdef([$7],[ @@ -450,7 +482,7 @@ dnl Although this is "pretty", it breaks libmysqld build AC_SUBST([plugin_]$2[_shared_target], [""]) ],[ m4_ifdef([$6],[ - AC_MSG_RESULT([error]) + __MYSQL_EMIT_CHECK_RESULT($3,[error]) AC_MSG_ERROR([Plugin $1 does not support static linking]) ],[ m4_ifdef([$5],[ @@ -462,7 +494,7 @@ dnl Although this is "pretty", it breaks libmysqld build ]) maria_plugin_defs="$maria_plugin_defs, [builtin_maria_]$2[_plugin]" [with_plugin_]$2=yes - AC_MSG_RESULT([yes]) + __MYSQL_EMIT_CHECK_RESULT($3,[yes]) m4_ifdef([$11], [ m4_foreach([plugin], [$11], [ condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp(plugin, [[^/]+$], [\&])" @@ -518,6 +550,12 @@ dnl ]) ]) +AC_DEFUN([__MYSQL_EMIT_CHECK_RESULT],[ + AC_MSG_RESULT($2) + plugin_report="[$plugin_report] +m4_format([ * %-32s $2],$1:)" +]) + AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[ ifelse($#, 0, [], $#, 1, [ _MYSQL_EMIT_PLUGIN_ACTION([$1]) diff --git a/config/ac-macros/ssl.m4 b/config/ac-macros/ssl.m4 index 729115ffe88..fc55f93d8d6 100644 --- a/config/ac-macros/ssl.m4 +++ b/config/ac-macros/ssl.m4 @@ -38,11 +38,20 @@ AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [ esac AC_SUBST([yassl_taocrypt_extra_cxxflags]) + # Thread safe check + yassl_thread_cxxflags="" + yassl_thread_safe="" + if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"; then + yassl_thread_cxxflags="-DYASSL_THREAD_SAFE" + yassl_thread_safe="(thread-safe)" + fi + AC_SUBST([yassl_thread_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]) + AC_MSG_RESULT([using bundled yaSSL $yassl_thread_safe]) ]) |