summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-06-18 15:25:30 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-06-18 16:28:52 +0200
commitd7dc9ca7c971686774739bbd789109fc966fbc39 (patch)
tree6a36907e5c9bf7fbdc8f4146bef980369ae8e9f1 /Makefile
parentd5a28db039dad5038a8aa2ae9bd6ca8c78f1d51f (diff)
Fallback to gcc when $CC is not in $PATH
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 31bb71b..598f097 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,9 @@ LIBNAME=libhiredis
HIREDIS_MAJOR=0
HIREDIS_MINOR=10
+# Fallback to gcc when $CC is not in $PATH.
+CC:=$(shell sh -c 'type $(CC) 2>/dev/null 1>/dev/null && echo $(CC) || echo gcc')
+
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
OPTIMIZATION?=-O3
ifeq ($(uname_S),SunOS)
@@ -48,7 +51,7 @@ else
DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR)
DYLIB_MAJOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR)
DYLIBNAME?=$(LIBNAME).$(DYLIBSUFFIX)
- DYLIB_MAKE_CMD?=gcc -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME)
+ DYLIB_MAKE_CMD?=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME)
STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX)
STLIB_MAKE_CMD?=ar rcs $(STLIBNAME)
INSTALL= cp -a