From 1ac7121f65bd6a6fd7a611e3024b69736f9c46a3 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 15:05:33 +0200 Subject: Define _POSIX_C_SOURCE for Solaris --- fmacros.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fmacros.h b/fmacros.h index 65f9692..83c20cd 100644 --- a/fmacros.h +++ b/fmacros.h @@ -1,11 +1,13 @@ #ifndef __HIREDIS_FMACRO_H #define __HIREDIS_FMACRO_H -#ifndef _BSD_SOURCE +#if !defined(_BSD_SOURCE) #define _BSD_SOURCE #endif -#ifdef __linux__ +#if defined(__sun__) +#define _POSIX_C_SOURCE 200112L +#elif defined(__linux__) #define _XOPEN_SOURCE 700 #else #define _XOPEN_SOURCE -- cgit v1.2.3 From d5a28db039dad5038a8aa2ae9bd6ca8c78f1d51f Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 15:06:27 +0200 Subject: 7th revision is not necessary --- fmacros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmacros.h b/fmacros.h index 83c20cd..21cd9cf 100644 --- a/fmacros.h +++ b/fmacros.h @@ -8,7 +8,7 @@ #if defined(__sun__) #define _POSIX_C_SOURCE 200112L #elif defined(__linux__) -#define _XOPEN_SOURCE 700 +#define _XOPEN_SOURCE 600 #else #define _XOPEN_SOURCE #endif -- cgit v1.2.3 From d7dc9ca7c971686774739bbd789109fc966fbc39 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 15:25:30 +0200 Subject: Fallback to gcc when $CC is not in $PATH --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 8ee630875a3d4220a663706826b5345123bd7743 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 15:56:41 +0200 Subject: Remove unused libraries from link flags --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 598f097..bf64832 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') OPTIMIZATION?=-O3 ifeq ($(uname_S),SunOS) CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -D__EXTENSIONS__ -D_XPG6 $(ARCH) $(PROF) - CCLINK?=-ldl -lnsl -lsocket -lm -lpthread + CCLINK?=-ldl -lnsl -lsocket LDFLAGS?=-L. DYLIBSUFFIX=so STLIBSUFFIX=a @@ -30,7 +30,7 @@ ifeq ($(uname_S),SunOS) else ifeq ($(uname_S),Darwin) CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) - CCLINK?=-lm -pthread + CCLINK?= LDFLAGS?=-L. OBJARCH?=-arch i386 -arch x86_64 DYLIBSUFFIX=dylib @@ -44,7 +44,7 @@ ifeq ($(uname_S),Darwin) INSTALL= cp -a else CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) - CCLINK?=-lm -pthread + CCLINK?= LDFLAGS?=-L. DYLIBSUFFIX=so STLIBSUFFIX=a -- cgit v1.2.3 From 2cd46456c08b85d88ee00404ec6349703b3053b7 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:00:42 +0200 Subject: Add myself to Makefile license --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bf64832..271d11b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ # Hiredis Makefile -# Copyright (C) 2010 Salvatore Sanfilippo +# Copyright (C) 2010-2011 Salvatore Sanfilippo +# Copyright (C) 2010-2011 Pieter Noordhuis # This file is released under the BSD license, see the COPYING file OBJ=net.o hiredis.o sds.o async.o -- cgit v1.2.3 From 367ac44ac1582c837e7a13031d9bfce0446bc415 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:02:42 +0200 Subject: Remove private feature macros for Solaris from compiler flags --- Makefile | 2 +- async.c | 1 + test.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 271d11b..eb325e1 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ 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) - CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -D__EXTENSIONS__ -D_XPG6 $(ARCH) $(PROF) + CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W $(ARCH) $(PROF) CCLINK?=-ldl -lnsl -lsocket LDFLAGS?=-L. DYLIBSUFFIX=so diff --git a/async.c b/async.c index ed6c530..cbbfb6d 100644 --- a/async.c +++ b/async.c @@ -29,6 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "fmacros.h" #include #include #include diff --git a/test.c b/test.c index 3eef05d..19f9ad1 100644 --- a/test.c +++ b/test.c @@ -1,3 +1,4 @@ +#include "fmacros.h" #include #include #include -- cgit v1.2.3 From 2ccb6e58ef9b049d57ead38e2adef8093c10339d Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:09:59 +0200 Subject: Merge CCLINK with LDFLAGS --- Makefile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index eb325e1..806f6ff 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,7 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') OPTIMIZATION?=-O3 ifeq ($(uname_S),SunOS) CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W $(ARCH) $(PROF) - CCLINK?=-ldl -lnsl -lsocket - LDFLAGS?=-L. + LDFLAGS?=-ldl -lnsl -lsocket DYLIBSUFFIX=so STLIBSUFFIX=a DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) @@ -31,8 +30,6 @@ ifeq ($(uname_S),SunOS) else ifeq ($(uname_S),Darwin) CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) - CCLINK?= - LDFLAGS?=-L. OBJARCH?=-arch i386 -arch x86_64 DYLIBSUFFIX=dylib STLIBSUFFIX=a @@ -45,8 +42,6 @@ ifeq ($(uname_S),Darwin) INSTALL= cp -a else CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) - CCLINK?= - LDFLAGS?=-L. DYLIBSUFFIX=so STLIBSUFFIX=a DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) @@ -59,7 +54,6 @@ else endif endif -CCOPT= $(CFLAGS) $(CCLINK) DEBUG?= -g -ggdb PREFIX?=/usr/local @@ -89,10 +83,10 @@ static: $(STLIBNAME) # Binaries: hiredis-example-libevent: example-libevent.c adapters/libevent.h $(STLIBNAME) - $(CC) -o $@ $(CCOPT) $(DEBUG) $(LDFLAGS) -levent example-libevent.c $(STLIBNAME) + $(CC) -o $@ $(CFLAGS) $(DEBUG) $(LDFLAGS) -levent example-libevent.c $(STLIBNAME) hiredis-example-libev: example-libev.c adapters/libev.h $(STLIBNAME) - $(CC) -o $@ $(CCOPT) $(DEBUG) $(LDFLAGS) -lev example-libev.c $(STLIBNAME) + $(CC) -o $@ $(CFLAGS) $(DEBUG) $(LDFLAGS) -lev example-libev.c $(STLIBNAME) ifndef AE_DIR hiredis-example-ae: @@ -100,11 +94,11 @@ hiredis-example-ae: @false else hiredis-example-ae: example-ae.c adapters/ae.h $(STLIBNAME) - $(CC) -o $@ $(CCOPT) $(DEBUG) -I$(AE_DIR) $(LDFLAGS) $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o example-ae.c $(STLIBNAME) + $(CC) -o $@ $(CFLAGS) $(DEBUG) -I$(AE_DIR) $(LDFLAGS) $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o example-ae.c $(STLIBNAME) endif hiredis-%: %.o $(STLIBNAME) - $(CC) -o $@ $(CCOPT) $(DEBUG) $(LDFLAGS) $< $(STLIBNAME) + $(CC) -o $@ $(CFLAGS) $(DEBUG) $(LDFLAGS) $< $(STLIBNAME) test: hiredis-test ./hiredis-test -- cgit v1.2.3 From 93329c467ef073b35cb6b4a83ab3f3739f9e29f3 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:19:59 +0200 Subject: Library variables may not be overridden --- Makefile | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 806f6ff..d3fc732 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,12 @@ ifeq ($(uname_S),SunOS) LDFLAGS?=-ldl -lnsl -lsocket DYLIBSUFFIX=so STLIBSUFFIX=a - DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) - DYLIB_MAJOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) - DYLIBNAME?=$(LIBNAME).$(DYLIBSUFFIX) - DYLIB_MAKE_CMD?=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) - STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX) - STLIB_MAKE_CMD?=ar rcs $(STLIBNAME) + DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) + DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) + DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) + DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) + STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) + STLIB_MAKE_CMD=ar rcs $(STLIBNAME) INSTALL= cp -r else ifeq ($(uname_S),Darwin) @@ -33,23 +33,23 @@ ifeq ($(uname_S),Darwin) OBJARCH?=-arch i386 -arch x86_64 DYLIBSUFFIX=dylib STLIBSUFFIX=a - DYLIB_MINOR_NAME?=$(LIBNAME).$(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(DYLIBSUFFIX) - DYLIB_MAJOR_NAME?=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX) - DYLIBNAME?=$(LIBNAME).$(DYLIBSUFFIX) - DYLIB_MAKE_CMD?=libtool -dynamic -o $(DYLIBNAME) -install_name $(DYLIB_MINOR_NAME) -lm $(DEBUG) - - STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX) - STLIB_MAKE_CMD?=libtool -static -o $(STLIBNAME) - + DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(DYLIBSUFFIX) + DYLIB_MAJOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX) + DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) + DYLIB_MAKE_CMD=libtool -dynamic -o $(DYLIBNAME) -install_name $(DYLIB_MINOR_NAME) -lm $(DEBUG) - + STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) + STLIB_MAKE_CMD=libtool -static -o $(STLIBNAME) - INSTALL= cp -a else CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) DYLIBSUFFIX=so STLIBSUFFIX=a - DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) - DYLIB_MAJOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) - DYLIBNAME?=$(LIBNAME).$(DYLIBSUFFIX) - DYLIB_MAKE_CMD?=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) - STLIBNAME?=$(LIBNAME).$(STLIBSUFFIX) - STLIB_MAKE_CMD?=ar rcs $(STLIBNAME) + DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) + DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) + DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) + DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) + STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) + STLIB_MAKE_CMD=ar rcs $(STLIBNAME) INSTALL= cp -a endif endif -- cgit v1.2.3 From b2bf7ba8c0dbe9761910107ad9dedf77d150d4e8 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:21:39 +0200 Subject: Move defaults outside if block --- Makefile | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index d3fc732..9f7a715 100644 --- a/Makefile +++ b/Makefile @@ -12,24 +12,29 @@ 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') +OPTIMIZATION?=-O3 +CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) +LDFLAGS= +DEBUG?= -g -ggdb + +DYLIBSUFFIX=so +STLIBSUFFIX=a +DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) +DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) +DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) +DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) +STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) +STLIB_MAKE_CMD=ar rcs $(STLIBNAME) +INSTALL= cp -a uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') -OPTIMIZATION?=-O3 ifeq ($(uname_S),SunOS) - CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W $(ARCH) $(PROF) LDFLAGS?=-ldl -lnsl -lsocket - DYLIBSUFFIX=so - STLIBSUFFIX=a - DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) - DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) - DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) - STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) STLIB_MAKE_CMD=ar rcs $(STLIBNAME) INSTALL= cp -r -else +endif ifeq ($(uname_S),Darwin) - CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) OBJARCH?=-arch i386 -arch x86_64 DYLIBSUFFIX=dylib STLIBSUFFIX=a @@ -39,23 +44,8 @@ ifeq ($(uname_S),Darwin) DYLIB_MAKE_CMD=libtool -dynamic -o $(DYLIBNAME) -install_name $(DYLIB_MINOR_NAME) -lm $(DEBUG) - STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) STLIB_MAKE_CMD=libtool -static -o $(STLIBNAME) - - INSTALL= cp -a -else - CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) - DYLIBSUFFIX=so - STLIBSUFFIX=a - DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) - DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR) - DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) - DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) - STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) - STLIB_MAKE_CMD=ar rcs $(STLIBNAME) - INSTALL= cp -a -endif endif -DEBUG?= -g -ggdb - PREFIX?=/usr/local INCLUDE_PATH?=include/hiredis LIBRARY_PATH?=lib -- cgit v1.2.3 From 461110e809f4d313832a9420db06d92b1f559372 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:28:33 +0200 Subject: Move path variables closer to install target --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9f7a715..ff827ca 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,6 @@ DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX) DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) STLIBNAME=$(LIBNAME).$(STLIBSUFFIX) STLIB_MAKE_CMD=ar rcs $(STLIBNAME) -INSTALL= cp -a uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') ifeq ($(uname_S),SunOS) @@ -46,12 +45,6 @@ ifeq ($(uname_S),Darwin) STLIB_MAKE_CMD=libtool -static -o $(STLIBNAME) - endif -PREFIX?=/usr/local -INCLUDE_PATH?=include/hiredis -LIBRARY_PATH?=lib -INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH) -INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH) - all: $(DYLIBNAME) $(BINS) # Deps (use make dep to generate this) @@ -114,6 +107,19 @@ clean: dep: $(CC) -MM *.c +# Installation related variables and target +PREFIX?=/usr/local +INCLUDE_PATH?=include/hiredis +LIBRARY_PATH?=lib +INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH) +INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH) + +ifeq ($(uname_S),SunOS) + INSTALL?= cp -r +endif + +INSTALL?= cp -a + install: $(DYLIBNAME) $(STLIBNAME) mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) $(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH) @@ -122,7 +128,6 @@ install: $(DYLIBNAME) $(STLIBNAME) cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME) $(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH) - 32bit: @echo "" @echo "WARNING: if it fails under Linux you probably need to install libc6-dev-i386" -- cgit v1.2.3 From 722c142801db995e682f6b60c3f83c18f03de82f Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:42:55 +0200 Subject: Disallow overriding CFLAGS and LDFLAGS --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ff827ca..03b079a 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ 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') OPTIMIZATION?=-O3 -CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) +CFLAGS=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) LDFLAGS= DEBUG?= -g -ggdb @@ -28,7 +28,7 @@ STLIB_MAKE_CMD=ar rcs $(STLIBNAME) uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') ifeq ($(uname_S),SunOS) - LDFLAGS?=-ldl -lnsl -lsocket + LDFLAGS=-ldl -lnsl -lsocket DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) STLIB_MAKE_CMD=ar rcs $(STLIBNAME) INSTALL= cp -r -- cgit v1.2.3 From 7a9127c938f37a5f76506927038fb347bb608420 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Sat, 18 Jun 2011 16:46:18 +0200 Subject: Move redirection around --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 03b079a..939b12d 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ 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') +CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc') OPTIMIZATION?=-O3 CFLAGS=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) LDFLAGS= -- cgit v1.2.3