Skip to contentSkip to conversation

package/php: use correct cxxflags for icu support

PATCH New Bernd Kuhls 2 participants 2 messages Jun 5, 2017 – Jun 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/php: use correct cxxflags for icu support

Php lacks "-std=c++11", provided by icu-config, when compiling icu support leading to a build failure:

/home/peko/autobuild/instance-1/output/host/usr/sh4-buildroot-linux-uclibc/sysroot/usr/include/unicode/umachine.h:347:13:
error: 'char16_t' does not name a type

     typedef char16_t UChar;

Fixes
http://autobuild.buildroot.net/results/238/238d0e4bb205c0e7288903c6498e6c1787d86a1b/

---
 package/php/php.mk | 1 +
 1 file changed, 1 insertion(+)
package/php/php.mk +1 -0
index cfc678991..2e4b667f9 100644
@@ -173,6 +173,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_PHP_EXT_INTL),y)
 PHP_CONF_OPTS += --enable-intl --with-icu-dir=$(STAGING_DIR)/usr
+PHP_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) `$(STAGING_DIR)/usr/bin/icu-config --cxxflags`"
 PHP_DEPENDENCIES += icu
 # The intl module is implemented in C++, but PHP fails to use
 # g++ as the compiler for the final link. As a workaround,
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 package/php: use correct cxxflags for icu support

Hello,

Quoted 20 lines · Bernd Kuhls

Php lacks "-std=c++11", provided by icu-config, when compiling icu support leading to a build failure:

/home/peko/autobuild/instance-1/output/host/usr/sh4-buildroot-linux-uclibc/sysroot/usr/include/unicode/umachine.h:347:13:
error: 'char16_t' does not name a type

     typedef char16_t UChar;

Fixes
http://autobuild.buildroot.net/results/238/238d0e4bb205c0e7288903c6498e6c1787d86a1b/

---
 package/php/php.mk | 1 +
 1 file changed, 1 insertion(+)
package/php/php.mk +0 -0
index cfc678991..2e4b667f9 100644

package/php/php.mk endif · line 176

Quoted 4 lines
package/php/php.mk +1 -0
@@ -173,6 +173,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_PHP_EXT_INTL),y)
 PHP_CONF_OPTS += --enable-intl --with-icu-dir=$(STAGING_DIR)/usr
+PHP_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) `$(STAGING_DIR)/usr/bin/icu-config --cxxflags`"

Please use the same logic as the one used for PHP_CFLAGS, i.e:

PHP_CXXFLAGS = $(TARGET_CXXFLAGS)

...

ifeq ($(BR2_PACKAGE_PHP_EXT_INTL),y)
PHP_CXXFLAGS += $(STAGING_DIR)/usr/bin/icu-config --cxxflags" endif

...

PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)"

Also, you forgot to add the dependency on gcc >= 4.8 in the ICU patch, so it should be added here, because it clearly needs a C++11 compatible compiler.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com