add simulator target for h8/300, reorg no-MMU
[openadk.git] / package / php / Makefile
blob061127fab0e59504870087bcbdc2f724c6f0c4c3
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/rules.mk
6 PKG_NAME:= php
7 PKG_VERSION:= 5.6.8
8 PKG_RELEASE:= 1
9 PKG_HASH:= 4c417387b88e100ca306adeda8051eb9fad93dae8da983f962dabf91a14b2b7b
10 PKG_DESCR:= php language interpreter
11 PKG_SECTION:= dev/lang
12 PKG_DEPENDS:= libpthread librt
13 PHP_URL:= http://www.php.net/
14 PKG_SITES:= http://de.php.net/distributions/
16 PKG_SUBPKGS:= PHP PHP_CLI PHP_CGI PHP_FPM
17 PKGSD_PHP_CGI:= php for fastcgi usage
18 PKGSN_PHP_CGI:= php
19 PKGSD_PHP_FPM:= php for fastcgi process manager usage
20 PKGSN_PHP_FPM:= php
21 PKGSD_PHP_CLI:= php cli
22 PKGSN_PHP_CLI:= php
24 PKG_FLAVOURS_PHP:= MOD_BZ2 MOD_CURL MOD_FTP MOD_GD MOD_GMP MOD_MYSQL
25 PKG_FLAVOURS_PHP+= MOD_OPENSSL MOD_PGSQL MOD_SESSION MOD_SNMP MOD_SQLITE
26 PKG_FLAVOURS_PHP+= MOD_SOCKETS MOD_XML MOD_SIMPLEXML MOD_ZLIB MOD_JSON
27 PKG_FLAVOURS_PHP+= MOD_LDAP MOD_PCNTL
29 PKGFD_MOD_BZ2:= bzip2 support
30 PKGFB_MOD_BZ2:= bzip2
31 PKGFS_MOD_BZ2:= bzip2
32 PKGFD_MOD_CURL:= curl support
33 PKGFB_MOD_CURL:= curl
34 PKGFS_MOD_CURL:= libcurl
35 PKGFD_MOD_FTP:= ftp support
36 PKGFD_MOD_GD:= gd support
37 PKGFB_MOD_GD:= libgd libpng libjpeg-turbo libXpm
38 PKGFS_MOD_GD:= libgd libpng libjpeg-turbo libxpm
39 PKGFD_MOD_GMP:= gmp support
40 PKGFB_MOD_GMP:= gmp
41 PKGFS_MOD_GMP:= libgmp
42 PKGFD_MOD_JSON:= json support
43 PKGFD_MOD_LDAP:= ldap support
44 PKGFB_MOD_LDAP:= openldap
45 PKGFS_MOD_LDAP:= libopenldap
46 PKGFD_MOD_MYSQL:= mysql support
47 PKGFS_MOD_MYSQL:= libmysqlclient
48 PKGFB_MOD_MYSQL:= mysql
49 PKGFD_MOD_OPENSSL:= openssl support
50 PKGFB_MOD_OPENSSL:= openssl
51 PKGFS_MOD_OPENSSL:= libopenssl
52 PKGFD_MOD_PCNTL:= process control support
53 PKGFD_MOD_PGSQL:= pgsql support
54 PKGFB_MOD_PGSQL:= postgresql
55 PKGFS_MOD_PGSQL:= libpq
56 PKGFD_MOD_SESSION:= session support
57 PKGFD_MOD_SNMP:= snmp support
58 PKGFB_MOD_SNMP:= net-snmp
59 PKGFS_MOD_SNMP:= libnetsnmp
60 PKGFD_MOD_SQLITE:= sqlite support
61 PKGFB_MOD_SQLITE:= sqlite
62 PKGFS_MOD_SQLITE:= libsqlite
63 PKGFD_MOD_SOCKETS:= socket support
64 PKGFD_MOD_XML:= xml support
65 PKGFB_MOD_XML:= expat
66 PKGFS_MOD_XML:= libexpat
67 PKGFD_MOD_SIMPLEXML:= simple xml support
68 PKGFB_MOD_SIMPLEXML:= libxml2
69 PKGFS_MOD_SIMPLEXML:= libxml2
70 PKGFD_MOD_ZLIB:= zlib support
71 PKGFB_MOD_ZLIB:= zlib
72 PKGFS_MOD_ZLIB:= zlib
74 include $(ADK_TOPDIR)/mk/package.mk
76 $(eval $(call PKG_template,PHP,php,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
77 $(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CLI},${PKG_SECTION}))
78 $(eval $(call PKG_template,PHP_CGI,php-cgi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_CGI},${PKG_SECTION}))
79 $(eval $(call PKG_template,PHP_FPM,php-fpm,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_PHP_FPM},${PKG_SECTION}))
81 define PKG_mod_template
83 INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
85 ${2}-install:
86 ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
87 for m in ${2}; do \
88 ${INSTALL_DATA} $(WRKBUILD)/modules/$$$${m}.so $$(IDIR_$(1))/usr/lib/php ;\
89 done
90 endef
92 PKG_CONFIGURE_OPTS:= \
93 --with-config-file-path=/etc \
94 --enable-cli \
95 --enable-cgi \
96 --enable-fpm \
97 --enable-opcache=no \
98 --disable-hash \
99 --disable-mbstring \
100 --disable-mbregex \
101 --disable-phar \
102 --disable-short-tags \
103 --disable-ctype \
104 --disable-soap \
105 --disable-fileinfo \
106 --disable-tokenizer \
107 --disable-filter \
108 --disable-xmlreader \
109 --disable-xmlwriter \
110 --disable-dom \
111 --without-pear \
112 --without-gettext \
113 --without-iconv \
114 --with-pcre-regex=no \
115 --with-kerberos=no
117 ifneq ($(ADK_PACKAGE_PHP_MOD_BZ2),)
118 PKG_CONFIGURE_OPTS+= --with-bz2=shared,"$(STAGING_TARGET_DIR)/usr"
119 else
120 PKG_CONFIGURE_OPTS+= --without-bz2
121 endif
122 ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
123 PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_TARGET_DIR)/usr"
124 else
125 PKG_CONFIGURE_OPTS+= --without-curl
126 endif
127 ifneq ($(ADK_PACKAGE_PHP_MOD_FTP),)
128 PKG_CONFIGURE_OPTS+= --enable-ftp=shared
129 else
130 PKG_CONFIGURE_OPTS+= --disable-ftp
131 endif
132 ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
133 PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_TARGET_DIR)/usr" \
134 --with-png-dir="$(STAGING_TARGET_DIR)/usr" \
135 --with-jpeg-dir="$(STAGING_TARGET_DIR)/usr" \
136 --without-freetype-dir \
137 --without-t1lib \
138 --enable-gd-native-ttf \
139 --disable-gd-jis-conv
140 else
141 PKG_CONFIGURE_OPTS+= --without-gd
142 endif
143 ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
144 PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_TARGET_DIR)/usr"
145 else
146 PKG_CONFIGURE_OPTS+= --without-gmp
147 endif
148 ifneq ($(ADK_PACKAGE_PHP_MOD_JSON),)
149 PKG_CONFIGURE_OPTS+= --enable-json=shared,"$(STAGING_TARGET_DIR)/usr"
150 else
151 PKG_CONFIGURE_OPTS+= --disable-json
152 endif
153 ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
154 PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_TARGET_DIR)/usr" \
155 --with-ldap-sasl="$(STAGING_TARGET_DIR)/usr"
156 else
157 PKG_CONFIGURE_OPTS+= --without-ldap
158 endif
159 ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
160 PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_TARGET_DIR)/usr"
161 else
162 PKG_CONFIGURE_OPTS+= --without-mysql
163 endif
164 ifneq ($(ADK_PACKAGE_PHP_MOD_OPENSSL),)
165 PKG_CONFIGURE_OPTS+= --with-openssl=shared,"$(STAGING_TARGET_DIR)/usr" \
166 --with-openssl-dir="$(STAGING_TARGET_DIR)/usr"
167 else
168 PKG_CONFIGURE_OPTS+= --without-openssl
169 endif
170 ifneq ($(ADK_PACKAGE_PHP_MOD_PCNTL),)
171 PKG_CONFIGURE_OPTS+= --enable-pcntl
172 else
173 PKG_CONFIGURE_OPTS+= --disable-pcntl
174 endif
175 ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
176 PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_TARGET_DIR)/usr"
177 else
178 PKG_CONFIGURE_OPTS+= --without-pgsql
179 endif
180 ifneq ($(ADK_PACKAGE_PHP_MOD_SESSION),)
181 PKG_CONFIGURE_OPTS+= --enable-session=shared
182 else
183 PKG_CONFIGURE_OPTS+= --disable-session
184 endif
185 ifneq ($(ADK_PACKAGE_PHP_MOD_SNMP),)
186 PKG_CONFIGURE_OPTS+= --with-snmp=shared,"$(STAGING_TARGET_DIR)/usr"
187 CONFIGURE_ENV+= LIBS="-lnetsnmpmibs"
188 else
189 PKG_CONFIGURE_OPTS+= --without-snmp
190 endif
191 ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
192 PKG_CONFIGURE_OPTS+= --with-sqlite3="$(STAGING_TARGET_DIR)/usr"
193 PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_TARGET_DIR)/usr"
194 PKG_CONFIGURE_OPTS+= --enable-pdo=shared
195 else
196 PKG_CONFIGURE_OPTS+= --without-sqlite3 --without-pdo-sqlite
197 endif
198 ifneq ($(ADK_PACKAGE_PHP_MOD_SOCKETS),)
199 PKG_CONFIGURE_OPTS+= --enable-sockets=shared
200 else
201 PKG_CONFIGURE_OPTS+= --enable-sockets=no
202 endif
203 ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
204 PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_TARGET_DIR)/usr" \
205 --with-libexpat-dir="$(STAGING_TARGET_DIR)/usr"
206 else
207 PKG_CONFIGURE_OPTS+= --disable-xml
208 endif
209 ifneq ($(ADK_PACKAGE_PHP_MOD_SIMPLEXML),)
210 PKG_CONFIGURE_OPTS+= --enable-simplexml=shared --enable-libxml --with-libxml-dir="$(STAGING_TARGET_DIR)/usr"
211 else
212 PKG_CONFIGURE_OPTS+= --disable-simplexml --disable-libxml
213 endif
214 ifneq ($(ADK_PACKAGE_PHP_MOD_ZLIB),)
215 PKG_CONFIGURE_OPTS+= --with-zlib=shared,"$(STAGING_TARGET_DIR)/usr"
216 else
217 PKG_CONFIGURE_OPTS+= --without-zlib
218 endif
220 $(eval $(call PKG_template,PHP_MOD_BZ2,php-mod-bz2,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
221 $(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
222 $(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
223 $(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
224 $(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
225 $(eval $(call PKG_template,PHP_MOD_JSON,php-mod-json,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
226 $(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
227 $(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
228 $(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
229 $(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
230 $(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
231 $(eval $(call PKG_template,PHP_MOD_SNMP,php-mod-snmp,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
232 $(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
233 $(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
234 $(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
235 $(eval $(call PKG_template,PHP_MOD_SIMPLEXML,php-mod-simplexml,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
236 $(eval $(call PKG_template,PHP_MOD_ZLIB,php-mod-zlib,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
238 $(eval $(call PKG_mod_template,PHP_MOD_BZ2,bz2))
239 $(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
240 $(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
241 $(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
242 $(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
243 $(eval $(call PKG_mod_template,PHP_MOD_JSON,json))
244 $(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
245 $(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
246 $(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
247 $(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
248 $(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
249 $(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
250 $(eval $(call PKG_mod_template,PHP_MOD_SNMP,snmp))
251 $(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo pdo_sqlite))
252 $(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
253 $(eval $(call PKG_mod_template,PHP_MOD_SIMPLEXML,simplexml))
254 $(eval $(call PKG_mod_template,PHP_MOD_ZLIB,zlib))
256 INSTALL_STYLE:= manual
257 TARGET_LDFLAGS+= -L$(STAGING_TARGET_DIR)/usr/lib/mysql
258 CONFIGURE_ENV+= LIBS="-ldl"
259 CONFIGURE_ARGS+= $(PKG_CONFIGURE_OPTS)
261 do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
262 ${INSTALL_DIR} $(IDIR_PHP)/etc
263 ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP)/etc
264 ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
265 ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php \
266 $(IDIR_PHP_CLI)/usr/bin
267 ${INSTALL_DIR} $(IDIR_PHP_CGI)/usr/bin
268 ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi \
269 $(IDIR_PHP_CGI)/usr/bin
270 ${INSTALL_DIR} $(IDIR_PHP_FPM)/etc
271 $(CP) ./files/php-fpm.conf $(IDIR_PHP_FPM)/etc
272 ${INSTALL_DIR} $(IDIR_PHP_FPM)/usr/bin
273 ${INSTALL_BIN} $(WRKBUILD)/sapi/fpm/php-fpm \
274 $(IDIR_PHP_FPM)/usr/bin/php
276 include ${ADK_TOPDIR}/mk/pkg-bottom.mk