This is the PHP5 module for asterisk patch- diffed from packages/ directory.
Signed-off-by: Michael Geddes <michael at frog dot wheelycreek dot net> -- Index: packages/lang/php5/Makefile =================================================================== --- packages/lang/php5/Makefile (revision 11801) +++ packages/lang/php5/Makefile (working copy) @@ -16,6 +16,13 @@ PKG_SOURCE_URL:=http://www.php.net/distributions/ PKG_MD5SUM:=7380ffecebd95c6edb317ef861229ebd +CONFIGURE_VARS += \ + pthreads_working=yes\ + LDFLAGS="$$$$LDFLAGS -lpthread" \ + ac_cv_pthreads_lib=pthread + +# ac_cv_pthreads_cflags=-lpthread + include $(INCLUDE_DIR)/package.mk define Package/php5/Default @@ -75,6 +82,18 @@ This package contains the FastCGI version of the PHP5 interpreter. endef +define Package/php5-apache + $(call Package/php5/Default) + DEPENDS:=php5 +apache-server +libpthread + TITLE+= (Apache) +endef + +define Package/php5-apache/description +$(call Package/php5/Default/description) + This package contains the Apache module version of the PHP5 interpreter. +endef + + define Package/php5-mod-curl $(call Package/php5/Default) DEPENDS:=php5 +libcurl @@ -107,7 +126,7 @@ define Package/php5-mod-mysql $(call Package/php5/Default) - DEPENDS:=php5 +libmysqlclient + DEPENDS:=php5 +libmysqlclient_r TITLE:=MySQL module endef @@ -210,11 +229,12 @@ --disable-filter ifneq ($(SDK),) - PKG_BUILD_DEPENDS:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libexpat + PKG_BUILD_DEPENDS:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient_r libpq libsqlite2 libexpat # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK CONFIG_PACKAGE_php5-cli:=m CONFIG_PACKAGE_php5-cgi:=m CONFIG_PACKAGE_php5-fastcgi:=m + CONFIG_PACKAGE_php5-apache:=m CONFIG_PACKAGE_php5-mod-curl:=m CONFIG_PACKAGE_php5-mod-gd:=m CONFIG_PACKAGE_php5-mod-gmp:=m @@ -295,6 +315,10 @@ else PKG_CONFIGURE_OPTS+= --disable-apc endif +ifneq ($(CONFIG_PACKAGE_php5-apache),) + PKG_BUILD_DEPENDS+= apache-server + PKG_CONFIGURE_LIBS+= -lpthread +endif define Build/Configure endef @@ -314,7 +338,8 @@ php_cv_cc_rpath="no" \ ) $(MAKE) -C $(PKG_BUILD_DIR) - mv $(PKG_BUILD_DIR)/sapi/cli/php $(PKG_BUILD_DIR)/php-cli + mv $(PKG_BUILD_DIR)/sapi/cli/php \ + $(PKG_BUILD_DIR)/php-cli endef endif @@ -333,7 +358,8 @@ php_cv_cc_rpath="no" \ ) $(MAKE) -C $(PKG_BUILD_DIR) - mv $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(PKG_BUILD_DIR)/php-cgi + mv $(PKG_BUILD_DIR)/sapi/cgi/php-cgi \ + $(PKG_BUILD_DIR)/php-cgi endef endif @@ -354,14 +380,41 @@ php_cv_cc_rpath="no" \ ) $(MAKE) -C $(PKG_BUILD_DIR) - mv $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(PKG_BUILD_DIR)/php-fcgi + mv $(PKG_BUILD_DIR)/sapi/cgi/php-cgi \ + $(PKG_BUILD_DIR)/php-fcgi endef endif + +ifneq ($(CONFIG_PACKAGE_php5-apache),) + define Build/Compile/php5-apache + -$(MAKE) -C $(PKG_BUILD_DIR) clean + cd $(PKG_BUILD_DIR) && ${SED} 's/APACHE_VERSION=`.*`/APACHE_VERSION=2000044/' configure \ + && ${SED} 's/pthreads_working=no/pthreads_working=yes/' configure + $(call Build/Configure/Default, \ + $(PKG_CONFIGURE_OPTS) \ + --enable-cli \ + --enable-cgi \ + --disable-fastcgi \ + --disable-force-cgi-redirect \ + --enable-discard-path \ + --with-apxs2=$(STAGING_DIR)/usr/sbin/apxs \ + , \ + LIBS="$(PKG_CONFIGURE_LIBS)" \ + php_cv_cc_rpath="no" \ + ) + $(MAKE) -C $(PKG_BUILD_DIR) + mkdir -p $(PKG_BUILD_DIR)/apache_module/ + $(CP) $(PKG_BUILD_DIR)/libs/libphp5.* \ + $(PKG_BUILD_DIR)/apache_module/ + endef +endif + define Build/Compile $(call Build/Compile/php5-cli) $(call Build/Compile/php5-cgi) $(call Build/Compile/php5-fastcgi) + $(call Build/Compile/php5-apache) endef define Package/php5/conffiles @@ -375,26 +428,37 @@ define Package/php5-cli/install $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_BUILD_DIR)/php-cli $(1)/usr/bin/php-cli + $(CP) $(PKG_BUILD_DIR)/php-cli \ + $(1)/usr/bin/php-cli endef define Package/php5-cgi/install $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_BUILD_DIR)/php-cgi $(1)/usr/bin/php-cgi + $(CP) $(PKG_BUILD_DIR)/php-cgi \ + $(1)/usr/bin/php-cgi endef define Package/php5-fastcgi/install $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_BUILD_DIR)/php-fcgi $(1)/usr/bin/php-fcgi + $(CP) $(PKG_BUILD_DIR)/php-fcgi \ + $(1)/usr/bin/php-fcgi $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php + $(INSTALL_BIN) ./files/php.init \ + $(1)/etc/init.d/php endef +define Package/php5-apache/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/apache_module/* \ + $(1)/usr/lib +endef + define BuildPlugin define Package/$(1)/install [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/php for m in $(2); do \ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so $$(1)/usr/lib/php/ ; \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$$$$$$$${m}.so \ + $$(1)/usr/lib/php/ ; \ done endef @@ -405,6 +469,7 @@ $(eval $(call BuildPackage,php5-cli)) $(eval $(call BuildPackage,php5-cgi)) $(eval $(call BuildPackage,php5-fastcgi)) +$(eval $(call BuildPackage,php5-apache)) $(eval $(call BuildPlugin,php5-mod-curl,curl)) $(eval $(call BuildPlugin,php5-mod-ftp,ftp)) $(eval $(call BuildPlugin,php5-mod-gd,gd)) _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel