diff options
author | Gustavo Zacarias <gustavo@zacarias.com.ar> | 2014-01-28 18:26:27 -0300 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2014-02-12 15:56:31 +0100 |
commit | 3f8b51338432686307f34a1ea44e6ff9a37e6399 (patch) | |
tree | a3e58f977f9edfe7424b32511f2761f7ee15f1c4 /package/php/php.mk | |
parent | 24bb549098b3a0bb578a9c3724fcc75aa4764d26 (diff) | |
download | buildroot-3f8b51338432686307f34a1ea44e6ff9a37e6399.tar.gz buildroot-3f8b51338432686307f34a1ea44e6ff9a37e6399.zip |
php: fix for external extensions
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 <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/php/php.mk')
-rw-r--r-- | package/php/php.mk | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/package/php/php.mk b/package/php/php.mk index de02f4bb91..2f6280fc72 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 |