Skip to content

Commit 98b8b0c

Browse files
committed
Merge pull request #25 from zelgerj/master
refactored build integration to be separated from appserver php build
2 parents 2595a5b + 28c753d commit 98b8b0c

File tree

4 files changed

+77
-55
lines changed

4 files changed

+77
-55
lines changed

build.Linux.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#--------------------------------------------------------------------------------
2+
# php-ext-appserver Unix Properties
3+
#
4+
# @copyright Copyright (c) 2014 <[email protected]> - TechDivision GmbH
5+
# @license http://opensource.org/licenses/osl-3.0.php
6+
# Open Software License (OSL 3.0)
7+
# @author appserver.io - Johann Zelger <[email protected]>
8+
#--------------------------------------------------------------------------------
9+
10+
# ---- General Settings ---------------------------------------------------------
11+
php.configure.libdir = /lib/x86_64-linux-gnu

build.default.properties

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,37 @@
1010
# ---- General Settings ---------------------------------------------------------
1111
php.ext.name = appserver
1212

13+
# ---- Release Settings ---------------------------------------------------------
1314
release.version = 0.1.12
1415
release.stability = beta
1516
api.version = 0.1.12
1617
api.stability = beta
1718

18-
php.version = 5.5.10
19+
# ---- PHP Settings -------------------------------------------------------------
20+
php.version = 5.5.16
21+
22+
pthreads.version = 1.0.1
23+
memcached.version = 2.1.0
24+
redis.version = 2.2.3
25+
apcu.version = 4.0.2
26+
xdebug.version = 2.2.3
1927

2028
# for stable releases
2129
php.downloadurl = http://de1.php.net/get/php-${php.version}.tar.gz/from/this/mirror
2230
# for beta releases
2331
# php.downloadurl = http://downloads.php.net/tyrael/php-${php.version}.tar.gz
2432

25-
php.configure = --prefix=/opt/appserver \
26-
--enable-debug \
27-
--enable-sockets \
28-
--enable-fpm \
33+
php.configure = --prefix=${c-build.dir} \
34+
--includedir=${c-build.dir} \
35+
--libdir=${c-build.dir}/php \
2936
--enable-maintainer-zts \
30-
--enable-pthreads=static \
3137
--enable-appserver=static \
32-
--enable-xdebug=shared \
33-
--enable-pcntl \
38+
--enable-sockets \
3439
--enable-mbstring \
35-
--with-libdir=lib \
3640
--with-pear \
37-
--with-mcrypt=/opt/appserver \
38-
--with-gd \
39-
--with-jpeg-dir=/opt/appserver \
40-
--with-png-dir=/opt/appserver \
41-
--with-freetype-dir=/opt/appserver \
4241
--with-pdo-mysql \
4342
--with-openssl \
44-
--with-zlib \
45-
46-
pthreads.version = 1.0.1
47-
memcached.version = 2.1.0
48-
redis.version = 2.2.3
49-
apcu.version = 4.0.2
50-
xdebug.version = 2.2.3
43+
--with-zlib
5144

45+
# ---- Deployment Settings ------------------------------------------------------
5246
deploy.dir = ${c-build.dir}/php/ext

build.mac.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
#--------------------------------------------------------------------------------
99

1010
# ---- General Settings ---------------------------------------------------------
11+
php.configure.libdir = /lib
1112
php.cc = gcc -arch x86_64

build.xml

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<property environment="env" />
55

66
<property name="c-src.dir" value="${basedir}/src" />
7-
<property name="c-php-tests.dir" value="${basedir}/src/tests" />
7+
<property name="c-php-tests.dir" value="${basedir}/src/tests" />
88
<property name="c-build.dir" value="${basedir}/build" />
99
<property name="c-target.dir" value="${basedir}/target" />
1010
<property name="c-pecl.dir" value="${basedir}/pecl" />
1111

1212
<property file="${user.home}/build.properties"/>
1313
<property file="${basedir}/build.properties"/>
1414
<property file="${basedir}/build.default.properties"/>
15-
<property file="${basedir}/build.${os.family}.properties"/>
15+
<property file="${basedir}/build.${os.name}.properties"/>
1616

1717
<!-- ==================================================================== -->
1818
<!-- Cleans the directories with the generated source files -->
@@ -61,7 +61,7 @@
6161
</filterchain>
6262
</copy>
6363
</target>
64-
64+
6565
<!-- ==================================================================== -->
6666
<!-- Copies the sources to the deploy directory -->
6767
<!-- ==================================================================== -->
@@ -156,38 +156,38 @@
156156
<target name="get-xdebug-src" depends="check-xdebug-src-present" unless="${xdebug-src.present}" description="Get PECL xdebug source package by given version number">
157157
<get src="http://pecl.php.net/get/xdebug-${xdebug.version}.tgz" dest="/tmp/xdebug-${xdebug.version}.tgz"/>
158158
</target>
159-
159+
160160
<!-- ==================================================================== -->
161161
<!-- Prepares the PHP sources for the runtime -->
162162
<!-- ==================================================================== -->
163163
<target name="prepare-source" depends="prepare" description="Prepares the PHP sources for the runtime.">
164-
<delete dir="${c-build.dir}/php-{php.version}" includeemptydirs="true" quiet="false" verbose="false" failonerror="false"/>
165-
166-
<!-- prepare PHP sources -->
164+
<delete dir="${c-build.dir}/php-{php.version}" includeemptydirs="true" quiet="false" verbose="false" failonerror="false"/>
165+
166+
<!-- prepare PHP sources -->
167167
<antcall target="get-php-src"/>
168168
<untar src="/tmp/php-${php.version}.tar.gz" dest="${c-build.dir}" compression="gzip"/>
169169
<chmod perm="755">
170170
<fileset dir="${c-build.dir}/php-${php.version}/build">
171171
<include name="**/*"/>
172172
</fileset>
173173
</chmod>
174-
175-
<!-- recreate symlink -->
176-
<symlink link="${c-build.dir}/php" action="delete"/>
177-
<symlink link="${c-build.dir}/php" resource="${c-build.dir}/php-${php.version}"/>
174+
175+
<!-- recreate symlink -->
176+
<symlink link="${c-build.dir}/php" action="delete"/>
177+
<symlink link="${c-build.dir}/php" resource="${c-build.dir}/php-${php.version}"/>
178178

179179
<antcall target="get-pthreads-src"/>
180180
<untar src="/tmp/pthreads-${pthreads.version}.tgz" dest="/tmp" compression="gzip"/>
181181
<move todir="${c-build.dir}/php/ext/pthreads">
182182
<fileset dir="/tmp/pthreads-${pthreads.version}"/>
183183
</move>
184-
185-
<!-- activate to fetch pthreads head instead of given version in properties file
184+
185+
<!-- activate to fetch pthreads head instead of given version in properties file
186186
<exec executable="git" dir="${c-build.dir}/php/ext">
187187
<arg line="clone https://github.com/krakjoe/pthreads.git"/>
188188
</exec>
189-
190-
<exec executable="git" dir="${c-build.dir}/php/ext">
189+
190+
<exec executable="git" dir="${c-build.dir}/php/ext">
191191
<arg line="clone https://github.com/krakjoe/uopz.git"/>
192192
</exec>
193193
-->
@@ -230,25 +230,41 @@
230230
<!-- configure, compile and install PHP binary -->
231231
<exec dir="${c-build.dir}/php" executable="sh">
232232
<!-- <env key="CC" value="${php.cc}"/> -->
233-
<arg line="configure ${php.configure}"/>
233+
<arg line="configure ${php.configure} --with-libdir=${php.configure.libdir}"/>
234234
</exec>
235235
</target>
236236

237237
<!-- ==================================================================== -->
238238
<!-- Makes the PHP source for the PHP build runtime -->
239239
<!-- ==================================================================== -->
240240
<target name="make" description="Compiles the php runtime environment.">
241-
<exec dir="${c-build.dir}/php" executable="make"/>
241+
<exec dir="${c-build.dir}/php" executable="make">
242+
<arg line="-j6"/>
243+
</exec>
244+
</target>
245+
246+
<!-- ==================================================================== -->
247+
<!-- Installs the builded php for the PHP build runtime -->
248+
<!-- ==================================================================== -->
249+
<target name="make-install" description="Installes the php build internally">
250+
<exec dir="${c-build.dir}/php" executable="make">
251+
<arg line="install"/>
252+
</exec>
242253
</target>
243254

244255
<!-- ==================================================================== -->
245256
<!-- Inits the build source for PHP -->
246257
<!-- ==================================================================== -->
247258
<target name="init-build" description="Init the php build environment.">
248-
<antcall target="prepare-source"/>
259+
<antcall target="prepare-source"/>
249260
<antcall target="deploy"/>
250261
<antcall target="configure"/>
251262
<antcall target="make"/>
263+
<chmod perm="+x">
264+
<fileset dir="${c-build.dir}/php-${php.version}/scripts">
265+
<include name="**/*"/>
266+
</fileset>
267+
</chmod>
252268
</target>
253269

254270
<!-- ==================================================================== -->
@@ -259,25 +275,25 @@
259275
<arg line="package package2.xml"/>
260276
</exec>
261277
</target>
262-
263-
<!-- ==================================================================== -->
278+
279+
<!-- ==================================================================== -->
264280
<!-- Runs php tests -->
265281
<!-- ==================================================================== -->
266-
<target name="run-tests" description="Runs the php tests">
267-
<exec dir="${c-build.dir}/php" executable="php">
268-
<env key="TEST_PHP_EXECUTABLE" value="${c-build.dir}/php/sapi/cli/php"/>
269-
<arg line="./run-tests.php ${c-php-tests.dir}"/>
270-
</exec>
271-
</target>
272-
273-
<!-- ==================================================================== -->
282+
<target name="run-tests" description="Runs the php tests">
283+
<exec dir="${c-build.dir}/php" executable="php">
284+
<env key="TEST_PHP_EXECUTABLE" value="${c-build.dir}/php/sapi/cli/php"/>
285+
<arg line="./run-tests.php ${c-php-tests.dir}"/>
286+
</exec>
287+
</target>
288+
289+
<!-- ==================================================================== -->
274290
<!-- Runs php tests in verbose mode to show all testing relevant info -->
275291
<!-- ==================================================================== -->
276-
<target name="run-tests-verbose" description="Runs the php tests">
277-
<exec dir="${c-build.dir}/php" executable="php">
278-
<env key="TEST_PHP_EXECUTABLE" value="${c-build.dir}/php/sapi/cli/php"/>
279-
<arg line="./run-tests.php --show-all ${c-php-tests.dir}"/>
280-
</exec>
281-
</target>
292+
<target name="run-tests-verbose" description="Runs the php tests">
293+
<exec dir="${c-build.dir}/php" executable="php">
294+
<env key="TEST_PHP_EXECUTABLE" value="${c-build.dir}/php/sapi/cli/php"/>
295+
<arg line="./run-tests.php --show-all ${c-php-tests.dir}"/>
296+
</exec>
297+
</target>
282298

283299
</project>

0 commit comments

Comments
 (0)