fix yet more dependancies
[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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=\
18 http://mysql.planetmirror.com/Downloads/MySQL-5.0/ \
19 http://mysql.he.net/Downloads/MySQL-5.0/ \
20 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
21 http://mysql.holywar.net/Downloads/MySQL-5.0/
22 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
23 PKG_CAT:=zcat
24
25 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
26 PKG_BUILDDEP:=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 DESCRIPTION:=MySQL client library.
36 URL:=http://dev.mysql.com/
37 endef
38
39 define Build/Configure
40 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
41 touch configure.in; \
42 touch aclocal.m4; \
43 touch Makefile.in; \
44 touch config.h.in; \
45 touch configure; \
46 $(TARGET_CONFIGURE_OPTS) \
47 CFLAGS="$(TARGET_CFLAGS)" \
48 CXXFLAGS="$(TARGET_CFLAGS)" \
49 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
50 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
51 ac_atomic_add=yes \
52 ac_atomic_sub=yes \
53 ac_cv_sys_restartable_syscalls=yes \
54 ac_cv_conv_longlong_to_float=yes \
55 mysql_cv_compress=yes \
56 mysql_cv_gethostname_style=glibc2 \
57 ./configure \
58 --target=$(GNU_TARGET_NAME) \
59 --host=$(GNU_TARGET_NAME) \
60 --build=$(GNU_HOST_NAME) \
61 --program-prefix="" \
62 --program-suffix="" \
63 --prefix=/usr \
64 --exec-prefix=/usr \
65 --bindir=/usr/bin \
66 --datadir=/usr/share \
67 --includedir=/usr/include \
68 --infodir=/usr/share/info \
69 --libdir=/usr/lib \
70 --libexecdir=/usr/lib \
71 --localstatedir=/var \
72 --mandir=/usr/share/man \
73 --sbindir=/usr/sbin \
74 --sysconfdir=/etc \
75 $(DISABLE_LARGEFILE) \
76 $(DISABLE_NLS) \
77 --enable-shared \
78 --enable-static \
79 --disable-assembler \
80 --with-pthread \
81 --without-raid \
82 --with-unix-socket-path=/tmp \
83 --without-libwrap \
84 --without-pstack \
85 --with-low-memory \
86 --without-server \
87 --without-embedded-server \
88 --without-query-cache \
89 --without-mysqlfs \
90 --without-vio \
91 --without-openssl \
92 --without-docs \
93 --without-bench \
94 --without-readline \
95 );
96 endef
97
98 define Build/Compile
99 rm -rf $(PKG_INSTALL_DIR)
100 mkdir -p $(PKG_INSTALL_DIR)
101 $(MAKE) -C "$(PKG_BUILD_DIR)" \
102 SUBDIRS="include" \
103 DESTDIR="$(PKG_INSTALL_DIR)" \
104 all install
105 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
106 CC="$(HOSTCC)" \
107 LINK="$(HOSTCC) -o conf_to_src -lc" \
108 CFLAGS="" \
109 CPPFLAGS="" \
110 conf_to_src
111 $(MAKE) -C "$(PKG_BUILD_DIR)" \
112 SUBDIRS="libmysql" \
113 DESTDIR="$(PKG_INSTALL_DIR)" \
114 all install
115 $(MAKE) -C "$(PKG_BUILD_DIR)" \
116 SUBDIRS="scripts" \
117 DESTDIR="$(PKG_INSTALL_DIR)" \
118 bin_SCRIPTS="mysql_config" \
119 install
120 endef
121
122 define Package/libmysqlclient/install
123 install -d -m0755 $(1)/usr/lib
124 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
125 endef
126
127 define Build/InstallDev
128 mkdir -p $(STAGING_DIR)/usr/bin
129 $(CP) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(STAGING_DIR)/usr/bin/
130 mkdir -p $(STAGING_DIR)/usr/include
131 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(STAGING_DIR)/usr/include/
132 mkdir -p $(STAGING_DIR)/usr/lib
133 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(STAGING_DIR)/usr/lib/
134 rm -f $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.la
135 endef
136
137 define Build/UninstallDev
138 rm -rf \
139 $(STAGING_DIR)/usr/bin/mysql_config \
140 $(STAGING_DIR)/usr/include/mysql \
141 $(STAGING_DIR)/usr/lib/mysql
142 endef
143
144 $(eval $(call BuildPackage,libmysqlclient))