summaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorJoerg Bruehe <joerg@mysql.com>2009-09-17 18:34:24 +0200
committerJoerg Bruehe <joerg@mysql.com>2009-09-17 18:34:24 +0200
commitdb890516564ebe4856e5cc100e689f33eae6c1eb (patch)
treefbc4db7ebc1f7f433063d6b32bd4f8a13ba07292 /unittest
parentd42364c6300b6547b45f9664808e6ab5c54d9379 (diff)
downloadmariadb-git-db890516564ebe4856e5cc100e689f33eae6c1eb.tar.gz
Fix bug#46980
Option "--without-server" still not working in 5.1 The general approach is to make sure that source files which require thread support are only compiled if the build really needs thread support, which means when the server is built or a thread-safe client library. This required several changes: - Make sure the subdirectories "storage/" and "plugin/" are only processed if the server is built, not ifclient-only. - Make the compilation of some modules which inherently require threading depend on thread supportin the build. - Separate the handling of threading in "configure.in" from that of server issues, threading is also needed in a non-server build of a thread-safe client library. Also, "libdbug" must get built even in a client-only build, so "dbug/" must be in the list of client directories. In addition, calls to thread functions in source files which can be built without thread support must use the wrapper functions which handle the non-threaded build. So the modules "client/mysqlimport.c" and "client/mysqlslap.c" must call "my_thread_end()" only via "mysql_thread_end()". Makefile.am: The directories "storage/" and "plugin/" contain files which are needed for the server only, so their contents is to be built only if a server is built. They must not be named unconditionally, because building their contents will fail unless threads are enabled. These directories are now listed in the "configure" variable "sql_server_dirs" which becomes part of "sql_union_dirs" if the server is to be built. client/mysqlimport.c: Use the wrapper function "mysql_thread_end()" which correctly handles the case of a non-threaded build. client/mysqlslap.c: Use the wrapper function "mysql_thread_end()" which correctly handles the case of a non-threaded build. configure.in: Various changes to support builds "--without-server": 1) For the unit tests, we need "libdbug". 2) Separate the treatment of the server from that of the thread-safe client library. 3) Introduce an "automake conditional" "NEED_THREAD" which can be checked in some "Makefile.am". 4) Include "storage/" and "plugin/" in the list of "sql_server_dirs" so that they are handled in the top "Makefile.am" only if the server is to be built (see the change in that file). mysys/Makefile.am: The code of "mf_keycache.c" in 5.1 is no longer safe to be built without thread support. (In 5.0, this was possible.) Rather than fix these issues, which is tedious and risky, avoid the need to ever build it without thread support: It is needed in the server only, which needs thread support. The only case where we build a "libmysys" without thread support is for a non-threaded client, where "mf_keycache" is not neded. So its inclusion in the list of source files can depend on the new conditional "NEED_THREAD". unittest/mysys/Makefile.am: Test program "my_atomic-t" is to verify the correct handling of threads only, it cannot be built without thread support and is not needed in such cases either. Let its build depend on the new conditional "NEED_THREAD".
Diffstat (limited to 'unittest')
-rw-r--r--unittest/mysys/Makefile.am11
1 files changed, 9 insertions, 2 deletions
diff --git a/unittest/mysys/Makefile.am b/unittest/mysys/Makefile.am
index be91ef31c9d..f0ffc7a6720 100644
--- a/unittest/mysys/Makefile.am
+++ b/unittest/mysys/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2006 MySQL AB
+# Copyright (C) 2009 Sun Microsystems, Inc.
#
# 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
@@ -21,7 +21,14 @@ LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a
-noinst_PROGRAMS = bitmap-t base64-t my_atomic-t
+noinst_PROGRAMS = bitmap-t base64-t
+
+if NEED_THREAD
+# my_atomic-t is used to check thread functions, so it is safe to
+# ignore the file in non-threaded builds.
+# In fact, it will not compile without thread support.
+noinst_PROGRAMS += my_atomic-t
+endif
# Don't update the files from bitkeeper
%::SCCS/s.%