new package tgt
[openwrt/svn-archive/archive.git] / net / tgt / patches / 020-usr_Makefile.patch
1 --- tgt-1.0.46.orig/usr/Makefile 2014-04-06 09:55:49.000000000 +0300
2 +++ tgt-1.0.46/usr/Makefile 2014-04-06 09:57:04.000000000 +0300
3 @@ -1,13 +1,13 @@
4 sbindir ?= $(PREFIX)/sbin
5 libdir ?= $(PREFIX)/lib/tgt
6
7 -ifneq ($(shell test -e /usr/include/linux/signalfd.h && echo 1),)
8 +#ifneq ($(shell test -e /usr/include/linux/signalfd.h && echo 1),)
9 CFLAGS += -DUSE_SIGNALFD
10 -endif
11 +#endif
12
13 -ifneq ($(shell test -e /usr/include/sys/timerfd.h && echo 1),)
14 +#ifneq ($(shell test -e /usr/include/sys/timerfd.h && echo 1),)
15 CFLAGS += -DUSE_TIMERFD
16 -endif
17 +#endif
18
19 TGTD_OBJS += $(addprefix iscsi/, conn.o param.o session.o \
20 iscsid.o target.o chap.o sha1.o md5.o transport.o iscsi_tcp.o \
21 @@ -21,8 +21,9 @@
22 MODULES += bs_glfs.so
23 endif
24
25 -ifneq ($(shell test -e /usr/include/sys/eventfd.h && test -e /usr/include/libaio.h && echo 1),)
26 -CFLAGS += -DUSE_EVENTFD
27 +#ifneq ($(shell test -e /usr/include/sys/eventfd.h && test -e $(STAGING_DIR)/usr/include/libaio.h && echo 1),)
28 +ifneq ((test -e $(STAGING_DIR)/usr/include/libaio.h && echo 1),)
29 +CFLAGS += -DUSE_EVENTFD -I$(STAGING_DIR)/usr/include/
30 TGTD_OBJS += bs_aio.o
31 LIBS += -laio
32 endif
33 @@ -47,7 +48,7 @@
34
35 LIBS += -lpthread -ldl
36
37 -PROGRAMS += tgtd tgtadm tgtimg
38 +PROGRAMS += tgtd tgtadm
39 TGTD_OBJS += tgtd.o mgmt.o target.o scsi.o log.o driver.o util.o work.o \
40 concat_buf.o parser.o spc.o sbc.o mmc.o osd.o scc.o smc.o \
41 ssc.o libssc.o bs_rdwr.o bs_ssc.o \
42 @@ -74,14 +75,8 @@
43
44 -include $(TGTADM_DEP)
45
46 -TGTIMG_OBJS = tgtimg.o libssc.o libcrc32c.o
47 TGTIMG_DEP = $(TGTIMG_OBJS:.o=.d)
48
49 -tgtimg: $(TGTIMG_OBJS)
50 - $(CC) $^ -o $@
51 -
52 --include $(TGTIMG_DEP)
53 -
54 %.o: %.c
55 $(CC) -c $(CFLAGS) $*.c -o $*.o
56 @$(CC) -MM $(CFLAGS) -MF $*.d -MT $*.o $*.c