[packages] libiconv-full: autoreconf is broken with this package, use patch-libtool...
[openwrt/svn-archive/archive.git] / libs / mysql / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mysql
11 PKG_VERSION:=5.1.53
12 PKG_RELEASE:=7
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=\
16 http://mysql.planetmirror.com/Downloads/MySQL-5.1/ \
17 http://mysql.he.net/Downloads/MySQL-5.1/ \
18 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.1/ \
19 http://mysql.holywar.net/Downloads/MySQL-5.1/
20 PKG_MD5SUM:=e5e7c5b0b5c382489e6a66778703bc46
21
22 PKG_BUILD_DEPENDS:=libncurses libreadline
23 PKG_BUILD_PARALLEL:=1
24
25 PKG_FIXUP:=libtool no-autoreconf
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/libmysqlclient/Default
30 SECTION:=libs
31 CATEGORY:=Libraries
32 DEPENDS:=+uclibcxx +zlib
33 TITLE:=MySQL client library
34 URL:=http://dev.mysql.com/
35 endef
36
37 define Package/mysql-server/Default
38 SECTION:=utils
39 CATEGORY:=Utilities
40 DEPENDS:=+libmysqlclient +libpthread +libncursesw +libreadline
41 TITLE:=MySQL Server
42 URL:=http://dev.mysql.com/
43 SUBMENU:=database
44 endef
45
46 define Package/mysql-server
47 $(call Package/mysql-server/Default)
48 endef
49
50 define Package/libmysqlclient
51 $(call Package/libmysqlclient/Default)
52 endef
53
54 define Package/libmysqlclient-r
55 $(call Package/libmysqlclient/Default)
56 TITLE += threadsafe
57 DEPENDS+= +libpthread
58 endef
59
60 TARGET_CXX=g++-uc
61
62 CONFIGURE_VARS += \
63 CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
64 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++" \
65 LDFLAGS="$$$$LDFLAGS" \
66 LIBS="-nodefaultlibs -luClibc++ -lm -lc $(LIBGCC_S)" \
67 CLIENTCLIBS="-nodefaultlibs -luClibc++ -lm -lc $(LIBGCC_S)" \
68
69
70 define Build/Configure
71 (cd $(PKG_BUILD_DIR); touch \
72 configure.in \
73 aclocal.m4 \
74 Makefile.in \
75 config.h.in \
76 configure \
77 );
78 $(CP) files/lex_hash.h $(PKG_BUILD_DIR)/sql/lex_hash.h
79
80 $(call Build/Configure/Default, \
81 --enable-shared \
82 --enable-static \
83 --enable-thread-safe-client \
84 --disable-assembler \
85 --with-pthread \
86 --with-server \
87 --without-mysqlmanager \
88 --without-raid \
89 --with-mysqld-user=root \
90 --with-unix-socket-path=/tmp \
91 --without-libwrap \
92 --without-pstack \
93 --with-low-memory \
94 --without-embedded-server \
95 --without-query-cache \
96 --without-mysqlfs \
97 --without-vio \
98 --without-ssl \
99 --without-docs \
100 --without-man \
101 --without-bench \
102 --without-readline \
103 --without-debug \
104 --with-named-thread-libs=-lpthread \
105 , \
106 mysql_cv_compress=yes \
107 mysql_cv_gethostname_style=glibc2 \
108 ac_cv_c_stack_direction=-1 \
109 );
110 endef
111
112 TARGET_CFLAGS += $(FPIC)
113
114 define Build/Compile
115 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
116 SUBDIRS="include" \
117 DESTDIR="$(PKG_INSTALL_DIR)" \
118 all
119 $(MAKE) -C "$(PKG_BUILD_DIR)" \
120 SUBDIRS="include" \
121 DESTDIR="$(PKG_INSTALL_DIR)" \
122 install
123 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)/libmysql" \
124 CC="g++" \
125 CFLAGS="$(HOST_CFLAGS)" \
126 CPPFLAGS="$(HOST_CFLAGS)" \
127 LDFLAGS="$(HOST_LDFLAGS)" \
128 conf_to_src
129 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
130 SUBDIRS="libmysql" \
131 DESTDIR="$(PKG_INSTALL_DIR)" \
132 all
133 $(MAKE) -C "$(PKG_BUILD_DIR)" \
134 SUBDIRS="libmysql" \
135 DESTDIR="$(PKG_INSTALL_DIR)" \
136 install
137 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
138 SUBDIRS="libmysql_r" \
139 DESTDIR="$(PKG_INSTALL_DIR)" \
140 all
141 $(MAKE) -C "$(PKG_BUILD_DIR)" \
142 SUBDIRS="libmysql_r" \
143 DESTDIR="$(PKG_INSTALL_DIR)" \
144 install
145 $(MAKE) -C "$(PKG_BUILD_DIR)" \
146 SUBDIRS="scripts" \
147 DESTDIR="$(PKG_INSTALL_DIR)" \
148 bin_SCRIPTS="mysql_config" \
149 install
150 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
151 DESTDIR="$(PKG_INSTALL_DIR)" \
152 all
153 $(MAKE) -C "$(PKG_BUILD_DIR)" \
154 DESTDIR="$(PKG_INSTALL_DIR)" \
155 install
156 endef
157
158
159 define Build/InstallDev
160 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
161 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
162 ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
163 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
164 # NOTE: needed for MySQL-Python
165 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
166 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
167 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
168 endef
169
170 define Package/libmysqlclient/install
171 $(INSTALL_DIR) $(1)/usr/lib
172 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
173 endef
174 define Package/libmysqlclient-r/install
175 $(INSTALL_DIR) $(1)/usr/lib
176 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/
177 endef
178
179 define Package/mysql-server/install
180 $(INSTALL_DIR) $(1)/usr/bin
181 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(1)/usr/bin/
182 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mysqld $(1)/usr/bin/
183 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/
184 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/
185 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/
186 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_install_db $(1)/usr/bin/
187 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/
188 $(INSTALL_DIR) $(1)/etc/init.d/
189 $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
190 $(INSTALL_CONF) conf/my.cnf $(1)/etc/
191 $(INSTALL_DIR) $(1)/usr/share/mysql
192 $(INSTALL_DIR) $(1)/usr/share/mysql/english
193 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/english/errmsg.sys $(1)/usr/share/mysql/english
194 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/fill_help_tables.sql $(1)/usr/share/mysql/
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables.sql $(1)/usr/share/mysql/
196 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables_data.sql $(1)/usr/share/mysql/
197 endef
198
199 define Package/mysql-server/conffiles
200 /etc/my.cnf
201 endef
202
203 $(eval $(call BuildPackage,mysql-server))
204 $(eval $(call BuildPackage,libmysqlclient))
205 $(eval $(call BuildPackage,libmysqlclient-r))