summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/php/php.inc
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2015-08-20 16:29:35 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2015-08-31 20:07:59 +0200
commit7f478ed5cb7f8ab22b8c96a2d9d20e60ae230a09 (patch)
treeec286cf17843346ea0b1199916363ab4c6926ccb /meta-oe/recipes-devtools/php/php.inc
parentcb7fdc16d9eb43c1620aabab4f1f938ad27e9337 (diff)
downloadmeta-openembedded-7f478ed5cb7f8ab22b8c96a2d9d20e60ae230a09.tar.gz
php: create recipe for 5.6.12
The difference between 5.6.x and 5.5.x is in http://php.net/migration56 Most improvements in PHP 5.6.x have no impact on existing code. There are a few incompatibilities and new features that should be considered, and code should be tested before switching PHP versions in production environments. Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/php/php.inc')
-rw-r--r--meta-oe/recipes-devtools/php/php.inc271
1 files changed, 271 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/php/php.inc b/meta-oe/recipes-devtools/php/php.inc
new file mode 100644
index 000000000..67d2362ab
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php.inc
@@ -0,0 +1,271 @@
1SUMMARY = "A server-side, HTML-embedded scripting language"
2HOMEPAGE = "http://www.php.net"
3SECTION = "console/network"
4
5LICENSE = "PHP-3.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=464ca70af214d2407f6b7d4458158afd"
7
8BBCLASSEXTEND = "native"
9DEPENDS = "zlib bzip2 libxml2 virtual/libiconv php-native lemon-native \
10 openssl libmcrypt"
11DEPENDS_class-native = "zlib-native libxml2-native"
12
13SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
14 file://acinclude-xml2-config.patch \
15 file://0001-php-don-t-use-broken-wrapper-for-mkdir.patch \
16 file://0001-acinclude-use-pkgconfig-for-libxml2-config.patch \
17 "
18
19SRC_URI_append_class-target += " \
20 file://iconv.patch \
21 file://imap-fix-autofoo.patch \
22 file://pear-makefile.patch \
23 file://phar-makefile.patch \
24 file://php_exec_native.patch \
25 file://php-fpm.conf \
26 file://php-fpm-apache.conf \
27 file://configure.patch \
28 file://pthread-check-threads-m4.patch \
29 file://70_mod_php5.conf \
30 file://php-fpm.service \
31 "
32S = "${WORKDIR}/php-${PV}"
33
34inherit autotools pkgconfig pythonnative gettext
35
36# phpize is not scanned for absolute paths by default (but php-config is).
37#
38SSTATE_SCAN_FILES += "phpize"
39SSTATE_SCAN_FILES += "build-defs.h"
40
41PHP_LIBDIR = "${libdir}/php5"
42
43# Common EXTRA_OECONF
44COMMON_EXTRA_OECONF = "--enable-sockets \
45 --enable-pcntl \
46 --enable-shared \
47 --disable-opcache \
48 --disable-rpath \
49 --with-pic \
50 --libdir=${PHP_LIBDIR} \
51"
52EXTRA_OECONF = "--enable-mbstring \
53 --enable-wddx \
54 --enable-fpm \
55 --enable-zip \
56 --with-libdir=${baselib} \
57 --with-gettext=${STAGING_LIBDIR}/.. \
58 --with-zlib=${STAGING_LIBDIR}/.. \
59 --with-iconv=${STAGING_LIBDIR}/.. \
60 --with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \
61 --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \
62 --with-config-file-path=${sysconfdir}/php/apache2-php5 \
63 ${@base_conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)} \
64 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '', 'ac_cv_lib_pam_pam_start=no', d)} \
65 ${COMMON_EXTRA_OECONF} \
66"
67EXTRA_OECONF_class-native = " \
68 --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \
69 --without-iconv \
70 ${COMMON_EXTRA_OECONF} \
71"
72
73PACKAGECONFIG ??= "mysql sqlite3 imap \
74 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
75PACKAGECONFIG_class-native = ""
76
77PACKAGECONFIG[mysql] = "--with-mysql=${STAGING_DIR_TARGET}${prefix} \
78 --with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config \
79 --with-pdo-mysql=${STAGING_BINDIR_CROSS}/mysql_config \
80 ,--without-mysql --without-mysqli --without-pdo-mysql \
81 ,mysql5"
82
83PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \
84 --with-pdo-sqlite=${STAGING_LIBDIR}/.. \
85 , \
86 ,sqlite3"
87PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,postgresql"
88PACKAGECONFIG[soap] = "--enable-libxml --enable-soap, --disable-soap, libxml2"
89PACKAGECONFIG[apache2] = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs,,apache2-native apache2"
90PACKAGECONFIG[pam] = ",,libpam"
91PACKAGECONFIG[imap] = "--with-imap=${STAGING_DIR_HOST} \
92 --with-imap-ssl=${STAGING_DIR_HOST} \
93 ,--without-imap --without-imap-ssl \
94 ,uw-imap"
95
96
97export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}"
98export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php"
99CFLAGS += " -D_GNU_SOURCE -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
100CFLAGS_append_aarch64 = " -O2"
101
102EXTRA_OEMAKE = "INSTALL_ROOT=${D}"
103
104acpaths = ""
105
106do_configure_prepend () {
107 rm -f ${S}/build/libtool.m4 ${S}/ltmain.sh ${S}/aclocal.m4
108 find ${S} -name config.m4 | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_BINDIR_NATIVE}/httpd!'
109}
110
111do_configure_append() {
112 # No, libtool, we really don't want rpath set...
113 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${HOST_SYS}-libtool
114 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${HOST_SYS}-libtool
115}
116
117do_install_append_class-native() {
118 rm -rf ${D}/${PHP_LIBDIR}/php/.registry
119 rm -rf ${D}/${PHP_LIBDIR}/php/.channels
120 rm -rf ${D}/${PHP_LIBDIR}/php/.[a-z]*
121}
122
123do_install_prepend() {
124 cat aclocal-copy/libtool.m4 aclocal-copy/lt~obsolete.m4 aclocal-copy/ltoptions.m4 \
125 aclocal-copy/ltsugar.m4 aclocal-copy/ltversion.m4 > ${S}/build/libtool.m4
126}
127
128do_install_prepend_class-target() {
129 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
130 # Install dummy config file so apxs doesn't fail
131 install -d ${D}${sysconfdir}/apache2
132 printf "\nLoadModule dummy_module modules/mod_dummy.so\n" > ${D}${sysconfdir}/apache2/httpd.conf
133 fi
134}
135
136# fixme
137do_install_append_class-target() {
138 install -d ${D}/${sysconfdir}/
139 if [ -d ${D}/${STAGING_DIR_NATIVE}/${sysconfdir} ];then
140 mv ${D}/${STAGING_DIR_NATIVE}/${sysconfdir}/* ${D}/${sysconfdir}/
141 fi
142 rm -rf ${D}/${TMPDIR}
143 rm -rf ${D}/.registry
144 rm -rf ${D}/.channels
145 rm -rf ${D}/.[a-z]*
146 rm -rf ${D}/var
147 rm -f ${D}/${sysconfdir}/php-fpm.conf.default
148 sed -i 's:${STAGING_DIR_NATIVE}::g' ${D}/${sysconfdir}/pear.conf
149 install -m 0644 ${WORKDIR}/php-fpm.conf ${D}/${sysconfdir}/php-fpm.conf
150 install -d ${D}/${sysconfdir}/apache2/conf.d
151 install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf
152 install -d ${D}${sysconfdir}/init.d
153 sed -i 's:=/usr/sbin:=${sbindir}:g' ${B}/sapi/fpm/init.d.php-fpm
154 sed -i 's:=/etc:=${sysconfdir}:g' ${B}/sapi/fpm/init.d.php-fpm
155 sed -i 's:=/var:=${localstatedir}:g' ${B}/sapi/fpm/init.d.php-fpm
156 install -m 0755 ${B}/sapi/fpm/init.d.php-fpm ${D}${sysconfdir}/init.d/php-fpm
157 install -m 0644 ${WORKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf
158
159 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
160 install -d ${D}${systemd_unitdir}/system
161 install -m 0644 ${WORKDIR}/php-fpm.service ${D}${systemd_unitdir}/system/
162 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
163 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
164 ${D}${systemd_unitdir}/system/php-fpm.service
165 fi
166
167 TMP=`dirname ${D}/${TMPDIR}`
168 while test ${TMP} != ${D}; do
169 rmdir ${TMP}
170 TMP=`dirname ${TMP}`;
171 done
172
173 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
174 install -d ${D}${libdir}/apache2/modules
175 install -d ${D}${sysconfdir}/apache2/modules.d
176 install -d ${D}${sysconfdir}/php/apache2-php5
177 install -m 755 libs/libphp5.so ${D}${libdir}/apache2/modules
178 install -m 644 ${WORKDIR}/70_mod_php5.conf ${D}${sysconfdir}/apache2/modules.d
179 sed -i s,lib/,${libdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php5.conf
180 cat ${S}/php.ini-production | \
181 sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
182 > ${D}${sysconfdir}/php/apache2-php5/php.ini
183 rm -f ${D}${sysconfdir}/apache2/httpd.conf*
184 fi
185}
186
187SYSROOT_PREPROCESS_FUNCS += "php_sysroot_preprocess"
188
189php_sysroot_preprocess () {
190 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
191 install -m 755 ${D}${bindir}/phpize ${SYSROOT_DESTDIR}${bindir_crossscripts}/
192 install -m 755 ${D}${bindir}/php-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
193
194 sed -i 's!eval echo /!eval echo ${STAGING_DIR_HOST}/!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/phpize
195 sed -i 's!^include_dir=.*!include_dir=${STAGING_INCDIR}/php!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/php-config
196}
197
198MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}"
199
200PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}"
201
202RDEPENDS_${PN}-pear = "${PN}"
203RDEPENDS_${PN}-phar = "${PN}-cli"
204RDEPENDS_${PN}-cli = "${PN}"
205RDEPENDS_${PN}-modphp = "${PN} apache2"
206RDEPENDS_${PN}-dev = "${PN}"
207
208INITSCRIPT_PACKAGES = "${PN}-fpm"
209inherit update-rc.d
210
211FILES_${PN}-dbg =+ "${bindir}/.debug \
212 ${libdir}/apache2/modules/.debug"
213FILES_${PN}-doc += "${PHP_LIBDIR}/php/doc"
214FILES_${PN}-cli = "${bindir}/php"
215FILES_${PN}-phar = "${bindir}/phar*"
216FILES_${PN}-cgi = "${bindir}/php-cgi"
217FILES_${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm ${systemd_unitdir}/system/php-fpm.service"
218FILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf"
219CONFFILES_${PN}-fpm = "${sysconfdir}/php-fpm.conf"
220CONFFILES_${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf"
221INITSCRIPT_NAME_${PN}-fpm = "php-fpm"
222INITSCRIPT_PARAMS_${PN}-fpm = "defaults 60"
223FILES_${PN}-pear = "${bindir}/pear* ${bindir}/pecl ${PHP_LIBDIR}/php/PEAR \
224 ${PHP_LIBDIR}/php/PEAR*.php ${PHP_LIBDIR}/php/System.php \
225 ${PHP_LIBDIR}/php/peclcmd.php ${PHP_LIBDIR}/php/pearcmd.php \
226 ${PHP_LIBDIR}/php/.channels ${PHP_LIBDIR}/php/.channels/.alias \
227 ${PHP_LIBDIR}/php/.registry ${PHP_LIBDIR}/php/Archive/Tar.php \
228 ${PHP_LIBDIR}/php/Console/Getopt.php ${PHP_LIBDIR}/php/OS/Guess.php \
229 ${PHP_LIBDIR}/php/data/PEAR \
230 ${sysconfdir}/pear.conf"
231FILES_${PN}-dev = "${includedir}/php ${PHP_LIBDIR}/build ${bindir}/phpize \
232 ${bindir}/php-config ${PHP_LIBDIR}/php/.depdb \
233 ${PHP_LIBDIR}/php/.depdblock ${PHP_LIBDIR}/php/.filemap \
234 ${PHP_LIBDIR}/php/.lock ${PHP_LIBDIR}/php/test"
235FILES_${PN} = "${PHP_LIBDIR}/php"
236FILES_${PN} += "${bindir}"
237
238SUMMARY_${PN}-modphp = "PHP module for the Apache HTTP server"
239FILES_${PN}-modphp = "${libdir}/apache2 ${sysconfdir}"
240
241MODPHP_OLDPACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'modphp', '', d)}"
242RPROVIDES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
243RREPLACES_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
244RCONFLICTS_${PN}-modphp = "${MODPHP_OLDPACKAGE}"
245
246do_install_append_class-native() {
247 create_wrapper ${D}${bindir}/php \
248 PHP_PEAR_SYSCONF_DIR=${sysconfdir}/
249}
250
251SSTATEPOSTINSTFUNCS_append_class-native = " php_sstate_postinst "
252
253php_sstate_postinst() {
254 if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
255 then
256 head -n1 ${sysconfdir}/pear.conf > ${sysconfdir}/pear.tmp.conf
257 for p in `tail -n1 ${sysconfdir}/pear.conf | sed -s 's/;/ /g'`; do
258 echo $p | awk -F: 'BEGIN {OFS = ":"; ORS = ";"}{if(NF==3){print $1, length($3)-2*match($3, /^"/), $3} else {print $0}}';
259 done >> ${sysconfdir}/pear.tmp.conf
260 mv -f ${sysconfdir}/pear.tmp.conf ${sysconfdir}/pear.conf
261 fi
262}
263
264# Fails to build with thumb-1 (qemuarm)
265# | {standard input}: Assembler messages:
266# | {standard input}:3719: Error: selected processor does not support Thumb mode `smull r0,r2,r9,r3'
267# | {standard input}:3720: Error: unshifted register required -- `sub r2,r2,r0,asr#31'
268# | {standard input}:3796: Error: selected processor does not support Thumb mode `smull r0,r2,r3,r3'
269# | {standard input}:3797: Error: unshifted register required -- `sub r2,r2,r0,asr#31'
270# | make: *** [ext/standard/math.lo] Error 1
271ARM_INSTRUCTION_SET = "arm"