Skip to contentSkip to conversation

pciutils: convert to the autotools infrastructure

PATCH New Thomas Brandstetter 3 participants 3 messages Apr 13, 2010 – Apr 14, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pciutils: convert to the autotools infrastructure

---
 package/pciutils/pciutils.mk |   81 ++++++++---------------------------------
 1 files changed, 16 insertions(+), 65 deletions(-)
package/pciutils/pciutils.mk +10 -17
index 7b19c5b..12d45f3 100644
@@ -1,80 +1,31 @@
 #############################################################
 #
-# pciutils
+# PCIUTILS
 #
 #############################################################
-PCIUTILS_VERSION:=3.0.1
-PCIUTILS_SOURCE:=pciutils-$(PCIUTILS_VERSION).tar.gz
-PCIUTILS_CAT:=$(ZCAT)
-PCIUTILS_SITE:=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
-PCIUTILS_DIR:=$(BUILD_DIR)/pciutils-$(PCIUTILS_VERSION)
-
-# Yet more targets...
-PCIIDS_SITE:=http://pciids.sourceforge.net/
-PCIIDS_SOURCE:=pci.ids.bz2
-PCIIDS_CAT:=$(BZCAT)
 
+PCIUTILS_VERSION = 3.1.7
+PCIUTILS_SITE = ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
+PCIUTILS_CONFIGURE_CMDS = echo ""
+PCIUTILS_INSTALL_TARGET_OPT = PREFIX=$(TARGET_DIR)/usr install
 ifeq ($(BR2_PACKAGE_ZLIB),y)
-PCIUTILS_HAVE_ZLIB=yes
-PCIIDS_FILE=pci.ids.gz
-PCIIDS_COMPRESSOR=gzip -9 -c
+	PCIUTILS_ZLIB=yes
 else
-PCIUTILS_HAVE_ZLIB=no
-PCIIDS_FILE=pci.ids
-PCIIDS_COMPRESSOR=cat
+	PCIUTILS_ZLIB=no
 endif
+PCIUTILS_DNS=no
+PCIUTILS_SHARED=yes
+PCIUTILS_MAKE_OPT = CC="$(TARGET_CC)" OPT="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) -C $(PCIUTILS_DIR) SHARED=$

(PCIUTILS_SHARED) ZLIB=$(PCIUTILS_ZLIB) DNS=$(PCIUTILS_DNS) SHAREDIR=/usr/share/misc

-$(DL_DIR)/$(PCIUTILS_SOURCE):
- $(call DOWNLOAD,$(PCIUTILS_SITE),$(PCIUTILS_SOURCE))
-
-$(DL_DIR)/$(PCIIDS_SOURCE):
- $(call DOWNLOAD,$(PCIIDS_SITE),$(PCIIDS_SOURCE))
+$(eval $(call AUTOTARGETS,package,pciutils))

-$(PCIUTILS_DIR)/.unpacked: $(DL_DIR)/$(PCIUTILS_SOURCE) $(DL_DIR)/$(PCIIDS_SOURCE)
- $(PCIUTILS_CAT) $(DL_DIR)/$(PCIUTILS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- $(PCIIDS_CAT) $(DL_DIR)/$(PCIIDS_SOURCE) | $(PCIIDS_COMPRESSOR) > $(PCIUTILS_DIR)/$(PCIIDS_FILE)
- toolchain/patch-kernel.sh $(PCIUTILS_DIR) package/pciutils pciutils-$(PCIUTILS_VERSION)\*.patch
- #$(CONFIG_UPDATE) $(@D)
+$(PCIUTILS_HOOK_POST_EXTRACT):
$(SED) 's/uname -s/echo Linux/' \
-e 's/uname -r/echo $(LINUX_HEADERS_VERSION)/' \
- $(PCIUTILS_DIR)/lib/configure
+ $(PCIUTILS_DIR)/lib/configure
touch $@

-$(PCIUTILS_DIR)/.compiled: $(PCIUTILS_DIR)/.unpacked
- $(MAKE1) CC="$(TARGET_CC)" OPT="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) -C $(PCIUTILS_DIR) \
- SHAREDIR="/usr/share/misc" \
- ZLIB=$(PCIUTILS_HAVE_ZLIB) \
- HOST=$(KERNEL_ARCH)-linux \
- PREFIX=/usr
+$(PCIUTILS_HOOK_POST_INSTALL):
+ $(STRIPCMD) $(TARGET_DIR)/usr/sbin/lspci
+ $(STRIPCMD) $(TARGET_DIR)/usr/sbin/setpci
touch $@
-
-$(TARGET_DIR)/sbin/lspci: $(PCIUTILS_DIR)/.compiled
- $(INSTALL) $(PCIUTILS_DIR)/lspci $(TARGET_DIR)/sbin/lspci
- $(STRIPCMD) $(STRIP_STRIP_ALL) $@
-
-$(TARGET_DIR)/sbin/setpci: $(PCIUTILS_DIR)/.compiled
- $(INSTALL) $(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) $@
-
-pciutils: $(if $(BR2_PACKAGE_ZLIB),zlib) $(TARGET_DIR)/sbin/setpci $(TARGET_DIR)/sbin/lspci $(TARGET_DIR)/usr/share/misc/$(PCIIDS_FILE) -
-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*
-
-pciutils-dirclean:
- rm -rf $(PCIUTILS_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_PCIUTILS),y)
-TARGETS+=pciutils
-endif

Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 pciutils: convert to the autotools infrastructure

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Brandstetter <[email protected]> writes:

Thomas> Signed-off-by: Thomas Brandstetter <[email protected]> Thomas> ---
Thomas> +PCIUTILS_DNS=no
Thomas> +PCIUTILS_SHARED=yes

Thanks, but:

Applying: pciutils: convert to the autotools infrastructure
fatal: corrupt patch at line 45
Patch failed at 0001 pciutils: convert to the autotools infrastructure When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".

Thomas> +PCIUTILS_MAKE_OPT = CC="$(TARGET_CC)" OPT="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" RANLIB=$(TARGET_RANLIB) AR=$(TARGET_AR) -C $(PCIUTILS_DIR) SHARED=$ Thomas> (PCIUTILS_SHARED) ZLIB=$(PCIUTILS_ZLIB) DNS=$(PCIUTILS_DNS) SHAREDIR=/usr/share/misc

Your mailer has word wrapped the patch - Could you use git send-email instead? That'll do the right thing.

It would also be good to split up that very long line using '\' - E.G.

PCIUTILS_MAKE_OPT = \
                  CC=... \
                  OPT=...

And so on.

We also have a TARGET_CONFIGURE_ENV (see package/Makefile.in) that might be nicer to use.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 pciutils: convert to the autotools infrastructure

In reply to Thomas Brandstetter

Hello,

Thanks for doing this! A couple of comments below.

Quoted 1 line · On Tue, 13 Apr 2010 23:49:17 +0200 Thomas Brandstetter…

+PCIUTILS_CONFIGURE_CMDS = echo ""

pciutils build system is not based on the autotools, therefore, you should not be using the autotools infrastructure, but the generic infrastructure (i.e GENTARGETS instead of AUTOTARGETS).

See http://buildroot.org/downloads/buildroot.html#generic-tutorial for details.

Review

Quoted 5 lines

+$(PCIUTILS_HOOK_POST_EXTRACT):

(quoted diff) +1 -1
 	$(SED) 's/uname -s/echo Linux/' \
 		-e 's/uname -r/echo $(LINUX_HEADERS_VERSION)/' \
-		$(PCIUTILS_DIR)/lib/configure
+		$(PCIUTILS_DIR)/lib/configure	

Could you use the new style hooks instead ? See again above link for details.

Review

Quoted 3 lines

+$(PCIUTILS_HOOK_POST_INSTALL):

(quoted diff) +2 -0
+	$(STRIPCMD) $(TARGET_DIR)/usr/sbin/lspci
+	$(STRIPCMD) $(TARGET_DIR)/usr/sbin/setpci

This is not needed, binaries in $(TARGET_DIR) are automatically stripped.

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com