Commit ab846a65 authored by Marek Vavruša's avatar Marek Vavruša

build: better binary finding

parent 88634db6
# Project # Project
MAJOR := 15 MAJOR := 15
MINOR := 04 MINOR := 04
PATCH := 0
# Paths # Paths
PREFIX := /usr/local PREFIX := /usr/local
...@@ -18,4 +19,4 @@ CFLAGS += -DPACKAGE_VERSION="\"$(MAJOR).$(MINOR)\"" -DPREFIX="\"$(PREFIX)\"" -D ...@@ -18,4 +19,4 @@ CFLAGS += -DPACKAGE_VERSION="\"$(MAJOR).$(MINOR)\"" -DPREFIX="\"$(PREFIX)\"" -D
RM := rm -f RM := rm -f
LN := ln -s LN := ln -s
INSTALL := install INSTALL := install
PYTHON := python PYTHON := python
\ No newline at end of file
...@@ -90,7 +90,10 @@ endef ...@@ -90,7 +90,10 @@ endef
# Find binary # Find binary
define find_bin define find_bin
ifeq ($$(strip $$($(1)_BIN)),) ifeq ($$(strip $$($(1)_BIN)),)
HAS_$(1) := $(shell $(1) --version > /dev/null 2>&1 && echo yes || echo no) $(1)_BIN := $(shell which $(1))
endif
ifeq ($$(strip $$($(1)_BIN)),)
HAS_$(1) := no
else else
HAS_$(1) := yes HAS_$(1) := yes
$(1) := $$($(1)_BIN) $(1) := $$($(1)_BIN)
...@@ -102,4 +105,4 @@ define find_python ...@@ -102,4 +105,4 @@ define find_python
python_CFLAGS := $(shell $(PYTHON) -c "from distutils import sysconfig as c;print('-I%s' % c.get_python_inc())") python_CFLAGS := $(shell $(PYTHON) -c "from distutils import sysconfig as c;print('-I%s' % c.get_python_inc())")
python_LIBS := $(shell $(PYTHON) -c "from distutils import sysconfig as c;print('-L%s -lpython%s' % (c.get_config_var('LIBDIR'), c.get_config_var('VERSION')))") python_LIBS := $(shell $(PYTHON) -c "from distutils import sysconfig as c;print('-L%s -lpython%s' % (c.get_config_var('LIBDIR'), c.get_config_var('VERSION')))")
$(call have_lib,python) $(call have_lib,python)
endef endef
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment