From: Martin Mares Date: Sat, 29 May 2004 19:13:58 +0000 (+0000) Subject: Cross-compilation support by Maciej X-Git-Tag: v3.0.0~120 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0d656226e4239f9acb8be3ca16c99242cd4da0e2;p=pciutils.git Cross-compilation support by Maciej git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-45 --- diff --git a/ChangeLog b/ChangeLog index e97e7e5..3b192bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-05-29 Martin Mares + + * Makefile, lib/configure: Cross-compilation support, patch by Maciej. + 2004-05-28 Martin Mares * Released as 2.1.99-test4. diff --git a/Makefile b/Makefile index 7ff7207..5b5f5f8 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,9 @@ DIRINSTALL=mkdir -p endif endif +HOST= +RELEASE= + export all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 pci.ids @@ -37,7 +40,7 @@ $(PCILIB): $(PCIINC) force force: lib/config.h: - cd lib && ./configure $(SHAREDIR) $(VERSION) + cd lib && ./configure $(SHAREDIR) $(VERSION) $(HOST) $(RELEASE) lspci: lspci.o common.o $(PCILIB) setpci: setpci.o common.o $(PCILIB) diff --git a/README b/README index fe5ccf1..9dd8dc6 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ This package contains the PCI Utilities, version @VERSION@. -Copyright (c) 1997--2003 Martin Mares +Copyright (c) 1997--2004 Martin Mares All files in this package can be freely distributed and used according to the terms of the GNU General Public License, either version 2 or @@ -15,7 +15,6 @@ Some more things I intend to merge before the 2.2.0 release: o pcimodules and possibly other Linux module related stuff o New ID's from the pciids project - o Cross-compilation support ############################################################################ diff --git a/lib/configure b/lib/configure index 6fd652a..8ff9040 100755 --- a/lib/configure +++ b/lib/configure @@ -22,7 +22,12 @@ then else cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'` fi -echo " $sys/$cpu $rel" +host=${3:-$cpu-$sys} +host=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr 'A-Z' 'a-z'` +cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +rel=${4:-$rel} +echo " $host $rel" c=config.h echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`" @@ -31,7 +36,7 @@ echo >>$c "#define OS_`echo $sys | tr 'a-z' 'A-Z'`" echo_n "Looking for access methods..." case $sys in - Linux) + linux*) case $rel in 2.[1-9]*|[3-9]*) echo_n "sysfs proc" echo >>$c '#define HAVE_PM_LINUX_SYSFS' @@ -52,7 +57,7 @@ case $sys in ;; esac ;; - SunOS) + sunos) case $cpu in i386) echo_n " i386-ports" echo >>$c "#define HAVE_PM_INTEL_CONF" @@ -65,24 +70,24 @@ case $sys in esac ;; - FreeBSD) + freebsd) echo_n " fbsd-device" echo >>$c '#define HAVE_PM_FBSD_DEVICE' echo >>$c '#define PATH_FBSD_DEVICE "/dev/pci"' ok=1 ;; - AIX) + aix) echo_n " aix-device" echo >>$c '#define HAVE_PM_AIX_DEVICE' ok=1 ;; - NetBSD) + netbsd) echo_n " nbsd-libpci" echo >>$c '#define HAVE_PM_NBSD_LIBPCI' echo >>$c '#define PATH_NBSD_DEVICE "/dev/pci0"' ok=1 ;; - GNU) + gnu) echo_n " i386-ports" echo >>$c '#define HAVE_PM_INTEL_CONF' ok=1