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