php: fixup paths in php-config for cross compilation
authorPeter Korsgaard <jacmet@sunsite.dk>
Tue, 1 May 2012 08:51:57 +0000 (10:51 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 1 May 2012 08:51:57 +0000 (10:51 +0200)
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/php/php.mk

index 7f848b178c2486d24f5b16d3e2764dacd2abd7ca..6de6a9e83d721ed99e3e002071ab66e382d41d2f 100644 (file)
@@ -171,6 +171,15 @@ ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),y)
 endif
 endif
 
+# Fixup prefix= and exec_prefix= in php-config
+define PHP_FIXUP_PHP_CONFIG
+       $(SED) 's%^prefix="/usr"%prefix="$(STAGING_DIR)/usr"%' \
+               -e 's%^exec_prefix="/usr"%exec_prefix="$(STAGING_DIR)/usr"%' \
+               $(STAGING_DIR)/usr/bin/php-config
+endef
+
+PHP_POST_INSTALL_STAGING_HOOKS += PHP_FIXUP_PHP_CONFIG
+
 define PHP_INSTALL_FIXUP
        rm -rf $(TARGET_DIR)/usr/lib/php
        rm -f $(TARGET_DIR)/usr/bin/phpize