2 # Copyright (C) 2006,2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=http
://fr.php.net
/distributions
/
17 PKG_MD5SUM
:=fbc67d240812136a9842bc1f2a217b7a
19 include $(INCLUDE_DIR
)/package.mk
21 define Package
/php4
/Default
25 TITLE
:=PHP4 Hypertext preprocessor
26 URL
:=http
://www.php.net
/
29 define Package
/php4
/Default
/description
30 PHP is a widely-used general-purpose scripting language that is especially
31 suited for Web development and can be embedded into HTML.
35 $(call Package
/php4
/Default
)
36 DEPENDS
:=+libopenssl
+zlib
39 define Package
/php4
/description
40 $(call Package
/php4
/Default
/description
)
41 This package contains only the PHP config file. You must actually choose
42 your PHP flavour
(cli
, cgi or fastcgi
).
45 define Package
/php4-cli
46 $(call Package
/php4
/Default
)
51 define Package
/php4-cli
/description
52 $(call Package
/php4
/Default
/description
)
53 This package contains the CLI version of the PHP4 interpreter.
56 define Package
/php4-cgi
57 $(call Package
/php4
/Default
)
62 define Package
/php4-cgi
/description
63 $(call Package
/php4
/Default
/description
)
64 This package contains the CGI version of the PHP4 interpreter.
67 define Package
/php4-fastcgi
68 $(call Package
/php4
/Default
)
73 define Package
/php4-fastcgi
/description
74 $(call Package
/php4
/Default
/description
)
75 This package contains the FastCGI version of the PHP4 interpreter.
78 define Package
/php4-mod-curl
79 $(call Package
/php4
/Default
)
80 DEPENDS
:=php4
+libcurl
84 define Package
/php4-mod-ftp
85 $(call Package
/php4
/Default
)
90 define Package
/php4-mod-gd
91 $(call Package
/php4
/Default
)
93 TITLE
:=GD graphics module
96 define Package
/php4-mod-gmp
97 $(call Package
/php4
/Default
)
102 define Package
/php4-mod-ldap
103 $(call Package
/php4
/Default
)
104 DEPENDS
:=php4
+libopenldap
108 define Package
/php4-mod-mysql
109 $(call Package
/php4
/Default
)
110 DEPENDS
:=php4
+libmysqlclient
114 define Package
/php4-mod-openssl
115 $(call Package
/php4
/Default
)
116 DEPENDS
:=php4
+libopenssl
117 TITLE
:=OpenSSL module
120 define Package
/php4-mod-pcre
121 $(call Package
/php4
/Default
)
122 DEPENDS
:=php4
+libpcre
126 define Package
/php4-mod-pgsql
127 $(call Package
/php4
/Default
)
129 TITLE
:=PostgreSQL module
132 define Package
/php4-mod-session
133 $(call Package
/php4
/Default
)
135 TITLE
:=Session module
138 define Package
/php4-mod-sockets
139 $(call Package
/php4
/Default
)
141 TITLE
:=Sockets module
144 define Package
/php4-mod-sqlite
145 $(call Package
/php4
/Default
)
146 DEPENDS
:=php4
+libsqlite2
150 define Package
/php4-mod-xml
151 $(call Package
/php4
/Default
)
152 DEPENDS
:=php4
+libexpat
156 PKG_CONFIGURE_LIBS
:= -lcrypto
-lssl
157 PKG_CONFIGURE_OPTS
:= \
164 --with-config-file-path
=/etc \
166 --enable-magic-quotes \
167 --enable-memory-limit \
169 --disable-short-tags \
173 --enable-ftp
=shared \
178 --with-openssl
=shared
,"$(STAGING_DIR)/usr" \
180 --with-openssl-dir
="$(STAGING_DIR)/usr" \
181 --enable-session
=shared \
182 --enable-sockets
=shared \
183 --disable-tokenizer \
184 --with-zlib
="$(STAGING_DIR)/usr" \
185 --with-zlib-dir
="$(STAGING_DIR)/usr" \
188 PKG_BUILD_DEPENDS
:=libopenssl zlib libcurl libgd libgmp libopenldap libmysqlclient libpq libsqlite2 libexpat
189 # force PKG_CONFIGURE_{LIBS,OPTS} below when built in the SDK
190 CONFIG_PACKAGE_php4-cli
:=m
191 CONFIG_PACKAGE_php4-cgi
:=m
192 CONFIG_PACKAGE_php4-fastcgi
:=m
193 CONFIG_PACKAGE_php4-mod-curl
:=m
194 CONFIG_PACKAGE_php4-mod-gd
:=m
195 CONFIG_PACKAGE_php4-mod-gmp
:=m
196 CONFIG_PACKAGE_php4-mod-ldap
:=m
197 CONFIG_PACKAGE_php4-mod-mysql
:=m
198 CONFIG_PACKAGE_php4-mod-pcre
:=m
199 CONFIG_PACKAGE_php4-mod-pgsql
:=m
200 CONFIG_PACKAGE_php4-mod-sqlite
:=m
201 CONFIG_PACKAGE_php4-mod-xml
:=m
204 ifneq ($(CONFIG_PACKAGE_php4-mod-curl
),)
205 PKG_CONFIGURE_OPTS
+= --with-curl
=shared
,"$(STAGING_DIR)/usr"
207 PKG_CONFIGURE_OPTS
+= --without-curl
209 ifneq ($(CONFIG_PACKAGE_php4-mod-gd
),)
210 PKG_CONFIGURE_OPTS
+= --with-gd
=shared
,"$(STAGING_DIR)/usr" \
211 --without-freetype-dir \
212 --with-jpeg-dir
="$(STAGING_DIR)/usr" \
213 --with-png-dir
="$(STAGING_DIR)/usr" \
217 --enable-gd-native-ttf \
218 --disable-gd-jis-conv
220 PKG_CONFIGURE_OPTS
+= --without-gd
222 ifneq ($(CONFIG_PACKAGE_php4-mod-gmp
),)
223 PKG_CONFIGURE_OPTS
+= --with-gmp
=shared
,"$(STAGING_DIR)/usr"
225 PKG_CONFIGURE_OPTS
+= --without-gmp
227 ifneq ($(CONFIG_PACKAGE_php4-mod-ldap
),)
228 PKG_CONFIGURE_OPTS
+= --with-ldap
=shared
,"$(STAGING_DIR)/usr"
229 --with-ldap-sasl
="$(STAGING_DIR)/usr"
231 PKG_CONFIGURE_OPTS
+= --without-ldap
233 ifneq ($(CONFIG_PACKAGE_php4-mod-mysql
),)
234 PKG_CONFIGURE_OPTS
+= --with-mysql
=shared
,"$(STAGING_DIR)/usr"
236 PKG_CONFIGURE_OPTS
+= --without-mysql
238 ifneq ($(CONFIG_PACKAGE_php4-mod-pcre
),)
239 PKG_CONFIGURE_OPTS
+= --with-pcre-regex
=shared
,"$(STAGING_DIR)/usr"
241 PKG_CONFIGURE_OPTS
+= --without-pcre-regex
243 ifneq ($(CONFIG_PACKAGE_php4-mod-pgsql
),)
244 PKG_CONFIGURE_OPTS
+= --with-pgsql
=shared
,"$(STAGING_DIR)/usr"
246 PKG_CONFIGURE_OPTS
+= --without-pgsql
248 ifneq ($(CONFIG_PACKAGE_php4-mod-sqlite
),)
249 PKG_CONFIGURE_OPTS
+= --with-sqlite
=shared
,"$(STAGING_DIR)/usr"
251 PKG_CONFIGURE_OPTS
+= --without-sqlite
253 ifneq ($(CONFIG_PACKAGE_php4-mod-xml
),)
254 PKG_CONFIGURE_OPTS
+= --enable-xml
=shared \
255 --with-expat-dir
="$(STAGING_DIR)/usr"
257 PKG_CONFIGURE_OPTS
+= --disable-xml
260 define Build
/Configure
263 ifneq ($(CONFIG_PACKAGE_php4-cli
),)
264 define Build
/Compile
/php4-cli
265 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
266 $(call Build
/Configure
/Default
, \
267 $(PKG_CONFIGURE_OPTS
) \
271 --enable-force-cgi-redirect \
272 --enable-discard-path \
274 LIBS
="$(PKG_CONFIGURE_LIBS)" \
275 php_cv_cc_rpath
="no" \
277 $(MAKE
) -C
$(PKG_BUILD_DIR
)
278 mv
$(PKG_BUILD_DIR
)/sapi
/cli
/php
$(PKG_BUILD_DIR
)/php-cli
282 ifneq ($(CONFIG_PACKAGE_php4-cgi
),)
283 define Build
/Compile
/php4-cgi
284 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
285 $(call Build
/Configure
/Default
, \
286 $(PKG_CONFIGURE_OPTS
) \
290 --enable-force-cgi-redirect \
291 --enable-discard-path \
293 LIBS
="$(PKG_CONFIGURE_LIBS)" \
294 php_cv_cc_rpath
="no" \
296 $(MAKE
) -C
$(PKG_BUILD_DIR
)
297 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php
$(PKG_BUILD_DIR
)/php-cgi
301 ifneq ($(CONFIG_PACKAGE_php4-fastcgi
),)
302 define Build
/Compile
/php4-fastcgi
303 -$(MAKE
) -C
$(PKG_BUILD_DIR
) clean
304 $(call Build
/Configure
/Default
, \
305 $(PKG_CONFIGURE_OPTS
) \
309 --enable-force-cgi-redirect \
310 --enable-discard-path \
312 LIBS
="$(PKG_CONFIGURE_LIBS)" \
313 php_cv_cc_rpath
="no" \
315 $(MAKE
) -C
$(PKG_BUILD_DIR
)
316 mv
$(PKG_BUILD_DIR
)/sapi
/cgi
/php
$(PKG_BUILD_DIR
)/php-fastcgi
321 $(call Build
/Compile
/php4-cli
)
322 $(call Build
/Compile
/php4-cgi
)
323 $(call Build
/Compile
/php4-fastcgi
)
326 define Package
/php4
/conffiles
330 define Package
/php4
/install
331 $(INSTALL_DIR
) $(1)/etc
332 $(INSTALL_DATA
) .
/files
/php.ini
$(1)/etc
/
335 define Package
/php4-cli
/install
336 $(INSTALL_DIR
) $(1)/usr
/bin
337 $(CP
) $(PKG_BUILD_DIR
)/php-cli
$(1)/usr
/bin
/php
340 define Package
/php4-cgi
/install
341 $(INSTALL_DIR
) $(1)/usr
/bin
342 $(CP
) $(PKG_BUILD_DIR
)/php-cgi
$(1)/usr
/bin
/php
345 define Package
/php4-fastcgi
/install
346 $(INSTALL_DIR
) $(1)/usr
/sbin
347 $(CP
) $(PKG_BUILD_DIR
)/php-fastcgi
$(1)/usr
/sbin
/php
348 $(INSTALL_DIR
) $(1)/etc
/init.d
349 $(INSTALL_BIN
) .
/files
/php.init
$(1)/etc
/init.d
/php
353 define Package
/$(1)/install
354 [ -z
"$(2)" ] ||
$(INSTALL_DIR
) $$(1)/usr
/lib
/php
356 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/modules
/$$$$$$$${m}.so
$$(1)/usr
/lib
/php
/ ; \
360 $$(eval
$$(call BuildPackage
,$(1)))
363 $(eval
$(call BuildPackage
,php4
))
364 $(eval
$(call BuildPackage
,php4-cli
))
365 $(eval
$(call BuildPackage
,php4-cgi
))
366 $(eval
$(call BuildPackage
,php4-fastcgi
))
367 $(eval
$(call BuildPlugin
,php4-mod-curl
,curl
))
368 $(eval
$(call BuildPlugin
,php4-mod-ftp
,ftp
))
369 $(eval
$(call BuildPlugin
,php4-mod-gd
,gd
))
370 $(eval
$(call BuildPlugin
,php4-mod-gmp
,gmp
))
371 $(eval
$(call BuildPlugin
,php4-mod-ldap
,ldap
))
372 $(eval
$(call BuildPlugin
,php4-mod-mysql
,mysql
))
373 $(eval
$(call BuildPlugin
,php4-mod-openssl
,openssl
))
374 $(eval
$(call BuildPlugin
,php4-mod-pcre
,pcre
))
375 $(eval
$(call BuildPlugin
,php4-mod-pgsql
,pgsql
))
376 $(eval
$(call BuildPlugin
,php4-mod-session
,session
))
377 $(eval
$(call BuildPlugin
,php4-mod-sockets
,sockets
))
378 $(eval
$(call BuildPlugin
,php4-mod-sqlite
,sqlite
))
379 $(eval
$(call BuildPlugin
,php4-mod-xml
,xml
))