diff --git a/deps/hiredis/fmacros.h b/deps/hiredis/fmacros.h index 9e5fec0ceb136fe42785a5b1365554fc61b9d35b..6a41aa1761bf7534e381e23b6fc446a5625f6149 100644 --- a/deps/hiredis/fmacros.h +++ b/deps/hiredis/fmacros.h @@ -5,6 +5,10 @@ #define _BSD_SOURCE #endif +#if defined(_AIX) +#define _ALL_SOURCE +#endif + #if defined(__sun__) #define _POSIX_C_SOURCE 200112L #elif defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) diff --git a/deps/hiredis/net.h b/deps/hiredis/net.h index 5e742f5779a5d95a8686b8d8431c1021ec5d2376..3763ab089daf08bbb3f4f076e7aa68c6dcf1cb62 100644 --- a/deps/hiredis/net.h +++ b/deps/hiredis/net.h @@ -35,7 +35,7 @@ #include "hiredis.h" -#if defined(__sun) +#if defined(__sun) || defined(_AIX) #define AF_LOCAL AF_UNIX #endif diff --git a/src/Makefile b/src/Makefile index 4ccc6d367a8a34f37d0ac88b2b9057482ea96b22..901104b2738538bf1d868fb3f361754bc8b6d3a2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,13 +62,19 @@ ifeq ($(uname_S),SunOS) else ifeq ($(uname_S),Darwin) # Darwin (nothing to do) +else +ifeq ($(uname_S),AIX) + # AIX + FINAL_LDFLAGS+= -Wl,-bexpall + FINAL_LIBS+= -pthread -lcrypt -lbsd + else # All the other OSes (notably Linux) FINAL_LDFLAGS+= -rdynamic FINAL_LIBS+= -pthread endif endif - +endif # Include paths to dependencies FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src diff --git a/src/anet.h b/src/anet.h index c4659cd35951d616b9860bc77148c02ad4d2291a..5191c4b69e5984a07a4a173cef6a28236815c2ce 100644 --- a/src/anet.h +++ b/src/anet.h @@ -39,10 +39,14 @@ #define ANET_NONE 0 #define ANET_IP_ONLY (1<<0) -#if defined(__sun) +#if defined(__sun) || defined(_AIX) #define AF_LOCAL AF_UNIX #endif +#ifdef _AIX +#undef ip_len +#endif + int anetTcpConnect(char *err, char *addr, int port); int anetTcpNonBlockConnect(char *err, char *addr, int port); int anetTcpNonBlockBindConnect(char *err, char *addr, int port, char *source_addr); diff --git a/src/fmacros.h b/src/fmacros.h index 44e378a685821705f110c8693bb7ec3141b6f545..e49735ce5230b3433390c74c1df141a5db7a1871 100644 --- a/src/fmacros.h +++ b/src/fmacros.h @@ -36,6 +36,10 @@ #define _GNU_SOURCE #endif +#if defined(_AIX) +#define _ALL_SOURCE +#endif + #if defined(__linux__) || defined(__OpenBSD__) #define _XOPEN_SOURCE 700 /* diff --git a/src/redis.h b/src/redis.h index d2b00bff5524bb983ce28611a72d77dc9639d37f..b049dbee81a07b22d2d7881eaac8b1c159f0f9af 100644 --- a/src/redis.h +++ b/src/redis.h @@ -626,6 +626,11 @@ typedef struct redisOpArray { struct clusterState; +#ifdef _AIX +#undef hz +#endif + + struct redisServer { /* General */ pid_t pid; /* Main process pid. */