build: -Wno-dollar-in-identifier-extension is clang only

Add a compiler check because turning on the option unconditionally
breaks the build when CC=gcc.

This should also fix the build on versions of OS X that predate Apple's
switch to clang (10.6 and older.)
This commit is contained in:
Ben Noordhuis 2013-04-10 23:40:55 +02:00
parent 633d33a92a
commit 0ff06b4ac3

View File

@ -80,8 +80,12 @@ endif
ifeq (darwin,$(PLATFORM))
HAVE_DTRACE=1
# dtrace(1) probes contain dollar signs.
# dtrace(1) probes contain dollar signs on OS X. Mute the warnings they
# generate but only when CC=clang, -Wno-dollar-in-identifier-extension
# is a clang extension.
ifeq (__clang__,$(shell sh -c "$(CC) -dM -E - </dev/null | grep -ow __clang__"))
CFLAGS += -Wno-dollar-in-identifier-extension
endif
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
LDFLAGS += -framework Foundation \
-framework CoreServices \