]> git.ipfire.org Git - thirdparty/pciutils.git/blame - lib/configure
Rewrote the pread/pwrite things once again. Use pread and pwrite only when we
[thirdparty/pciutils.git] / lib / configure
CommitLineData
727ce158
MM
1#!/bin/sh
2
3echo -n "Configuring libpci for your system..."
4prefix=${1:-/usr}
5version=${2:-0.0}
6sys=`uname -s`
7rel=`uname -r`
8cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
9echo "$sys/$cpu $rel"
10if [ "$sys" != Linux ] ; then
11 echo "libpci currently supports only Linux"
12 exit 1
13fi
14echo -n "Looking for access methods..."
15c=config.h
16echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
17case $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 ;;
24esac
25case $cpu in
26 i386) echo -n " i386-ports"
27 echo >>$c '#define HAVE_PM_INTEL_CONF'
28 ok=1
29 ;;
e95c8373
MM
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'
727ce158
MM
37# echo -n " syscalls"
38# echo >>$c '#define HAVE_PM_SYSCALLS'
39# ok=1
40 ;;
41esac
42echo >>$c '#define HAVE_PM_DUMP'
43echo " dump"
44if [ -z "$ok" ] ; then
45 echo "WARNING: No real configuration access method is available."
46fi
47echo >>$c "#define PATH_PCI_IDS \"$prefix/share/pci.ids\""
48if [ -f header.h ] ; then
49 echo >>$c '#define HAVE_OWN_HEADER_H'
50fi
51echo >>$c "#define PCILIB_VERSION \"$version\""
52sed '/^#define [^ ]*$/!d;s/^#define \(.*\)/\1=1/' <$c >config.mk