Makefile 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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.4.21
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= cc8da0d18683e3a83b332f264af7ca83
  8. PKG_DESCR:= PHP language interpreter
  9. PKG_SECTION:= lang
  10. PKG_DEPENDS:= libpthread librt libgcc
  11. PHP_URL:= http://www.php.net/
  12. PKG_SITES:= http://de.php.net/distributions/
  13. PKG_MULTI:= 1
  14. PKG_SUBPKGS:= PHP PHP_CLI PHP_FASTCGI
  15. PKGSD_PHP_FASTCGI:= PHP for FastCGI usage
  16. PKGSD_PHP_CLI:= PHP CLI
  17. PKG_FLAVOURS_PHP:= MOD_BZ2 MOD_CURL MOD_FTP MOD_GD MOD_GMP MOD_MYSQL
  18. PKG_FLAVOURS_PHP+= MOD_OPENSSL MOD_PGSQL MOD_SESSION MOD_SNMP MOD_SQLITE
  19. PKG_FLAVOURS_PHP+= MOD_SOCKETS MOD_XML MOD_SIMPLEXML MOD_ZLIB MOD_JSON
  20. PKG_FLAVOURS_PHP+= MOD_LDAP
  21. PKGFD_MOD_BZ2:= Bzip2 support
  22. PKGFB_MOD_BZ2:= bzip2
  23. PKGFS_MOD_BZ2:= bzip2
  24. PKGFD_MOD_CURL:= Curl support
  25. PKGFB_MOD_CURL:= curl
  26. PKGFS_MOD_CURL:= libcurl
  27. PKGFD_MOD_FTP:= FTP support
  28. PKGFD_MOD_GD:= Gd support
  29. PKGFB_MOD_GD:= libgd libpng jpeg
  30. PKGFS_MOD_GD:= libgd libpng libjpeg
  31. PKGFD_MOD_GMP:= GMP support
  32. PKGFB_MOD_GMP:= gmp
  33. PKGFS_MOD_GMP:= libgmp
  34. PKGFD_MOD_JSON:= JSON support
  35. PKGFD_MOD_LDAP:= LDAP support
  36. PKGFB_MOD_LDAP:= openldap
  37. PKGFS_MOD_LDAP:= libopenldap
  38. PKGFD_MOD_MYSQL:= MySQL support
  39. PKGFS_MOD_MYSQL:= libmysqlclient
  40. PKGFB_MOD_MYSQL:= mysql
  41. PKGFD_MOD_OPENSSL:= OpenSSL support
  42. PKGFB_MOD_OPENSSL:= openssl
  43. PKGFS_MOD_OPENSSL:= libopenssl
  44. PKGFD_MOD_PGSQL:= PGSQL support
  45. PKGFB_MOD_PGSQL:= postgresql
  46. PKGFS_MOD_PGSQL:= libpq
  47. PKGFD_MOD_SESSION:= Session support
  48. PKGFD_MOD_SNMP:= SNMP support
  49. PKGFB_MOD_SNMP:= net-snmp
  50. PKGFS_MOD_SNMP:= libnetsnmp
  51. PKGFD_MOD_SQLITE:= SQlite support
  52. PKGFB_MOD_SQLITE:= sqlite
  53. PKGFS_MOD_SQLITE:= libsqlite
  54. PKGFD_MOD_SOCKETS:= Socket support
  55. PKGFD_MOD_XML:= XML support
  56. PKGFB_MOD_XML:= expat
  57. PKGFS_MOD_XML:= libexpat
  58. PKGFD_MOD_SIMPLEXML:= simple XML support
  59. PKGFB_MOD_SIMPLEXML:= libxml2
  60. PKGFS_MOD_SIMPLEXML:= libxml2
  61. PKGFD_MOD_ZLIB:= ZLIB support
  62. PKGFB_MOD_ZLIB:= zlib
  63. PKGFS_MOD_ZLIB:= zlib
  64. PKG_ARCH_DEPENDS:= !cris !avr32
  65. PKG_HOST_DEPENDS:= !cygwin
  66. include $(TOPDIR)/mk/package.mk
  67. $(eval $(call PKG_template,PHP,php,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  68. $(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CLI},${PKG_SECTION}))
  69. $(eval $(call PKG_template,PHP_FASTCGI,php-fastcgi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_FASTCGI},${PKG_SECTION}))
  70. define PKG_mod_template
  71. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  72. ${2}-install:
  73. ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
  74. for m in ${2}; do \
  75. ${INSTALL_DATA} $(WRKBUILD)/modules/$$$${m}.so $$(IDIR_$(1))/usr/lib/php ;\
  76. done
  77. endef
  78. PKG_CONFIGURE_OPTS:= \
  79. --with-config-file-path=/etc \
  80. --enable-cli \
  81. --enable-cgi \
  82. --disable-hash \
  83. --disable-mbstring \
  84. --disable-mbregex \
  85. --disable-phar \
  86. --disable-short-tags \
  87. --disable-ctype \
  88. --disable-soap \
  89. --disable-fileinfo \
  90. --disable-tokenizer \
  91. --disable-filter \
  92. --disable-xmlreader \
  93. --disable-xmlwriter \
  94. --disable-dom \
  95. --without-pear \
  96. --without-gettext \
  97. --without-iconv \
  98. --with-pcre-regex=no \
  99. --with-kerberos=no
  100. ifneq ($(ADK_PACKAGE_PHP_MOD_BZ2),)
  101. PKG_CONFIGURE_OPTS+= --with-bz2=shared,"$(STAGING_TARGET_DIR)/usr"
  102. else
  103. PKG_CONFIGURE_OPTS+= --without-bz2
  104. endif
  105. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  106. PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_TARGET_DIR)/usr"
  107. else
  108. PKG_CONFIGURE_OPTS+= --without-curl
  109. endif
  110. ifneq ($(ADK_PACKAGE_PHP_MOD_FTP),)
  111. PKG_CONFIGURE_OPTS+= --enable-ftp=shared
  112. else
  113. PKG_CONFIGURE_OPTS+= --disable-ftp
  114. endif
  115. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  116. PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_TARGET_DIR)/usr" \
  117. --with-png-dir="$(STAGING_TARGET_DIR)/usr" \
  118. --with-jpeg-dir="$(STAGING_TARGET_DIR)/usr" \
  119. --without-freetype-dir \
  120. --without-xpm-dir \
  121. --without-ttf \
  122. --without-t1lib \
  123. --enable-gd-native-ttf \
  124. --disable-gd-jis-conv
  125. else
  126. PKG_CONFIGURE_OPTS+= --without-gd
  127. endif
  128. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  129. PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_TARGET_DIR)/usr"
  130. else
  131. PKG_CONFIGURE_OPTS+= --without-gmp
  132. endif
  133. ifneq ($(ADK_PACKAGE_PHP_MOD_JSON),)
  134. PKG_CONFIGURE_OPTS+= --enable-json=shared,"$(STAGING_TARGET_DIR)/usr"
  135. else
  136. PKG_CONFIGURE_OPTS+= --disable-json
  137. endif
  138. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  139. PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_TARGET_DIR)/usr" \
  140. --with-ldap-sasl="$(STAGING_TARGET_DIR)/usr"
  141. else
  142. PKG_CONFIGURE_OPTS+= --without-ldap
  143. endif
  144. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  145. PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_TARGET_DIR)/usr"
  146. else
  147. PKG_CONFIGURE_OPTS+= --without-mysql
  148. endif
  149. ifneq ($(ADK_PACKAGE_PHP_MOD_OPENSSL),)
  150. PKG_CONFIGURE_OPTS+= --with-openssl=shared,"$(STAGING_TARGET_DIR)/usr" \
  151. --with-openssl-dir="$(STAGING_TARGET_DIR)/usr"
  152. else
  153. PKG_CONFIGURE_OPTS+= --without-openssl
  154. endif
  155. ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
  156. PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_TARGET_DIR)/usr"
  157. else
  158. PKG_CONFIGURE_OPTS+= --without-pgsql
  159. endif
  160. ifneq ($(ADK_PACKAGE_PHP_MOD_SESSION),)
  161. PKG_CONFIGURE_OPTS+= --enable-session=shared
  162. else
  163. PKG_CONFIGURE_OPTS+= --without-session
  164. endif
  165. ifneq ($(ADK_PACKAGE_PHP_MOD_SNMP),)
  166. PKG_CONFIGURE_OPTS+= --with-snmp=shared,"$(STAGING_TARGET_DIR)/usr"
  167. CONFIGURE_ENV+= LIBS="-lnetsnmpmibs"
  168. else
  169. PKG_CONFIGURE_OPTS+= --without-snmp
  170. endif
  171. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  172. PKG_CONFIGURE_OPTS+= --with-sqlite3="$(STAGING_TARGET_DIR)/usr"
  173. PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_TARGET_DIR)/usr"
  174. PKG_CONFIGURE_OPTS+= --enable-pdo=shared
  175. else
  176. PKG_CONFIGURE_OPTS+= --without-sqlite3 --without-pdo-sqlite
  177. endif
  178. ifneq ($(ADK_PACKAGE_PHP_MOD_SOCKETS),)
  179. PKG_CONFIGURE_OPTS+= --enable-sockets=shared
  180. else
  181. PKG_CONFIGURE_OPTS+= --without-sockets
  182. endif
  183. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  184. PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_TARGET_DIR)/usr" \
  185. --with-libexpat-dir="$(STAGING_TARGET_DIR)/usr"
  186. else
  187. PKG_CONFIGURE_OPTS+= --disable-xml
  188. endif
  189. ifneq ($(ADK_PACKAGE_PHP_MOD_SIMPLEXML),)
  190. PKG_CONFIGURE_OPTS+= --enable-simplexml=shared --enable-libxml --with-libxml-dir="$(STAGING_TARGET_DIR)/usr"
  191. else
  192. PKG_CONFIGURE_OPTS+= --disable-simplexml --disable-libxml
  193. endif
  194. ifneq ($(ADK_PACKAGE_PHP_MOD_ZLIB),)
  195. PKG_CONFIGURE_OPTS+= --with-zlib=shared,"$(STAGING_TARGET_DIR)/usr"
  196. else
  197. PKG_CONFIGURE_OPTS+= --without-zlib
  198. endif
  199. $(eval $(call PKG_template,PHP_MOD_BZ2,php-mod-bz2,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  200. $(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  201. $(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  202. $(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  203. $(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  204. $(eval $(call PKG_template,PHP_MOD_JSON,php-mod-json,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  205. $(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  206. $(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  207. $(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  208. $(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  209. $(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  210. $(eval $(call PKG_template,PHP_MOD_SNMP,php-mod-snmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  211. $(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  212. $(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  213. $(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  214. $(eval $(call PKG_template,PHP_MOD_SIMPLEXML,php-mod-simplexml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  215. $(eval $(call PKG_template,PHP_MOD_ZLIB,php-mod-zlib,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  216. $(eval $(call PKG_mod_template,PHP_MOD_BZ2,bz2))
  217. $(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
  218. $(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
  219. $(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
  220. $(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
  221. $(eval $(call PKG_mod_template,PHP_MOD_JSON,json))
  222. $(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
  223. $(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
  224. $(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
  225. $(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
  226. $(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
  227. $(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
  228. $(eval $(call PKG_mod_template,PHP_MOD_SNMP,snmp))
  229. $(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo pdo_sqlite))
  230. $(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
  231. $(eval $(call PKG_mod_template,PHP_MOD_SIMPLEXML,simplexml))
  232. $(eval $(call PKG_mod_template,PHP_MOD_ZLIB,zlib))
  233. INSTALL_STYLE:= manual
  234. TARGET_LDFLAGS+= -L$(STAGING_TARGET_DIR)/usr/lib/mysql
  235. CONFIGURE_ENV+= LIBS="-ldl"
  236. CONFIGURE_ARGS+= $(PKG_CONFIGURE_OPTS)
  237. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  238. ${INSTALL_DIR} $(IDIR_PHP)/etc
  239. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP)/etc
  240. ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
  241. ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php $(IDIR_PHP_CLI)/usr/bin/php
  242. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/usr/bin
  243. ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi \
  244. $(IDIR_PHP_FASTCGI)/usr/bin/php
  245. include ${TOPDIR}/mk/pkg-bottom.mk