nuke $Id$ in /packages as well
[openwrt/svn-archive/archive.git] / libs / mysql / Makefile
index db7bb5086108c7c772de436b45f8849032ceff35..279f5957bc8576bee88e5bbf359ab8d3104f68e5 100644 (file)
@@ -4,7 +4,6 @@
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-# $Id$
 
 include $(TOPDIR)/rules.mk
 
@@ -12,7 +11,6 @@ PKG_NAME:=mysql
 PKG_VERSION:=5.0.18
 PKG_RELEASE:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=\
        http://mysql.planetmirror.com/Downloads/MySQL-5.0/ \
@@ -20,9 +18,8 @@ PKG_SOURCE_URL:=\
        http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
        http://mysql.holywar.net/Downloads/MySQL-5.0/
 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
-PKG_CAT:=zcat
 
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_BUILD_DEPENDS:=libncurses libreadline
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -31,69 +28,45 @@ define Package/libmysqlclient
   CATEGORY:=Libraries
   DEPENDS:=+zlib
   TITLE:=MySQL client library
-  DESCRIPTION:=MySQL client library.
   URL:=http://dev.mysql.com/
 endef
 
 define Build/Configure
-       (cd $(PKG_BUILD_DIR); rm -f config.cache; \
-               touch configure.in; \
-               touch aclocal.m4; \
-               touch Makefile.in; \
-               touch config.h.in; \
-               touch configure; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CXXFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-               ac_atomic_add=yes \
-               ac_atomic_sub=yes \
-               ac_cv_sys_restartable_syscalls=yes \
-               ac_cv_conv_longlong_to_float=yes \
+       (cd $(PKG_BUILD_DIR); touch \
+               configure.in \
+               aclocal.m4 \
+               Makefile.in \
+               config.h.in \
+               configure \
+       );
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --enable-static \
+               --disable-assembler \
+               --with-pthread \
+               --without-raid \
+               --with-unix-socket-path=/tmp \
+               --without-libwrap \
+               --without-pstack \
+               --with-low-memory \
+               --without-server \
+               --without-embedded-server \
+               --without-query-cache \
+               --without-mysqlfs \
+               --without-vio \
+               --without-openssl \
+               --without-docs \
+               --without-bench \
+               --without-readline \
+               --with-named-thread-libs=-lpthread \
+               , \
                mysql_cv_compress=yes \
                mysql_cv_gethostname_style=glibc2 \
-               ./configure \
-                       --target=$(GNU_TARGET_NAME) \
-                       --host=$(GNU_TARGET_NAME) \
-                       --build=$(GNU_HOST_NAME) \
-                       --program-prefix="" \
-                       --program-suffix="" \
-                       --prefix=/usr \
-                       --exec-prefix=/usr \
-                       --bindir=/usr/bin \
-                       --datadir=/usr/share \
-                       --includedir=/usr/include \
-                       --infodir=/usr/share/info \
-                       --libdir=/usr/lib \
-                       --libexecdir=/usr/lib \
-                       --localstatedir=/var \
-                       --mandir=/usr/share/man \
-                       --sbindir=/usr/sbin \
-                       --sysconfdir=/etc \
-                       $(DISABLE_LARGEFILE) \
-                       $(DISABLE_NLS) \
-                       --enable-shared \
-                       --enable-static \
-                       --disable-assembler \
-                       --with-pthread \
-                       --without-raid \
-                       --with-unix-socket-path=/tmp \
-                       --without-libwrap \
-                       --without-pstack \
-                       --with-low-memory \
-                       --without-server \
-                       --without-embedded-server \
-                       --without-query-cache \
-                       --without-mysqlfs \
-                       --without-vio \
-                       --without-openssl \
-                       --without-docs \
-                       --without-bench \
-                       --without-readline \
        );
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
 define Build/Compile
        rm -rf $(PKG_INSTALL_DIR)
        mkdir -p $(PKG_INSTALL_DIR)
@@ -118,26 +91,20 @@ define Build/Compile
                install
 endef
 
-define Package/libmysqlclient/install
-       install -d -m0755 $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
-endef
-
 define Build/InstallDev
-       mkdir -p $(STAGING_DIR)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(STAGING_DIR)/usr/bin/
-       mkdir -p $(STAGING_DIR)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(STAGING_DIR)/usr/include/
-       mkdir -p $(STAGING_DIR)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(STAGING_DIR)/usr/lib/
-       rm -f $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.la
+       $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
+       ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
+       # NOTE: needed for MySQL-Python
+       $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
+       rm -f $(1)/usr/lib/mysql/libmysqlclient.la
 endef
 
-define Build/UninstallDev
-       rm -rf \
-               $(STAGING_DIR)/usr/bin/mysql_config \
-               $(STAGING_DIR)/usr/include/mysql \
-               $(STAGING_DIR)/usr/lib/mysql
+define Package/libmysqlclient/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,libmysqlclient))