]> mj.ucw.cz Git - pciutils.git/commitdiff
Cross-compilation support by Maciej
authorMartin Mares <mj@ucw.cz>
Sat, 29 May 2004 19:13:58 +0000 (19:13 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:18:19 +0000 (14:18 +0200)
git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-45

ChangeLog
Makefile
README
lib/configure

index e97e7e5f52bbd27b62e25be937802a9554977ad9..3b192bb6edd1eab61ea6a6881340ed44d16560bd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-29  Martin Mares  <mj@ucw.cz>
+
+       * Makefile, lib/configure: Cross-compilation support, patch by Maciej.
+
 2004-05-28  Martin Mares  <mj@ucw.cz>
 
        * Released as 2.1.99-test4.
index 7ff7207b64279847eb817d4cbdcec7e16410f08e..5b5f5f87a343b3e9ec3b703eca8f6328cf138865 100644 (file)
--- 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 fe5ccf1140e5dffadf3fd29d159adb1cf5927bcc..9dd8dc6fc363601f9e5f1cd080b8dc58d908a62e 100644 (file)
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 This package contains the PCI Utilities, version @VERSION@.
 
-Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz>
 
 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
 
 ############################################################################
 
index 6fd652a3310d942ecd52bea9c1ded526e7fdf58c..8ff9040cc34eb3c53864d582670e9f47ffe503f5 100755 (executable)
@@ -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