Makefile 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:= php
  5. PKG_VERSION:= 5.3.2
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 4480d7c6d6b4a86de7b8ec8f0c2d1871
  8. PKG_DESCR:= PHP CLI
  9. PKG_SECTION:= lang
  10. PKG_MULTI:= 1
  11. PKG_DEPENDS:= libopenssl zlib
  12. PKG_BUILDDEP+= openssl zlib
  13. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  14. PKG_BUILDDEP+= curl
  15. endif
  16. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  17. PKG_BUILDDEP+= libgd libpng
  18. endif
  19. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  20. PKG_BUILDDEP+= gmp
  21. endif
  22. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  23. PKG_BUILDDEP+= openldap
  24. endif
  25. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  26. PKG_BUILDDEP+= mysql
  27. endif
  28. ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
  29. PKG_BUILDDEP+= pcre
  30. endif
  31. ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
  32. PKG_BUILDDEP+= postgresql
  33. endif
  34. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  35. PKG_BUILDDEP+= sqlite
  36. endif
  37. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  38. PKG_BUILDDEP+= expat
  39. endif
  40. PHP_URL:= http://www.php.net
  41. PKG_SITES:= http://de.php.net/distributions/
  42. PKG_DESCR_FCGI:= PHP for FastCGI usage
  43. PKG_HOST_DEPENDS:= !cygwin
  44. # FIX PKG_DEPENDS
  45. include $(TOPDIR)/mk/package.mk
  46. $(eval $(call PKG_template,PHP,php,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  47. $(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  48. $(eval $(call PKG_template,PHP_FASTCGI,php-fastcgi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_FCGI},${PKG_SECTION}))
  49. define PKG_mod_template
  50. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  51. ${2}-install:
  52. ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
  53. ${INSTALL_DATA} $(WRKBUILD)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
  54. endef
  55. PKG_CONFIGURE_OPTS:= \
  56. --without-pear \
  57. --disable-spl \
  58. --with-config-file-path=/etc \
  59. --enable-magic-quotes \
  60. --disable-short-tags \
  61. --disable-ctype \
  62. --disable-dom \
  63. --enable-ftp=shared \
  64. --without-gettext \
  65. --without-iconv \
  66. --disable-libxml \
  67. --without-libxml-dir \
  68. --disable-mbstring \
  69. --disable-mbregex \
  70. --disable-phar \
  71. --with-openssl=shared,"$(STAGING_DIR)/usr" \
  72. --with-kerberos=no \
  73. --with-openssl-dir="$(STAGING_DIR)/usr" \
  74. --enable-session=shared \
  75. --disable-simplexml \
  76. --disable-soap \
  77. --disable-fileinfo \
  78. --enable-sockets=shared \
  79. --disable-tokenizer \
  80. --disable-filter \
  81. --disable-xmlreader \
  82. --disable-xmlwriter \
  83. --with-zlib="$(STAGING_DIR)/usr" \
  84. --with-zlib-dir="$(STAGING_DIR)/usr" \
  85. --enable-cli \
  86. --enable-cgi \
  87. --enable-fastcgi \
  88. --enable-force-cgi-redirect \
  89. --enable-discard-path \
  90. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  91. PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_DIR)/usr"
  92. else
  93. PKG_CONFIGURE_OPTS+= --without-curl
  94. endif
  95. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  96. PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
  97. --without-freetype-dir \
  98. --with-jpeg-dir="$(STAGING_DIR)/usr" \
  99. --with-png-dir="$(STAGING_DIR)/usr" \
  100. --without-xpm-dir \
  101. --without-ttf \
  102. --without-t1lib \
  103. --enable-gd-native-ttf \
  104. --disable-gd-jis-conv
  105. else
  106. PKG_CONFIGURE_OPTS+= --without-gd
  107. endif
  108. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  109. PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
  110. else
  111. PKG_CONFIGURE_OPTS+= --without-gmp
  112. endif
  113. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  114. PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr" \
  115. --with-ldap-sasl="$(STAGING_DIR)/usr"
  116. else
  117. PKG_CONFIGURE_OPTS+= --without-ldap
  118. endif
  119. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  120. PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
  121. else
  122. PKG_CONFIGURE_OPTS+= --without-mysql
  123. endif
  124. ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
  125. PKG_CONFIGURE_OPTS+= --with-pcre-dir=shared,"$(STAGING_DIR)/usr"
  126. else
  127. PKG_CONFIGURE_OPTS+= --without-pcre-dir
  128. endif
  129. ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
  130. PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
  131. else
  132. PKG_CONFIGURE_OPTS+= --without-pgsql
  133. endif
  134. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  135. PKG_CONFIGURE_OPTS+= --without-sqlite
  136. PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
  137. PKG_CONFIGURE_OPTS+= --enable-pdo=shared
  138. else
  139. PKG_CONFIGURE_OPTS+= --without-sqlite
  140. endif
  141. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  142. PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_DIR)/usr" \
  143. --with-libexpat-dir="$(STAGING_DIR)/usr"
  144. else
  145. PKG_CONFIGURE_OPTS+= --disable-xml
  146. endif
  147. $(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  148. $(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  149. $(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  150. $(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  151. $(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  152. $(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  153. $(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  154. #$(eval $(call PKG_template,PHP_MOD_PCRE,php-mod-pcre,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  155. $(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  156. $(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  157. $(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  158. $(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  159. $(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  160. $(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
  161. $(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
  162. $(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
  163. $(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
  164. $(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
  165. $(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
  166. $(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
  167. $(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
  168. $(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
  169. $(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
  170. $(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo))
  171. $(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
  172. INSTALL_STYLE:= manual
  173. TLDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
  174. CONFIGURE_ENV+= LIBS="-ldl"
  175. CONFIGURE_ARGS+= $(PKG_CONFIGURE_OPTS)
  176. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  177. ${INSTALL_DIR} $(IDIR_PHP)/etc
  178. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP)/etc/
  179. ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
  180. ${INSTALL_DIR} $(IDIR_PHP_CLI)/etc
  181. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_CLI)/etc/
  182. ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php $(IDIR_PHP_CLI)/usr/bin/php
  183. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc
  184. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_FASTCGI)/etc/
  185. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/usr/sbin
  186. ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi \
  187. $(IDIR_PHP_FASTCGI)/usr/sbin/php
  188. include ${TOPDIR}/mk/pkg-bottom.mk