Makefile.am 8.21 KB
Newer Older
1
# Copyright (C) 2001-2006 MySQL AB
2 3 4
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
5 6
# License as published by the Free Software Foundation; version 2
# of the License.
7 8 9 10 11 12 13 14 15 16 17 18 19
# 
# 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

20 21 22
MYSQLDATAdir =		$(localstatedir)
MYSQLSHAREdir =		$(pkgdatadir)
MYSQLBASEdir=		$(prefix)
23
MYSQLLIBdir=            $(libdir)
24
pkgplugindir =		$(pkglibdir)/plugin
25

26
EXTRA_DIST =		libmysqld.def CMakeLists.txt
27 28 29
DEFS =			-DEMBEDDED_LIBRARY -DMYSQL_SERVER \
			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
			-DDATADIR="\"$(MYSQLDATAdir)\"" \
30
			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
31
			-DPLUGINDIR="\"$(pkgplugindir)\""
32
INCLUDES=		-I$(top_builddir)/include -I$(top_srcdir)/include \
33 34
			-I$(top_builddir)/sql -I$(top_srcdir)/sql \
			-I$(top_srcdir)/sql/examples \
35
			-I$(top_srcdir)/regex \
36 37
			$(openssl_includes) @ZLIB_INCLUDES@ \
			@condition_dependent_plugin_includes@
38

39 40
noinst_LIBRARIES =	libmysqld_int.a
pkglib_LIBRARIES =	libmysqld.a
41
SUBDIRS =		. examples
hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
42
libmysqld_sources=	libmysqld.c lib_sql.cc emb_qcache.cc
43 44
libmysqlsources =	errmsg.c get_password.c libmysql.c client.c pack.c \
                        my_time.c
45

hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
46
noinst_HEADERS =	embedded_priv.h emb_qcache.h
47

48
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
49
	     ha_ndbcluster.cc ha_ndbcluster_cond.cc \
acurtis@xiphis.org's avatar
acurtis@xiphis.org committed
50 51
	ha_ndbcluster_binlog.cc ha_partition.cc \
	handler.cc sql_handler.cc \
52
	hostname.cc init.cc password.c \
53 54
	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
	item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
55
	item_geofunc.cc item_subselect.cc item_row.cc\
56
	item_xmlfunc.cc \
57
	key.cc lock.cc log.cc sql_state.c \
58
	log_event.cc rpl_record.cc \
59
	log_event_old.cc rpl_record_old.cc \
ram@gw.mysql.r18.ru's avatar
ram@gw.mysql.r18.ru committed
60
	protocol.cc net_serv.cc opt_range.cc \
61
	opt_sum.cc procedure.cc records.cc sql_acl.cc \
bar@mysql.com's avatar
bar@mysql.com committed
62
	sql_load.cc discover.cc sql_locale.cc \
63
	sql_profile.cc \
64
	sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
venu@myvenu.com's avatar
venu@myvenu.com committed
65
	sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
66 67
	sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
	scheduler.cc sql_connect.cc sql_parse.cc \
hf@deer.mysql.r18.ru's avatar
SCRUM  
hf@deer.mysql.r18.ru committed
68
	sql_prepare.cc sql_derived.cc sql_rename.cc \
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
69
	sql_select.cc sql_do.cc sql_show.cc set_var.cc \
70 71
	sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
	sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
72
	unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
73
	spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
74
	sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
75
	parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
76 77
	event_scheduler.cc events.cc event_data_objects.cc \
        event_queue.cc event_db_repository.cc \
acurtis@xiphis.org's avatar
acurtis@xiphis.org committed
78 79
	rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
	sql_tablespace.cc \
patg@radha.tangent.org's avatar
patg@radha.tangent.org committed
80 81
	rpl_injector.cc my_user.c partition_info.cc \
	sql_servers.cc
82

83 84
libmysqld_int_a_SOURCES= $(libmysqld_sources)
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
85
libmysqld_a_SOURCES=
86

87
sqlstoragesources =	$(EXTRA_libmysqld_a_SOURCES)
88
storagesources = @condition_dependent_plugin_modules@
89
storageobjects = @condition_dependent_plugin_objects@
90
storagesourceslinks = @condition_dependent_plugin_links@
91

92 93 94
# automake misses these
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy

95 96 97 98 99
# The following libraries should be included in libmysqld.a
INC_LIB=	$(top_builddir)/regex/libregex.a \
		$(top_builddir)/mysys/libmysys.a \
		$(top_builddir)/strings/libmystrings.a \
		$(top_builddir)/dbug/libdbug.a \
100
		$(top_builddir)/vio/libvio.a \
101
                @NDB_SCI_LIBS@ \
acurtis@xiphis.org's avatar
acurtis@xiphis.org committed
102
		@mysql_plugin_libs@ \
kent@mysql.com's avatar
kent@mysql.com committed
103
		$(yassl_inc_libs)
104

kent@mysql.com's avatar
kent@mysql.com committed
105
if HAVE_YASSL
106 107
yassl_inc_libs=	$(top_builddir)/extra/yassl/src/.libs/libyassl.a \
		$(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
kent@mysql.com's avatar
kent@mysql.com committed
108
endif
109 110 111 112 113

# Storage engine specific compilation options
ha_ndbcluster.o:ha_ndbcluster.cc
		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<

114 115 116
ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc
		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<

tomas@poseidon.ndb.mysql.com's avatar
tomas@poseidon.ndb.mysql.com committed
117 118 119
ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<

120 121 122 123
# Until we can remove dependency on ha_ndbcluster.h
handler.o:	handler.cc
		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<

124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
# We need rules to compile these as no good way
# found to append fileslists that collected by configure
# to the sources list

ha_federated.o:ha_federated.cc
		$(CXXCOMPILE) $(LM_CFLAGS) -c $<

ha_heap.o:ha_heap.cc
		$(CXXCOMPILE) $(LM_CFLAGS) -c $<

ha_innodb.o:ha_innodb.cc
		$(CXXCOMPILE) $(LM_CFLAGS) -c $<

ha_myisam.o:ha_myisam.cc
		$(CXXCOMPILE) $(LM_CFLAGS) -c $<

ha_myisammrg.o:ha_myisammrg.cc
		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
142

143
#
monty@mysql.com's avatar
monty@mysql.com committed
144 145
# To make it easy for the end user to use the embedded library we
# generate a total libmysqld.a from all library files,
146

147 148 149 150 151 152
# note - InnoDB libraries have circular dependencies, so in INC_LIB
# few libraries are present two times. Metrowerks linker doesn't like
# it at all. Traditional ar has no problems with it, but still there's no
# need to add the same file twice to the library, so 'sort -u' save us
# some time and spares unnecessary work.

153
libmysqld.a:	libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
kent@mysql.com's avatar
kent@mysql.com committed
154
if DARWIN_MWCC
155
	mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
kent@mysql.com's avatar
kent@mysql.com committed
156
else
157
		-rm -f libmysqld.a
monty@mysql.com's avatar
monty@mysql.com committed
158 159
		if test "$(host_os)" = "netware" ; \
		then \
160
		  $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
monty@mysql.com's avatar
monty@mysql.com committed
161
		else \
162
		  current_dir=`pwd`; \
163
		  rm -rf tmp; mkdir tmp; \
164
		  (for arc in $(INC_LIB) ./libmysqld_int.a; do \
kent@mysql.com's avatar
kent@mysql.com committed
165
		    arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
166
		    artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
kent@mysql.com's avatar
kent@mysql.com committed
167
		    for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
168
		      if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
169 170 171
		      mkdir $$artmp; cd $$artmp > /dev/null; \
		      $(AR) x ../../$$arc; \
		      cd $$current_dir > /dev/null; \
kent@mysql.com's avatar
kent@mysql.com committed
172
		      ls $$artmp/* | grep -v SYMDEF; \
173
		      continue 2; fi; done; \
174
		  done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
175
		  $(AR) r libmysqld.a $(storageobjects); \
monty@mysql.com's avatar
monty@mysql.com committed
176
		  $(RANLIB) libmysqld.a	; \
177
		  rm -rf tmp; \
monty@mysql.com's avatar
monty@mysql.com committed
178
		fi
kent@mysql.com's avatar
kent@mysql.com committed
179
endif
180

181 182 183 184 185
## XXX: any time the client interface changes, we'll need to bump
## the version info for libmysqld; however, it's possible for the
## libmysqld interface to change without affecting the standard
## libmysqlclient interface.  Should we make a separate version
## string for the two?
186 187
#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
#CLEANFILES =		$(libmysqld_la_LIBADD) libmysqld.la
188

189 190 191 192
BUILT_SOURCES = link_sources

CLEANFILES = $(BUILT_SOURCES)

193
link_sources:
194
	  for f in $(sqlsources); do \
kent@mysql.com's avatar
kent@mysql.com committed
195
	    rm -f $$f; \
196
	    if test -e $(top_srcdir)/sql/$$f ; \
197
	    then \
198
	      @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
199
	    else \
200
	      @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
201
	    fi ; \
202
	  done; \
203
	  for f in $(libmysqlsources); do \
kent@mysql.com's avatar
kent@mysql.com committed
204
	    rm -f $$f; \
205 206 207 208 209 210
	    if test -e $(top_srcdir)/libmysql/$$f ; \
	    then \
	      @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
	    else \
	      @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
	    fi ; \
hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
211
	  done; \
212
	  if test -n "$(sqlstoragesources)" ; \
213 214 215 216 217 218
	  then \
	    for f in "$(sqlstoragesources)"; do \
	      rm -f "$$f"; \
	      @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
	    done; \
	  fi; \
219 220 221
	  if test -n "$(storagesources)" ; \
	  then \
	    rm -f $(storagesources); \
222
	    for f in $(storagesourceslinks); do \
223 224 225
	      @LN_CP_F@ $(top_srcdir)/$$f . ; \
	    done; \
	  fi; \
kent@mysql.com's avatar
kent@mysql.com committed
226
	  rm -f client_settings.h; \
227 228 229
	  @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \
                                          client_settings.h; \
	echo timestamp > link_sources
hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
230

231 232

clean-local:
233
	rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \
hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
234
	rm -f client_settings.h
235 236 237

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