Skip to content

Commit ee5fd96

Browse files
author
foobar
committed
- Made it possible to do "make test" for phpized extensions
1 parent 0f2986f commit ee5fd96

File tree

7 files changed

+30
-14
lines changed

7 files changed

+30
-14
lines changed

Makefile.global

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ install-modules: build-modules
4545
@rm -f modules/*.la >/dev/null 2>&1
4646
@$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)
4747

48-
install-tester:
49-
@echo "Installing regression tester: $(INSTALL_ROOT)$(PEAR_INSTALLDIR)/"
50-
@$(mkinstalldirs) $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
51-
@$(INSTALL) -m 755 $(top_srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
52-
53-
install-su: install-pear install-tester
48+
install-su: install-pear
5449

5550
test:
56-
-@if test -x $(SAPI_CLI_PATH) && test ! -z $(SAPI_CLI_PATH); then \
51+
-@if test ! -z $(PHP_EXECUTABLE) && test -x $(PHP_EXECUTABLE); then \
52+
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
53+
TEST_PHP_SRCDIR=$(top_srcdir) \
54+
CC="$(CC)" \
55+
$(PHP_EXECUTABLE) -d 'extension_dir=modules/' -d 'extension='`basename $(PHP_MODULES) .la`'.so' -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' -d 'memory_limit=-1' $(top_srcdir)/run-tests.php tests/; \
56+
elif test ! -z $(SAPI_CLI_PATH) && test -x $(SAPI_CLI_PATH); then \
5757
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
5858
TEST_PHP_SRCDIR=$(top_srcdir) \
5959
CC="$(CC)" \

configure.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,8 +1082,8 @@ PHP_SUBST_OLD(php_abs_top_srcdir)
10821082

10831083
PHP_SUBST(bindir)
10841084
PHP_SUBST(exec_prefix)
1085-
PHP_SUBST(program_prefix)
1086-
PHP_SUBST(program_suffix)
1085+
PHP_SUBST_OLD(program_prefix)
1086+
PHP_SUBST_OLD(program_suffix)
10871087
PHP_SUBST(includedir)
10881088
PHP_SUBST(libdir)
10891089
PHP_SUBST(mandir)
@@ -1183,7 +1183,7 @@ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
11831183
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
11841184

11851185
all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
1186-
install_targets="$install_modules $install_pear install-build install-headers install-programs install-tester"
1186+
install_targets="$install_modules $install_pear install-build install-headers install-programs"
11871187

11881188
case $PHP_SAPI in
11891189
cgi)

scripts/Makefile.frag

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ BUILD_FILES = \
1313
build/libtool.m4 \
1414
Makefile.global \
1515
acinclude.m4 \
16-
ltmain.sh
16+
ltmain.sh \
17+
run-tests.php \
18+
run-tests-config.php
1719

1820
BUILD_FILES_EXEC = \
1921
build/shtool \

scripts/man1/php-config.1.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Extra libraries which PHP was compiled with
5151
Directory where extensions are searched by default
5252
.TP
5353
.PD 0
54+
.B \-\-php-binary
55+
Full path to php CLI/CGI binary
56+
.TP
57+
.PD 0
5458
.B \-\-version
5559
PHP version
5660
.TP

scripts/php-config.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#! /bin/sh
22

33
prefix="@prefix@"
4+
exec_prefix="@exec_prefix@"
45
version="@PHP_VERSION@"
56
includedir="@includedir@/php"
67
includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend"
78
ldflags="@PHP_LDFLAGS@"
89
libs="@EXTRA_LIBS@"
910
extension_dir='@EXTENSION_DIR@'
11+
program_prefix="@program_prefix@"
12+
program_suffix="@program_suffix@"
13+
exe_extension="@EXEEXT@"
14+
php_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}"
1015

1116
case "$1" in
1217
--prefix)
@@ -19,10 +24,12 @@ case "$1" in
1924
echo $libs;;
2025
--extension-dir)
2126
echo $extension_dir;;
27+
--php-binary)
28+
echo $php_binary;;
2229
--version)
2330
echo $version;;
2431
*)
25-
echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--version]"
32+
echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--php-binary|--version]"
2633
exit 1;;
2734
esac
2835

scripts/phpize.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ includedir="`eval echo @includedir@`/php"
88
builddir="`pwd`"
99

1010
FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4"
11-
FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh"
11+
FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php"
1212
CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \
1313
mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
1414
aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \
15-
config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h"
15+
config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \
16+
run-tests*.php"
1617

1718
# function declaration
1819
phpize_usage()

scripts/phpize.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ AC_DEFUN([PHP_WITH_PHP_CONFIG],[
1818
prefix=`$PHP_CONFIG --prefix 2>/dev/null`
1919
INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
2020
EXTENSION_DIR=`$PHP_CONFIG --extension-dir`
21+
PHP_EXECUTABLE=`$PHP_CONFIG --php-binary`
2122
2223
if test -z "$prefix"; then
2324
AC_MSG_ERROR(Cannot find php-config. Please use --with-php-config=PATH)
@@ -99,6 +100,7 @@ PHP_SUBST(CPPFLAGS)
99100
PHP_SUBST(CXX)
100101
PHP_SUBST(CXXFLAGS)
101102
PHP_SUBST(EXTENSION_DIR)
103+
PHP_SUBST(PHP_EXECUTABLE)
102104
PHP_SUBST(EXTRA_LDFLAGS)
103105
PHP_SUBST(EXTRA_LIBS)
104106
PHP_SUBST(INCLUDES)

0 commit comments

Comments
 (0)