Makefile.am 4.93 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# 
# 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=		@MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \
unknown's avatar
unknown committed
29 30
			-I$(top_srcdir)/sql -I$(top_srcdir)/regex \
			$(openssl_includes)
31

32 33
noinst_LIBRARIES =	libmysqld_int.a
pkglib_LIBRARIES =	libmysqld.a
34
SUBDIRS =		. examples
unknown's avatar
SCRUM  
unknown committed
35
libmysqld_sources=	libmysqld.c lib_sql.cc emb_qcache.cc
unknown's avatar
SCRUM  
unknown committed
36
libmysqlsources =	errmsg.c get_password.c libmysql.c client.c pack.c
37

unknown's avatar
SCRUM  
unknown committed
38
noinst_HEADERS =	embedded_priv.h emb_qcache.h
unknown's avatar
unknown committed
39

40
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
41
	ha_innodb.cc ha_berkeley.cc ha_heap.cc ha_isam.cc ha_isammrg.cc \
unknown's avatar
unknown committed
42
	ha_myisam.cc ha_myisammrg.cc handler.cc sql_handler.cc \
43
	hostname.cc init.cc password.c \
44 45
	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
	item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
46
	item_geofunc.cc item_uniq.cc item_subselect.cc item_row.cc\
unknown's avatar
unknown committed
47
	key.cc lock.cc log.cc log_event.cc sql_state.c \
unknown's avatar
unknown committed
48
	protocol.cc net_serv.cc opt_range.cc \
49
	opt_sum.cc procedure.cc records.cc sql_acl.cc \
50
	sql_load.cc discover.cc \
51
	sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
unknown's avatar
unknown committed
52 53
	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 \
unknown's avatar
SCRUM  
unknown committed
54
	sql_prepare.cc sql_derived.cc sql_rename.cc \
unknown's avatar
unknown committed
55
	sql_select.cc sql_do.cc sql_show.cc set_var.cc \
56 57
	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 \
unknown's avatar
unknown committed
58
	unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
59
	spatial.cc gstream.cc sql_help.cc
60

61
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
62
libmysqld_a_SOURCES=
63

64 65 66
# automake misses these
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy

67 68 69 70 71
# 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 \
72
		@innodb_libs@ @bdb_libs_with_path@ \
73 74 75
		$(top_builddir)/mysys/libmysys.a \
		$(top_builddir)/strings/libmystrings.a \
		$(top_builddir)/dbug/libdbug.a \
unknown's avatar
SCRUM  
unknown committed
76
		$(top_builddir)/vio/libvio.a
77 78

#
unknown's avatar
unknown committed
79 80
# To make it easy for the end user to use the embedded library we
# generate a total libmysqld.a from all library files,
81 82

libmysqld.a:	libmysqld_int.a $(INC_LIB)
unknown's avatar
unknown committed
83 84 85 86 87 88 89 90 91 92 93
		if test "$(host_os)" = "netware" ; \
		then \
		  $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
		else \
		  if test ! -d tmp ; then mkdir tmp ; fi ; \
		  rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a ; \
		  cp $(INC_LIB) tmp ; \
		  cp libmysqld_int.a libmysqld_int2.a ; \
		  cd tmp ; \
		  for file in *.a ; do \
		    bfile=`basename $$file .a` ; \
94
		    $(AR) x $$file; \
unknown's avatar
unknown committed
95
		    for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \
96
		    $(AR) q ../libmysqld_int2.a *.o ; \
unknown's avatar
unknown committed
97 98 99 100 101 102 103 104
		    rm -f *.o ; \
		  done ; \
		  cd .. ; \
		  mv libmysqld_int2.a libmysqld.a ; \
		  rm -f tmp/* ; \
		  $(RANLIB) libmysqld.a	; \
		fi

105

106 107 108 109 110
## 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?
111 112
#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
#CLEANFILES =		$(libmysqld_la_LIBADD) libmysqld.la
113 114 115 116 117 118 119 120 121 122 123

# This is called from the toplevel makefile
link_sources:
	  set -x; \
	  for f in $(sqlsources); do \
	    rm -f $(srcdir)/$$f; \
	    @LN_CP_F@ $(srcdir)/../sql/$$f $(srcdir)/$$f; \
	  done; \
	  for f in $(libmysqlsources); do \
	    rm -f $(srcdir)/$$f; \
	    @LN_CP_F@ $(srcdir)/../libmysql/$$f $(srcdir)/$$f; \
unknown's avatar
SCRUM  
unknown committed
124
	  done; \
unknown's avatar
unknown committed
125
	  rm -f $(srcdir)/client_settings.h; \
unknown's avatar
SCRUM  
unknown committed
126 127
	  @LN_CP_F@ $(srcdir)/../libmysql/client_settings.h $(srcdir)/client_settings.h;

128 129 130

clean-local:
	rm -f `echo $(sqlsources) $(libmysqlsources) | sed "s;\.lo;.c;g"` \
unknown's avatar
SCRUM  
unknown committed
131 132
	       $(top_srcdir)/linked_libmysqld_sources; \
	rm -f client_settings.h
133 134 135

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