swig.mk: Detect PHP major version with php-config

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-12-29 14:42:28 +00:00
commit ca3db118fe

View file

@ -4,7 +4,8 @@ ifeq ($(SWIG_TARGET),php)
SWIG_LANG ?= php
SWIG_TARGET_EXT ?= php
PHP ?= php7
PHP_MAJOR := $(shell php-config --version | cut -d. -f1)
PHP ?= php$(PHP_MAJOR)
#PHP ?= $(firstword $(notdir $(wildcard /usr/share/php*)))
SWIG_OPTS ?= -$(PHP)
SWIG_MODULE_TARGET_DIR = $(ENV_PREFIX)/usr/share/$(PHP)