--- pciutils-2.2.3/lib/configure.multilib	2006-05-05 14:25:07.000000000 +0200
+++ pciutils-2.2.3/lib/configure	2006-05-23 15:50:16.000000000 +0200
@@ -30,8 +30,37 @@
 echo " $host $rel"
 
 c=config.h
-echo >$c "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
-echo >>$c "#define PCI_OS_`echo $sys | tr 'a-z' 'A-Z'`"
+cm=config.h.mk
+cat >$c <<EOF
+#if defined(__x86_64__)
+#define PCI_ARCH_X86_64
+#elif defined(__ia64__)
+#define PCI_ARCH_IA64
+#elif defined(__i386__)
+#define PCI_ARCH_I386
+#define PCI_HAVE_PM_INTEL_CONF
+#elif defined(__ppc64__) || defined(__powerpc64__)
+#define PCI_ARCH_PPC64
+#elif defined(__ppc__)  || defined(__powerpc__)
+#define PCI_ARCH_PPC
+#elif defined(__s390x__)
+#define PCI_ARCH_S390X
+#elif defined(__s390__)
+#define PCI_ARCH_S390
+#else
+#error Unknown Arch
+#endif
+#define PCI_OS_LINUX
+#define PCI_HAVE_PM_LINUX_SYSFS
+#define PCI_HAVE_PM_LINUX_PROC
+#define PCI_HAVE_LINUX_BYTEORDER_H
+#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"
+#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"
+#define PCI_HAVE_64BIT_ADDRESS
+EOF
+
+echo >$cm "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
+echo >>$cm "#define PCI_OS_`echo $sys | tr 'a-z' 'A-Z'`"
 
 echo_n "Looking for access methods..."
 
@@ -39,63 +68,22 @@
 	linux*)
 		case $rel in
 			2.[1-9]*|[3-9]*)	echo_n " sysfs proc"
-						echo >>$c '#define PCI_HAVE_PM_LINUX_SYSFS'
-						echo >>$c '#define PCI_HAVE_PM_LINUX_PROC'
-						echo >>$c '#define PCI_HAVE_LINUX_BYTEORDER_H'
-						echo >>$c '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"'
-						echo >>$c '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"'
-						ok=1
-						;;
-		esac
-		case $cpu in
-				i386)		echo_n " i386-ports"
-						echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
+						echo >>$cm '#define PCI_HAVE_PM_LINUX_SYSFS'
+						echo >>$cm '#define PCI_HAVE_PM_LINUX_PROC'
+						echo >>$cm '#define PCI_HAVE_LINUX_BYTEORDER_H'
+						echo >>$cm '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"'
+						echo >>$cm '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"'
 						ok=1
 						;;
 		esac
-		echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
-		;;
-	sunos)
 		case $cpu in
 				i386)		echo_n " i386-ports"
-						echo >>$c "#define PCI_HAVE_PM_INTEL_CONF"
+						echo >>$cm '#define PCI_HAVE_PM_INTEL_CONF'
 						ok=1
 						;;
-				*)
-						echo " The PCI library is does not support Solaris for this architecture: $cpu"
-						exit 1
-						;;
 		esac
-		;;
-		
-	freebsd)
-		echo_n " fbsd-device"
-		echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE'
-		echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"'
-		ok=1
-		;;
-        openbsd)
-	        echo_n " obsd-device"
-		echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE'
-		echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"'
-		ok=1
-		;;
-	aix)
-		echo_n " aix-device"
-		echo >>$c '#define PCI_HAVE_PM_AIX_DEVICE'
-		ok=1
-		;;
-	netbsd)
-		echo_n " nbsd-libpci"
-		echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI'
-		echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"'
-		ok=1
-		;;
-    	gnu)
-		echo_n " i386-ports"
-		echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
-		ok=1
-		;;
+		echo >>$cm '#define PCI_HAVE_64BIT_ADDRESS'
+		;;		
         *)
 		echo " Unfortunately, your OS is not supported by the PCI Library"
 		exit 1
@@ -103,10 +91,14 @@
 esac
 
 echo >>$c '#define PCI_HAVE_PM_DUMP'
+echo >>$cm '#define PCI_HAVE_PM_DUMP'
 echo " dump"
 if [ -z "$ok" ] ; then
 	echo "WARNING: No real configuration access method is available."
 fi
 echo >>$c "#define PCI_PATH_IDS \"$idsdir/pci.ids\""
 echo >>$c "#define PCILIB_VERSION \"$version\""
-sed '/^#define [^ ]*$/!d;s/^#define \(.*\)/\1=1/' <$c >config.mk
+
+echo >>$cm "#define PCI_PATH_IDS \"$idsdir/pci.ids\""
+echo >>$cm "#define PCILIB_VERSION \"$version\""
+sed '/^#define [^ ]*$/!d;s/^#define \(.*\)/\1=1/' <$cm >config.mk
