Makefile.include: Refactor ar-wrapper test.

llvm-ar does not understand `-rc`, but works for creating empty
archives when called with `rc` (without the leading dash). BSD `ar`
which ships with OSX, which the test is written for, understands the
argument with or without the leading dash (but does not support creating
empty archives.)
dev/timer
Joakim Gebart 8 years ago
parent 7fc721e277
commit 5e2b9f52ba

@ -112,7 +112,7 @@ CFLAGS += -DCPU_$(CPUDEF)=\"$(CPU)\" -DRIOT_CPU=CPU_$(CPUDEF)
CFLAGS += -DMCU_$(MCUDEF)=\"$(MCU)\" -DRIOT_MCU=MCU_$(MCUDEF)
# OSX fails to create empty archives. Provide a wrapper to catch that error.
ifneq (0, $(shell mkdir -p $(BINDIR); $(AR) -rc $(BINDIR)empty-archive.a 2> /dev/null; echo $$?))
ifneq (0, $(shell mkdir -p $(BINDIR); $(AR) rc $(BINDIR)empty-archive.a 2> /dev/null; echo $$?))
AR := $(RIOTBASE)/dist/ar-wrapper $(AR)
endif

Loading…
Cancel
Save