From 6d555bf4c9e9efae66d1844347d20fbf305784fa Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Mon, 31 Aug 2009 11:08:25 -0700 Subject: [PATCH] Link against libs3 for access to Amazon S3. libs3 is licensed as GPLv3. --- Makefile | 3 ++- nfs3/Makefile | 3 ++- nfs3/nfsd.c | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 54aedc9..8d986f4 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +LIBS3_PATH=$(HOME)/scratch/libs3-1.4/build PACKAGES=glib-2.0 gthread-2.0 DEBUG=-g CFLAGS=-O -std=gnu99 -Wall -D_FILE_OFFSET_BITS=64 $(DEBUG) \ @@ -16,7 +17,7 @@ bluesky.a : $(OBJS) ranlib $@ bluesky : main.o bluesky.a - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -o $@ $^ -Wl,-rpath=$(LIBS3_PATH)/lib -L$(LIBS3_PATH)/lib -ls3 clean : rm -f $(OBJS) bluesky diff --git a/nfs3/Makefile b/nfs3/Makefile index 1a5f040..3b09716 100644 --- a/nfs3/Makefile +++ b/nfs3/Makefile @@ -1,3 +1,4 @@ +LIBS3_PATH=$(HOME)/scratch/libs3-1.4/build PACKAGES=glib-2.0 gthread-2.0 DEBUG=-g CFLAGS=-Wall -D_FILE_OFFSET_BITS=64 $(DEBUG) -I.. \ @@ -8,7 +9,7 @@ SRCS=nfsd.c rpc.c mount.c nfs3.c mount_prot_xdr.c nfs3_prot_xdr.c OBJS=$(SRCS:.c=.o) nfsproxy : $(OBJS) - $(CC) $(LDFLAGS) -o $@ $^ ../bluesky.a + $(CC) $(LDFLAGS) -o $@ $^ ../bluesky.a -Wl,-rpath=$(LIBS3_PATH)/lib -L$(LIBS3_PATH)/lib -ls3 clean : rm -f $(OBJS) nfsproxy diff --git a/nfs3/nfsd.c b/nfs3/nfsd.c index abd1050..f33a945 100644 --- a/nfs3/nfsd.c +++ b/nfs3/nfsd.c @@ -19,6 +19,7 @@ #include #include +#include "libs3.h" #include "bluesky.h" void register_rpc(); @@ -30,6 +31,8 @@ int main(int argc, char *argv[]) g_thread_init(NULL); register_rpc(); + S3_initialize(NULL, S3_INIT_ALL); + fs = bluesky_new_fs("export"); BlueSkyInode *root; -- 2.20.1