~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Copyright (C) 2000-2004 MySQL AB
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 GNU General Public License as
# published by the Free Software Foundation.
#
# There are special exceptions to the terms and conditions of the GPL as it
# is applied to this software. View the full text of the exception in file
# EXCEPTIONS-CLIENT in the directory of this software distribution.
# 
# 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)

pkglib_LTLIBRARIES = libmysqlclient.la
libmysqlclient_la_SOURCES = libmysql.c password.c get_password.c errmsg.c
libmysqlclient_la_LIBADD = ${sql_cmn_objects} ${vio_objects} ${sqlobjects} \
			   ${top_builddir}/mysys/libmysyslt.la \
			   ${top_builddir}/strings/libmystringslt.la \
			   ${top_builddir}/dbug/libdbuglt.la
libmysqlclient_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@ 

DEFS =			-DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
			-DDATADIR="\"$(MYSQLDATAdir)\"" \
			-DDEFAULT_HOME_ENV=MYSQL_HOME \
			-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
			-DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \
			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
			-DUNDEF_THREADS_HACK

LIBS =		@CLIENT_LIBS@ 
INCLUDES =	-I$(top_builddir)/include -I$(top_srcdir)/include -lz

EXTRA_DIST = libmysql.def
noinst_HEADERS = client_settings.h


mysysheaders =		mysys_priv.h my_static.h
vioheaders =		vio_priv.h
sqlobjects =		net.lo
sql_cmn_objects =	pack.lo client.lo my_time.lo
target_ldflags =
vio_objects= vio.lo viosocket.lo


BUILT_SOURCES		= link_sources

CLEANFILES =		$(target_libadd) $(SHLIBOBJS) \
			$(target) $(BUILT_SOURCES)

# The automatic dependencies miss this
#bmove_upp.lo:		$(LTCHARSET_OBJS)

clean-local:
	rm -f `echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
	      `echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
	      `echo $(vio_objects) | sed "s;\.lo;.c;g"` \
	      `echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \
	       $(CHARSET_SRCS) $(CHARSET_OBJS) \
	       $(mysysheaders) $(vioheaders) \
               net.c

link_sources:
	  set -x; \
	  ds=`echo $(dbugobjects) | sed "s;\.lo;.c;g"`; \
	  ms=`echo $(mysysobjects) | sed "s;\.lo;.c;g"`; \
	  vs=`echo $(vio_objects) | sed "s;\.lo;.c;g"`; \
	  scs=`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"`; \
	  for f in $$vs $(vioheaders); do \
	    rm -f $$f; \
	    @LN_CP_F@ $(top_srcdir)/vio/$$f $$f; \
	  done; \
	  for f in $$scs; do \
	    rm -f $$f; \
	    @LN_CP_F@ $(top_srcdir)/sql-common/$$f $$f; \
	  done; \
	  for f in $$ds; do \
	    rm -f $$f; \
	    @LN_CP_F@ $(top_srcdir)/dbug/$$f $$f; \
	  done; \
	  for f in $$ms $(mysysheaders); do \
	    rm -f $$f; \
	    @LN_CP_F@ $(top_srcdir)/mysys/$$f $$f; \
	  done; \
	  rm -f net.c; \
	  @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc net.c ; \
	  rm -f password.c; \
	  @LN_CP_F@ $(top_srcdir)/sql/password.c password.c
	  echo timestamp > link_sources

# This part requires GNUmake
#
# This makes a distribution file with only the files needed to compile
# a minimal MySQL client library
#
# A list of needed headers collected from the deps information 000213
nh =		my_global.h config-win32.h dbug.h errmsg.h \
		m_ctype.h m_string.h \
		my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \
		mysql.h mysql_com.h mysql_version.h mysqld_error.h \
		mysys_err.h my_pthread.h thr_alarm.h violite.h hash.h \
                sql_common.h client_settings.h 
# Get a list of the needed objects  
lobjs = $(mysysobjects1) $(dbugobjects) $(sqlobjects)

do-lib-dist:
	dir=libmysql-$(MYSQL_NO_DASH_VERSION); \
	srcs1=`echo $(lobjs) | sed "s;\.lo;.c;g"`; \
	srcs2=$(target_sources); \
	srcs="$$srcs1 $$srcs2"; \
	objs1=`echo $(lobjs) | sed "s;\.lo;.o;g"`; \
	objs2=`echo $(target_sources) | sed "s;\.c;.o;g"`; \
	objs="$$objs1 $$objs2"; \
	rm -rf $$dir; \
	mkdir $$dir; \
	$(INSTALL_DATA) $$srcs $(mysysheaders) $$dir; \
	for i in $(nh); do $(INSTALL_DATA) ../include/$$i $$dir; done; \
	echo "# A very minimal Makefile to compile" > $$dir/Makefile; \
	echo "# the minimized libmysql library" >> $$dir/Makefile; \
	echo "# This file is autogenerated from Makefile.am" >> $$dir/Makefile; \
	echo 'CFLAGS=	-I. -DUNDEF_THREADS_HACK' >>$$dir/Makefile; \
	echo "obj=$$objs"  >>$$dir/Makefile; \
	echo 'all: libmysql.a'  >>$$dir/Makefile; \
	echo 'libmysql.a: $$(obj)'  >>$$dir/Makefile; \
	echo '	$$(AR) r $$@ $$?'  >>$$dir/Makefile; \
	gtar cvzf $$dir.tar.gz $$dir; \
	cd $$dir; gmake

# Don't update the files from bitkeeper
%::SCCS/s.%