diff --git a/Makefile b/Makefile index a76eae6917..d14b043573 100755 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ - LIBNAME=librdkafka LIBVER=1 @@ -30,7 +29,9 @@ CFLAGS+=-DSG #LDFLAGS += -pg LDFLAGS+= -g -ifneq ($(shell uname -o),Cygwin) +UNAME_S := $(shell uname -s) +CYGWIN := $(UNAME 1 6) +ifneq ($(CYGWIN), CYGWIN) LDFLAGS+=-fPIC CFLAGS+=-fPIC endif @@ -46,12 +47,12 @@ libs: $(LIBNAME).so.$(LIBVER) $(LIBNAME).a CONFIGURATION.md $(LIBNAME).so.$(LIBVER): $(OBJS) - @(if [ "`uname -s`" = "Linux" -o "`uname -o`" = "Cygwin" ]; then \ + @(if [ $(UNAME_S) = "Linux" -o $(CYGWIN) = CYGWIN ]; then \ $(CC) $(LDFLAGS) \ -shared -Wl,-soname,$@ \ -Wl,--version-script=librdkafka.lds \ $(OBJS) -o $@ -lpthread -lrt -lz -lc ; \ - elif [ "`uname -s`" = "Darwin" ]; then \ + elif [ $(UNAME_S) = "Darwin" ]; then \ $(CC) $(LDFLAGS) \ $(OBJS) -dynamiclib -o $@ -lpthread -lz -lc ; \ fi) diff --git a/tests/run-test.sh b/tests/run-test.sh index 6d97c0cd61..3a23eb62f8 100755 --- a/tests/run-test.sh +++ b/tests/run-test.sh @@ -1,10 +1,10 @@ #!/bin/bash # -RED='\e[31m' -GREEN='\e[32m' -CYAN='\e[36m' -CCLR='\e[0m' +RED='\033[31m' +GREEN='\033[32m' +CYAN='\033[36m' +CCLR='\033[0m' if [ -z "$1" ]; then echo "Usage: $0 <00xx-...test> [modes..]"