Skip to content

Commit 8ffc024

Browse files
committed
- 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.
1 parent c61be8e commit 8ffc024

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

py/mkenv.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ ECHO = @echo
4242
CP = cp
4343
MKDIR = mkdir
4444
SED = sed
45-
PYTHON = python
46-
47-
AS = $(CROSS_COMPILE)as
48-
CC = $(CROSS_COMPILE)gcc
49-
LD = $(CROSS_COMPILE)ld
50-
OBJCOPY = $(CROSS_COMPILE)objcopy
51-
SIZE = $(CROSS_COMPILE)size
52-
STRIP = $(CROSS_COMPILE)strip
45+
PYTHON ?= python
46+
47+
AS ?= $(CROSS_COMPILE)as
48+
CC ?= $(CROSS_COMPILE)gcc
49+
LD ?= $(CROSS_COMPILE)ld
50+
OBJCOPY ?= $(CROSS_COMPILE)objcopy
51+
SIZE ?= $(CROSS_COMPILE)size
52+
STRIP ?= $(CROSS_COMPILE)strip
5353

5454
all:
5555
.PHONY: all

py/py-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
# Note: git describe doesn't work if no tag is available
44
git_tag="$(git describe --dirty --always)"

unix/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ ifeq ($(MICROPY_PY_FFI),1)
4848
LIBFFI_LDFLAGS_MOD := $(shell pkg-config --libs libffi)
4949
LIBFFI_CFLAGS_MOD := $(shell pkg-config --cflags libffi)
5050
CFLAGS_MOD += $(LIBFFI_CFLAGS_MOD) -DMICROPY_PY_FFI=1
51-
LDFLAGS_MOD += -ldl $(LIBFFI_LDFLAGS_MOD)
51+
ifeq ($(UNAME_S),Linux)
52+
LDFLAGS_MOD += -ldl
53+
endif
54+
LDFLAGS_MOD += $(LIBFFI_LDFLAGS_MOD)
5255
SRC_MOD += modffi.c
5356
endif
5457

0 commit comments

Comments
 (0)