1
0

Makefile 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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.4
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= b69b36132899c5ca3bf155efa0218676
  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. PKGSB_MOD_CURL:= curl
  19. PKGSB_MOD_GD:= libgd libpng
  20. PKGSB_MOD_GMP:= gmp
  21. PKGSB_MOD_LDAP:= openldap
  22. PKGSB_MOD_MYSQL:= mysql
  23. PKGSB_MOD_PGSQL:= postgresql
  24. PKGSB_MOD_PCRE:= pcre
  25. PKGSB_MOD_SQLITE:= sqlite
  26. PKGSB_MOD_XML:= expat
  27. PKG_HOST_DEPENDS:= !cygwin
  28. # FIX PKG_DEPENDS
  29. include $(TOPDIR)/mk/package.mk
  30. $(eval $(call PKG_template,PHP,php,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  31. $(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CLI},${PKG_SECTION}))
  32. $(eval $(call PKG_template,PHP_FASTCGI,php-fastcgi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_FASTCGI},${PKG_SECTION}))
  33. define PKG_mod_template
  34. INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
  35. ${2}-install:
  36. ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
  37. ${INSTALL_DATA} $(WRKBUILD)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
  38. endef
  39. PKG_CONFIGURE_OPTS:= \
  40. --without-pear \
  41. --disable-spl \
  42. --with-config-file-path=/etc \
  43. --enable-magic-quotes \
  44. --disable-short-tags \
  45. --disable-ctype \
  46. --disable-dom \
  47. --enable-ftp=shared \
  48. --without-gettext \
  49. --without-iconv \
  50. --disable-libxml \
  51. --without-libxml-dir \
  52. --disable-mbstring \
  53. --disable-mbregex \
  54. --disable-phar \
  55. --with-openssl=shared,"$(STAGING_TARGET_DIR)/usr" \
  56. --with-kerberos=no \
  57. --with-openssl-dir="$(STAGING_TARGET_DIR)/usr" \
  58. --enable-session=shared \
  59. --disable-simplexml \
  60. --disable-soap \
  61. --disable-fileinfo \
  62. --enable-sockets=shared \
  63. --disable-tokenizer \
  64. --disable-filter \
  65. --disable-xmlreader \
  66. --disable-xmlwriter \
  67. --with-zlib="$(STAGING_TARGET_DIR)/usr" \
  68. --with-zlib-dir="$(STAGING_TARGET_DIR)/usr" \
  69. --enable-cli \
  70. --enable-cgi \
  71. --enable-fastcgi \
  72. --enable-force-cgi-redirect \
  73. --enable-discard-path \
  74. ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
  75. PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_TARGET_DIR)/usr"
  76. else
  77. PKG_CONFIGURE_OPTS+= --without-curl
  78. endif
  79. ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
  80. PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_TARGET_DIR)/usr" \
  81. --without-freetype-dir \
  82. --with-jpeg-dir="$(STAGING_TARGET_DIR)/usr" \
  83. --with-png-dir="$(STAGING_TARGET_DIR)/usr" \
  84. --without-xpm-dir \
  85. --without-ttf \
  86. --without-t1lib \
  87. --enable-gd-native-ttf \
  88. --disable-gd-jis-conv
  89. else
  90. PKG_CONFIGURE_OPTS+= --without-gd
  91. endif
  92. ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
  93. PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_TARGET_DIR)/usr"
  94. else
  95. PKG_CONFIGURE_OPTS+= --without-gmp
  96. endif
  97. ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
  98. PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_TARGET_DIR)/usr" \
  99. --with-ldap-sasl="$(STAGING_TARGET_DIR)/usr"
  100. else
  101. PKG_CONFIGURE_OPTS+= --without-ldap
  102. endif
  103. ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
  104. PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_TARGET_DIR)/usr"
  105. else
  106. PKG_CONFIGURE_OPTS+= --without-mysql
  107. endif
  108. ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
  109. PKG_CONFIGURE_OPTS+= --with-pcre-dir=shared,"$(STAGING_TARGET_DIR)/usr"
  110. else
  111. PKG_CONFIGURE_OPTS+= --without-pcre-dir
  112. endif
  113. ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
  114. PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_TARGET_DIR)/usr"
  115. else
  116. PKG_CONFIGURE_OPTS+= --without-pgsql
  117. endif
  118. ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
  119. PKG_CONFIGURE_OPTS+= --without-sqlite
  120. PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_TARGET_DIR)/usr"
  121. PKG_CONFIGURE_OPTS+= --enable-pdo=shared
  122. else
  123. PKG_CONFIGURE_OPTS+= --without-sqlite
  124. endif
  125. ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
  126. PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_TARGET_DIR)/usr" \
  127. --with-libexpat-dir="$(STAGING_TARGET_DIR)/usr"
  128. else
  129. PKG_CONFIGURE_OPTS+= --disable-xml
  130. endif
  131. $(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  132. $(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  133. $(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  134. $(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  135. $(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  136. $(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  137. $(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  138. #$(eval $(call PKG_template,PHP_MOD_PCRE,php-mod-pcre,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  139. $(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  140. $(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  141. $(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  142. $(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  143. $(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  144. $(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
  145. $(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
  146. $(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
  147. $(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
  148. $(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
  149. $(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
  150. $(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
  151. $(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
  152. $(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
  153. $(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
  154. $(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo))
  155. $(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
  156. INSTALL_STYLE:= manual
  157. TLDFLAGS+= -L$(STAGING_TARGET_DIR)/usr/lib/mysql
  158. CONFIGURE_ENV+= LIBS="-ldl"
  159. CONFIGURE_ARGS+= $(PKG_CONFIGURE_OPTS)
  160. do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
  161. ${INSTALL_DIR} $(IDIR_PHP)/etc
  162. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP)/etc/
  163. ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
  164. ${INSTALL_DIR} $(IDIR_PHP_CLI)/etc
  165. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_CLI)/etc/
  166. ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php $(IDIR_PHP_CLI)/usr/bin/php
  167. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc
  168. ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_FASTCGI)/etc/
  169. ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/usr/sbin
  170. ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi \
  171. $(IDIR_PHP_FASTCGI)/usr/sbin/php
  172. include ${TOPDIR}/mk/pkg-bottom.mk