Makefile 7.3 KB

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