From a168315321b5209d2d7b1e31de6d6bab11261cb7 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 31 Oct 2008 14:14:03 +0100 Subject: [PATCH] take SHARED and INCLUDES into account --- package/pciutils/pciutils.mk | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/package/pciutils/pciutils.mk b/package/pciutils/pciutils.mk index bc9df11..7b60927 100644 --- a/package/pciutils/pciutils.mk +++ b/package/pciutils/pciutils.mk @@ -23,6 +23,14 @@ PCIUTILS_HAVE_ZLIB=no PCIIDS_FILE=pci.ids endif +ifeq ($(BR2_ENABLE_SHARED),y) +PCIUTILS_HAVE_SO=yes +LIB_PCI=libpci.so +LIB_PCI_ABIVERSION=.$(word 1,$(subst ., ,$(PCIUTILS_VERSION))) +else +PCIUTILS_HAVE_SO=no +endif + $(DL_DIR)/$(PCIUTILS_SOURCE): $(WGET) -P $(DL_DIR) $(PCIUTILS_SITE)/$(PCIUTILS_SOURCE) @@ -40,30 +48,55 @@ $(PCIUTILS_DIR)/.unpacked: $(DL_DIR)/$(PCIUTILS_SOURCE) $(DL_DIR)/$(PCIIDS_SOURC touch $@ $(PCIUTILS_DIR)/.compiled: $(PCIUTILS_DIR)/.unpacked $(if $(BR2_PACKAGE_ZLIB),zlib) - $(MAKE1) CC="$(TARGET_CC)" OPT="$(TARGET_CFLAGS)" -C $(PCIUTILS_DIR) \ + $(MAKE) -C $(PCIUTILS_DIR) clean + $(MAKE) CC="$(TARGET_CC)" OPT="$(TARGET_CFLAGS)" -C $(PCIUTILS_DIR) \ SHAREDIR="/usr/share/misc" \ ZLIB=$(PCIUTILS_HAVE_ZLIB) \ + SHARED=$(PCIUTILS_HAVE_SO) \ PREFIX=/usr touch $@ +$(PCIUTILS_DIR)/lib/libpci.a: $(PCIUTILS_DIR)/.unpacked $(if $(BR2_PACKAGE_ZLIB),zlib) + $(MAKE) -C $(PCIUTILS_DIR) clean + $(MAKE) CC="$(TARGET_CC)" OPT="$(TARGET_CFLAGS)" -C $(PCIUTILS_DIR) \ + SHAREDIR="/usr/share/misc" \ + ZLIB=$(PCIUTILS_HAVE_ZLIB) \ + SHARED=no \ + PREFIX=/usr + touch -c $@ + +$(TARGET_DIR)/usr/lib/libpci.a: $(PCIUTILS_DIR)/lib/libpci.a + $(INSTALL) -D -m0644 $< $@ + $(INSTALL) -d $(TARGET_DIR)/usr/include/pci + $(INSTALL) -m0644 $(addprefix $(PCIUTILS_DIR)/lib/,config.h header.h pci.h types.h ) $(TARGET_DIR)/usr/include/pci/ + touch -c $@ + $(TARGET_DIR)/sbin/lspci: $(PCIUTILS_DIR)/.compiled - $(INSTALL) $(PCIUTILS_DIR)/lspci $(TARGET_DIR)/sbin/lspci + $(INSTALL) -D -m0755 $(PCIUTILS_DIR)/lspci $(TARGET_DIR)/sbin/lspci +ifeq ($(BR2_ENABLE_SHARED),y) + $(INSTALL) -D -m0755 $(PCIUTILS_DIR)/lib/$(LIB_PCI).$(PCIUTILS_VERSION) $(TARGET_DIR)/usr/lib/$(LIB_PCI).$(PCIUTILS_VERSION) + ln -sf $(LIB_PCI).$(PCIUTILS_VERSION) $(TARGET_DIR)/usr/lib/$(LIB_PCI)$(LIB_PCI_ABIVERSION) + $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/$(LIB_PCI).$(PCIUTILS_VERSION) +endif $(STRIPCMD) $(STRIP_STRIP_ALL) $@ $(TARGET_DIR)/sbin/setpci: $(PCIUTILS_DIR)/.compiled - $(INSTALL) $(PCIUTILS_DIR)/setpci $(TARGET_DIR)/sbin/setpci + $(INSTALL) -D -m0755 $(PCIUTILS_DIR)/setpci $(TARGET_DIR)/sbin/setpci $(STRIPCMD) $(STRIP_STRIP_ALL) $@ $(TARGET_DIR)/usr/share/misc/$(PCIIDS_FILE): $(PCIUTILS_DIR)/.unpacked $(INSTALL) -D $(PCIUTILS_DIR)/$(PCIIDS_FILE) $(@D) pciutils: uclibc $(TARGET_DIR)/sbin/setpci $(TARGET_DIR)/sbin/lspci $(TARGET_DIR)/usr/share/misc/$(PCIIDS_FILE) +pciutils-headers: $(TARGET_DIR)/usr/lib/libpci.a pciutils-source: $(DL_DIR)/$(PCIUTILS_SOURCE) $(DL_DIR)/$(PCIIDS_SOURCE) pciutils-clean: -$(MAKE) -C $(PCIUTILS_DIR) clean - rm -f $(TARGET_DIR)/sbin/lspci $(TARGET_DIR)/sbin/setpci $(TARGET_DIR)/usr/share/misc/pci.ids* + rm -f $(TARGET_DIR)/sbin/lspci $(TARGET_DIR)/sbin/setpci \ + $(TARGET_DIR)/usr/share/misc/pci.ids* \ + $(TARGET_DIR)/usr/lib/$(LIB_PCI)* pciutils-dirclean: rm -rf $(PCIUTILS_DIR) @@ -73,6 +106,9 @@ pciutils-dirclean: # Toplevel Makefile options # ############################################################# +ifeq ($(BR2_PACKAGE_PCIUTILS)$(BR2_HAVE_INCLUDES),yy) +TARGETS+=pciutils-headers +endif ifeq ($(BR2_PACKAGE_PCIUTILS),y) TARGETS+=pciutils endif -- 2.11.4.GIT