From 8ffc02495fefcd3eaf71d15276136e9a90aee912 Mon Sep 17 00:00:00 2001 From: Marcus von Appen Date: Sat, 7 Jun 2014 09:16:42 +0200 Subject: [PATCH] - Let the build environment decide about the toolchain to be used, in case there are special tweaks and paths to be considered. Just provide some defaults, in case the values are undefined. - py-version.sh does not need any bash specific features. - Use libdl only on Linux for now. FreeBSD provides dl*() calls from libc. --- py/mkenv.mk | 14 +++++++------- py/py-version.sh | 2 +- unix/Makefile | 5 ++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/py/mkenv.mk b/py/mkenv.mk index 4bc71edd78..b8dde807e8 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -42,14 +42,14 @@ ECHO = @echo CP = cp MKDIR = mkdir SED = sed -PYTHON = python +PYTHON ?= python -AS = $(CROSS_COMPILE)as -CC = $(CROSS_COMPILE)gcc -LD = $(CROSS_COMPILE)ld -OBJCOPY = $(CROSS_COMPILE)objcopy -SIZE = $(CROSS_COMPILE)size -STRIP = $(CROSS_COMPILE)strip +AS ?= $(CROSS_COMPILE)as +CC ?= $(CROSS_COMPILE)gcc +LD ?= $(CROSS_COMPILE)ld +OBJCOPY ?= $(CROSS_COMPILE)objcopy +SIZE ?= $(CROSS_COMPILE)size +STRIP ?= $(CROSS_COMPILE)strip all: .PHONY: all diff --git a/py/py-version.sh b/py/py-version.sh index 93b8d7a1fd..88c3ebb986 100755 --- a/py/py-version.sh +++ b/py/py-version.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Note: git describe doesn't work if no tag is available git_tag="$(git describe --dirty --always)" diff --git a/unix/Makefile b/unix/Makefile index ffc3391a14..485009135f 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -48,7 +48,10 @@ ifeq ($(MICROPY_PY_FFI),1) LIBFFI_LDFLAGS_MOD := $(shell pkg-config --libs libffi) LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi) CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_PY_FFI=1 -LDFLAGS_MOD += -ldl $(LIBFFI_LDFLAGS_MOD) +ifeq ($(UNAME_S),Linux) +LDFLAGS_MOD += -ldl +endif +LDFLAGS_MOD += $(LIBFFI_LDFLAGS_MOD) SRC_MOD += modffi.c endif