I spoke too soon.. the patch is slightly larger

it mainly adds the
#include "config.h"
line to various files.
the 'biggies' are
:- the changes around BTRFS.. it stubs a lot of functionality there, as the include files to build it are not present. :- the changing of lseek64 to lseek in ebofs. lseek is 64-bit by default on OS/X.

I can verify it generates log files now.

regards
Ian


Sage Weil wrote:
On Mon, 4 Aug 2008, Ian Holsman wrote:
at the moment I have no idea on if ceph would work on a mac or not, but
it compiles with the following minor tweaks. I'm sure there is a
autoconf way of doing  as well... but I don't know it.

It should mostly work, at least well enough for testing or development.

Did you try building without malloc.h? You may not actually need it at all..

--- a/src/include/page.h
+++ b/src/include/page.h
@@ -6,9 +6,14 @@ extern unsigned _page_size;
extern unsigned long _page_mask;
extern unsigned _page_shift;

+#if defined(__APPLE__)
+/* These are defined in mach/XXXX/vm_param.h  */
+
+#else
#define PAGE_SIZE _page_size
#define PAGE_MASK _page_mask
#define PAGE_SHIFT _page_shift
+#endif

Here, unconditionally doing

#undef PAGE_SIZE
#undef PAGE_MASK
#undef PAGE_SHIFT

before the #define's should work. The _page_size etc values are set using sysconf, the preferred portable way to get those values.

If that works for you, I'll commit it!

sage


/*
#define PAGE_SIZE 4096



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ceph-devel mailing list
Ceph-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ceph-devel




diff --git a/src/client/Client.cc b/src/client/Client.cc
index d4d6401..08a050e 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -28,6 +28,7 @@
 #include <iostream>
 using namespace std;
 
+#include "config.h"
 
 // ceph stuff
 #include "Client.h"
diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc
index 0d65470..9afd3cb 100644
--- a/src/client/SyntheticClient.cc
+++ b/src/client/SyntheticClient.cc
@@ -17,6 +17,7 @@
 using namespace std;
 
 
+#include "config.h"
 #include "SyntheticClient.h"
 #include "osdc/Objecter.h"
 #include "osdc/Filer.h"
diff --git a/src/common/Clock.cc b/src/common/Clock.cc
index 8b07f6d..a41fdc1 100644
--- a/src/common/Clock.cc
+++ b/src/common/Clock.cc
@@ -13,6 +13,7 @@
  */
 
 
+#include "config.h"
 #include "Clock.h"
 
 // public
diff --git a/src/ebofs/Allocator.cc b/src/ebofs/Allocator.cc
index 7e4afea..641cb91 100644
--- a/src/ebofs/Allocator.cc
+++ b/src/ebofs/Allocator.cc
@@ -14,6 +14,7 @@
 
 
 
+#include "config.h"
 #include "Allocator.h"
 #include "Ebofs.h"
 
diff --git a/src/ebofs/BlockDevice.cc b/src/ebofs/BlockDevice.cc
index aee22b2..7e6f250 100644
--- a/src/ebofs/BlockDevice.cc
+++ b/src/ebofs/BlockDevice.cc
@@ -12,9 +12,9 @@
  * 
  */
 
+#include "config.h"
 #include "BlockDevice.h"
 
-#include "config.h"
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -34,6 +34,9 @@
 #ifndef __CYGWIN__
 #ifndef DARWIN
 #include <linux/fs.h>
+#else
+/* lseek works on 64-bit offsets on OS/X */
+#define lseek64 lseek
 #endif
 #endif
 
diff --git a/src/include/buffer.h b/src/include/buffer.h
index caa0896..4435fd2 100644
--- a/src/include/buffer.h
+++ b/src/include/buffer.h
@@ -17,7 +17,22 @@
 
 #define _XOPEN_SOURCE 600
 #include <stdlib.h>
+#ifdef DARWIN
+
+#ifndef MAP_ANON
+#define MAP_ANON 0x1000
+#endif
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 0x100000
+void   *valloc(size_t);
+#endif
+
+
+
+#else
+
 #include <malloc.h>
+#endif
 #include <stdint.h>
 #include <assert.h>
 #include <string.h>
diff --git a/src/mds/LogEvent.cc b/src/mds/LogEvent.cc
index 2492036..d1ccb46 100644
--- a/src/mds/LogEvent.cc
+++ b/src/mds/LogEvent.cc
@@ -12,6 +12,7 @@
  * 
  */
 
+#include "config.h"
 #include "LogEvent.h"
 
 #include "MDS.h"
diff --git a/src/mds/journal.cc b/src/mds/journal.cc
index 06e7432..1d257cd 100644
--- a/src/mds/journal.cc
+++ b/src/mds/journal.cc
@@ -12,6 +12,7 @@
  * 
  */
 
+#include "config.h"
 #include "events/EString.h"
 #include "events/ESubtreeMap.h"
 #include "events/ESession.h"
diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc
index 225e57b..b6cfd1d 100644
--- a/src/os/FileJournal.cc
+++ b/src/os/FileJournal.cc
@@ -12,6 +12,7 @@
  * 
  */
 
+#include "config.h"
 #include "FileJournal.h"
 
 #include <stdio.h>
@@ -20,7 +21,6 @@
 #include <fcntl.h>
 
 
-#include "config.h"
 
 #define dout(x) if (x <= g_conf.debug_journal) *_dout << dbeginl << 
g_clock.now() << " journal "
 #define derr(x) if (x <= g_conf.debug_journal) *_derr << dbeginl << 
g_clock.now() << " journal "
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 84820bc..5988ad1 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -445,6 +445,9 @@ int FileStore::umount()
 
 int FileStore::transaction_start(int len)
 {
+#ifdef DARWIN
+  return 0;
+#else
   if (!btrfs || !btrfs_trans_start_end)
     return 0;
 
@@ -477,10 +480,14 @@ int FileStore::transaction_start(int len)
   ::mknod(fn, 0644, 0);
 
   return fd;
+#endif /* DARWIN */
 }
 
 void FileStore::transaction_end(int fd)
 {
+#ifdef DARWIN
+  return;
+#else
   if (!btrfs || !btrfs_trans_start_end)
     return;
 
@@ -498,10 +505,15 @@ void FileStore::transaction_end(int fd)
     _handle_signal(sig_pending);
   }
   sig_lock.Unlock();
+#endif /* DARWIN */
 }
 
 unsigned FileStore::apply_transaction(Transaction &t, Context *onsafe)
 {
+#ifdef DARWIN
+  return ObjectStore::apply_transaction(t, onsafe);
+#else
+
   // no btrfs transaction support?
   // or, use trans start/end ioctls?
   if (!btrfs || btrfs_trans_start_end)
@@ -894,6 +906,7 @@ unsigned FileStore::apply_transaction(Transaction &t, 
Context *onsafe)
     delete onsafe;
 
   return r;
+#endif /* DARWIN */
 }
 
 
@@ -1048,9 +1061,13 @@ int FileStore::clone(coll_t cid, pobject_t oldoid, 
pobject_t newoid)
   if (n < 0)
       return -errno;
   int r = 0;
+#ifndef DARWIN
   if (btrfs)
     r = ::ioctl(n, BTRFS_IOC_CLONE, o);
   else {
+#else 
+    {
+#endif /* DARWIN */
     struct stat st;
     ::fstat(o, &st);
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ceph-devel mailing list
Ceph-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ceph-devel

Reply via email to