summaryrefslogtreecommitdiffstats
path: root/package/pciutils/pciutils.mk
blob: 819d6a4ba8a588eb6806d7b7c67b656d7912f809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
################################################################################
#
# pciutils
#
################################################################################

PCIUTILS_VERSION = 3.2.1
PCIUTILS_SITE = ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
PCIUTILS_INSTALL_STAGING = YES
PCIUTILS_LICENSE = GPLv2+
PCIUTILS_LICENSE_FILES = COPYING

ifeq ($(BR2_PACKAGE_ZLIB),y)
	PCIUTILS_ZLIB=yes
	PCIUTILS_DEPENDENCIES += zlib
else
	PCIUTILS_ZLIB=no
endif

PCIUTILS_DNS = no

ifeq ($(BR2_PACKAGE_KMOD),y)
	PCIUTILS_DEPENDENCIES += kmod
	PCIUTILS_KMOD = yes
else
	PCIUTILS_KMOD = no
endif

ifeq ($(BR2_PREFER_STATIC_LIB),y)
	PCIUTILS_SHARED=no
else
	PCIUTILS_SHARED=yes
endif

PCIUTILS_MAKE_OPTS = \
	CC="$(TARGET_CC)" \
	HOST="$(KERNEL_ARCH)-linux" \
	OPT="$(TARGET_CFLAGS)" \
	LDFLAGS="$(TARGET_LDFLAGS)" \
	RANLIB=$(TARGET_RANLIB) \
	AR=$(TARGET_AR) \
	ZLIB=$(PCIUTILS_ZLIB) \
	DNS=$(PCIUTILS_DNS) \
	LIBKMOD=$(PCIUTILS_KMOD) \
	SHARED=$(PCIUTILS_SHARED)

# Build after busybox since it's got a lightweight lspci
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
	PCIUTILS_DEPENDENCIES += busybox
endif

define PCIUTILS_CONFIGURE_CMDS
	$(SED) 's/wget --no-timestamping/wget/' $(PCIUTILS_DIR)/update-pciids.sh
	$(SED) 's/uname -s/echo Linux/' \
		-e 's/uname -r/echo $(LINUX_HEADERS_VERSION)/' \
		$(PCIUTILS_DIR)/lib/configure
	$(SED) 's/^STRIP/#STRIP/' $(PCIUTILS_DIR)/Makefile
endef

define PCIUTILS_BUILD_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(PCIUTILS_MAKE_OPTS) \
		PREFIX=/usr
endef

define PCIUTILS_INSTALL_TARGET_CMDS
	$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) $(PCIUTILS_MAKE_OPTS) \
		PREFIX=$(TARGET_DIR)/usr install install-lib install-pcilib
endef

define PCIUTILS_INSTALL_STAGING_CMDS
	$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) $(PCIUTILS_MAKE_OPTS) \
		PREFIX=$(STAGING_DIR)/usr install install-lib install-pcilib
endef

$(eval $(generic-package))
OpenPOWER on IntegriCloud