Skip to content

Commit f534c7c

Browse files
vapierwdenx
authored andcommitted
config.mk: avoid -traditional-cpp on OS X 10.5
Simply trying to include a basic header file like stdlib.h on OS X 10.5 and then building with -traditional-cpp fails with lots of errors like: In file included from /usr/include/stdlib.h:63, from test.c:3: /usr/include/available.h:85: error: stray '#' in program /usr/include/available.h:85: error: syntax error before numeric constant /usr/include/available.h:86: error: stray '#' in program In the past, I hadn't noticed because the old logic for these flags were restricted to Darwin running on PowerPC systems while I'm running on an Intel system. But after some recent clean ups and changes, the flag was being applied to all Darwin systems and my host tools broke. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
1 parent 3840ebf commit f534c7c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

config.mk

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ ifeq ($(HOSTOS),darwin)
6868
DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.')
6969
DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.')
7070

71-
before-snow-leopard = $(shell if [ $(DARWIN_MAJOR_VERSION) -le 10 -a \
72-
$(DARWIN_MINOR_VERSION) -le 5 ] ; then echo "$(1)"; else echo "$(2)"; fi ;)
71+
os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
72+
$(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo "$(3)"; else echo "$(4)"; fi ;)
7373

7474
# Snow Leopards build environment has no longer restrictions as described above
75-
HOSTCC = $(call before-snow-leopard, "cc", "gcc")
76-
HOSTCFLAGS += $(call before-snow-leopard, "-traditional-cpp")
77-
HOSTLDFLAGS += $(call before-snow-leopard, "-multiply_defined suppress")
75+
HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc")
76+
HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
77+
HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
7878
else
7979
HOSTCC = gcc
8080
endif

0 commit comments

Comments
 (0)