Makefile.am 5.9 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 24 25 26 27

DEFS =			-DEMBEDDED_LIBRARY -DMYSQL_SERVER \
			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
			-DDATADIR="\"$(MYSQLDATAdir)\"" \
			-DSHAREDIR="\"$(MYSQLSHAREdir)\""
28
INCLUDES=		@bdb_includes@  @innodb_includes@ @ndbcluster_includes@ \
kent@mysql.com's avatar
kent@mysql.com committed
29
			-I$(top_builddir)/include -I$(top_srcdir)/include \
30 31
			-I$(top_builddir)/sql -I$(top_srcdir)/sql \
			-I$(top_srcdir)/sql/examples \
32
			-I$(top_srcdir)/regex \
33
			$(openssl_includes) @ZLIB_INCLUDES@
34

35 36
noinst_LIBRARIES =	libmysqld_int.a
pkglib_LIBRARIES =	libmysqld.a
37
SUBDIRS =		. examples
hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
38
libmysqld_sources=	libmysqld.c lib_sql.cc emb_qcache.cc
39 40
libmysqlsources =	errmsg.c get_password.c libmysql.c client.c pack.c \
                        my_time.c
41
sqlexamplessources =	ha_example.cc ha_tina.cc
42

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

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 50
	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
	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 \
ram@gw.mysql.r18.ru's avatar
ram@gw.mysql.r18.ru committed
53
	protocol.cc net_serv.cc opt_range.cc \
54
	opt_sum.cc procedure.cc records.cc sql_acl.cc \
bar@mysql.com's avatar
bar@mysql.com committed
55
	sql_load.cc discover.cc sql_locale.cc \
56
	sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
venu@myvenu.com's avatar
venu@myvenu.com committed
57 58
	sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
	sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc sql_parse.cc \
hf@deer.mysql.r18.ru's avatar
SCRUM  
hf@deer.mysql.r18.ru committed
59
	sql_prepare.cc sql_derived.cc sql_rename.cc \
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
60
	sql_select.cc sql_do.cc sql_show.cc set_var.cc \
61 62
	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 \
63
	unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
64
	spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
65
	sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
66
	parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
67
	ha_blackhole.cc ha_archive.cc my_user.c
68

69
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
70
libmysqld_a_SOURCES=
71

72 73 74
# automake misses these
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy

75 76 77 78 79 80 81 82 83
# The following libraries should be included in libmysqld.a
INC_LIB=	$(top_builddir)/regex/libregex.a \
		$(top_builddir)/myisam/libmyisam.a \
		$(top_builddir)/myisammrg/libmyisammrg.a \
		$(top_builddir)/heap/libheap.a \
		@innodb_libs@ @bdb_libs_with_path@ \
		$(top_builddir)/mysys/libmysys.a \
		$(top_builddir)/strings/libmystrings.a \
		$(top_builddir)/dbug/libdbug.a \
84
		$(top_builddir)/vio/libvio.a
85

86 87

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

91 92 93 94 95 96
# 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.

97
libmysqld.a:	libmysqld_int.a $(INC_LIB)
kent@mysql.com's avatar
kent@mysql.com committed
98
if DARWIN_MWCC
99
	mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u`
kent@mysql.com's avatar
kent@mysql.com committed
100
else
101
		-rm -f libmysqld.a
monty@mysql.com's avatar
monty@mysql.com committed
102 103 104 105
		if test "$(host_os)" = "netware" ; \
		then \
		  $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
		else \
106 107 108 109
		  for arc in ./libmysqld_int.a $(INC_LIB); do \
		    arpath=`echo $$arc|sed 's|[^/]*$$||'`; \
		    $(AR) t $$arc|sed "s|^|$$arpath|"; \
		  done | sort -u | xargs $(AR) cq libmysqld.a ; \
monty@mysql.com's avatar
monty@mysql.com committed
110 111
		  $(RANLIB) libmysqld.a	; \
		fi
kent@mysql.com's avatar
kent@mysql.com committed
112
endif
113

114 115 116 117 118
## 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?
119 120
#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
#CLEANFILES =		$(libmysqld_la_LIBADD) libmysqld.la
121

122 123 124
# This is called from the toplevel makefile. If we can link now
# to an existing file in source, we do that, else we assume it
# will show up in the build tree eventually (generated file).
125 126 127
link_sources:
	  set -x; \
	  for f in $(sqlsources); do \
kent@mysql.com's avatar
kent@mysql.com committed
128
	    rm -f $$f; \
129
	    if test -e $(top_srcdir)/sql/$$f ; \
130
	    then \
131
	      @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
132
	    else \
133
	      @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
134
	    fi ; \
135 136
	  done; \
	  for f in $(libmysqlsources); do \
kent@mysql.com's avatar
kent@mysql.com committed
137
	    rm -f $$f; \
138 139 140 141 142 143
	    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
144
	  done; \
145
	  for f in $(sqlexamplessources); do \
kent@mysql.com's avatar
kent@mysql.com committed
146 147
	    rm -f $$f; \
	    @LN_CP_F@ $(top_srcdir)/sql/examples/$$f $$f; \
148
	  done; \
kent@mysql.com's avatar
kent@mysql.com committed
149 150
	  rm -f client_settings.h; \
	  @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
151

152 153

clean-local:
154
	rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \
hf@deer.(none)'s avatar
SCRUM  
hf@deer.(none) committed
155 156
	       $(top_srcdir)/linked_libmysqld_sources; \
	rm -f client_settings.h
157 158 159

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