Skip to content

Commit

Permalink
fix build on OSX when only CLT is installed
Browse files Browse the repository at this point in the history
Based on a patch by Wael M. Nasreddine.  If Xcode is not installed
but command line tools are, the build will still work.  So detect
when xcode -version fails, and if so just do the build like normal.

Signed-off-by: Bob Copeland <[email protected]>
  • Loading branch information
Bob Copeland committed Dec 21, 2015
1 parent 72b3076 commit 37af7df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ CFLAGS += -MMD

UNAME_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(UNAME_S),Darwin)
HAS_XCODE := $(shell sh -c 'xcodebuild -version 2>/dev/null && echo 1')
endif

ifeq ($(HAS_XCODE),1)
SDKROOT ?= $(shell xcodebuild -version -sdk macosx | sed -n 's/^Path: \(.*\)/\1/p')
CFLAGS += -Wno-deprecated-declarations -isysroot $(SDKROOT) -I$(SDKROOT)/usr/include/libxml2
LDLIBS = -lcurl -lxml2 -lssl -lcrypto
Expand Down

0 comments on commit 37af7df

Please sign in to comment.