xref: /OK3568_Linux_fs/buildroot/package/lockdev/lockdev.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# lockdev
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunLOCKDEV_VERSION_MAJOR = 1
8*4882a593SmuzhiyunLOCKDEV_VERSION = $(LOCKDEV_VERSION_MAJOR).0.3
9*4882a593SmuzhiyunLOCKDEV_SOURCE = lockdev_$(LOCKDEV_VERSION).orig.tar.gz
10*4882a593SmuzhiyunLOCKDEV_PATCH = lockdev_$(LOCKDEV_VERSION)-1.6.diff.gz
11*4882a593SmuzhiyunLOCKDEV_SITE = http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/l/lockdev
12*4882a593SmuzhiyunLOCKDEV_LICENSE = LGPL-2.1
13*4882a593SmuzhiyunLOCKDEV_LICENSE_FILES = LICENSE
14*4882a593SmuzhiyunLOCKDEV_INSTALL_STAGING = YES
15*4882a593Smuzhiyun
16*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS),y)
17*4882a593SmuzhiyunLOCKDEV_BUILD_ARGS = static
18*4882a593SmuzhiyunLOCKDEV_INSTALL_ARGS = install_static
19*4882a593Smuzhiyunelse ifeq ($(BR2_SHARED_STATIC_LIBS),y)
20*4882a593SmuzhiyunLOCKDEV_BUILD_ARGS = static shared
21*4882a593SmuzhiyunLOCKDEV_INSTALL_ARGS = install_run install_static
22*4882a593Smuzhiyunelse # BR2_SHARED_LIBS
23*4882a593SmuzhiyunLOCKDEV_BUILD_ARGS = shared
24*4882a593SmuzhiyunLOCKDEV_INSTALL_ARGS = install_run
25*4882a593Smuzhiyunendif
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun# Make the code believe we are using a C library compatible with
28*4882a593Smuzhiyun# glibc, which for the purpose of lockdev is actually true.
29*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
30*4882a593SmuzhiyunLOCKDEV_BUILD_ARGS += CFLAGS="$(TARGET_CFLAGS) -D__GNU_LIBRARY__"
31*4882a593Smuzhiyunendif
32*4882a593Smuzhiyun
33*4882a593Smuzhiyunifeq ($(BR2_SHARED_STATIC_LIBS)$(BR2_SHARED_LIBS),y)
34*4882a593Smuzhiyundefine LOCKDEV_CREATE_LINKS_STAGING
35*4882a593Smuzhiyun	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so
36*4882a593Smuzhiyun	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.$(LOCKDEV_VERSION_MAJOR)
37*4882a593Smuzhiyunendef
38*4882a593Smuzhiyun
39*4882a593Smuzhiyundefine LOCKDEV_CREATE_LINKS_TARGET
40*4882a593Smuzhiyun	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.$(LOCKDEV_VERSION_MAJOR)
41*4882a593Smuzhiyunendef
42*4882a593Smuzhiyunendif
43*4882a593Smuzhiyun
44*4882a593Smuzhiyundefine LOCKDEV_BUILD_CMDS
45*4882a593Smuzhiyun	$(MAKE1) $(TARGET_CONFIGURE_OPTS) -C $(@D) $(LOCKDEV_BUILD_ARGS)
46*4882a593Smuzhiyunendef
47*4882a593Smuzhiyun
48*4882a593Smuzhiyundefine LOCKDEV_INSTALL_STAGING_CMDS
49*4882a593Smuzhiyun	$(MAKE1) basedir=$(STAGING_DIR)/usr -C $(@D) $(LOCKDEV_INSTALL_ARGS) install_dev
50*4882a593Smuzhiyun	$(LOCKDEV_CREATE_LINKS_STAGING)
51*4882a593Smuzhiyunendef
52*4882a593Smuzhiyun
53*4882a593Smuzhiyundefine LOCKDEV_INSTALL_TARGET_CMDS
54*4882a593Smuzhiyun	$(MAKE1) basedir=$(TARGET_DIR)/usr -C $(@D) $(LOCKDEV_INSTALL_ARGS)
55*4882a593Smuzhiyun	$(LOCKDEV_CREATE_LINKS_TARGET)
56*4882a593Smuzhiyunendef
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun$(eval $(generic-package))
59