cygwin 编译redis

来源:互联网 发布:门诊收费系统源码 编辑:程序博客网 时间:2024/05/16 17:41

1.修改/usr/include/netinet/tcp.h文件

在后边添加这几个宏:(注意:这里是添加,我一开始在这个文件里查找这几个变量,企图修改)

#ifndef TCP_KEEPIDLE#define TCP_KEEPIDLE 4/* Start keeplives after this period */#endif#ifndef TCP_KEEPINTVL#define TCP_KEEPINTVL 5/* Interval between keepalives */#endif#ifndef TCP_KEEPCNT#define TCP_KEEPCNT 6/* Number of keepalives before death */#endif

2.修改 edis-3.0.1srcfmacros.h 文件(这个不是很重要,省略也可以)

在前面加入这一个宏:

/* Cygwin Fix */   #ifdef __CYGWIN__   #ifndef SA_ONSTACK   #define SA_ONSTACK 0x08000000   #endif   #endif


3.修改redis-3.0.1srcMakefile文件

73行注释掉:  # FINAL_LDFLAGS+= -rdynamic

4.cd redis-3.0.1deps


5. make lua hiredis linenoise


6. cd ..


7. make && make install


8. 测试:

 (redis-server.exe&) ; redis-cli.exe