[packages] Add missing libtool fixups
[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:=2
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
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 Build/Configure
36 (cd $(PKG_BUILD_DIR); touch \
37 configure.in \
38 aclocal.m4 \
39 Makefile.in \
40 config.h.in \
41 configure \
42 );
43 $(call Build/Configure/Default, \
44 --enable-shared \
45 --enable-static \
46 --disable-assembler \
47 --with-pthread \
48 --without-raid \
49 --with-unix-socket-path=/tmp \
50 --without-libwrap \
51 --without-pstack \
52 --with-low-memory \
53 --without-server \
54 --without-embedded-server \
55 --without-query-cache \
56 --without-mysqlfs \
57 --without-vio \
58 --without-openssl \
59 --without-docs \
60 --without-bench \
61 --without-readline \
62 --with-named-thread-libs=-lpthread \
63 , \
64 mysql_cv_compress=yes \
65 mysql_cv_gethostname_style=glibc2 \
66 );
67 endef
68
69 TARGET_CFLAGS += $(FPIC)
70
71 define Build/Compile
72 $(MAKE) -C "$(PKG_BUILD_DIR)" \
73 SUBDIRS="include" \
74 DESTDIR="$(PKG_INSTALL_DIR)" \
75 all install
76 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
77 CC="$(HOSTCC)" \
78 LINK="$(HOSTCC) -o conf_to_src -lc" \
79 CFLAGS="" \
80 CPPFLAGS="" \
81 conf_to_src
82 $(MAKE) -C "$(PKG_BUILD_DIR)" \
83 SUBDIRS="libmysql" \
84 DESTDIR="$(PKG_INSTALL_DIR)" \
85 all install
86 $(MAKE) -C "$(PKG_BUILD_DIR)" \
87 SUBDIRS="scripts" \
88 DESTDIR="$(PKG_INSTALL_DIR)" \
89 bin_SCRIPTS="mysql_config" \
90 install
91 endef
92
93 define Build/InstallDev
94 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
95 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
96 ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
97 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
98 # NOTE: needed for MySQL-Python
99 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
100 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
101 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
102 endef
103
104 define Package/libmysqlclient/install
105 $(INSTALL_DIR) $(1)/usr/lib
106 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
107 endef
108
109 $(eval $(call BuildPackage,libmysqlclient))