From patchwork Fri Feb 15 02:27:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 158468 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp179203jaa; Thu, 14 Feb 2019 18:27:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IZo6JfsGpJU60p8lOthC2c+kLawBpa1xBZzdrbKO/rotllLZX7lc3oyCp87MEawBitxa4Jz X-Received: by 2002:aa7:87c6:: with SMTP id i6mr7344210pfo.208.1550197654677; Thu, 14 Feb 2019 18:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197654; cv=none; d=google.com; s=arc-20160816; b=wv44uzD/31tLFHpyPoF7Sqlo1q2leSUY/L4SdgEy9uOrF7+Z4YSEecnh0EIVIsGLTg fsJHoYO/b8h2FvgFB4b4srjb/ITg6671vsiBc29r1yncDuL9TtQ+2jzQYWh7Aoyar0UA s4wxwunwLBPVEQ/L/b+/JVqspvhrSU58NGtdz4BOcjPa8sqVnFQu7HoWvNs/EF40lljp RkrNQfMpyT0bqjW79P/N13W90lSb3GNZn0z3tbOo3Zkv0X1Ri1nts29o4B1agH+NwNBh u8xyoN9rjFQxrto+1uwcBEfQANFRKb8Vir6jkxROBGqk8wEGVqOHvUSv4DWUGT/lrLpe wK8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=YuJRtZNSAMm1Amdzau/I2tHo271g6YgeRPZ1JilWAiY=; b=zxxCij0X198rfm5YLjx6+m0ICpG6OWT/0rFx8G9k8+qPIBO/K5RrdFEWmPRnGrevsI PIsXtnsfPXGvTx99s0octl5bmakanXNpZWY3xft+eLkMWnsf5ldkj9tiC2jn0nDlk45q EyklARfYte5+F0FuG7sIMr6iohC0F2DUijgzYLaMvKvMegGlRyC+acP5nP7Oe3JOy4P5 W5D4j2+Hq52bZl6GOXBv0i/QrPPY9S6BABFdRHQkXmwNtJb2GQCOojYksH7fmzORxQ9i EMzB3CGwxknGf0hF4AzB2LcIr5+aJrnZF87DS9Kcj5gi9gmlJ/oOwsqoL213Jd+G0JMY nQWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=FhADfmZ4; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id a18si4214171plm.75.2019.02.14.18.27.34; Thu, 14 Feb 2019 18:27:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=FhADfmZ4; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id C28607C67D; Fri, 15 Feb 2019 02:27:30 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mail.openembedded.org (Postfix) with ESMTP id 761936010B for ; Fri, 15 Feb 2019 02:27:29 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id u9so520296pgo.7 for ; Thu, 14 Feb 2019 18:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Ce26+FEudiUeF6uqqj9yNaBB5wLOe6zIFFbyyX3/Xc=; b=FhADfmZ4dpEY0l6AOvOkgxxE1pQCQ0WQa0EGo4JYiBb81M07VMkQXANyXQoGTSJGq+ MRC5Qw+vuV40msbPNHKQsraENov5eipAI1oVclT0tCX/yWEpWxRDlnFOtzPiPQXAOBec /Idyl/p1NqaACdb65tTRDxSgJsjq+YB2iVw3VKHV5+vn7y0qrLqEZnHGvriOhg/pSLeI VmNV0kasjR+pde60JTTOW9Z2H5q1LwjWdOgzS+DbxlX2R+j5m03U2vx2mWgxwa50Yjp0 ID44BGTtXxwZQ4bjsHo7WQ1rjXSRjQl3ZMV3kCiUEQAkxfOlNCkS8oUVgfIJKRLNHEGh OE8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Ce26+FEudiUeF6uqqj9yNaBB5wLOe6zIFFbyyX3/Xc=; b=HpeJWlzoCF6hMeiNdzfJn2PlhtRiIurJNh1Xe7qeTOvxJEMNE5aoVthGnS5NGqKRmo U5dTUf4vRkJ4jhhOuVp1tUehSTObFb6IJqqzjpYUTgc1NeZp1xYmIkaGt6mWfo68YJIg f3ZCO4HxWJanziLlreT/x/3SaJhd1TFmDEVEYvbRJskq9t3s7Dne5KBU/arjpsgN+k0P 8iZooUDvPXHp4nOy0Tn59Qw/08husm6nWUmFae7/5xA9JBuxc3BoKFC/p8oA1xMNknTc iGkRVknKtgMOEPap6x5hMt+fV8HMRTbQamUIK3cADg2abCMxzRbxXZIswZMB7bMGVcqj 8Y2Q== X-Gm-Message-State: AHQUAuZ++Lli6ZUv0mjsE1qh2rIBhLQNBijPZiReWDhkQ4fok8RzxhlP tqWkVaLCA4IjwSnJFvMhjSX2eFGJ X-Received: by 2002:a62:444b:: with SMTP id r72mr7491482pfa.184.1550197649880; Thu, 14 Feb 2019 18:27:29 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:8500:6bc6::dc44]) by smtp.gmail.com with ESMTPSA id d13sm5374658pfd.58.2019.02.14.18.27.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 18:27:29 -0800 (PST) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Thu, 14 Feb 2019 18:27:18 -0800 Message-Id: <20190215022718.24488-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [oe] [meta-oe][PATCH] php_7.3.2.bb: Fix cross build on hosts which have libxml2 installed X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org libxml2 is not detected properly, it pokes at host and takes the libraries and header files added to build which links in libraries like libicu which may not be available in sysroot causing configure failures like checking for sqlite3 files in default path... found in TOPDIR/build/tmp/work/aarch64-yoe-linux/php/7.3.2-r0/recipe-sysroot/usr/lib/.. checking for SQLite 3.3.9+... checking for sqlite3_prepare_v2 in -lsqlite3... no not found configure: error: Please install SQLite 3.3.9 first or check libsqlite3 is present the reason is configure test fails to find icu libraries since they were added based on build host's libxml2.pc Signed-off-by: Khem Raj Cc: Changqing Li --- ...Use-pkg-config-for-libxml2-detection.patch | 23 ++++ ...e-pkg-config-for-FreeType2-detection.patch | 53 +++++++++ ...xt-intl-Use-pkg-config-to-detect-icu.patch | 111 ++++++++++++++++++ meta-oe/recipes-devtools/php/php_7.3.2.bb | 3 + 4 files changed, 190 insertions(+) create mode 100644 meta-oe/recipes-devtools/php/php/0001-Use-pkg-config-for-libxml2-detection.patch create mode 100644 meta-oe/recipes-devtools/php/php/0048-Use-pkg-config-for-FreeType2-detection.patch create mode 100644 meta-oe/recipes-devtools/php/php/0049-ext-intl-Use-pkg-config-to-detect-icu.patch -- 2.20.1 -- _______________________________________________ Openembedded-devel mailing list Openembedded-devel@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-devel diff --git a/meta-oe/recipes-devtools/php/php/0001-Use-pkg-config-for-libxml2-detection.patch b/meta-oe/recipes-devtools/php/php/0001-Use-pkg-config-for-libxml2-detection.patch new file mode 100644 index 0000000000..ccc6d4ede1 --- /dev/null +++ b/meta-oe/recipes-devtools/php/php/0001-Use-pkg-config-for-libxml2-detection.patch @@ -0,0 +1,23 @@ +Use pkg-config for libxml2 detection. + +xml2-config does not work. Use pkgconfig to set CPPFLAGS and LIBS. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Khem Raj +--- + configure.in | 15 ++------------- + 1 file changed, 2 insertions(+), 13 deletions(-) +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -2481,8 +2481,8 @@ AC_DEFUN([PHP_SETUP_LIBXML], [ + LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3` + if test "$LIBXML_VERSION" -ge "2006011"; then + found_libxml=yes +- LIBXML_LIBS=`$XML2_CONFIG --libs` +- LIBXML_INCS=`$XML2_CONFIG --cflags` ++ LIBXML_LIBS=`pkg-config --libs libxml-2.0` ++ LIBXML_INCS=`pkg-config --cflags libxml-2.0` + else + AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.]) + fi diff --git a/meta-oe/recipes-devtools/php/php/0048-Use-pkg-config-for-FreeType2-detection.patch b/meta-oe/recipes-devtools/php/php/0048-Use-pkg-config-for-FreeType2-detection.patch new file mode 100644 index 0000000000..f36ddac262 --- /dev/null +++ b/meta-oe/recipes-devtools/php/php/0048-Use-pkg-config-for-FreeType2-detection.patch @@ -0,0 +1,53 @@ +From: =?utf-8?b?T25kxZllaiBTdXLDvQ==?= +Date: Mon, 22 Oct 2018 06:54:31 +0000 +Subject: Use pkg-config for FreeType2 detection + +--- + ext/gd/config.m4 | 30 +++++++++++++++++++----------- + 1 file changed, 19 insertions(+), 11 deletions(-) + +diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 +index 498d870..d28c6ae 100644 +--- a/ext/gd/config.m4 ++++ b/ext/gd/config.m4 +@@ -184,21 +184,29 @@ AC_DEFUN([PHP_GD_XPM],[ + AC_DEFUN([PHP_GD_FREETYPE2],[ + if test "$PHP_FREETYPE_DIR" != "no"; then + +- for i in $PHP_FREETYPE_DIR /usr/local /usr; do +- if test -f "$i/bin/freetype-config"; then +- FREETYPE2_DIR=$i +- FREETYPE2_CONFIG="$i/bin/freetype-config" +- break ++ if test -z "$PKG_CONFIG"; then ++ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) ++ fi ++ if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists freetype2 ; then ++ FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags freetype2` ++ FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2` ++ else ++ for i in $PHP_FREETYPE_DIR /usr/local /usr; do ++ if test -f "$i/bin/freetype-config"; then ++ FREETYPE2_DIR=$i ++ FREETYPE2_CONFIG="$i/bin/freetype-config" ++ break ++ fi ++ done ++ ++ if test -z "$FREETYPE2_DIR"; then ++ AC_MSG_ERROR([freetype-config not found.]) + fi +- done + +- if test -z "$FREETYPE2_DIR"; then +- AC_MSG_ERROR([freetype-config not found.]) ++ FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags` ++ FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs` + fi + +- FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags` +- FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs` +- + PHP_EVAL_INCLINE($FREETYPE2_CFLAGS) + PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD) + AC_DEFINE(HAVE_LIBFREETYPE,1,[ ]) diff --git a/meta-oe/recipes-devtools/php/php/0049-ext-intl-Use-pkg-config-to-detect-icu.patch b/meta-oe/recipes-devtools/php/php/0049-ext-intl-Use-pkg-config-to-detect-icu.patch new file mode 100644 index 0000000000..deada1ff97 --- /dev/null +++ b/meta-oe/recipes-devtools/php/php/0049-ext-intl-Use-pkg-config-to-detect-icu.patch @@ -0,0 +1,111 @@ +From: Hugh McMaster +Date: Wed, 5 Dec 2018 23:27:30 +1100 +Subject: ext/intl: Use pkg-config to detect icu + +The developers of icu recommend using pkg-config to detect icu, +because icu-config is deprecated. +--- + acinclude.m4 | 56 +++++++----------------------------------------------- + ext/intl/config.m4 | 16 ++++++---------- + 2 files changed, 13 insertions(+), 59 deletions(-) + +--- php7.3.orig/acinclude.m4 ++++ php7.3/acinclude.m4 +@@ -2168,58 +2168,16 @@ dnl + dnl Common setup macro for ICU + dnl + AC_DEFUN([PHP_SETUP_ICU],[ +- PHP_ARG_WITH(icu-dir,, +- [ --with-icu-dir=DIR Specify where ICU libraries and headers can be found], DEFAULT, no) ++ PKG_CHECK_MODULES([ICU], [icu-io >= 50.1]) + +- if test "$PHP_ICU_DIR" = "no"; then +- PHP_ICU_DIR=DEFAULT +- fi +- +- if test "$PHP_ICU_DIR" = "DEFAULT"; then +- dnl Try to find icu-config +- AC_PATH_PROG(ICU_CONFIG, icu-config, no, [$PATH:/usr/local/bin]) +- else +- ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config" +- fi +- +- AC_MSG_CHECKING([for location of ICU headers and libraries]) +- +- dnl Trust icu-config to know better what the install prefix is.. +- icu_install_prefix=`$ICU_CONFIG --prefix 2> /dev/null` +- if test "$?" != "0" || test -z "$icu_install_prefix"; then +- AC_MSG_RESULT([not found]) +- AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please verify ICU install prefix and make sure icu-config works.]) +- else +- AC_MSG_RESULT([$icu_install_prefix]) +- +- dnl Check ICU version +- AC_MSG_CHECKING([for ICU 4.0 or greater]) +- icu_version_full=`$ICU_CONFIG --version` +- ac_IFS=$IFS +- IFS="." +- set $icu_version_full +- IFS=$ac_IFS +- icu_version=`expr [$]1 \* 1000 + [$]2` +- AC_MSG_RESULT([found $icu_version_full]) +- +- if test "$icu_version" -lt "4000"; then +- AC_MSG_ERROR([ICU version 4.0 or later is required]) +- fi ++ PHP_EVAL_INCLINE($ICU_CFLAGS) ++ PHP_EVAL_LIBLINE($ICU_LIBS, $1) + +- ICU_VERSION=$icu_version +- ICU_INCS=`$ICU_CONFIG --cppflags-searchpath` +- ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio` +- PHP_EVAL_INCLINE($ICU_INCS) +- PHP_EVAL_LIBLINE($ICU_LIBS, $1) ++ ICU_CFLAGS="$ICU_CFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" ++ ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit" + +- ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags` +- if test "$icu_version" -ge "49000"; then +- ICU_CXXFLAGS="$ICU_CXXFLAGS -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit" +- ICU_CFLAGS="-DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" +- fi +- if test "$icu_version" -ge "60000"; then +- ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1" +- fi ++ if $PKG_CONFIG icu-io --atleast-version=60; then ++ ICU_CFLAGS="$ICU_CFLAGS -DU_HIDE_OBSOLETE_UTF_OLD_H=1" + fi + ]) + +--- php7.3.orig/ext/intl/config.m4 ++++ php7.3/ext/intl/config.m4 +@@ -9,15 +9,7 @@ if test "$PHP_INTL" != "no"; then + PHP_SETUP_ICU(INTL_SHARED_LIBADD) + PHP_SUBST(INTL_SHARED_LIBADD) + PHP_REQUIRE_CXX() +- INTL_COMMON_FLAGS="$ICU_INCS $ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" +- if test "$icu_version" -ge "4002"; then +- icu_spoof_src=" spoofchecker/spoofchecker_class.c \ +- spoofchecker/spoofchecker.c\ +- spoofchecker/spoofchecker_create.c\ +- spoofchecker/spoofchecker_main.c" +- else +- icu_spoof_src="" +- fi ++ INTL_COMMON_FLAGS="$ICU_CFLAGS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" + PHP_NEW_EXTENSION(intl, php_intl.c \ + intl_error.c \ + intl_convert.c \ +@@ -68,7 +60,11 @@ if test "$PHP_INTL" != "no"; then + transliterator/transliterator_methods.c \ + uchar/uchar.c \ + idn/idn.c \ +- $icu_spoof_src, $ext_shared,,$INTL_COMMON_FLAGS,cxx) ++ spoofchecker/spoofchecker_class.c \ ++ spoofchecker/spoofchecker.c\ ++ spoofchecker/spoofchecker_create.c\ ++ spoofchecker/spoofchecker_main.c \ ++ , $ext_shared,,$INTL_COMMON_FLAGS,cxx) + + PHP_INTL_CXX_SOURCES="intl_convertcpp.cpp \ + common/common_enum.cpp \ diff --git a/meta-oe/recipes-devtools/php/php_7.3.2.bb b/meta-oe/recipes-devtools/php/php_7.3.2.bb index fdd08ebc9c..db04ce3756 100644 --- a/meta-oe/recipes-devtools/php/php_7.3.2.bb +++ b/meta-oe/recipes-devtools/php/php_7.3.2.bb @@ -3,6 +3,9 @@ require php.inc LIC_FILES_CHKSUM = "file://LICENSE;md5=fb07bfc51f6d5e0c30b65d9701233b2e" SRC_URI += "file://0001-acinclude.m4-don-t-unset-cache-variables.patch \ + file://0048-Use-pkg-config-for-FreeType2-detection.patch \ + file://0049-ext-intl-Use-pkg-config-to-detect-icu.patch \ + file://0001-Use-pkg-config-for-libxml2-detection.patch \ " SRC_URI_append_class-target = " \ file://pear-makefile.patch \