From patchwork Tue Feb 4 15:41:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 316625 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 1F97D2C0098 for ; Wed, 5 Feb 2014 02:42:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7ED9E932CB; Tue, 4 Feb 2014 15:42:03 +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 ZSt5FtaA5y26; Tue, 4 Feb 2014 15:42:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 692E293CB1; Tue, 4 Feb 2014 15:42:02 +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 04C331BF94F for ; Tue, 4 Feb 2014 15:42:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F2F848C22F for ; Tue, 4 Feb 2014 15:42:01 +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 DjmxrPW4GQlt for ; Tue, 4 Feb 2014 15:42:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 00F728BF8A for ; Tue, 4 Feb 2014 15:42:00 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id w61so4161984wes.26 for ; Tue, 04 Feb 2014 07:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=eKSyZFv6q0i0tectLxClFJvgu2E3VKIfs4hEGnceLYo=; b=TgEBM/PWk1SO9NCH5vBgt4UiSeRq2TrEydrOHwWcGKCvQ89/+3B8XjQ1yKHlwT0pz3 E7Sw0h4cHED8WNcWqCWdHJqacQcwPG2Uk0zYzjZ6S7SdIo+xqjvJIvHYbO3cmu0XBEvL fsM/KA1dNfG49QubQC3iQDQ8r43Iwf7od0g0jZBsE3C53dqIdRzsOpCc9ntQLWE2Xw5g RX2D6auE7APaBW7T0MeoDalbBi4Bl3sz+oqtnD/dxMO2FvvIw08hWdQKjEvcoYcufSW5 NlHWntsmzf7qaWw3iPlmtTEOaRpu8Ah7Nz8Ga5QrXna+zhFiVc45aOx5O0so5x+20Zn6 GMNg== X-Received: by 10.180.74.200 with SMTP id w8mr13114179wiv.58.1391528519446; Tue, 04 Feb 2014 07:41:59 -0800 (PST) Received: from localhost.localdomain (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id j9sm53602628wjz.13.2014.02.04.07.41.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:41:58 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Tue, 4 Feb 2014 16:41:58 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.2 In-Reply-To: References: MIME-Version: 1.0 Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 1/2] mysql: add option to build the server 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 From: Marcelo GutiƩrrez(UTN/FRH) Signed-off-by: Marcelo GutiƩrrez [yann.morin.1998@free.fr: fix menuconfig layout] Signed-off-by: "Yann E. MORIN" --- package/mysql/Config.in | 9 +++++ .../mysql-0003-ac_stack_direction-is-unset.patch | 15 +++++++ .../mysql-0004-Fix-gen_lex_hash-execution.patch | 32 +++++++++++++++ package/mysql/mysql.mk | 46 +++++++++++++++++++++- 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 package/mysql/mysql-0003-ac_stack_direction-is-unset.patch create mode 100644 package/mysql/mysql-0004-Fix-gen_lex_hash-execution.patch diff --git a/package/mysql/Config.in b/package/mysql/Config.in index 0def957..7133892 100644 --- a/package/mysql/Config.in +++ b/package/mysql/Config.in @@ -10,6 +10,15 @@ config BR2_PACKAGE_MYSQL http://www.mysql.com/ +if BR2_PACKAGE_MYSQL + +config BR2_PACKAGE_MYSQL_SERVER + bool "MySQL server" + help + Install the MySQL server on the target. + +endif + comment "MySQL needs a toolchain w/ C++, threads" depends on BR2_USE_MMU depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/mysql/mysql-0003-ac_stack_direction-is-unset.patch b/package/mysql/mysql-0003-ac_stack_direction-is-unset.patch new file mode 100644 index 0000000..6fef0a9 --- /dev/null +++ b/package/mysql/mysql-0003-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/mysql-0004-Fix-gen_lex_hash-execution.patch b/package/mysql/mysql-0004-Fix-gen_lex_hash-execution.patch new file mode 100644 index 0000000..b91ed4f --- /dev/null +++ b/package/mysql/mysql-0004-Fix-gen_lex_hash-execution.patch @@ -0,0 +1,32 @@ +Makefile: fix cross-compiling the server + +MySQL Makefile believes it can run code it just compiled, to +generate a header. This does not work for cross-compilation. + +Instead, use a pre-installed host-version of the required tool. + +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/mysql.mk b/package/mysql/mysql.mk index 9b22c2d..9bcbf4f 100644 --- a/package/mysql/mysql.mk +++ b/package/mysql/mysql.mk @@ -25,7 +25,6 @@ MYSQL_CONF_ENV = \ MYSQL_CONF_OPT = \ --without-ndb-binlog \ - --without-server \ --without-docs \ --without-man \ --without-libedit \ @@ -34,6 +33,50 @@ MYSQL_CONF_OPT = \ --enable-thread-safe-client \ $(ENABLE_DEBUG) +ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y) +MYSQL_DEPENDENCIES += host-mysql +HOST_MYSQL_DEPENDENCIES = + +HOST_MYSQL_CONF_OPT = \ + --with-embedded-server + +MYSQL_CONF_OPT += \ + --disable-dependency-tracking \ + --with-atomic-ops=up \ + --with-embedded-server \ + --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 + +define HOST_MYSQL_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_INSTALL_CMDS + $(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/ +endef + +else +MYSQL_CONF_OPT += \ + --without-server +endif + + define MYSQL_REMOVE_TEST_PROGS rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench endef @@ -46,3 +89,4 @@ MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_REMOVE_TEST_PROGS MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_MYSQL_LIB_PATH $(eval $(autotools-package)) +$(eval $(host-autotools-package))