????
| Current Path : /usr/src/snapapi26-0.7.130/ |
| Current File : //usr/src/snapapi26-0.7.130/Makefile |
SNAPAPI_FLAGS := $(shell \
grep -q freeze_bdev $(srctree)/include/linux/buffer_head.h \
$(srctree)/include/linux/fs.h && \
echo -DHAVE_FREEZE_BDEV)
ifeq ($(notdir $(wildcard $(srctree)/include/linux/config.h)),config.h)
SNAPAPI_FLAGS += -DHAVE_LINUX_CONFIG
endif
ifeq ($(notdir $(wildcard $(srctree)/include/linux/autoconf.h)),autoconf.h)
SNAPAPI_FLAGS += -DHAVE_LINUX_AUTOCONF
endif
ifeq ($(notdir $(wildcard $(srctree)/include/generated/autoconf.h)),autoconf.h)
SNAPAPI_FLAGS += -DHAVE_GENERATED_AUTOCONF
endif
ifeq ($(notdir $(wildcard $(srctree)/include/linux/ioctl32.h)),ioctl32.h)
SNAPAPI_FLAGS += -DHAVE_IOCTL32_CONVERSIONS
endif
ifeq ($(notdir $(wildcard $(srctree)/include/linux/sched/signal.h)),signal.h)
SNAPAPI_FLAGS += -DHAVE_SCHED_SIGNAL_H
endif
ifeq ($(notdir $(wildcard $(srctree)/include/linux/blk-cgroup.h)),blk-cgroup.h)
SNAPAPI_FLAGS += -DHAVE_BLK_CGROUP_H
endif
SNAPAPI_FLAGS += $(shell \
grep -q page_mapcount $(srctree)/include/linux/mm.h && \
echo -DHAVE_PAGE_MAPCOUNT)
SNAPAPI_FLAGS += $(shell \
grep -qw "_mapcount" $(srctree)/include/linux/mm_types.h && \
echo -DHAVE_PAGE_UMAPCOUNT)
SNAPAPI_FLAGS += $(shell \
grep -qw SPIN_LOCK_UNLOCKED $(srctree)/include/linux/spinlock_types.h \
$(srctree)/include/linux/spinlock.h && \
echo -DHAVE_SPIN_LOCK_UNLOCKED)
SNAPAPI_FLAGS += $(shell \
grep -qw queue_max_sectors $(srctree)/include/linux/blkdev.h && \
echo -DHAVE_QUEUE_MAX_SECTORS)
SNAPAPI_FLAGS += $(shell \
grep -qw queue_max_hw_sectors $(srctree)/include/linux/blkdev.h && \
echo -DHAVE_QUEUE_MAX_HW_SECTORS)
SNAPAPI_FLAGS += $(shell \
grep -qw fmode_t $(srctree)/include/linux/types.h && \
echo -DHAVE_FMODE_T)
SNAPAPI_FLAGS += $(shell \
if grep -q try_to_freeze $(srctree)/include/linux/freezer.h; then \
echo -DHAVE_TRY_TO_FREEZE_NO_ARGS -DHAVE_FREEZER_H; \
elif grep -qw "try_to_freeze(unsigned.*)" $(srctree)/include/linux/sched.h; then \
echo -DHAVE_TRY_TO_FREEZE_ONE_ARG; \
elif grep -qw "try_to_freeze(void)" $(srctree)/include/linux/sched.h; then \
echo -DHAVE_TRY_TO_FREEZE_NO_ARGS; \
fi)
SNAPAPI_FLAGS += $(shell \
grep -qw REQ_WRITE $(srctree)/include/linux/fs.h && \
echo -DHAVE_REQ_WRITE)
SNAPAPI_FLAGS += $(shell \
grep -qw unlocked_ioctl $(srctree)/include/linux/fs.h && \
echo -DHAVE_UNLOCKED_IOCTL)
SNAPAPI_FLAGS += $(shell \
grep -qw "extern int bd_claim" $(srctree)/include/linux/fs.h && \
echo -DHAVE_BD_CLAIM)
SNAPAPI_FLAGS += $(shell \
if grep -qw "extern int blkdev_put.*,.*" $(srctree)/include/linux/fs.h; then \
echo -DHAVE_BLKDEV_PUT_2ARGS; \
echo -DHAVE_BLKDEV_PUT_INT; \
elif grep -qw "extern void blkdev_put.*,.*" $(srctree)/include/linux/fs.h; then \
echo -DHAVE_BLKDEV_PUT_2ARGS; \
echo -DHAVE_BLKDEV_PUT_VOID; \
fi)
SNAPAPI_FLAGS += $(shell \
if grep -qw "extern int blkdev_get.*,.*,.*unsigned.*" $(srctree)/include/linux/fs.h; then \
echo -DHAVE_BLKDEV_GET_3ARG_FLAG; \
elif grep -qw "extern int blkdev_get.*,.*,.*" $(srctree)/include/linux/fs.h; then \
echo -DHAVE_BLKDEV_GET_3ARGS; \
fi)
SNAPAPI_FLAGS += $(shell \
if grep -qw "kmap_atomic(.*page.*,.*)" $(srctree)/include/linux/highmem.h; then \
echo -DHAVE_KMAP_ATOMIC_2ARGS; \
fi)
SNAPAPI_FLAGS += $(shell \
if grep -qw "nr_rqs.*" $(srctree)/include/linux/blkdev.h; then \
echo -DHAVE_REQUEST_QUEUE_RQS; \
elif grep -qw "struct request_list rq" $(srctree)/include/linux/blk_types.h; then \
echo -DHAVE_REQUEST_LIST_COUNT; \
fi)
SNAPAPI_FLAGS += $(shell \
grep -qw "typedef int (make_request_fn)" $(srctree)/include/linux/blkdev.h && \
echo -DHAVE_MAKE_REQUEST_INT)
SNAPAPI_FLAGS += $(shell \
grep -qw "typedef blk_qc_t (make_request_fn)" $(srctree)/include/linux/blkdev.h && \
echo -DHAVE_MAKE_REQUEST_BLK_QC_T)
SNAPAPI_FLAGS += $(shell \
grep -qw "struct bvec_iter" $(srctree)/include/linux/blk_types.h && \
echo -DHAVE_BVEC_ITER)
SNAPAPI_FLAGS += $(shell \
grep -qw "pid_ns_for_children" $(srctree)/include/linux/nsproxy.h && \
echo -DHAVE_PID_NS_CHILDREN)
SNAPAPI_FLAGS += $(shell \
grep -v '^//' $(srctree)/include/linux/fs.h | grep -qw "f_dentry" && \
echo -DHAVE_FILE_F_DENTRY)
SNAPAPI_FLAGS += $(shell \
grep -qw "spinlock_t.\squeue_lock" $(srctree)/include/linux/blkdev.h && \
echo -DHAVE_QUEUE_LOCK_NPTR)
SNAPAPI_FLAGS += $(shell \
grep -qw "set_mb" $(srctree)/arch/x86/include/asm/barrier.h \
$(srctree)/arch/x86/include/asm/system.h \
$(srctree)/include/asm/system.h \
$(srctree)/include/asm-generic/system.h && \
echo -DHAVE_ASM_HAVE_SET_MB)
SNAPAPI_FLAGS += $(shell \
if grep -qw "extern void bio_endio(.*bio.*,.*)" $(srctree)/include/linux/bio.h; then \
echo -DHAVE_BIO_ENDIO_2ARGS; \
fi)
SNAPAPI_FLAGS += $(shell \
if grep -qw "BIO_UPTODATE" $(srctree)/include/linux/blk_types.h \
$(srctree)/include/linux/bio.h ; then \
echo -DHAVE_BIO_UPTODATE; \
elif grep -qw "bi_error" $(srctree)/include/linux/blk_types.h; then \
echo -DHAVE_BIO_BI_ERROR; \
fi)
SNAPAPI_FLAGS += $(shell \
if grep -qw "page_cache_release" $(srctree)/include/linux/pagemap.h; then \
echo -DHAVE_PAGE_CACHE_RELEASE; \
fi)
SNAPAPI_FLAGS += $(shell \
grep -qw "void (.*release) (.*.*,.*)" $(srctree)/include/linux/blkdev.h && \
echo -DHAVE_FOPS_RELEASE_VOID)
SNAPAPI_FLAGS += $(shell \
grep -qw "submit_bio(struct bio \*)" $(srctree)/include/linux/fs.h \
$(srctree)/include/linux/bio.h && \
echo -DHAVE_SUBMIT_BIO_ONEARG)
SNAPAPI_FLAGS += $(shell \
grep -qw "op_is_write" $(srctree)/include/linux/fs.h \
$(srctree)/include/linux/blk_types.h && \
echo -DHAVE_OP_IS_WRITE)
SNAPAPI_FLAGS += $(shell \
grep -qw "bi_opf" $(srctree)/include/linux/fs.h \
$(srctree)/include/linux/blk_types.h && \
echo -DHAVE_BIO_OPF)
SNAPAPI_FLAGS += $(shell \
grep -qw "virtual_address;" $(srctree)/include/linux/mm.h && \
echo -DHAVE_VMFAULT_VIRTUAL_ADDRESS)
SNAPAPI_FLAGS += $(shell \
grep -qw "fault.(.*,.*)" $(srctree)/include/linux/mm.h && \
echo -DHAVE_VM_FAULT_2ARGS)
SNAPAPI_FLAGS += $(shell \
if grep -qw "bio_set_dev" $(srctree)/include/linux/bio.h; then \
echo -DHAVE_BIO_SET_DEV; \
fi)
SNAPAPI_FLAGS += $(shell \
if grep -A8 "bio_set_dev" $(srctree)/include/linux/bio.h | \
grep -qw "bio_associate_blkg"; then \
echo -DHAVE_BIO_SET_DEV_USE_ASSISIATE_BLKG; \
fi)
SNAPAPI_FLAGS += $(shell \
if grep -qw "init_timer" $(srctree)/include/linux/timer.h; then \
echo -DHAVE_INIT_TIMER; \
fi)
SNAPAPI_FLAGS += $(shell \
grep -qw vm_fault_t $(srctree)/include/linux/mm_types.h && \
echo -DHAVE_VMFAULT_T)
EXTRA_CFLAGS += $(SNAPAPI_FLAGS) $(DKMS_CFLAGS)
obj-m += snapapi26.o
obj-m += snumbd26.o