12 echo_n "Configuring libpci for your system..."
13 idsdir=${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/'`
25 if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ]
30 # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
31 host=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'`
32 cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
33 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
40 echo >$c "#define PCI_ARCH_`echo $cpu | tr '[a-z]' '[A-Z]'`"
41 echo >>$c "#define PCI_OS_`echo $sys | tr '[a-z]' '[A-Z]'`"
44 echo_n "Looking for access methods..."
49 echo >>$c '#define PCI_HAVE_PM_LINUX_SYSFS'
50 echo >>$c '#define PCI_HAVE_PM_LINUX_PROC'
51 echo >>$c '#define PCI_HAVE_LINUX_BYTEORDER_H'
52 echo >>$c '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"'
53 echo >>$c '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"'
55 i386) echo_n " i386-ports"
56 echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
59 echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
60 echo >>$c '#define PCI_USE_DNS'
64 i386) echo_n " i386-ports"
65 echo >>$c "#define PCI_HAVE_PM_INTEL_CONF"
68 echo " The PCI library is does not support Solaris for this architecture: $cpu"
72 echo >>$c '#define PCI_HAVE_STDINT_H'
73 echo >>$c '#define PCI_USE_DNS'
77 echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE'
78 echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"'
79 echo >>$c '#define PCI_USE_DNS'
83 echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE'
84 echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"'
85 echo >>$c '#define PCI_USE_DNS'
89 echo >>$c '#define PCI_HAVE_PM_AIX_DEVICE'
91 echo >>$m 'INSTALL=installbsd'
92 echo >>$m 'DIRINSTALL=mkdir -p'
96 echo >>$c '#define PCI_USE_DNS'
97 echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI'
98 echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"'
99 echo >>$m 'PCILIB=lib/libpciutils.a'
100 echo >>$m 'LDLIBS+=-lpci'
104 echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
105 echo >>$c '#define PCI_USE_DNS'
108 echo " Unfortunately, your OS is not supported by the PCI Library"
113 echo >>$c '#define PCI_HAVE_PM_DUMP'
116 echo_n "Checking for zlib support... "
117 if [ "$zlib" = yes -o "$zlib" = no ] ; then
118 echo "$zlib (set manually)"
120 if [ -f /usr/include/zlib.h ] ; then
125 echo "$zlib (auto-detected)"
127 if [ "$zlib" = yes ] ; then
128 echo >>$c '#define PCI_COMPRESSED_IDS'
129 echo >>$c '#define PCI_IDS "pci.ids.gz"'
131 echo >>$m 'LDLIBS+=$(LIBZ)'
133 echo >>$c '#define PCI_IDS "pci.ids"'
135 echo >>$c "#define PCI_PATH_IDS_DIR \"$idsdir\""
136 echo >>$c "#define PCI_ID_DOMAIN \"pci-id.ucw.cz\""
138 echo >>$c "#define PCILIB_VERSION \"$version\""
139 sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >>$m