1
0

Makefile 6.9 KB

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