Commit 42e9ffdc authored by unknown's avatar unknown

Change the behavior of --enable-thread-safe-client. It now builds

both a non-threaded libmysqlclient and a threaded libmysqlclient_r.


Makefile.am:
  - build libmysqlclient_r in a separate directory
include/global.h:
  - build libmysqlclient_r in a separate directory
libmysql/Makefile.am:
  - build libmysqlclient_r in a separate directory
parent 03f4445c
......@@ -21,7 +21,7 @@ TAR = gtar
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE README \
COPYING COPYING.LIB MIRRORS
SUBDIRS = include @docs_dirs@ @readline_dir@ libmysql client \
SUBDIRS = include @docs_dirs@ @readline_dir@ @sql_client_dirs@ \
@sql_server_dirs@ scripts tests man \
@bench_dirs@ support-files
......@@ -33,6 +33,7 @@ config.h: linked_client_sources linked_server_sources
linked_client_sources:
cd libmysql; $(MAKE) link_sources
cd libmysql_r; $(MAKE) link_sources
echo timestamp > linked_client_sources
#avoid recursive make calls in sql directory
......
......@@ -987,15 +987,6 @@ else
fi
#---END:
if test "$THREAD_SAFE_CLIENT" = "no"
then
CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS
else
CLIENT_LIBS=$LIBS
AC_DEFINE(THREAD_SAFE_CLIENT)
fi
AC_SUBST(CLIENT_LIBS)
# for user definable functions (must be checked after threads on AIX)
AC_CHECK_LIB(dl,dlopen)
......@@ -1769,6 +1760,19 @@ MYSQL_CHECK_BDB
# If we have threads generate some library functions and test programs
sql_server_dirs=
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="libmysql client"
CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS
if test "$THREAD_SAFE_CLIENT" != "no"
then
sql_client_dirs="libmysql_r $sql_client_dirs"
AC_DEFINE(THREAD_SAFE_CLIENT)
fi
AC_SUBST(CLIENT_LIBS)
AC_SUBST(sql_client_dirs)
if test "$with_server" = "yes"
then
AC_DEFINE(THREAD)
......@@ -1840,7 +1844,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile \
strings/Makefile regex/Makefile heap/Makefile \
myisam/Makefile myisammrg/Makefile \
man/Makefile \
readline/Makefile libmysql/Makefile client/Makefile \
readline/Makefile libmysql_r/Makefile libmysql/Makefile client/Makefile \
sql/Makefile sql/share/Makefile \
merge/Makefile dbug/Makefile scripts/Makefile \
include/Makefile sql-bench/Makefile \
......
......@@ -33,7 +33,7 @@
#endif /* _cplusplus */
/* The client defines this to avoid all thread code */
#if defined(UNDEF_THREADS_HACK) && !defined(THREAD_SAFE_CLIENT)
#if defined(UNDEF_THREADS_HACK)
#undef THREAD
#undef HAVE_mit_thread
#undef HAVE_LINUXTHREADS
......
......@@ -17,60 +17,15 @@
# This file is public domain and comes with NO WARRANTY of any kind
MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
INCLUDES = -I$(srcdir)/../include -I../include \
-I$(srcdir)/.. -I$(top_srcdir) -I..
target = libmysqlclient.la
target_defs = -DUNDEF_THREADS_HACK
LIBS = @CLIENT_LIBS@
LDADD = @CLIENT_EXTRA_LDFLAGS@ libmysqlclient.la
pkglib_LTLIBRARIES = libmysqlclient.la
noinst_PROGRAMS = conf_to_src
include $(srcdir)/Makefile.shared
# We need .lo, not .o files for everything.
CHARSET_OBJS=@CHARSET_OBJS@
LTCHARSET_OBJS= ${CHARSET_OBJS:.o=.lo}
libmysqlclient_la_SOURCES = libmysql.c net.c violite.c password.c \
get_password.c errmsg.c
mystringsobjects = strmov.lo strxmov.lo strnmov.lo strmake.lo strend.lo \
strnlen.lo strfill.lo is_prefix.lo \
int2str.lo str2int.lo strinstr.lo strcont.lo \
strcend.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo strto.lo \
ctype.lo $(LTCHARSET_OBJS)
mystringsextra= strto.c ctype_autoconf.c
dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo
mysysheaders = mysys_priv.h my_static.h
mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
my_create.lo my_delete.lo my_tempnam.lo my_open.lo \
mf_casecnv.lo my_read.lo my_write.lo errors.lo \
my_error.lo my_getwd.lo my_div.lo \
mf_pack.lo my_messnc.lo mf_dirname.lo mf_fn_ext.lo\
mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \
mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \
mf_loadpath.lo my_pthread.lo my_thr_init.lo \
thr_mutex.lo mulalloc.lo string.lo default.lo \
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
charset.lo
# Not needed in the minimum library
mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo
mysysobjects = $(mysysobjects1) $(mysysobjects2)
libmysqlclient_la_LIBADD = $(mysysobjects) $(mystringsobjects) $(dbugobjects)
libmysqlclient_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
CLEANFILES = $(libmysqlclient_la_LIBADD) $(SHLIBOBJS) \
libmysqclient.la
DEFS = -DUNDEF_THREADS_HACK \
-DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
# The automatic dependencies miss this
bmove_upp.lo: $(LTCHARSET_OBJS)
ctype.c: ctype_extra_sources.c
libmysqlclient_la_SOURCES = $(target_sources)
libmysqlclient_la_LIBADD = $(target_libadd)
libmysqlclient_la_LDFLAGS = $(target_ldflags)
# This is called from the toplevel makefile
link_sources:
......@@ -95,19 +50,6 @@ link_sources:
@LN_CP_F@ $(srcdir)/../mysys/$$f $(srcdir)/$$f; \
done;
clean-local:
rm -f `echo $(mystringsobjects) | sed "s;\.lo;.c;g"` \
`echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
`echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
$(mystringsextra) ctype_extra_sources.c \
../linked_client_sources
ctype_extra_sources.c: conf_to_src
./conf_to_src $(top_srcdir) @CHARSETS_NEED_SOURCE@ > \
$(srcdir)/ctype_extra_sources.c
conf_to_src_SOURCES = conf_to_src.c
conf_to_src_LDADD=
# This part requires GNUmake
#
# This makes a distribution file with only the files needed to compile
......@@ -128,10 +70,10 @@ lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects)
do-lib-dist:
dir=libmysql-$(MYSQL_NO_DASH_VERSION); \
srcs1=`echo $(lobjs) | sed "s;\.lo;.c;g"`; \
srcs2=$(libmysqlclient_la_SOURCES); \
srcs2=$(target_sources); \
srcs="$$srcs1 $$srcs2"; \
objs1=`echo $(lobjs) | sed "s;\.lo;.o;g"`; \
objs2=`echo $(libmysqlclient_la_SOURCES) | sed "s;\.c;.o;g"`; \
objs2=`echo $(target_sources) | sed "s;\.c;.o;g"`; \
objs="$$objs1 $$objs2"; \
rm -rf $$dir; \
mkdir $$dir; \
......@@ -147,6 +89,3 @@ do-lib-dist:
echo ' $$(AR) r $$@ $$?' >>$$dir/Makefile; \
gtar cvzf $$dir.tar.gz $$dir; \
cd $$dir; gmake
# Don't update the files from bitkeeper
%::SCCS/s.%
## Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## This library 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
## Library General Public License for more details.
##
## You should have received a copy of the GNU Library General Public
## License along with this library; if not, write to the Free
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
## MA 02111-1307, USA
##
## This file is public domain and comes with NO WARRANTY of any kind
MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
INCLUDES = -I$(srcdir)/../include -I../include \
-I$(srcdir)/.. -I$(top_srcdir) -I..
## We'll use CLIENT_EXTRA_LDFLAGS for threaded and non-threaded
## until someone complains that they need separate options.
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(target)
pkglib_LTLIBRARIES = $(target)
noinst_PROGRAMS = conf_to_src
# We need .lo, not .o files for everything.
CHARSET_OBJS=@CHARSET_OBJS@
LTCHARSET_OBJS= ${CHARSET_OBJS:.o=.lo}
target_sources = libmysql.c net.c violite.c password.c \
get_password.c errmsg.c
mystringsobjects = strmov.lo strxmov.lo strnmov.lo strmake.lo strend.lo \
strnlen.lo strfill.lo is_prefix.lo \
int2str.lo str2int.lo strinstr.lo strcont.lo \
strcend.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo strto.lo \
ctype.lo $(LTCHARSET_OBJS)
mystringsextra= strto.c ctype_autoconf.c
dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo
mysysheaders = mysys_priv.h my_static.h
mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
my_create.lo my_delete.lo my_tempnam.lo my_open.lo \
mf_casecnv.lo my_read.lo my_write.lo errors.lo \
my_error.lo my_getwd.lo my_div.lo \
mf_pack.lo my_messnc.lo mf_dirname.lo mf_fn_ext.lo\
mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \
mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \
mf_loadpath.lo my_pthread.lo my_thr_init.lo \
thr_mutex.lo mulalloc.lo string.lo default.lo \
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
charset.lo
# Not needed in the minimum library
mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo
mysysobjects = $(mysysobjects1) $(mysysobjects2)
target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects)
target_ldflags = -version-info @SHARED_LIB_VERSION@
CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
$(target)
DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs)
# The automatic dependencies miss this
bmove_upp.lo: $(LTCHARSET_OBJS)
ctype.lo: ctype_extra_sources.c
clean-local:
rm -f `echo $(mystringsobjects) | sed "s;\.lo;.c;g"` \
`echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
`echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
$(mystringsextra) ctype_extra_sources.c \
../linked_client_sources
ctype_extra_sources.c: conf_to_src
./conf_to_src $(top_srcdir) @CHARSETS_NEED_SOURCE@ > \
$(srcdir)/ctype_extra_sources.c
conf_to_src_SOURCES = conf_to_src.c
conf_to_src_LDADD=
# Don't update the files from bitkeeper
%::SCCS/s.%
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
# This file is public domain and comes with NO WARRANTY of any kind
target = libmysqlclient_r.la
target_defs =
## LIBS = @LIBS@
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
include $(top_srcdir)/libmysql/Makefile.shared
libmysql_dir = $(top_srcdir)/libmysql
libmysqlclient_r_la_SOURCES = $(target_sources)
libmysqlclient_r_la_LIBADD = $(target_libadd)
libmysqlclient_r_la_LDFLAGS = $(target_ldflags)
# This is called from the toplevel makefile
link_sources:
set -x; \
for f in `cd $(libmysql_dir) && echo *.[ch]`; do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(libmysql_dir)/$$f $(srcdir)/$$f; \
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment