Makefile 6.3 KB

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