X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fconfigure;h=5e4d97fb9b1af34de79d941ef3582b67b3a61f30;hb=d45531756b426fb883e78deb412be3c031bb7675;hp=d855a3cb3851ede87ac2accf881f14e1d876113c;hpb=cd2f6a34ab5eecbafe02d6c420bb7711e013a36b;p=pciutils.git diff --git a/lib/configure b/lib/configure index d855a3c..5e4d97f 100755 --- a/lib/configure +++ b/lib/configure @@ -32,21 +32,28 @@ if [ -z "$HOST" ] ; then then sys=freebsd fi + if [ "$sys" = "CYGWIN_NT-5.1" ] + 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=' echo_n "Looking for access methods..." +LIBRESOLV=-lresolv case $sys in linux*) @@ -57,16 +64,15 @@ 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 echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' - echo >>$c '#define PCI_USE_DNS' ;; sunos) case $cpu in - i386) echo_n " i386-ports" + i?86) echo_n " i386-ports" echo >>$c "#define PCI_HAVE_PM_INTEL_CONF" ;; *) @@ -80,11 +86,13 @@ case $sys in echo_n " fbsd-device" echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE' echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"' + LIBRESOLV= ;; openbsd) echo_n " obsd-device" echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE' echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"' + LIBRESOLV= ;; aix) echo_n " aix-device" @@ -99,11 +107,17 @@ case $sys in echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"' echo >>$m 'LIBNAME=libpciutils' echo >>$m 'WITH_LIBS+=-lpci' + LIBRESOLV= ;; gnu) 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 @@ -148,7 +162,7 @@ fi if [ "$DNS" = yes ] ; then echo >>$c "#define PCI_USE_DNS" echo >>$c "#define PCI_ID_DOMAIN \"pci.id.ucw.cz\"" - echo >>$m 'WITH_LIBS+=-lresolv' + echo >>$m "WITH_LIBS+=$LIBRESOLV" fi echo "Checking whether to build a shared library... $SHARED (set manually)" @@ -161,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