288b9988ed6ed439db45814a300c72cf0e2f88f9
[openwrt/svn-archive/archive.git] / libs / mysql / Makefile
1 #
2 # Copyright (C) 2006-2010 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.0.18
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=\
16 http://mysql.planetmirror.com/Downloads/MySQL-5.0/ \
17 http://mysql.he.net/Downloads/MySQL-5.0/ \
18 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
19 http://mysql.holywar.net/Downloads/MySQL-5.0/
20 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
21
22 PKG_BUILD_DEPENDS:=libncurses libreadline
23 PKG_FIXUP:=libtool
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/libmysqlclient/Default
28 SECTION:=libs
29 CATEGORY:=Libraries
30 DEPENDS:=+zlib
31 TITLE:=MySQL client library
32 URL:=http://dev.mysql.com/
33 endef
34
35 define Package/libmysqlclient
36 $(call Package/libmysqlclient/Default)
37 endef
38
39 define Package/libmysqlclient_r
40 $(call Package/libmysqlclient/Default)
41 TITLE += threadsafe
42 endef
43
44 define Build/Configure
45 (cd $(PKG_BUILD_DIR); touch \
46 configure.in \
47 aclocal.m4 \
48 Makefile.in \
49 config.h.in \
50 configure \
51 );
52 $(call Build/Configure/Default, \
53 --enable-shared \
54 --enable-static \
55 --enable-thread-safe-client \
56 --disable-assembler \
57 --with-pthread \
58 --without-raid \
59 --with-unix-socket-path=/tmp \
60 --without-libwrap \
61 --without-pstack \
62 --with-low-memory \
63 --without-server \
64 --without-embedded-server \
65 --without-query-cache \
66 --without-mysqlfs \
67 --without-vio \
68 --without-openssl \
69 --without-docs \
70 --without-bench \
71 --without-readline \
72 --with-named-thread-libs=-lpthread \
73 , \
74 mysql_cv_compress=yes \
75 mysql_cv_gethostname_style=glibc2 \
76 );
77 endef
78
79 TARGET_CFLAGS += $(FPIC)
80
81 define Build/Compile
82 $(MAKE) -C "$(PKG_BUILD_DIR)" \
83 SUBDIRS="include" \
84 DESTDIR="$(PKG_INSTALL_DIR)" \
85 all install
86 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
87 CC="$(HOSTCC)" \
88 LINK="$(HOSTCC) -o conf_to_src -lc" \
89 CFLAGS="" \
90 CPPFLAGS="" \
91 conf_to_src
92 $(MAKE) -C "$(PKG_BUILD_DIR)" \
93 SUBDIRS="libmysql" \
94 DESTDIR="$(PKG_INSTALL_DIR)" \
95 all install
96 $(MAKE) -C "$(PKG_BUILD_DIR)" \
97 SUBDIRS="libmysql_r" \
98 DESTDIR="$(PKG_INSTALL_DIR)" \
99 all install
100 $(MAKE) -C "$(PKG_BUILD_DIR)" \
101 SUBDIRS="scripts" \
102 DESTDIR="$(PKG_INSTALL_DIR)" \
103 bin_SCRIPTS="mysql_config" \
104 install
105 endef
106
107 define Build/InstallDev
108 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
109 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
110 ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
111 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
112 # NOTE: needed for MySQL-Python
113 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
115 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
116 endef
117
118 define Package/libmysqlclient/install
119 $(INSTALL_DIR) $(1)/usr/lib
120 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
121 endef
122 define Package/libmysqlclient_r/install
123 $(INSTALL_DIR) $(1)/usr/lib
124 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/
125 endef
126
127 $(eval $(call BuildPackage,libmysqlclient))
128 $(eval $(call BuildPackage,libmysqlclient_r))