]> git.ipfire.org Git - thirdparty/pciutils.git/blob - lib/configure
Various PCIutils changes accumulated over last two weeks:
[thirdparty/pciutils.git] / lib / configure
1 #!/bin/sh
2
3 echo -n "Configuring libpci for your system..."
4 prefix=${1:-/usr}
5 version=${2:-0.0}
6 sys=`uname -s`
7 rel=`uname -r`
8 cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
9 echo "$sys/$cpu $rel"
10 if [ "$sys" != Linux ] ; then
11 echo "libpci currently supports only Linux"
12 exit 1
13 fi
14 echo -n "Looking for access methods..."
15 c=config.h
16 echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
17 case $rel in
18 2.[1-9]*|[3-9]*) echo -n " proc"
19 echo >>$c '#define HAVE_PM_LINUX_PROC'
20 echo >>$c '#define HAVE_LINUX_BYTEORDER_H'
21 echo >>$c '#define PATH_PROC_BUS_PCI "/proc/bus/pci"'
22 ok=1
23 ;;
24 esac
25 case $cpu in
26 i386) echo -n " i386-ports"
27 echo >>$c '#define HAVE_PM_INTEL_CONF'
28 ok=1
29 ;;
30 alpha) echo >>$c '#define HAVE_64BIT_ADDRESS'
31 # echo -n " syscalls"
32 # echo >>$c '#define HAVE_PM_SYSCALLS'
33 # ok=1
34 ;;
35 sparc|sparc64) echo >>$c '#define HAVE_64BIT_ADDRESS'
36 echo >>$c '#define HAVE_LONG_ADDRESS'
37 # echo -n " syscalls"
38 # echo >>$c '#define HAVE_PM_SYSCALLS'
39 # ok=1
40 ;;
41 esac
42 echo >>$c '#define HAVE_PM_DUMP'
43 echo " dump"
44 if [ -z "$ok" ] ; then
45 echo "WARNING: No real configuration access method is available."
46 fi
47 echo >>$c "#define PATH_PCI_IDS \"$prefix/share/pci.ids\""
48 if [ -f header.h ] ; then
49 echo >>$c '#define HAVE_OWN_HEADER_H'
50 fi
51 echo >>$c "#define PCILIB_VERSION \"$version\""
52 sed '/^#define [^ ]*$/!d;s/^#define \(.*\)/\1=1/' <$c >config.mk