diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2011-06-18 15:25:30 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2011-06-18 16:28:52 +0200 |
commit | d7dc9ca7c971686774739bbd789109fc966fbc39 (patch) | |
tree | 6a36907e5c9bf7fbdc8f4146bef980369ae8e9f1 /Makefile | |
parent | d5a28db039dad5038a8aa2ae9bd6ca8c78f1d51f (diff) |
Fallback to gcc when $CC is not in $PATH
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |