diff --git a/osd-target/Makefile b/osd-target/Makefile index da67ee8..b48f905 100644 --- a/osd-target/Makefile +++ b/osd-target/Makefile @@ -10,7 +10,7 @@ DEP := .depend OBJ := $(SRC:.c=.o) TESTDIR := ./tests/ UTILDIR := ../osd-util/ -STGTDIR := ../stgt/ +STGTDIR := ../tgt/ INITDIR := ../osd-initiator/ OSDTARGETLIB := libosdtgt.a @@ -19,7 +19,14 @@ UTILLIB := ../osd-util/libosdutil.a IB_HW_OF_LIBS= -L/usr/local/openib-iser/lib -LIBS := -lm -lcrypto -lsqlite3 -laio -lavahi-core -lavahi-common \ +UNAME= $(shell uname) +ifeq (FreeBSD,$(UNAME)) +LIBS += -L/usr/local/lib/ +CFLAGS += -I/usr/local/include -I$(STGTDIR)/usr/bsd -I$(STGTDIR)/usr +CFLAGS += -D__MAKE_BSD_BUILD__ +endif + +LIBS += -lm -lcrypto -lsqlite3 -laio -lavahi-core -lavahi-common \ $(IB_HW_OF_LIBS) -libverbs -lrdmacm -include ../Makedefs @@ -32,7 +39,7 @@ COPTS += -fPIC -foptimize-sibling-calls -D_GNU_SOURCE CWARN := -Wall -W -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual \ -Wbad-function-cast -Wundef -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -CFLAGS := $(COPTS) $(CWARN) -I.. -Wno-unused -I../osd-util +CFLAGS += $(COPTS) $(CWARN) -I.. -Wno-unused -I../osd-util ifeq ($(PVFS_OSD_INTEGRATED),1) CFLAGS += -DPVFS_OSD_INTEGRATED @@ -69,7 +76,7 @@ $(STGTLIB): STGT $(UTILLIB): UTIL make -C $(UTILDIR) -%.o: %.c +%.o: %.c Makefile $(CC) $(CFLAGS) -c $< -o $@ osd-schema.c: osd.schema diff --git a/osd-target/osd.c b/osd-target/osd.c index 08f242f..ea0debb 100644 --- a/osd-target/osd.c +++ b/osd-target/osd.c @@ -27,6 +27,8 @@ #include #include +#include + #include "osd.h" #include "osd-util/osd-defs.h" #include "target-sense.h" @@ -39,6 +41,14 @@ #include "osd-util/osd-sense.h" #include "list-entry.h" +#ifdef __MAKE_BSD_BUILD__ +static int os_sync_file_range(int fd, __off64_t offset, __off64_t bytes, + unsigned int flags) +{ + return fsync(fd); +} +#endif + struct incits_page_id { const char root_dir_page[40]; const char root_info_page[40];