From patchwork Sat Jan 18 21:24:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marcelo_Guti=C3=A9rrez=28UTN/FRH=29?= X-Patchwork-Id: 312334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 6A54A2C00A7 for ; Sun, 19 Jan 2014 08:24:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id F298A93A59; Sat, 18 Jan 2014 21:24:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3tN6q5u3kjdd; Sat, 18 Jan 2014 21:24:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 91AE993A4B; Sat, 18 Jan 2014 21:24:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7BF0C1C2440 for ; Sat, 18 Jan 2014 21:24:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 714B28BBCA for ; Sat, 18 Jan 2014 21:24:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CChvYucSGRTf for ; Sat, 18 Jan 2014 21:24:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ob0-f196.google.com (mail-ob0-f196.google.com [209.85.214.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2DD168BB71 for ; Sat, 18 Jan 2014 21:24:52 +0000 (UTC) Received: by mail-ob0-f196.google.com with SMTP id gq1so341605obb.11 for ; Sat, 18 Jan 2014 13:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FUVgViJXj/CjZsLb9xxn/th3CHZTvGAIb3tbnYzrCjI=; b=S/8jLqxgG2RcFzUFaPmoEtidBwUS3mdkF2jVcftRJD81RmlA0mrkJ559TFL7EO0ImC wxYN/+PRZiYlKC5TN6kFPgq6EjgJd5vT/nEV3vBzwdgPB0XNOwxXQOGSZVgqDLgJBF+t /4D7v4V8Z+rM0pbQdeclcB4ajeX6ZXXJrqSmiWwUZ5E55qr5zRah3MwrzGZtD4vx30ef DRLBYe0gTV8qynV41RKofuFAgDAzOezJDc+5dec83tvLSvPGHuLtdHRt0ulFD2DIrtye CKYdXTvxkavOZZGjc0w1xleHiLbAXQiOY3PlqnJ32cZ3xF7E5TMdJn/5pxyjO4GtKBN5 zW2A== MIME-Version: 1.0 X-Received: by 10.182.4.232 with SMTP id n8mr8066570obn.34.1390080291280; Sat, 18 Jan 2014 13:24:51 -0800 (PST) Received: by 10.76.79.164 with HTTP; Sat, 18 Jan 2014 13:24:51 -0800 (PST) Date: Sat, 18 Jan 2014 19:24:51 -0200 Message-ID: From: Marcelo Gutierrez To: buildroot@busybox.net Subject: [Buildroot] [PATCH 2/2] Update MySQL client package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Changes v1 -> v2: - fix comments following new policy - rename patches - remove useless hook points - add the URL to the home of MySQL - add commit-log description to the patches - install host tools to $(HOST_DIR)/usr/bin - fix only builds the required program Signed-off-by: Marcelo GutiƩrrez(UTN/FRH) --- package/mysql_client/Config.in | 20 +++++++-- package/mysql_client/S60mysqld | 25 +++++++++++ .../mysql_client-Fix-gen_lex_hash-execution.patch | 28 ++++++++++++ .../mysql_client-ac_stack_direction-is-unset.patch | 15 +++++++ package/mysql_client/mysql_client.mk | 47 +++++++++++++++++++- 5 files changed, 130 insertions(+), 5 deletions(-) create mode 100644 package/mysql_client/S60mysqld create mode 100644 package/mysql_client/mysql_client-Fix-gen_lex_hash-execution.patch create mode 100644 package/mysql_client/mysql_client-ac_stack_direction-is-unset.patch +$(eval $(host-autotools-package)) diff --git a/package/mysql_client/Config.in b/package/mysql_client/Config.in index 543bed1..8ebe70f 100644 --- a/package/mysql_client/Config.in +++ b/package/mysql_client/Config.in @@ -1,13 +1,25 @@ -config BR2_PACKAGE_MYSQL_CLIENT - bool "MySQL client" +config BR2_PACKAGE_MYSQL + bool "MySQL" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS select BR2_PACKAGE_NCURSES select BR2_PACKAGE_READLINE help - MySQL client + The MySQL Open Source Database System + http://www.mysql.com/ -comment "MySQL client needs a toolchain w/ C++, threads" +comment "MySQL server and MySQL client needs a toolchain w/ C++, threads" depends on BR2_USE_MMU depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS + +if BR2_PACKAGE_MYSQL + +config BR2_PACKAGE_MYSQL_CLIENT + bool "MySQL client" + +config BR2_PACKAGE_MYSQL_CLIENT_SERVER + bool "MySQL server" + +endif + diff --git a/package/mysql_client/S60mysqld b/package/mysql_client/S60mysqld new file mode 100644 index 0000000..38e1c41 --- /dev/null +++ b/package/mysql_client/S60mysqld @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Starts mysqld. +# + +case "$1" in + start) + /usr/bin/mysqld_safe & + ;; + stop) + if test -f /var/lib/mysql/mysqld.pid ; then + PID=`cat /var/lib/mysql/mysqld.pid` + kill $PID + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "Usage: /etc/init.d/mysqld {start|stop|restart}" + ;; +esac + +exit 0 diff --git a/package/mysql_client/mysql_client-Fix-gen_lex_hash-execution.patch b/package/mysql_client/mysql_client-Fix-gen_lex_hash-execution.patch new file mode 100644 index 0000000..377cabb --- /dev/null +++ b/package/mysql_client/mysql_client-Fix-gen_lex_hash-execution.patch @@ -0,0 +1,28 @@ +When MySQL server is enabled, I first compile the tool with the host gcc +and then copy into the "$(HOST_DIR)/usr/bin/" folder + +Signed-off-by: Marcelo Gutierrez (UTN/FRH) + +--- mysql-5.1.70/sql/Makefile.am ++++ mysql-5.1.70.patch/sql/Makefile.am +@@ -177,7 +177,7 @@ + # this avoid the rebuild of the built files in a source dist + lex_hash.h: gen_lex_hash.cc lex.h + $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) +- ./gen_lex_hash$(EXEEXT) > $@-t ++ gen_lex_hash$(EXEEXT) > $@-t + $(MV) $@-t $@ + + # For testing of udf_example.so + +--- mysql-5.1.70/sql/Makefile.in ++++ mysql-5.1.70.patch/sql/Makefile.in +@@ -1310,7 +1310,7 @@ + # this avoid the rebuild of the built files in a source dist + lex_hash.h: gen_lex_hash.cc lex.h + $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) +- ./gen_lex_hash$(EXEEXT) > $@-t ++ gen_lex_hash$(EXEEXT) > $@-t + $(MV) $@-t $@ + + # We might have some stuff not built in this build, but that we want to install diff --git a/package/mysql_client/mysql_client-ac_stack_direction-is-unset.patch b/package/mysql_client/mysql_client-ac_stack_direction-is-unset.patch new file mode 100644 index 0000000..6fef0a9 --- /dev/null +++ b/package/mysql_client/mysql_client-ac_stack_direction-is-unset.patch @@ -0,0 +1,15 @@ +misc.m4: ac_cv_c_stack_direction is unset. + +Signed-off-by: Marcelo Gutierrez (UTN/FRH) + +--- mysql-5.1.70.orig/config/ac-macros/misc.m4 ++++ mysql-5.1.70/config/ac-macros/misc.m4 +@@ -477,7 +477,7 @@ + exit(ptr_f(&a) < 0); + } + ], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, +- ac_cv_c_stack_direction=)]) ++ ac_cv_c_stack_direction=0)]) + AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) + ])dnl + diff --git a/package/mysql_client/mysql_client.mk b/package/mysql_client/mysql_client.mk index bd4c565..127f65e 100644 --- a/package/mysql_client/mysql_client.mk +++ b/package/mysql_client/mysql_client.mk @@ -14,6 +14,15 @@ MYSQL_CLIENT_AUTORECONF = YES MYSQL_CLIENT_LICENSE = GPLv2 MYSQL_CLIENT_LICENSE_FILES = README COPYING + +ifeq ($(BR2_PACKAGE_MYSQL_CLIENT_SERVER),y) +MYSQL_CLIENT_DEPENDENCIES += host-mysql_client +HOST_MYSQL_CLIENT_DEPENDENCIES = + +HOST_MYSQL_CLIENT_CONF_OPT = \ + --with-embedded-server +endif + MYSQL_CLIENT_CONF_ENV = \ ac_cv_sys_restartable_syscalls=yes \ ac_cv_path_PS=/bin/ps \ @@ -25,15 +34,50 @@ MYSQL_CLIENT_CONF_ENV = \ MYSQL_CLIENT_CONF_OPT = \ --without-ndb-binlog \ - --without-server \ --without-docs \ --without-man \ --without-libedit \ --without-readline \ + --without-libedit \ + --disable-dependency-tracking \ --with-low-memory \ + --with-atomic-ops=up \ --enable-thread-safe-client \ + --without-query-cache \ + --without-plugin-partition \ + --without-plugin-daemon_example \ + --without-plugin-ftexample \ + --without-plugin-archive \ + --without-plugin-blackhole \ + --without-plugin-example \ + --without-plugin-federated \ + --without-plugin-ibmdb2i \ + --without-plugin-innobase \ + --without-plugin-innodb_plugin \ + --without-plugin-ndbcluster \ $(ENABLE_DEBUG) +ifeq ($(BR2_PACKAGE_MYSQL_CLIENT_SERVER),y) + MYSQL_CLIENT_CONF_OPT += --with-embedded-server + +define HOST_MYSQL_CLIENT_BUILD_CMDS + $(MAKE) -C $(@D)/include my_config.h + $(MAKE) -C $(@D)/mysys libmysys.a + $(MAKE) -C $(@D)/strings libmystrings.a + $(MAKE) -C $(@D)/vio libvio.a + $(MAKE) -C $(@D)/dbug libdbug.a + $(MAKE) -C $(@D)/regex libregex.a + $(MAKE) -C $(@D)/sql gen_lex_hash +endef + +define HOST_MYSQL_CLIENT_INSTALL_CMDS + $(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/ +endef + +else +MYSQL_CLIENT_CONF_OPT += --without-server +endif + define MYSQL_CLIENT_REMOVE_TEST_PROGS rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench endef @@ -46,3 +90,4 @@ MYSQL_CLIENT_POST_INSTALL_TARGET_HOOKS += MYSQL_CLIENT_REMOVE_TEST_PROGS MYSQL_CLIENT_POST_INSTALL_TARGET_HOOKS += MYSQL_CLIENT_ADD_MYSQL_LIB_PATH $(eval $(autotools-package))