~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
# Copyright (C) 2000-2004 MySQL AB
2
# 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of version 2 GNU General Public License as
5
# published by the Free Software Foundation.
6
#
7
# There are special exceptions to the terms and conditions of the GPL as it
8
# is applied to this software. View the full text of the exception in file
9
# EXCEPTIONS-CLIENT in the directory of this software distribution.
10
# 
11
# This library is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
# Library General Public License for more details.
15
# 
16
# You should have received a copy of the GNU Library General Public
17
# License along with this library; if not, write to the Free
18
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19
# MA 02111-1307, USA
20
#
21
# This file is public domain and comes with NO WARRANTY of any kind
22
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
23
MYSQLDATAdir =			$(localstatedir)
24
MYSQLSHAREdir =			$(pkgdatadir)
25
MYSQLBASEdir=			$(prefix)
26
27
pkglib_LTLIBRARIES = libmysqlclient.la
28
libmysqlclient_la_SOURCES = libmysql.c password.c get_password.c errmsg.c
29
libmysqlclient_la_LIBADD = ${sql_cmn_objects} ${vio_objects} ${sqlobjects} \
28.1.3 by Monty Taylor
Fixed patch application so that the silly thing compiles. :)
30
			   ${top_builddir}/mysys/libmysyslt.la \
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
31
			   ${top_builddir}/strings/libmystringslt.la \
28.1.3 by Monty Taylor
Fixed patch application so that the silly thing compiles. :)
32
			   ${top_builddir}/dbug/libdbuglt.la
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
33
libmysqlclient_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@ 
34
35
DEFS =			-DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
36
			-DDATADIR="\"$(MYSQLDATAdir)\"" \
37
			-DDEFAULT_HOME_ENV=MYSQL_HOME \
38
			-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
39
			-DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \
40
			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
41
			-DUNDEF_THREADS_HACK
42
1 by brian
clean slate
43
LIBS =		@CLIENT_LIBS@ 
44
INCLUDES =	-I$(top_builddir)/include -I$(top_srcdir)/include -lz
45
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
46
EXTRA_DIST = libmysql.def
1 by brian
clean slate
47
noinst_HEADERS = client_settings.h
48
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
49
50
mysysheaders =		mysys_priv.h my_static.h
51
vioheaders =		vio_priv.h
52
sqlobjects =		net.lo
53
sql_cmn_objects =	pack.lo client.lo my_time.lo
54
target_ldflags =
55
vio_objects= vio.lo viosocket.lo
56
57
58
BUILT_SOURCES		= link_sources
59
60
CLEANFILES =		$(target_libadd) $(SHLIBOBJS) \
61
			$(target) $(BUILT_SOURCES)
62
63
# The automatic dependencies miss this
64
#bmove_upp.lo:		$(LTCHARSET_OBJS)
65
66
clean-local:
67
	rm -f `echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
68
	      `echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
69
	      `echo $(vio_objects) | sed "s;\.lo;.c;g"` \
70
	      `echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \
71
	       $(CHARSET_SRCS) $(CHARSET_OBJS) \
72
	       $(mysysheaders) $(vioheaders) \
73
               net.c
74
1 by brian
clean slate
75
link_sources:
76
	  set -x; \
77
	  ds=`echo $(dbugobjects) | sed "s;\.lo;.c;g"`; \
78
	  ms=`echo $(mysysobjects) | sed "s;\.lo;.c;g"`; \
79
	  vs=`echo $(vio_objects) | sed "s;\.lo;.c;g"`; \
80
	  scs=`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"`; \
81
	  for f in $$vs $(vioheaders); do \
82
	    rm -f $$f; \
83
	    @LN_CP_F@ $(top_srcdir)/vio/$$f $$f; \
84
	  done; \
85
	  for f in $$scs; do \
86
	    rm -f $$f; \
87
	    @LN_CP_F@ $(top_srcdir)/sql-common/$$f $$f; \
88
	  done; \
89
	  for f in $$ds; do \
90
	    rm -f $$f; \
91
	    @LN_CP_F@ $(top_srcdir)/dbug/$$f $$f; \
92
	  done; \
93
	  for f in $$ms $(mysysheaders); do \
94
	    rm -f $$f; \
95
	    @LN_CP_F@ $(top_srcdir)/mysys/$$f $$f; \
96
	  done; \
97
	  rm -f net.c; \
98
	  @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc net.c ; \
99
	  rm -f password.c; \
100
	  @LN_CP_F@ $(top_srcdir)/sql/password.c password.c
101
	  echo timestamp > link_sources
102
103
# This part requires GNUmake
104
#
105
# This makes a distribution file with only the files needed to compile
106
# a minimal MySQL client library
107
#
108
# A list of needed headers collected from the deps information 000213
109
nh =		my_global.h config-win32.h dbug.h errmsg.h \
110
		m_ctype.h m_string.h \
111
		my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \
112
		mysql.h mysql_com.h mysql_version.h mysqld_error.h \
113
		mysys_err.h my_pthread.h thr_alarm.h violite.h hash.h \
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
114
                sql_common.h client_settings.h 
1 by brian
clean slate
115
# Get a list of the needed objects  
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
116
lobjs = $(mysysobjects1) $(dbugobjects) $(sqlobjects)
1 by brian
clean slate
117
118
do-lib-dist:
119
	dir=libmysql-$(MYSQL_NO_DASH_VERSION); \
120
	srcs1=`echo $(lobjs) | sed "s;\.lo;.c;g"`; \
121
	srcs2=$(target_sources); \
122
	srcs="$$srcs1 $$srcs2"; \
123
	objs1=`echo $(lobjs) | sed "s;\.lo;.o;g"`; \
124
	objs2=`echo $(target_sources) | sed "s;\.c;.o;g"`; \
125
	objs="$$objs1 $$objs2"; \
126
	rm -rf $$dir; \
127
	mkdir $$dir; \
128
	$(INSTALL_DATA) $$srcs $(mysysheaders) $$dir; \
129
	for i in $(nh); do $(INSTALL_DATA) ../include/$$i $$dir; done; \
130
	echo "# A very minimal Makefile to compile" > $$dir/Makefile; \
131
	echo "# the minimized libmysql library" >> $$dir/Makefile; \
132
	echo "# This file is autogenerated from Makefile.am" >> $$dir/Makefile; \
133
	echo 'CFLAGS=	-I. -DUNDEF_THREADS_HACK' >>$$dir/Makefile; \
134
	echo "obj=$$objs"  >>$$dir/Makefile; \
135
	echo 'all: libmysql.a'  >>$$dir/Makefile; \
136
	echo 'libmysql.a: $$(obj)'  >>$$dir/Makefile; \
137
	echo '	$$(AR) r $$@ $$?'  >>$$dir/Makefile; \
138
	gtar cvzf $$dir.tar.gz $$dir; \
139
	cd $$dir; gmake
140
141
# Don't update the files from bitkeeper
142
%::SCCS/s.%