Makefile 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.5
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= fb727a3ac72bf0ce37e1a20468a7bb81
  8. PKG_DESCR:= PHP language interpreter
  9. PKG_SECTION:= lang
  10. PKG_DEPENDS:= libopenssl zlib
  11. PKG_BUILDDEP:= openssl zlib
  12. PHP_URL:= http://www.php.net/
  13. PKG_SITES:= http://de.php.net/distributions/
  14. PKG_MULTI:= 1
  15. PKG_SUBPKGS:= PHP PHP_CLI PHP_FASTCGI
  16. PKGSD_PHP_FASTCGI:= PHP for FastCGI usage
  17. PKGSD_PHP_CLI:= PHP CLI
  18. PKG_FLAVOURS_PHP:= MOD_CURL MOD_GD MOD_GMP MOD_LDAP MOD_MYSQL
  19. PKG_FLAVOURS_PHP+= MOD_PGSQL MOD_SQLITE MOD_XML
  20. PKGFD_MOD_CURL:= Curl support
  21. PKGFB_MOD_CURL:= curl
  22. PKGFS_MOD_CURL:= libcurl
  23. PKGFD_MOD_GD:= Gd support
  24. PKGFB_MOD_GD:= libgd libpng
  25. PKGFS_MOD_GD:= libgd libpng
  26. PKGFD_MOD_GMP:= GMP support
  27. PKGFB_MOD_GMP:= gmp
  28. PKGFS_MOD_GMP:= libgmp
  29. PKGFD_MOD_LDAP:= LDAP support
  30. PKGFB_MOD_LDAP:= openldap
  31. PKGFS_MOD_LDAP:= libopenldap
  32. PKGFD_MOD_MYSQL:= MySQL support
  33. PKGFS_MOD_MYSQL:= libmysqlclient
  34. PKGFB_MOD_MYSQL:= mysql
  35. PKGFD_MOD_PGSQL:= PGSQL support
  36. PKGFB_MOD_PGSQL:= postgresql
  37. PKGFS_MOD_PGSQL:= libpq
  38. PKGFD_MOD_SQLITE:= SQlite support
  39. PKGFB_MOD_SQLITE:= sqlite
  40. PKGFS_MOD_SQLITE:= libsqlite
  41. PKGFD_MOD_XML:= XML support
  42. PKGFB_MOD_XML:= expat
  43. PKGFS_MOD_XML:= libexpat
  44. PKG_ARCH_DEPENDS:= !cris
  45. PKG_HOST_DEPENDS:= !cygwin
  46. include $(TOPDIR)/mk/package.mk
  47. $(eval $(call PKG_template,PHP,php,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  48. $(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CLI},${PKG_SECTION}))
  49. $(eval $(call PKG_template,PHP_FASTCGI,php-fastcgi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_FASTCGI},${PKG_SECTION}))
  50. define PKG_mod_template
  51. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  52. ${2}-install:
  53. ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
  54. ${INSTALL_DATA} $(WRKBUILD)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
  55. endef
  56. PKG_CONFIGURE_OPTS:= \
  57. --with-config-file-path=/etc \
  58. --enable-magic-quotes \
  59. --enable-ftp=shared \
  60. --enable-session=shared \
  61. --enable-sockets=shared \
  62. --enable-cli \
  63. --enable-cgi \
  64. --enable-fastcgi \
  65. --enable-force-cgi-redirect \
  66. --enable-discard-path \
  67. --disable-mbstring \
  68. --disable-mbregex \
  69. --disable-phar \
  70. --disable-libxml \
  71. --disable-spl \
  72. --disable-short-tags \
  73. --disable-ctype \
  74. --disable-simplexml \
  75. --disable-soap \
  76. --disable-fileinfo \
  77. --disable-tokenizer \
  78. --disable-filter \
  79. --disable-xmlreader \
  80. --disable-xmlwriter \
  81. --disable-dom \
  82. --without-pear \
  83. --without-gettext \
  84. --without-iconv \
  85. --without-libxml-dir \
  86. --with-kerberos=no \
  87. --with-openssl=shared,"$(STAGING_TARGET_DIR)/usr" \
  88. --with-openssl-dir="$(STAGING_TARGET_DIR)/usr" \
  89. --with-zlib="$(STAGING_TARGET_DIR)/usr" \
  90. --with-zlib-dir="$(STAGING_TARGET_DIR)/usr" \
  91. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  92. PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_TARGET_DIR)/usr"
  93. else
  94. PKG_CONFIGURE_OPTS+= --without-curl
  95. endif
  96. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  97. PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_TARGET_DIR)/usr" \
  98. --with-jpeg-dir="$(STAGING_TARGET_DIR)/usr" \
  99. --with-png-dir="$(STAGING_TARGET_DIR)/usr" \
  100. --without-freetype-dir \
  101. --without-xpm-dir \
  102. --without-ttf \
  103. --without-t1lib \
  104. --enable-gd-native-ttf \
  105. --disable-gd-jis-conv
  106. else
  107. PKG_CONFIGURE_OPTS+= --without-gd
  108. endif
  109. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  110. PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_TARGET_DIR)/usr"
  111. else
  112. PKG_CONFIGURE_OPTS+= --without-gmp
  113. endif
  114. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  115. PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_TARGET_DIR)/usr" \
  116. --with-ldap-sasl="$(STAGING_TARGET_DIR)/usr"
  117. else
  118. PKG_CONFIGURE_OPTS+= --without-ldap
  119. endif
  120. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  121. PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_TARGET_DIR)/usr"
  122. else
  123. PKG_CONFIGURE_OPTS+= --without-mysql
  124. endif
  125. ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
  126. PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_TARGET_DIR)/usr"
  127. else
  128. PKG_CONFIGURE_OPTS+= --without-pgsql
  129. endif
  130. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  131. PKG_CONFIGURE_OPTS+= --without-sqlite
  132. PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_TARGET_DIR)/usr"
  133. PKG_CONFIGURE_OPTS+= --enable-pdo=shared
  134. else
  135. PKG_CONFIGURE_OPTS+= --without-sqlite
  136. endif
  137. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  138. PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_TARGET_DIR)/usr" \
  139. --with-libexpat-dir="$(STAGING_TARGET_DIR)/usr"
  140. else
  141. PKG_CONFIGURE_OPTS+= --disable-xml
  142. endif
  143. $(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  144. $(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  145. $(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  146. $(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  147. $(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  148. $(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  149. $(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  150. $(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  151. $(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  152. $(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  153. $(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  154. $(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  155. $(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
  156. $(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
  157. $(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
  158. $(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
  159. $(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
  160. $(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
  161. $(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
  162. $(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
  163. $(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
  164. $(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
  165. $(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo))
  166. $(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
  167. INSTALL_STYLE:= manual
  168. TARGET_LDFLAGS+= -L$(STAGING_TARGET_DIR)/usr/lib/mysql
  169. CONFIGURE_ENV+= LIBS="-ldl"
  170. CONFIGURE_ARGS+= $(PKG_CONFIGURE_OPTS)
  171. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  172. ${INSTALL_DIR} $(IDIR_PHP)/etc
  173. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP)/etc
  174. ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
  175. ${INSTALL_DIR} $(IDIR_PHP_CLI)/etc
  176. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_CLI)/etc
  177. ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php $(IDIR_PHP_CLI)/usr/bin/php
  178. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc
  179. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_FASTCGI)/etc
  180. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/usr/bin
  181. ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi \
  182. $(IDIR_PHP_FASTCGI)/usr/bin/php
  183. include ${TOPDIR}/mk/pkg-bottom.mk