下载:
$ wget http://download.redis.io/releases/redis-2.8.19.tar.gz
$ tar zxf redis-2.8.19.tar.gz
修改redis.h
$ vi src/redis.h
第一个#define前增加以下代码
/* Cygwin Fix */
#ifdef __CYGWIN__
#ifndef SA_ONSTACK
#define SA_ONSTACK 0x08000000
#endif
#endif
修改deps/hiredis/net.c
在最后一个#include后添加下面代码:
/* Cygwin Fix */
#ifdef __CYGWIN__
#define TCP_KEEPCNT 8
#define TCP_KEEPINTVL 150
#define TCP_KEEPIDLE 14400
#endif
修改src/Makefile
找到注释:# All the other OSes (notably Linux),将下面的两行代码注释掉
# All the other OSes (notably Linux)
# FINAL_LDFLAGS+= -rdynamic
# FINAL_LIBS+= -pthread
编译:
$ cd redis-2.8.19
$ make && make install