Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] pciutils: convert to the autotools infrastructure
@ 2010-04-13 21:49 Thomas Brandstetter
  2010-04-14 10:31 ` Peter Korsgaard
  2010-04-14 13:10 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Brandstetter @ 2010-04-13 21:49 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Brandstetter <tbrandstetter@me.com>
---
 package/pciutils/pciutils.mk |   81 ++++++++---------------------------------
 1 files changed, 16 insertions(+), 65 deletions(-)

diff --git a/package/pciutils/pciutils.mk b/package/pciutils/pciutils.mk
index 7b19c5b..12d45f3 100644
--- a/package/pciutils/pciutils.mk
+++ b/package/pciutils/pciutils.mk
@@ -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
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] pciutils: convert to the autotools infrastructure
  2010-04-13 21:49 [Buildroot] [PATCH] pciutils: convert to the autotools infrastructure Thomas Brandstetter
@ 2010-04-14 10:31 ` Peter Korsgaard
  2010-04-14 13:10 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2010-04-14 10:31 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Brandstetter <thomas.brandstetter@me.com> writes:

 Thomas> Signed-off-by: Thomas Brandstetter <tbrandstetter@me.com>
 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.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] pciutils: convert to the autotools infrastructure
  2010-04-13 21:49 [Buildroot] [PATCH] pciutils: convert to the autotools infrastructure Thomas Brandstetter
  2010-04-14 10:31 ` Peter Korsgaard
@ 2010-04-14 13:10 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2010-04-14 13:10 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for doing this! A couple of comments below.

On Tue, 13 Apr 2010 23:49:17 +0200
Thomas Brandstetter <thomas.brandstetter@me.com> wrote:

> +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.

> +$(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	

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

> +$(PCIUTILS_HOOK_POST_INSTALL):
> +	$(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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-14 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-13 21:49 [Buildroot] [PATCH] pciutils: convert to the autotools infrastructure Thomas Brandstetter
2010-04-14 10:31 ` Peter Korsgaard
2010-04-14 13:10 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox