Win7-64位 Cygwin编译Redis

本文档详细介绍了如何在Cygwin环境下编译并安装Redis 2.8.19版本的具体步骤,包括必要的源代码下载、配置文件调整、依赖项更改以及编译安装过程。

下载:

$ 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


转载于:https://my.oschina.net/enjoymore/blog/424509

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值