Skip to content
Snippets Groups Projects
Commit ab846a65 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

build: better binary finding

parent 88634db6
Branches
Tags
No related merge requests found
# Project
MAJOR := 15
MINOR := 04
PATCH := 0
# Paths
PREFIX := /usr/local
......@@ -18,4 +19,4 @@ CFLAGS += -DPACKAGE_VERSION="\"$(MAJOR).$(MINOR)\"" -DPREFIX="\"$(PREFIX)\"" -D
RM := rm -f
LN := ln -s
INSTALL := install
PYTHON := python
\ No newline at end of file
PYTHON := python
......@@ -90,7 +90,10 @@ endef
# Find binary
define find_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
HAS_$(1) := yes
$(1) := $$($(1)_BIN)
......@@ -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_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)
endef
\ No newline at end of file
endef
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