From patchwork Tue Jan 28 21:26:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Zacarias X-Patchwork-Id: 314837 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 EEAE22C0091 for ; Wed, 29 Jan 2014 08:26:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 44357943CC; Tue, 28 Jan 2014 21:26:57 +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 8+TT1HxQ-zI4; Tue, 28 Jan 2014 21:26:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A097394357; Tue, 28 Jan 2014 21:26:56 +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 7EF281BFA0C for ; Tue, 28 Jan 2014 21:26:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 78FDB8F0C3 for ; Tue, 28 Jan 2014 21:26:55 +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 HC-C7zlOLd-k for ; Tue, 28 Jan 2014 21:26:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from loknar.toptech.com.ar (loknar.toptech.com.ar [78.46.79.162]) by whitealder.osuosl.org (Postfix) with ESMTPS id B774F8F0B1 for ; Tue, 28 Jan 2014 21:26:54 +0000 (UTC) Received: from asgard (host83.181-1-251.telecom.net.ar [181.1.251.83]) (authenticated bits=0) by loknar.toptech.com.ar (8.14.7/8.14.7) with ESMTP id s0SLQm8S002474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 28 Jan 2014 21:26:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zacarias.com.ar; s=dkey; t=1390944412; bh=+T5igE6/tlUp0b8Wvnp4vbP9K0/15lPbGQ5kWnr1IUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=K84rBaNBqx18Pw7LiO47WutDq2zoSf+UD6gTUMpF4p/KjtXQ/mplU+n6dmu+v0TFS 1Bb25e8TLWOpbqMpK4gqyEEdPgl9kDj3CzcXl0c2x/4CWR8OhVpQw4L1ofJF6TKU5d 2cPxgyPqxZlE2xd35RvqCyOCkZPo+BVjs7NpTT2E= Received: by asgard (sSMTP sendmail emulation); Tue, 28 Jan 2014 18:26:42 -0300 From: Gustavo Zacarias To: buildroot@busybox.net Date: Tue, 28 Jan 2014 18:26:27 -0300 Message-Id: <1390944391-3892-2-git-send-email-gustavo@zacarias.com.ar> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1390944391-3892-1-git-send-email-gustavo@zacarias.com.ar> References: <1390944391-3892-1-git-send-email-gustavo@zacarias.com.ar> X-Virus-Scanned: clamav-milter 0.98 at loknar X-Virus-Status: Clean Subject: [Buildroot] [PATCH 2/6] php: fix for external extensions 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Adjust phpize and php-config to make them work for cross-compiled external extensions. While at it also fix dl* issues that prevent said extensions from loading. Signed-off-by: Gustavo Zacarias --- package/php/php-02-dlopen.patch | 25 +++++++++++++++++++++++++ package/php/php.mk | 25 ++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 package/php/php-02-dlopen.patch diff --git a/package/php/php-02-dlopen.patch b/package/php/php-02-dlopen.patch new file mode 100644 index 0000000..1dd009f --- /dev/null +++ b/package/php/php-02-dlopen.patch @@ -0,0 +1,25 @@ +PHP can't be AUTORECONF with any modern autotools and the dl tests are +pretty bad for cross-compilation, so just kill the needed ac_cv value unsets +so they can flow through from the package makefile. + +Signed-off-by: Gustavo Zacarias + +diff -Nura php-5.5.8.orig/configure php-5.5.8/configure +--- php-5.5.8.orig/configure 2014-01-28 17:41:33.943851727 -0300 ++++ php-5.5.8/configure 2014-01-28 17:42:53.785493795 -0300 +@@ -16985,7 +16985,6 @@ + + + +- unset ac_cv_func_dlopen + unset ac_cv_func___dlopen + unset found + +@@ -17013,7 +17012,6 @@ + + *) + +- unset ac_cv_lib_dl_dlopen + unset ac_cv_lib_dl___dlopen + unset found + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 diff --git a/package/php/php.mk b/package/php/php.mk index de02f4b..2f6280f 100644 --- a/package/php/php.mk +++ b/package/php/php.mk @@ -19,15 +19,25 @@ PHP_CONF_OPT = --mandir=/usr/share/man \ --with-config-file-path=/etc \ --localstatedir=/var \ --disable-rpath +PHP_CONF_ENV = EXTRA_LIBS="$(PHP_EXTRA_LIBS)" + ifeq ($(BR2_ENDIAN),"BIG") -PHP_CONF_ENV = ac_cv_c_bigendian_php=yes +PHP_CONF_ENV += ac_cv_c_bigendian_php=yes else -PHP_CONF_ENV = ac_cv_c_bigendian_php=no +PHP_CONF_ENV += ac_cv_c_bigendian_php=no endif PHP_CONFIG_SCRIPTS = php-config PHP_CFLAGS = $(TARGET_CFLAGS) +# We need to force dl "detection" +ifeq ($(BR2_PREFER_STATIC_LIB),) +PHP_CONF_ENV += ac_cv_func_dlopen=yes ac_cv_lib_dl_dlopen=yes +PHP_EXTRA_LIBS += -ldl +else +PHP_CONF_ENV += ac_cv_func_dlopen=no ac_cv_lib_dl_dlopen=no +endif + # Workaround for non-IPv6 uClibc toolchain ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) ifneq ($(BR2_INET_IPV6),y) @@ -116,7 +126,7 @@ ifeq ($(BR2_PACKAGE_PHP_EXT_INTL),y) # The intl module is implemented in C++, but PHP fails to use # g++ as the compiler for the final link. As a workaround, # tell it to link libstdc++. - PHP_CONF_ENV += EXTRA_LIBS="-lstdc++" + PHP_EXTRA_LIBS + = -lstdc++ endif ifeq ($(BR2_PACKAGE_PHP_EXT_GMP),y) @@ -200,6 +210,15 @@ ifeq ($(BR2_PACKAGE_PHP_EXT_SNMP),y) PHP_DEPENDENCIES += netsnmp endif +define PHP_EXTENSIONS_FIXUP + $(SED) "/prefix/ s:/usr:$(STAGING_DIR)/usr:" \ + $(STAGING_DIR)/usr/bin/phpize + $(SED) "/extension_dir/ s:/usr:$(TARGET_DIR)/usr:" \ + $(STAGING_DIR)/usr/bin/php-config +endef + +PHP_POST_INSTALL_TARGET_HOOKS += PHP_EXTENSIONS_FIXUP + define PHP_INSTALL_FIXUP rm -rf $(TARGET_DIR)/usr/lib/php rm -f $(TARGET_DIR)/usr/bin/phpize