diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 250 |
1 files changed, 186 insertions, 64 deletions
diff --git a/configure.in b/configure.in index 9f361d88a38..6ff35483898 100644 --- a/configure.in +++ b/configure.in @@ -12,7 +12,7 @@ dnl dnl When changing the major version number please also check the switch dnl statement in mysqlbinlog::check_master_version(). You may also need dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.1.67], [], [mysql]) +AC_INIT([MariaDB Server], [5.1.67-MariaDB], [], [mysql]) AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CANONICAL_SYSTEM @@ -76,6 +76,7 @@ sinclude(config/ac-macros/large_file.m4) sinclude(config/ac-macros/misc.m4) sinclude(config/ac-macros/readline.m4) sinclude(config/ac-macros/ssl.m4) +sinclude(config/ac-macros/libevent.m4) sinclude(config/ac-macros/zlib.m4) # Remember to add a directory sql/share/LANGUAGE @@ -110,7 +111,19 @@ AC_ARG_WITH([debug], [with_debug=$withval], [with_debug=no]) +AC_ARG_WITH([valgrind], + [AS_HELP_STRING([--with-valgrind], + [Valgrind instrumentation @<:@default=no@:>@])], + [], [with_valgrind=no]) + +if test "$with_valgrind" != "no" +then + AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h], + [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])]) +fi + # Whether the maintainer mode should be enabled. +# Note that this uses $with_debug and $with_valgrind MY_MAINTAINER_MODE # Canonicalize the configuration name. @@ -248,14 +261,6 @@ then GXX="no" fi -if test "$ac_cv_prog_gcc" = "yes" -then - AS="$CC -c" - AC_SUBST(AS) -else - AC_PATH_PROG(AS, as, as) -fi - # Still need ranlib for readline; local static use only so no libtool. AC_PROG_RANLIB # We use libtool @@ -264,7 +269,7 @@ AC_PROG_LIBTOOL # Ensure that we have --preserve-dup-deps defines, otherwise we get link # problems of 'mysql' with CXX=g++ -LIBTOOL="$LIBTOOL --preserve-dup-deps" +#LIBTOOL="$LIBTOOL --preserve-dup-deps" AC_SUBST(LIBTOOL)dnl AC_SUBST(NM)dnl @@ -282,8 +287,40 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' # Not critical since the generated file is distributed AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL']) -AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf) -AC_CHECK_PROG(DVIS, tex, manual.dvi) + +#check the return type of sprintf +AC_MSG_CHECKING("return type of sprintf") +AC_TRY_RUN([ + int main() + { + char* s = "hello"; + char buf[6]; + if((int)sprintf(buf, s) == strlen(s)) + return 0; + + return -1; + } + ], + [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf]) + AC_MSG_RESULT("int")], + [AC_TRY_RUN([ + int main() + { + char* s = "hello"; + char buf[6]; + if((char*)sprintf(buf,s) == buf + strlen(s)) + return 0; + return -1; + } ], + [AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf]) + AC_MSG_RESULT("ptr")], + [AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf]) + AC_MSG_RESULT("garbage")] + )], + # Cross compile, assume POSIX + [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf]) + AC_MSG_RESULT("int (we assume)")] +) AC_PATH_PROG(uname_prog, uname, no) @@ -362,7 +399,7 @@ export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS if test "$GCC" = "yes" then # mysqld requires -fno-implicit-templates. - # Disable exceptions as they seams to create problems with gcc and threads. + # Disable exceptions as they seem to create problems with gcc and threads. # mysqld doesn't use run-time-type-checking, so we disable it. # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc # regarding offset() usage in C++ which are done in a safe manner in the @@ -595,6 +632,14 @@ AC_ARG_WITH(other-libc, ) AC_SUBST(NOINST_LDFLAGS) +AC_ARG_ENABLE(distribution, + AC_HELP_STRING( + [--disable-distribution], + [Allow linking with system GPLv3 libraries. It may result in a binary that can not be legally distributed.]), + [ enable_distribution=$enableval ], + [ enable_distribution=yes ] + ) + # # Check if we are using Linux and a glibc compiled with static nss # (this is true on the MySQL build machines to avoid NSS problems) @@ -603,7 +648,7 @@ AC_CHECK_TOOL([NM], [nm]) if test "$TARGET_LINUX" = "true" -a "$static_nss" = "" then - tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a | grep _nss_files_getaliasent_r1` + tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a 2>&1 | grep _nss_files_getaliasent_r1` if test -n "$tmp" then STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv" @@ -678,9 +723,20 @@ AC_ARG_ENABLE(assembler, [ ENABLE_ASSEMBLER=no ] ) +# Don't use assembler if building on Solaris with native linker +# and with embedded. Because our asm code is not PIC and solaris ld +# aborts with an error when creating .so +if test "x$ENABLE_ASSEMBLER" = "xyes" -a \ + "x$LD_VERSION_SCRIPT" = "x" -a \ + "x$with_embedded_server" = "xyes" -a \ + `expr "$SYSTEM_TYPE" : "^.*solaris"` -gt 0; then + ENABLE_ASSEMBLER=no + AC_MSG_WARN([No assembler functions when non-GNU linker is used and embedded-server is enabled]) +fi + AC_MSG_CHECKING(if we should use assembler functions) # For now we only support assembler on i386 and sparc systems -AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)) +AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $CCAS $CCASFLAGS -c strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)) AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc") AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9") AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "") @@ -815,8 +871,8 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h fpu_control.h \ - ieeefp.h limits.h memory.h pwd.h select.h \ - stdlib.h stddef.h \ + ieeefp.h limits.h memory.h pwd.h select.h fnmatch.h \ + stdlib.h stddef.h sys/stat.h sys/sockio.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ @@ -1518,6 +1574,31 @@ else fi fi +# +# Solaris bug http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6611808 +# Detect and work around. +# +AC_MSG_CHECKING([for OpenSolaris Bug 6611808]) +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ + #include <pthread.h> + void dummy() {} + int main() + { + pthread_once_t once_control = { PTHREAD_ONCE_INIT }; + pthread_once(&once_control, dummy); + return 0; + } +])], [ + AC_DEFINE([PTHREAD_ONCE_INITIALIZER], [{PTHREAD_ONCE_INIT}], + [See OpenSolaris Bug 6611808]) + AC_MSG_RESULT([yes]) +], [ + AC_MSG_RESULT([no]) +]); +CFLAGS="$save_CFLAGS" + #---START: Used in for client configure # Must be checked after, because strtok_r may be in -lpthread # On AIX strtok_r is in libc_r @@ -1645,14 +1726,17 @@ if test "$with_debug" = "yes" then # Medium debug. AC_DEFINE([DBUG_ON], [1], [Use libdbug]) - CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DSAFE_MUTEX $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" + AC_DEFINE([SAFE_MUTEX], [1], [Use safe mutexes]) + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS" elif test "$with_debug" = "full" then # Full debug. Very slow in some cases AC_DEFINE([DBUG_ON], [1], [Use libdbug]) - CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" + AC_DEFINE([SAFE_MUTEX], [1], [Use safe mutexes]) + AC_DEFINE([SAFEMALLOC], [1], [Use safe malloc]) + CFLAGS="$DEBUG_CFLAGS $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS" else # Optimized version. No debug AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug]) @@ -1660,17 +1744,6 @@ else CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" fi -AC_ARG_WITH([valgrind], - [AS_HELP_STRING([--with-valgrind], - [Valgrind instrumentation @<:@default=no@:>@])], - [], [with_valgrind=no]) - -if test "$with_valgrind" != "no" -then - AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h], - [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])]) -fi - # Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it. AC_MSG_CHECKING(if Debug Sync Facility should be enabled.) AC_ARG_ENABLE(debug_sync, @@ -1719,22 +1792,8 @@ then fi fi -AC_ARG_WITH([atomic-ops], - AC_HELP_STRING([--with-atomic-ops=rwlocks|smp|up], - [Implement atomic operations using pthread rwlocks or atomic CPU - instructions for multi-processor (default) or uniprocessor - configuration]), , [with_atomic_ops=smp]) -case "$with_atomic_ops" in - "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1], - [Assume single-CPU mode, no concurrency]) ;; - "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1], - [Use pthread rwlocks for atomic ops]) ;; - "smp") ;; - *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;; -esac - AC_CACHE_CHECK([whether the compiler provides atomic builtins], - [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([ + [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([ int main() { int foo= -10; int bar= 10; @@ -1754,9 +1813,30 @@ AC_CACHE_CHECK([whether the compiler provides atomic builtins], if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1, - [Define to 1 if compiler provides atomic builtins.]) + [Define to 1 if compiler provides atomic builtins.]) fi +AC_ARG_WITH([atomic-ops], + AC_HELP_STRING([--with-atomic-ops=rwlocks|smp|up], + [Implement atomic operations using pthread rwlocks or atomic CPU + instructions for multi-processor or uniprocessor + configuration. By default gcc built-in sync functions are used, + if available and 'smp' configuration otherwise.])) +case "$with_atomic_ops" in + "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1], + [Assume single-CPU mode, no concurrency]) ;; + "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1], + [Use pthread rwlocks for atomic ops]) ;; + "smp") ;; + "") + if test "x$mysql_cv_gcc_atomic_builtins" = xyes_but_disabled; then + AC_DEFINE([MY_ATOMIC_MODE_GCC_BUILTINS], [1], + [Use GCC atomic builtins for atomic ops]) + fi + ;; + *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;; +esac + # Force static compilation to avoid linking problems/get more speed AC_ARG_WITH(mysqld-ldflags, [ --with-mysqld-ldflags Extra linking arguments for mysqld], @@ -2044,7 +2124,7 @@ AC_FUNC_VPRINTF AC_CHECK_DECLS([fdatasync, bzero]) -AC_CHECK_FUNCS(alarm bfill bmove bsearch bzero \ +AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \ chsize cuserid fchmod fcntl \ fconvert fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \ getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ @@ -2058,7 +2138,7 @@ AC_CHECK_FUNCS(alarm bfill bmove bsearch bzero \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ realpath rename rint rwlock_init setupterm \ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ - sighold sigset sigthreadmask port_create sleep \ + sighold sigset sigthreadmask port_create sleep thr_yield \ snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \ strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \ posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd printstack \ @@ -2445,6 +2525,7 @@ MYSQL_CHECK_BIG_TABLES MYSQL_CHECK_MAX_INDEXES MYSQL_CHECK_VIO MYSQL_CHECK_SSL +MYSQL_CHECK_LIBEVENT #-------------------------------------------------------------------- # Declare our plugin modules @@ -2452,12 +2533,22 @@ MYSQL_CHECK_SSL # functions tested above #-------------------------------------------------------------------- +# MyISAM is declared here,not in storage/myisam/plug.in +# because we want it to be the first in the list of plugins, +# Maria needs it. When it'll be fixed the declaration below can +# be removed and restored (uncommented) in storage/myisam/plug.in +MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine], + [Traditional non-transactional MySQL tables]) +MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam]) +MYSQL_PLUGIN_STATIC(myisam, [libmyisam_s.la], [libmyisam_embedded.la]) +MYSQL_PLUGIN_MANDATORY(myisam) dnl Default + MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support], [MySQL Partitioning Support], [max,max-no-ndb]) dnl -- ndbcluster requires partition to be enabled -MYSQL_CONFIGURE_PLUGINS([none]) +MYSQL_CONFIGURE_PLUGINS([default]) # Only build client code? AC_ARG_WITH(server, @@ -2619,7 +2710,7 @@ case $SYSTEM_TYPE in echo "Skipping readline" ;; *) - if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"] + if [test "$with_libedit" = "yes"] || ( [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"] ) then readline_topdir="cmd-line-utils" readline_basedir="libedit" @@ -2629,6 +2720,8 @@ case $SYSTEM_TYPE in compile_libedit=yes AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1) AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1) + AC_MSG_CHECKING([for libedit/readline]) + AC_MSG_RESULT([libedit bundled]) elif test "$with_readline" = "yes" then readline_topdir="cmd-line-utils" @@ -2639,6 +2732,8 @@ case $SYSTEM_TYPE in compile_readline=yes want_to_use_readline="yes" AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1) + AC_MSG_CHECKING([for libedit/readline]) + AC_MSG_RESULT([readline bundled]) else # Use system readline library AC_LANG_SAVE @@ -2653,12 +2748,16 @@ case $SYSTEM_TYPE in # this way we avoid linking commercial source with GPL readline readline_link="-lreadline" want_to_use_readline="yes" + AC_MSG_CHECKING([for libedit/readline]) + AC_MSG_RESULT([readline system]) elif [test "$mysql_cv_libedit_interface" = "yes"] then # Use libedit readline_link="-ledit" + AC_MSG_CHECKING([for libedit/readline]) + AC_MSG_RESULT([libedit system]) else - AC_MSG_ERROR([Could not find system readline or libedit libraries + AC_MSG_ERROR([Could not find usable system readline or libedit libraries Use --with-readline or --with-libedit to use the bundled versions of libedit or readline]) fi @@ -2680,8 +2779,6 @@ AC_SUBST(readline_basedir) AC_SUBST(readline_link) AC_SUBST(readline_h_ln_cmd) - - # Include man pages, if desired, adapted to the configured parts. if test X"$with_man" = Xyes then @@ -2743,7 +2840,7 @@ server_scripts= dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. -sql_client_dirs="strings mysys dbug extra regex libmysql" +sql_client_dirs="strings mysys dbug extra regex libmysql unittest" AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no") @@ -2775,9 +2872,6 @@ if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no" then AC_DEFINE([THREAD], [1], [Define if you want to have threaded code. This may be undef on client code]) - # Avoid _PROGRAMS names - THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o" - AC_SUBST(THREAD_LOBJECTS) fi AM_CONDITIONAL(NEED_THREAD, test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no") @@ -2788,6 +2882,7 @@ then sql_server="vio sql" fi +AM_CONDITIONAL(THREAD, test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no") # "innochecksum" is not in the "innobase/" subdirectory, but should be switched AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes -o X"$with_plugin_innodb_plugin" = Xyes ]) @@ -2805,6 +2900,7 @@ AC_SUBST(server_scripts) AC_SUBST(mysql_plugin_dirs) AC_SUBST(mysql_plugin_libs) +AC_SUBST(mysql_embedded_plugin_libs) AC_SUBST(mysql_plugin_defs) @@ -2869,12 +2965,35 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl include/mysql_version.h plugin/Makefile win/Makefile) AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h) +AC_CONFIG_COMMANDS([my_config.h], cp include/config.h include/my_config.h) # Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'") AC_OUTPUT +echo +echo "You can find information about MariaDB at" +echo http://askmonty.org/wiki/index.php/MariaDB +echo +echo "Remember to check the platform specific part of the reference manual for" +echo "hints about installing MariaDB on your platform. Also have a look at the" +echo "files in the Docs directory." +echo + +echo "---" +echo "Configuration summary for $PACKAGE_NAME version $VERSION" +echo "" +echo " * Installation prefix: $prefix" +echo " * System type: $SYSTEM_TYPE" +echo " * Host CPU: $host_cpu" +echo " * C Compiler: $CC_VERSION" +echo " * C++ Compiler: $CXX_VERSION" +echo " * Debug enabled: $with_debug" +echo " * Community Features: $ENABLE_COMMUNITY_FEATURES" +echo "" +echo "---" + # Add warning if user configures with --with-ndbcluster if test X"$with_plugin_ndbcluster" = Xyes ; then echo @@ -2884,12 +3003,15 @@ if test X"$with_plugin_ndbcluster" = Xyes ; then echo for more details. fi +if test "$enable_distribution" = "warn" +then + echo "You have linked MariaDB with GPLv3 libraries!" + echo "You may not distribute the resulting binary. If you do, you will " + echo "put yourself into a legal problem with Free Software Foundation." +fi + # The first line "Thank you ..." is checked in ./Do-compile to verify that configure # ended sucessfully - don't remove it. echo -echo "Thank you for choosing MySQL!" -echo -echo "Remember to check the platform specific part of the reference manual" -echo "for hints about installing MySQL on your platform." -echo "Also have a look at the files in the Docs directory." +echo "Thank you for choosing MariaDB!" echo |