[PATCH 15/15] tgt: usr/Makefile BSD build Support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If compiling under FreeBSD:
- Add the bsd/epoll.o epoll emulation
- Add -Ibsd/ to INCLUDES for overide and/or emulation
  of Linux specific APIs.
- Use bsd/os.o instead of linux/os.o
- bs_aio.o and bs_sg.o are not available under BSD

Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx>
---
 usr/Makefile |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/usr/Makefile b/usr/Makefile
index 03b3c90..f4e3819 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -4,6 +4,8 @@ EXTRAVERSION = $(if $(shell git-show-ref 2>/dev/null),-git-$(shell git-show-ref
 mandir = /usr/share/man
 docdir = /usr/share/doc/tgt
 
+UNAME ?= $(shell uname)
+
 ifneq ($(IBMVIO),)
 CFLAGS += -DIBMVIO -DUSE_KERNEL
 TGTD_OBJS += $(addprefix ibmvio/, ibmvio.o)
@@ -15,7 +17,10 @@ CFLAGS += -DISCSI
 TGTD_OBJS += $(addprefix iscsi/, conn.o param.o session.o \
 		iscsid.o target.o chap.o transport.o iscsi_tcp.o \
 		isns.o)
-TGTD_OBJS += bs_rdwr.o bs_aio.o
+TGTD_OBJS += bs_rdwr.o
+ifneq (FreeBSD,$(UNAME))
+TGTD_OBJS += bs_aio.o
+endif
 
 LIBS += -lcrypto
 ifneq ($(ISCSI_RDMA),)
@@ -64,9 +69,17 @@ SCRIPTS += ../scripts/tgt-setup-lun ../scripts/tgt-admin
 TGTD_OBJS += tgtd.o mgmt.o target.o scsi.o log.o driver.o util.o work.o \
 		parser.o spc.o sbc.o mmc.o osd.o scc.o smc.o \
 		ssc.o bs_ssc.o libssc.o \
-		bs_null.o bs_sg.o bs.o libcrc32c.o
-
-TGTD_OBJS += linux/os.o
+		bs_null.o bs.o libcrc32c.o
+
+ifneq (FreeBSD,$(UNAME))
+	TGTD_OBJS += bs_sg.o
+	TGTD_OBJS += linux/os.o
+else
+	CFLAGS += -D__MAKE_TGT_ON_BSD__
+	CFLAGS += -Ibsd/
+	TGTD_OBJS += bsd/epoll.o
+	TGTD_OBJS += bsd/os.o
+endif
 
 MANPAGES = ../doc/manpages/tgtadm.8 ../doc/manpages/tgt-admin.8 \
 		../doc/manpages/tgt-setup-lun.8
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux