1
# Copyright (C) 2001-2006 MySQL AB
3
# This library is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU Library General Public
5
# License as published by the Free Software Foundation; version 2
8
# This library is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
# Library General Public License for more details.
13
# You should have received a copy of the GNU Library General Public
14
# License along with this library; if not, write to the Free
15
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18
# This file is public domain and comes with NO WARRANTY of any kind
20
MYSQLDATAdir = $(localstatedir)
21
MYSQLSHAREdir = $(pkgdatadir)
22
MYSQLBASEdir= $(prefix)
24
DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
25
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
26
-DDATADIR="\"$(MYSQLDATAdir)\"" \
27
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
28
INCLUDES= @bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \
29
-I$(top_builddir)/include -I$(top_srcdir)/include \
30
-I$(top_builddir)/sql -I$(top_srcdir)/sql \
31
-I$(top_srcdir)/sql/examples \
32
-I$(top_srcdir)/regex \
33
$(openssl_includes) @ZLIB_INCLUDES@
35
noinst_LIBRARIES = libmysqld_int.a
36
pkglib_LIBRARIES = libmysqld.a
38
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
39
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
41
sqlexamplessources = ha_example.cc ha_tina.cc
43
noinst_HEADERS = embedded_priv.h emb_qcache.h
45
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
46
ha_innodb.cc ha_berkeley.cc ha_heap.cc ha_federated.cc \
47
ha_myisam.cc ha_myisammrg.cc handler.cc sql_handler.cc \
48
hostname.cc init.cc password.c \
49
item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
50
item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
51
item_geofunc.cc item_uniq.cc item_subselect.cc item_row.cc\
52
key.cc lock.cc log.cc log_event.cc sql_state.c \
53
protocol.cc net_serv.cc opt_range.cc \
54
opt_sum.cc procedure.cc records.cc sql_acl.cc \
55
sql_load.cc discover.cc sql_locale.cc \
57
sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
58
sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
59
sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc sql_parse.cc \
60
sql_prepare.cc sql_derived.cc sql_rename.cc \
61
sql_select.cc sql_do.cc sql_show.cc set_var.cc \
62
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
63
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
64
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
65
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
66
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
67
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
68
ha_blackhole.cc ha_archive.cc my_user.c
70
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
73
# automake misses these
74
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
76
# The following libraries should be included in libmysqld.a
77
INC_LIB= $(top_builddir)/regex/libregex.a \
78
$(top_builddir)/myisam/libmyisam.a \
79
$(top_builddir)/myisammrg/libmyisammrg.a \
80
$(top_builddir)/heap/libheap.a \
81
@innodb_libs@ @bdb_libs_with_path@ \
82
$(top_builddir)/mysys/libmysys.a \
83
$(top_builddir)/strings/libmystrings.a \
84
$(top_builddir)/dbug/libdbug.a \
85
$(top_builddir)/vio/libvio.a @NDB_SCI_LIBS@
89
# To make it easy for the end user to use the embedded library we
90
# generate a total libmysqld.a from all library files,
92
# note - InnoDB libraries have circular dependencies, so in INC_LIB
93
# few libraries are present two times. Metrowerks linker doesn't like
94
# it at all. Traditional ar has no problems with it, but still there's no
95
# need to add the same file twice to the library, so 'sort -u' save us
96
# some time and spares unnecessary work.
98
libmysqld.a: libmysqld_int.a $(INC_LIB)
100
mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u`
103
if test "$(host_os)" = "netware" ; \
105
$(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
107
for arc in ./libmysqld_int.a $(INC_LIB); do \
108
arpath=`echo $$arc|sed 's|[^/]*$$||'`; \
109
$(AR) t $$arc|sed "s|^|$$arpath|"; \
110
done | sort -u | xargs $(AR) cq libmysqld.a ; \
111
$(RANLIB) libmysqld.a ; \
115
## XXX: any time the client interface changes, we'll need to bump
116
## the version info for libmysqld; however, it's possible for the
117
## libmysqld interface to change without affecting the standard
118
## libmysqlclient interface. Should we make a separate version
119
## string for the two?
120
#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
121
#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la
123
# This is called from the toplevel makefile. If we can link now
124
# to an existing file in source, we do that, else we assume it
125
# will show up in the build tree eventually (generated file).
128
for f in $(sqlsources); do \
130
if test -e $(top_srcdir)/sql/$$f ; \
132
@LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
134
@LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
137
for f in $(libmysqlsources); do \
139
if test -e $(top_srcdir)/libmysql/$$f ; \
141
@LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
143
@LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
146
for f in $(sqlexamplessources); do \
148
@LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
150
rm -f client_settings.h; \
151
@LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
155
rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \
156
$(top_srcdir)/linked_libmysqld_sources; \
157
rm -f client_settings.h
159
# Don't update the files from bitkeeper