diff options
-rw-r--r-- | Makefile.am | 11 | ||||
-rw-r--r-- | acinclude.m4 | 108 | ||||
-rw-r--r-- | configure.in | 23 | ||||
-rw-r--r-- | libmysql/Makefile.am | 2 | ||||
-rw-r--r-- | libmysql_r/Makefile.am | 3 | ||||
-rw-r--r-- | libmysqld/Makefile.am | 2 | ||||
-rw-r--r-- | myisam/Makefile.am | 7 | ||||
-rw-r--r-- | mysys/Makefile.am | 3 | ||||
-rw-r--r-- | sql/Makefile.am | 19 | ||||
-rw-r--r-- | tools/Makefile.am | 22 | ||||
-rw-r--r-- | zlib/Makefile.am | 29 |
11 files changed, 167 insertions, 62 deletions
diff --git a/Makefile.am b/Makefile.am index f8efb247c95..e2d61e56b60 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,8 +19,15 @@ AUTOMAKE_OPTIONS = foreign # These are built from source in the Docs directory -EXTRA_DIST = INSTALL-SOURCE README COPYING zlib -SUBDIRS = . include @docs_dirs@ \ +EXTRA_DIST = INSTALL-SOURCE README COPYING +SUBDIRS = . include @docs_dirs@ @zlib_dir@ \ + @readline_topdir@ sql-common \ + @thread_dirs@ pstack @sql_client_dirs@ \ + @sql_server_dirs@ scripts man tests \ + netware @libmysqld_dirs@ \ + @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ + +DIST_SUBDIRS = . include @docs_dirs@ zlib \ @readline_topdir@ sql-common \ @thread_dirs@ pstack @sql_client_dirs@ \ @sql_server_dirs@ scripts man tests SSL\ diff --git a/acinclude.m4 b/acinclude.m4 index 0e6dab052ab..bcfa7b55e9b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -167,32 +167,94 @@ then fi ]) -AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [ -save_LIBS="$LIBS" -LIBS="-l$1 $LIBS" -AC_CACHE_CHECK([if libz with compress], mysql_cv_compress, -[AC_TRY_RUN([#include <zlib.h> -#ifdef __cplusplus -extern "C" -#endif -int main(int argv, char **argc) -{ - return 0; -} -int link_test() -{ - return compress(0, (unsigned long*) 0, "", 0); -} -], mysql_cv_compress=yes, mysql_cv_compress=no)]) -if test "$mysql_cv_compress" = "yes" -then - AC_DEFINE([HAVE_COMPRESS], [1], [ZLIB and compress]) -else - LIBS="$save_LIBS" -fi +dnl MYSQL_CHECK_ZLIB_WITH_COMPRESS +dnl ------------------------------------------------------------------------ +dnl @synopsis MYSQL_CHECK_ZLIB_WITH_COMPRESS +dnl +dnl Provides the following configure options: +dnl --with-zlib-dir - custom location of compression library. +dnl MySQL needs both header file (zlib.h) and the library +dnl (libz.a). Given location prefix, the macro expects +dnl to find the library headers in $prefix/include, +dnl and binaries in $prefix/lib. If DIR is "no", +dnl compression and all dependent functions will be +dnl disabled. +dnl The call checks presense of 'zlib' compression library in default or +dnl given location. If there is no default library, the macro falls +dnl back to use zlib bundled along with MySQL sources. But if configure is +dnl called with custom name/path, and there is no library at given place, +dnl the macro bails out with error. +dnl +dnl If the library was found, this function #defines HAVE_COMPRESS +dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include) and +dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz). +dnl +dnl Exception is Novell Netware, where we assume zlib is always present. + +AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [ +AC_MSG_CHECKING([for zlib compression library]) +case $SYSTEM_TYPE in + *netware* | *modesto*) + AC_MSG_RESULT(ok) + ;; + *) + AC_ARG_WITH([zlib-dir], + AC_HELP_STRING([--with-zlib-dir=DIR], + [Provide MySQL with a custom location of + compression library. Given DIR, zlib binary is + assumed to be in $DIR/lib and header files + in $DIR/include.]), + [mysql_zlib_dir=${withval}], + [mysql_zlib_dir=""]) + if test "$mysql_zlib_dir" = "no"; then + mysql_cv_compress="no" + AC_MSG_RESULT([disabled]) + else + if test "$mysql_zlib_dir" = ""; then + ZLIB_INCLUDES="" + ZLIB_LIBS="-lz" + else + if test -f "$mysql_zlib_dir/lib/libz.a" -a \ + -f "$mysql_zlib_dir/include/zlib.h"; then + true + else + AC_MSG_ERROR([headers or binaries were not found in $mysql_zlib_dir/{include,lib}]) + fi + ZLIB_INCLUDES="-I$mysql_zlib_dir/include" + ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz" + fi + save_INCLUDES="$INCLUDES" + save_LIBS="$LIBS" + INCLUDES="$ZLIB_INCLUDES" + LIBS="$ZLIB_LIBS" + AC_CACHE_VAL([mysql_cv_compress], + [AC_TRY_LINK([#include <zlib.h>], + [int link_test() { return compress(0, (unsigned long*) 0, "", 0); }], + [mysql_cv_compress="yes" + AC_MSG_RESULT(ok)], + [if test "$mysql_zlib_dir" = ""; then + AC_MSG_RESULT([system-wide zlib not found, using one bundled with MySQL]) + ZLIB_INCLUDES="-I\$(top_srcdir)/zlib" + ZLIB_LIBS="-L\$(top_builddir)/zlib -lz" + zlib_dir="zlib" + AC_SUBST([zlib_dir]) + mysql_cv_compress="yes" + else + AC_MSG_ERROR([not found in $mysql_zlib_dir]) + fi])]) + INCLUDES="$save_INCLUDES" + LIBS="$save_LIBS" + AC_DEFINE([HAVE_COMPRESS], [1], [Define if zlib is present]) + AC_SUBST([ZLIB_LIBS]) + AC_SUBST([ZLIB_INCLUDES]) + fi + ;; +esac ]) +dnl ------------------------------------------------------------------------ + #---START: Used in for client configure AC_DEFUN(MYSQL_CHECK_ULONG, [AC_MSG_CHECKING(for type ulong) diff --git a/configure.in b/configure.in index 080c2bcc823..7309d73970e 100644 --- a/configure.in +++ b/configure.in @@ -664,15 +664,6 @@ AC_ARG_WITH(named-curses-libs, [ with_named_curses=no ] ) -# Force use of a zlib (compress) -AC_ARG_WITH(named-z-libs, - [ --with-named-z-libs=ARG - Use specified zlib libraries instead of - those automatically found by configure.], - [ with_named_zlib=$withval ], - [ with_named_zlib=z ] - ) - # Make thread safe client AC_ARG_ENABLE(thread-safe-client, [ --enable-thread-safe-client @@ -806,16 +797,7 @@ AC_CHECK_FUNC(crypt, AC_DEFINE([HAVE_CRYPT], [1], [crypt])) # For sem_xxx functions on Solaris 2.6 AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init)) - -# For compress in zlib -case $SYSTEM_TYPE in - *netware* | *modesto*) - AC_DEFINE(HAVE_COMPRESS, [1]) - ;; - *) - MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib) - ;; -esac +MYSQL_CHECK_ZLIB_WITH_COMPRESS #-------------------------------------------------------------------- # Check for TCP wrapper support @@ -945,7 +927,7 @@ then fi # We make a special variable for client library's to avoid including # thread libs in the client. -NON_THREADED_CLIENT_LIBS="$LIBS" +NON_THREADED_CLIENT_LIBS="$LIBS $ZLIB_LIBS" AC_MSG_CHECKING([for int8]) case $SYSTEM_TYPE in @@ -3082,6 +3064,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl include/mysql_version.h dnl cmd-line-utils/Makefile dnl cmd-line-utils/libedit/Makefile dnl + zlib/Makefile dnl cmd-line-utils/readline/Makefile) AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h) AC_OUTPUT diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index 3e026fe589a..7e43ff751f9 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -20,7 +20,7 @@ target = libmysqlclient.la target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@ LIBS = @CLIENT_LIBS@ -INCLUDES = -I$(top_srcdir)/include $(openssl_includes) +INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ include $(srcdir)/Makefile.shared diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am index b75f65b6f78..5329c2cf18f 100644 --- a/libmysql_r/Makefile.am +++ b/libmysql_r/Makefile.am @@ -21,7 +21,8 @@ target = libmysqlclient_r.la target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ LIBS = @LIBS@ @openssl_libs@ -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes) +INCLUDES = @MT_INCLUDES@ \ + -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ ## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include include $(top_srcdir)/libmysql/Makefile.shared diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index a0825a6a4fd..75a5ef7ff91 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -27,7 +27,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \ -I$(top_srcdir)/sql -I$(top_srcdir)/regex \ - $(openssl_includes) + $(openssl_includes) @ZLIB_INCLUDES@ noinst_LIBRARIES = libmysqld_int.a pkglib_LIBRARIES = libmysqld.a diff --git a/myisam/Makefile.am b/myisam/Makefile.am index 5aa0740261e..9f4eef348a3 100644 --- a/myisam/Makefile.am +++ b/myisam/Makefile.am @@ -18,8 +18,11 @@ EXTRA_DIST = mi_test_all.sh mi_test_all.res pkgdata_DATA = mi_test_all mi_test_all.res INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a ../mysys/libmysys.a \ - ../dbug/libdbug.a ../strings/libmystrings.a +LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \ + $(top_builddir)/mysys/libmysys.a \ + $(top_builddir)/dbug/libdbug.a \ + @ZLIB_LIBS@ \ + $(top_builddir)/strings/libmystrings.a pkglib_LIBRARIES = libmyisam.a bin_PROGRAMS = myisamchk myisamlog myisampack myisam_ftdump myisamchk_DEPENDENCIES= $(LIBRARIES) diff --git a/mysys/Makefile.am b/mysys/Makefile.am index d4290bbc49b..3ffeeab0411 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -17,7 +17,8 @@ MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir= $(prefix) -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) +INCLUDES = @MT_INCLUDES@ \ + @ZLIB_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) pkglib_LIBRARIES = libmysys.a LDADD = libmysys.a ../dbug/libdbug.a \ ../strings/libmystrings.a diff --git a/sql/Makefile.am b/sql/Makefile.am index 007239f2e8c..9859f1ef841 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -19,7 +19,7 @@ MYSQLDATAdir = $(localstatedir) MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir= $(prefix) -INCLUDES = @MT_INCLUDES@ \ +INCLUDES = @MT_INCLUDES@ @ZLIB_INCLUDES@ \ @bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \ -I$(top_srcdir)/include -I$(top_srcdir)/regex \ -I$(srcdir) $(openssl_includes) @@ -30,14 +30,15 @@ noinst_PROGRAMS = gen_lex_hash bin_PROGRAMS = mysql_tzinfo_to_sql gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@ LDADD = @isam_libs@ \ - ../myisam/libmyisam.a \ - ../myisammrg/libmyisammrg.a \ - ../heap/libheap.a \ - ../vio/libvio.a \ - ../mysys/libmysys.a \ - ../dbug/libdbug.a \ - ../regex/libregex.a \ - ../strings/libmystrings.a + @ZLIB_LIBS@ \ + $(top_builddir)/myisam/libmyisam.a \ + $(top_builddir)/myisammrg/libmyisammrg.a \ + $(top_builddir)/heap/libheap.a \ + $(top_builddir)/vio/libvio.a \ + $(top_builddir)/mysys/libmysys.a \ + $(top_builddir)/dbug/libdbug.a \ + $(top_builddir)/regex/libregex.a \ + $(top_builddir)/strings/libmystrings.a mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \ @bdb_libs@ @innodb_libs@ @pstack_libs@ \ diff --git a/tools/Makefile.am b/tools/Makefile.am index 0dc0b90c60e..50d1c8af56a 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,23 @@ -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes) -LDADD= @CLIENT_EXTRA_LDFLAGS@ ../libmysql_r/libmysqlclient_r.la @openssl_libs@ +# Copyright (C) 2004 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Process this file with automake to create Makefile.in + +INCLUDES=@MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes) +LDADD= @CLIENT_EXTRA_LDFLAGS@ @openssl_libs@ @ZLIB_LIBS@ \ + $(top_builddir)/libmysql_r/libmysqlclient_r.la \ bin_PROGRAMS= mysqlmanager mysqlmanager_SOURCES= mysqlmanager.c mysqlmanager_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) diff --git a/zlib/Makefile.am b/zlib/Makefile.am new file mode 100644 index 00000000000..81d0f26082d --- /dev/null +++ b/zlib/Makefile.am @@ -0,0 +1,29 @@ +# Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Process this file with automake to create Makefile.in + +noinst_LIBRARIES=libz.a + +noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ + inftrees.h trees.h zconf.h zlib.h zutil.h + +libz_a_SOURCES= adler32.c compress.c crc32.c deflate.c gzio.c \ + infback.c inffast.c inflate.c inftrees.c trees.c \ + uncompr.c zutil.c + +EXTRA_DIST= README FAQ INDEX ChangeLog algorithm.txt zlib.3 + |