]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/configure
Fix inconsistent bus centric view between the sysfs and proc methods
[pciutils.git] / lib / configure
index bec5f864a06809870d1a10ae5a597dc65af2d18d..b0529a7b789cf2a33ba0c66eaf67be6f11082a0d 100755 (executable)
@@ -32,17 +32,23 @@ if [ -z "$HOST" ] ; then
        then
                sys=freebsd
        fi
+       if [ "$sys" = "CYGWIN_NT-5.1" -o "$sys" = "CYGWIN_NT-6.0" ]
+       then
+               sys=cygwin
+       fi
        HOST=${3:-$cpu-$sys}
 fi
+[ -n "$RELEASE" ] && rel="${RELEASE}"
 # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
-host=`echo $HOST | sed 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'`
+host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'`
 cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo " $host $rel"
+echo " $host $rel $cpu $sys"
 
 c=config.h
 m=config.mk
-echo >$c "#define PCI_ARCH_`echo $cpu | tr '[a-z]' '[A-Z]'`"
+echo >$c '#define PCI_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]'`"
 echo >$m 'WITH_LIBS='
 
@@ -58,7 +64,7 @@ case $sys in
                echo >>$c '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"'
                echo >>$c '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"'
                case $cpu in
-                               i386|x86_64)    echo_n " i386-ports"
+                               i?86|x86_64)    echo_n " i386-ports"
                                                echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
                                                ;;
                esac
@@ -66,7 +72,7 @@ case $sys in
                ;;
        sunos)
                case $cpu in
-                               i386)           echo_n " i386-ports"
+                               i?86)           echo_n " i386-ports"
                                                echo >>$c "#define PCI_HAVE_PM_INTEL_CONF"
                                                ;;
                                *)
@@ -107,6 +113,11 @@ case $sys in
                echo_n " i386-ports"
                echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
                ;;
+       cygwin)
+               echo_n " i386-ports"
+               echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
+               echo >>$m 'WITH_LIBS+=-lioperm'
+               ;;
         *)
                echo " Unfortunately, your OS is not supported by the PCI Library"
                exit 1
@@ -164,6 +175,7 @@ else
        # We link the dependencies _to_ the library, so we do not need explicit deps in .pc
        echo >>$m 'LDLIBS='
        echo >>$m 'LIB_LDLIBS=$(WITH_LIBS)'
+       echo >>$c '#define PCI_SHARED_LIB'
        if [ "$SHARED" = yes ] ; then
                echo >>$m 'SONAME=-Wl,-soname,$(LIBNAME).so$(ABI_VERSION)'
        fi