diff options
author | Marcus Boerger <helly@php.net> | 2008-06-03 20:18:58 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2008-06-03 20:18:58 +0000 |
commit | c317ce0d677a686ca989b684e06d372c215ebd02 (patch) | |
tree | 8ad1083d369d7f09dc8feae8270d85fcced7e73b /ext/phar/Makefile.frag | |
parent | cc23d3bade433999c6adb007d9d779ed6ddb7f98 (diff) | |
download | php-git-c317ce0d677a686ca989b684e06d372c215ebd02.tar.gz |
- Prefer current CLI target to build phar.phar
- Use php -n
- Use shared phar, bz2, zlib automatically
Diffstat (limited to 'ext/phar/Makefile.frag')
-rwxr-xr-x | ext/phar/Makefile.frag | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag index d18136fc73..d8885c62cd 100755 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -4,27 +4,39 @@ $(srcdir)/phar_path_check.c: $(srcdir)/phar_path_check.re pharcmd: $(builddir)/phar.php $(builddir)/phar.phar -$(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH) - if test -x "$(PHP_EXECUTABLE)"; then \ - export PHP="$(PHP_EXECUTABLE)"; \ +PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 +PHP_PHARCMD_EXECUTABLE = ` \ + if test -x "$(top_builddir)/$(SAPI_CLI_PATH)"; then \ + $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH)"; \ + if test "x$(PHP_MODULES)" != "x"; then \ + $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \ + for i in bz2 zlib phar; do \ + if test -f "$(top_builddir)/modules/$$i.la"; then \ + . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \ + fi; \ + done; \ + fi; \ + else \ + $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \ + fi;` +PHP_PHARCMD_BANG = `if test -x "$(PHP_EXECUTABLE)"; then \ + $(top_srcdir)/build/shtool echo -n -- "$(PHP_EXECUTABLE)"; \ else \ - export PHP="$(top_builddir)/$(SAPI_CLI_PATH)"; \ - fi; \ - $$PHP $(srcdir)/build_precommand.php > $(builddir)/phar.php + $(top_srcdir)/build/shtool echo -n -- "$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)"; \ + fi; ` + +$(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH) + -@echo "Generating phar.php" + @$(PHP_PHARCMD_EXECUTABLE) $(PHP_PHARCMD_SETTINGS) $(srcdir)/build_precommand.php > $(builddir)/phar.php $(builddir)/phar.phar: $(builddir)/phar.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH) - -@test -f $(builddir)/phar.phar && rm -f $(builddir)/phar.phar - -@if test -x "$(PHP_EXECUTABLE)"; then \ - export PHP="$(PHP_EXECUTABLE)"; \ - export BANG="$(PHP_EXECUTABLE)"; \ - else \ - export PHP="$(top_builddir)/$(SAPI_CLI_PATH)"; \ - export BANG="$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)"; \ - fi; \ - $$PHP -d phar.readonly=0 $(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -x CVS -p 0 -s $(srcdir)/phar/phar.php -h sha1 -b "$$BANG" $(srcdir)/phar/ - @chmod +x $(builddir)/phar.phar + -@echo "Generating phar.phar" + -@rm -f $(top_builddir)/ext/phar/phar.phar + -@rm -f $(top_srcdir)/ext/phar/phar.phar + @$(PHP_PHARCMD_EXECUTABLE) $(PHP_PHARCMD_SETTINGS) $(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -x CVS -p 0 -s $(srcdir)/phar/phar.php -h sha1 -b "$(PHP_PHARCMD_BANG)" $(srcdir)/phar/ + -@chmod +x $(builddir)/phar.phar install-pharcmd: pharcmd -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir) - @$(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir) + $(INSTALL) $(builddir)/phar.phar $(INSTALL_ROOT)$(bindir) |