2 # Copyright (C) 2006-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
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
22 PKG_BUILD_DEPENDS:=libncurses libreadline
25 PKG_FIXUP:=libtool no-autoreconf
27 include $(INCLUDE_DIR)/package.mk
29 define Package/libmysqlclient/Default
32 DEPENDS:=+uclibcxx +zlib
33 TITLE:=MySQL client library
34 URL:=http://dev.mysql.com/
37 define Package/mysql-server/Default
40 DEPENDS:=+libmysqlclient
42 URL:=http://dev.mysql.com/
46 define Package/mysql-server
47 $(call Package/mysql-server/Default)
50 define Package/libmysqlclient
51 $(call Package/libmysqlclient/Default)
54 define Package/libmysqlclient_r
55 $(call Package/libmysqlclient/Default)
62 CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
63 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++" \
64 LDFLAGS="$$$$LDFLAGS" \
65 LIBS="-nodefaultlibs -luClibc++ -lm $(LIBGCC_S)" \
66 CLIENTCLIBS="-nodefaultlibs -luClibc++ -lm $(LIBGCC_S)" \
69 define Build/Configure
70 (cd $(PKG_BUILD_DIR); touch \
77 $(CP) files/lex_hash.h $(PKG_BUILD_DIR)/sql/lex_hash.h
79 $(call Build/Configure/Default, \
82 --enable-thread-safe-client \
86 --without-mysqlmanager \
88 --with-mysqld-user=root \
89 --with-unix-socket-path=/tmp \
93 --without-embedded-server \
94 --without-query-cache \
103 --with-named-thread-libs=-lpthread \
105 mysql_cv_compress=yes \
106 mysql_cv_gethostname_style=glibc2 \
107 ac_cv_c_stack_direction=-1 \
111 TARGET_CFLAGS += $(FPIC)
114 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
116 DESTDIR="$(PKG_INSTALL_DIR)" \
118 $(MAKE) -C "$(PKG_BUILD_DIR)" \
120 DESTDIR="$(PKG_INSTALL_DIR)" \
122 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)/libmysql" \
124 CFLAGS="$(HOST_CFLAGS)" \
125 CPPFLAGS="$(HOST_CFLAGS)" \
126 LDFLAGS="$(HOST_LDFLAGS)" \
128 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
130 DESTDIR="$(PKG_INSTALL_DIR)" \
132 $(MAKE) -C "$(PKG_BUILD_DIR)" \
134 DESTDIR="$(PKG_INSTALL_DIR)" \
136 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
137 SUBDIRS="libmysql_r" \
138 DESTDIR="$(PKG_INSTALL_DIR)" \
140 $(MAKE) -C "$(PKG_BUILD_DIR)" \
141 SUBDIRS="libmysql_r" \
142 DESTDIR="$(PKG_INSTALL_DIR)" \
144 $(MAKE) -C "$(PKG_BUILD_DIR)" \
146 DESTDIR="$(PKG_INSTALL_DIR)" \
147 bin_SCRIPTS="mysql_config" \
149 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
150 DESTDIR="$(PKG_INSTALL_DIR)" \
152 $(MAKE) -C "$(PKG_BUILD_DIR)" \
153 DESTDIR="$(PKG_INSTALL_DIR)" \
158 define Build/InstallDev
159 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
160 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
161 ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
162 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
163 # NOTE: needed for MySQL-Python
164 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
165 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
166 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
169 define Package/libmysqlclient/install
170 $(INSTALL_DIR) $(1)/usr/lib
171 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
173 define Package/libmysqlclient_r/install
174 $(INSTALL_DIR) $(1)/usr/lib
175 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/
178 define Package/mysql-server/install
179 $(INSTALL_DIR) $(1)/usr/bin
180 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(1)/usr/bin/
181 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mysqld $(1)/usr/bin/
182 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/
183 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/
184 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/
185 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_install_db $(1)/usr/bin/
186 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/
187 $(INSTALL_DIR) $(1)/etc/init.d/
188 $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
189 $(INSTALL_CONF) conf/my.cnf $(1)/etc/
190 $(INSTALL_DIR) $(1)/usr/share/mysql
191 $(INSTALL_DIR) $(1)/usr/share/mysql/english
192 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/english/errmsg.sys $(1)/usr/share/mysql/english
193 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/fill_help_tables.sql $(1)/usr/share/mysql/
194 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables.sql $(1)/usr/share/mysql/
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables_data.sql $(1)/usr/share/mysql/
198 define Package/mysql-server/conffiles
202 $(eval $(call BuildPackage,mysql-server))
203 $(eval $(call BuildPackage,libmysqlclient))
204 $(eval $(call BuildPackage,libmysqlclient_r))