12 echo_n "Configuring libpci for your system..."
13 sharedir=${1:-/usr/share}
17 if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
19 rel=`/usr/bin/oslevel`
20 proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
21 cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
23 cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'`
26 host=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr 'A-Z' 'a-z'`
27 cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
28 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
33 echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
34 echo >>$c "#define OS_`echo $sys | tr 'a-z' 'A-Z'`"
36 echo_n "Looking for access methods..."
41 2.[1-9]*|[3-9]*) echo_n "sysfs proc"
42 echo >>$c '#define HAVE_PM_LINUX_SYSFS'
43 echo >>$c '#define HAVE_PM_LINUX_PROC'
44 echo >>$c '#define HAVE_LINUX_BYTEORDER_H'
45 echo >>$c '#define PATH_PROC_BUS_PCI "/proc/bus/pci"'
46 echo >>$c '#define PATH_SYS_BUS_PCI "/sys/bus/pci"'
51 i386) echo_n " i386-ports"
52 echo >>$c '#define HAVE_PM_INTEL_CONF'
55 alpha|ia64|sparc|sparc64|ppc|ppc64)
56 echo >>$c '#define HAVE_64BIT_ADDRESS'
62 i386) echo_n " i386-ports"
63 echo >>$c "#define HAVE_PM_INTEL_CONF"
67 echo " The PCI library is does not support Solaris for this architecture: $cpu"
75 echo >>$c '#define HAVE_PM_FBSD_DEVICE'
76 echo >>$c '#define PATH_FBSD_DEVICE "/dev/pci"'
81 echo >>$c '#define HAVE_PM_AIX_DEVICE'
86 echo >>$c '#define HAVE_PM_NBSD_LIBPCI'
87 echo >>$c '#define PATH_NBSD_DEVICE "/dev/pci0"'
92 echo >>$c '#define HAVE_PM_INTEL_CONF'
96 echo " Unfortunately, your OS is not supported by the PCI Library"
101 echo >>$c '#define HAVE_PM_DUMP'
103 if [ -z "$ok" ] ; then
104 echo "WARNING: No real configuration access method is available."
106 echo >>$c "#define PATH_PCI_IDS \"$sharedir/pci.ids\""
107 echo >>$c "#define PCILIB_VERSION \"$version\""
108 sed '/^#define [^ ]*$/!d;s/^#define \(.*\)/\1=1/' <$c >config.mk