1
0

Makefile 10 KB

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