From: Michael Wallner Date: Mon, 25 Jan 2016 11:20:06 +0000 (+0100) Subject: Squashed commit of the following: X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=eced8a2fe1fc21ff6ab7b2020d2f061639ccef62;p=m6w6%2Ftravis-pecl Squashed commit of the following: commit 769fe6be0d15669eec7308b6f8d1e17124187814 Author: Michael Wallner Date: Mon Jan 25 12:18:07 2016 +0100 less $(shell), better Makefile commit 0a6d8d038ea3143809a14a00bc6a7c7f9f6e236a Author: Michael Wallner Date: Mon Jan 25 12:08:55 2016 +0100 build ext in checkout dir commit 33aee54b6afe7f1207c88b51b570b8dc16a49a09 Author: Michael Wallner Date: Fri Jan 22 20:18:35 2016 +0100 oneliner commit 1903e5867ae79f3e88d2c31aecdbe0bd229f02bd Author: Michael Wallner Date: Fri Jan 22 14:20:08 2016 +0100 not sure where I thought that CURDIR came from commit 897a8b2b63b76c230dc265fd965f9346316bf93f Author: Michael Wallner Date: Fri Jan 22 13:59:32 2016 +0100 build ext in CURDIR --- diff --git a/Makefile b/Makefile index 6d3c70b..edaf87b 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,12 @@ endif exec_prefix ?= $(prefix) bindir = $(exec_prefix)/bin srcdir := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) +ifdef TRAVIS_BUILD_DIR +curdir ?= $(TRAVIS_BUILD_DIR) +else +# CURDIR is a make builtin +curdir ?= $(CURDIR) +endif enable_maintainer_zts ?= no enable_debug ?= no @@ -22,10 +28,12 @@ with_php_config ?= $(bindir)/php-config extdir = $(shell test -x $(with_php_config) && $(with_php_config) --extension-dir) PECL_MIRROR ?= http://pecl.php.net/get/ -PECL_EXTENSION ?= $(shell echo $(PECL) | cut -d: -f1) -PECL_SONAME ?= $(if $(shell echo $(PECL) | cut -d: -f2),$(shell echo $(PECL) | cut -d: -f2),$(PECL_EXTENSION)) -PECL_VERSION ?= $(shell echo $(PECL) | cut -d: -f3 -s) +PECL_WORDS := $(subst :, ,$(PECL)) +PECL_EXTENSION ?= $(word 1,$(PECL_WORDS)) +PECL_SONAME ?= $(if $(word 2,$(PECL_WORDS)),$(word 2,$(PECL_WORDS)),$(PECL_EXTENSION)) +PECL_VERSION ?= $(word 3,$(PECL_WORDS)) PECL_INI = $(with_config_file_scan_dir)/pecl.ini +PECL_DIR := $(if $(filter ext ext%, $(MAKECMDGOALS)), $(curdir), $(srcdir)/pecl-$(PECL_EXTENSION)) PHP_VERSION_MAJOR = $(firstword $(subst ., ,$(PHP))) PHP_VERSIONS_JSON = $(srcdir)/php-versions$(PHP_VERSION_MAJOR).json @@ -83,7 +91,7 @@ pecl-check: .PHONY: pecl-clean pecl-clean: - @if test -d $(srcdir)/pecl-$(PECL_EXTENSION); then cd $(srcdir)/pecl-$(PECL_EXTENSION); make distclean || true; fi + @if test -d $(PECL_DIR); then cd $(PECL_DIR); make distclean || true; fi .PHONY: pecl-rm pecl-rm: @@ -92,24 +100,21 @@ pecl-rm: $(PECL_INI): | $(with_config_file_scan_dir) touch $@ -$(srcdir)/pecl-$(PECL_EXTENSION): - test -e $@ || ln -s $(CURDIR) $@ - -$(srcdir)/pecl-$(PECL_EXTENSION)/config.m4: - mkdir -p $(srcdir)/pecl-$(PECL_EXTENSION) - curl -Ss $(PECL_MIRROR)/$(PECL_EXTENSION)$(if $(PECL_VERSION),/$(PECL_VERSION)) | tar xz --strip-components 1 -C $(srcdir)/pecl-$(PECL_EXTENSION) +$(PECL_DIR)/config.m4: + mkdir -p $(PECL_DIR) + curl -Ss $(PECL_MIRROR)/$(PECL_EXTENSION)$(if $(PECL_VERSION),/$(PECL_VERSION)) | tar xz --strip-components 1 -C $(PECL_DIR) -$(srcdir)/pecl-$(PECL_EXTENSION)/configure: $(srcdir)/pecl-$(PECL_EXTENSION)/config.m4 - cd $(srcdir)/pecl-$(PECL_EXTENSION) && $(bindir)/phpize +$(PECL_DIR)/configure: $(PECL_DIR)/config.m4 + cd $(PECL_DIR) && $(bindir)/phpize -$(srcdir)/pecl-$(PECL_EXTENSION)/Makefile: $(srcdir)/pecl-$(PECL_EXTENSION)/configure - cd $(srcdir)/pecl-$(PECL_EXTENSION) && ./configure -C +$(PECL_DIR)/Makefile: $(PECL_DIR)/configure + cd $(PECL_DIR) && ./configure -C -$(srcdir)/pecl-$(PECL_EXTENSION)/.libs/$(PECL_SONAME).so: $(srcdir)/pecl-$(PECL_EXTENSION)/Makefile - cd $(srcdir)/pecl-$(PECL_EXTENSION) && make -j $(JOBS) || make +$(PECL_DIR)/.libs/$(PECL_SONAME).so: $(PECL_DIR)/Makefile + cd $(PECL_DIR) && make -j $(JOBS) || make -$(extdir)/$(PECL_SONAME).so: $(srcdir)/pecl-$(PECL_EXTENSION)/.libs/$(PECL_SONAME).so - cd $(srcdir)/pecl-$(PECL_EXTENSION) && make install +$(extdir)/$(PECL_SONAME).so: $(PECL_DIR)/.libs/$(PECL_SONAME).so + cd $(PECL_DIR) && make install .PHONY: pecl pecl: pecl-check php $(extdir)/$(PECL_SONAME).so | $(PECL_INI) @@ -122,7 +127,7 @@ ext-clean: pecl-clean ext-rm: pecl-rm .PHONY: ext -ext: pecl-check $(srcdir)/pecl-$(PECL_EXTENSION) pecl +ext: pecl-check pecl $(srcdir)/check-packagexml.php package.xml .PHONY: php