e086648e29dbfbcbd7d6f0111f56644c18bdc411
[openwrt/svn-archive/archive.git] / libs / mysql / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=mysql
12 PKG_VERSION:=5.0.18
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=\
17 http://mysql.planetmirror.com/Downloads/MySQL-5.0/ \
18 http://mysql.he.net/Downloads/MySQL-5.0/ \
19 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
20 http://mysql.holywar.net/Downloads/MySQL-5.0/
21 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
22
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26 PKG_BUILD_DEPENDS:=libncurses libreadline
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/libmysqlclient
31 SECTION:=libs
32 CATEGORY:=Libraries
33 DEPENDS:=+zlib
34 TITLE:=MySQL client library
35 URL:=http://dev.mysql.com/
36 endef
37
38 define Build/Configure
39 (cd $(PKG_BUILD_DIR); touch \
40 configure.in \
41 aclocal.m4 \
42 Makefile.in \
43 config.h.in \
44 configure \
45 );
46 $(call Build/Configure/Default, \
47 --enable-shared \
48 --enable-static \
49 --disable-assembler \
50 --with-pthread \
51 --without-raid \
52 --with-unix-socket-path=/tmp \
53 --without-libwrap \
54 --without-pstack \
55 --with-low-memory \
56 --without-server \
57 --without-embedded-server \
58 --without-query-cache \
59 --without-mysqlfs \
60 --without-vio \
61 --without-openssl \
62 --without-docs \
63 --without-bench \
64 --without-readline \
65 --with-named-thread-libs=-lpthread \
66 , \
67 mysql_cv_compress=yes \
68 mysql_cv_gethostname_style=glibc2 \
69 );
70 endef
71
72 define Build/Compile
73 rm -rf $(PKG_INSTALL_DIR)
74 mkdir -p $(PKG_INSTALL_DIR)
75 $(MAKE) -C "$(PKG_BUILD_DIR)" \
76 SUBDIRS="include" \
77 DESTDIR="$(PKG_INSTALL_DIR)" \
78 all install
79 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
80 CC="$(HOSTCC)" \
81 LINK="$(HOSTCC) -o conf_to_src -lc" \
82 CFLAGS="" \
83 CPPFLAGS="" \
84 conf_to_src
85 $(MAKE) -C "$(PKG_BUILD_DIR)" \
86 SUBDIRS="libmysql" \
87 DESTDIR="$(PKG_INSTALL_DIR)" \
88 all install
89 $(MAKE) -C "$(PKG_BUILD_DIR)" \
90 SUBDIRS="scripts" \
91 DESTDIR="$(PKG_INSTALL_DIR)" \
92 bin_SCRIPTS="mysql_config" \
93 install
94 endef
95
96 define Build/InstallDev
97 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
98 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
99 ln -sf $(1)/usr/bin/mysql_config $(2)/bin/
100 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
101 # NOTE: needed for MySQL-Python
102 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
104 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
105 endef
106
107 define Package/libmysqlclient/install
108 $(INSTALL_DIR) $(1)/usr/lib
109 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
110 endef
111
112 $(eval $(call BuildPackage,libmysqlclient))