xref: /PHP-7.2/pear/Makefile.frag (revision 60a69dae)
1# -*- makefile -*-
2
3peardir=$(PEAR_INSTALLDIR)
4
5# Skip all php.ini files altogether
6PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0
7
8WGET = `which wget 2>/dev/null`
9FETCH = `which fetch 2>/dev/null`
10PEAR_PREFIX = -dp a${program_prefix}
11PEAR_SUFFIX = -ds a$(program_suffix)
12PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
13
14install-pear-installer: $(SAPI_CLI_PATH)
15	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
16
17install-pear:
18	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
19	@if test ! -f $(builddir)/install-pear-nozlib.phar; then \
20		if test -f $(srcdir)/install-pear-nozlib.phar; then \
21			cp $(srcdir)/install-pear-nozlib.phar $(builddir)/install-pear-nozlib.phar; \
22		else \
23			if test ! -z "$(WGET)" && test -x "$(WGET)"; then \
24				"$(WGET)" "${PEAR_INSTALLER_URL}" -nd -P $(builddir)/; \
25			elif test ! -z "$(FETCH)" && test -x "$(FETCH)"; then \
26				"$(FETCH)" -o $(builddir)/ "${PEAR_INSTALLER_URL}"; \
27			else \
28				$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php "${PEAR_INSTALLER_URL}" $(builddir)/install-pear-nozlib.phar; \
29			fi \
30		fi \
31	fi
32	@if test -f $(builddir)/install-pear-nozlib.phar && $(mkinstalldirs) $(INSTALL_ROOT)$(peardir); then \
33		$(MAKE) -s install-pear-installer; \
34	else \
35		cat $(srcdir)/install-pear.txt; \
36	fi
37