benluteijn / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Patch for compiling Redis on OS X Tiger #96

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I have created a small patch to compile Redis on Mac OS X Tiger (10.4).

Note: This disables backtrace feature which is only available in OS X 10.5+

To apply: 
cd redis-1.02
patch -p1 < ../tiger-nobacktrace.patch
make

File: tiger-nobacktrace.patch

diff -urN redis-1.02/Makefile redis-1.02.new/Makefile
--- redis-1.02/Makefile 2009-09-03 04:43:43.000000000 -0400
+++ redis-1.02.new/Makefile     2009-11-15 03:07:56.000000000 -0500
@@ -2,7 +2,7 @@
 # Copyright (C) 2009 Salvatore Sanfilippo <antirez at gmail dot com>
 # This file is released under the BSD license, see the COPYING file

-DEBUG?= -g -rdynamic -ggdb 
+DEBUG?= -g -ggdb 
 CFLAGS?= -std=c99 -pedantic -O2 -Wall -W
 CCOPT= $(CFLAGS)

diff -urN redis-1.02/config.h redis-1.02.new/config.h
--- redis-1.02/config.h 2009-09-03 04:43:43.000000000 -0400
+++ redis-1.02.new/config.h     2009-11-15 03:08:35.000000000 -0500
@@ -13,7 +13,7 @@
 #endif

 /* define redis_fstat to fstat or fstat64() */
-#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
+#if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_5)
 #define redis_fstat fstat64
 #define redis_stat stat64
 #else
@@ -22,7 +22,7 @@
 #endif

 /* test for backtrace() */
-#if defined(__APPLE__) || defined(__linux__)
+#if defined(MAC_OS_X_VERSION_10_5) || defined(__linux__)
 #define HAVE_BACKTRACE 1
 #endif

Original issue reported on code.google.com by youwanta...@gmail.com on 15 Nov 2009 at 8:16

GoogleCodeExporter commented 9 years ago
I changed it to MAC_OS_X_VERSION_10_5 because fstat64 exists on MacBook with OS 
X Leopard (Intel Core 2 
Duo)... it compiles well.

This patch also compiles well on my MacBook with OS X Tiger (Intel Core Duo).

Original comment by youwanta...@gmail.com on 15 Nov 2009 at 8:27

GoogleCodeExporter commented 9 years ago
How does one go about using this patch?

Original comment by james.sl...@gmail.com on 14 Jan 2010 at 2:21

GoogleCodeExporter commented 9 years ago
james: you can use it without problems if you are dealing with databases <= 2GB 
(or 
maybe 4GB, not sure about this, don't remember of off_t is unsigned or signed).

If you are not using replication you are probably safe anyway (even with bigger 
databases).

Original comment by anti...@gmail.com on 14 Jan 2010 at 2:49