X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fconfigure;h=08b94624b9425a2f52c252de0c368f997b7dd982;hb=8b122188dfd404984eb360e8d876682fe7eb1613;hp=27388bc15b5e99f0d550e5bec30f861fa2b97115;hpb=657bd95db1ed0fa31455cfeb01685f4c0552933b;p=pciutils.git diff --git a/lib/configure b/lib/configure index 27388bc..08b9462 100755 --- a/lib/configure +++ b/lib/configure @@ -6,12 +6,7 @@ LC_ALL=C export LC_ALL echo_n() { - if [ -n "$BASH" ] - then - echo -n "$*" - else - echo "$*\c" - fi + printf '%s' "$*" } if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then @@ -44,7 +39,7 @@ if [ -z "$HOST" ] ; then fi [ -n "$RELEASE" ] && rel="${RELEASE}" # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless. -host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'` +host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\2/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'` cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo " $host $rel $cpu $sys" @@ -58,6 +53,7 @@ echo >$m 'WITH_LIBS=' echo_n "Looking for access methods..." LIBRESOLV=-lresolv +LIBEXT=so case $sys in linux*) @@ -100,6 +96,15 @@ case $sys in echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"' LIBRESOLV= ;; + + darwin*) + echo_n " darwin" + echo >>$c '#define PCI_HAVE_PM_DARWIN_DEVICE' + echo >>$m 'WITH_LIBS+=-lresolv -framework CoreFoundation -framework IOKit' + echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' + LIBRESOLV= + LIBEXT=dylib + ;; aix) echo_n " aix-device" echo >>$c '#define PCI_HAVE_PM_AIX_DEVICE' @@ -111,11 +116,17 @@ case $sys in echo_n " nbsd-libpci" echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI' echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"' + echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' echo >>$m 'LIBNAME=libpciutils' echo >>$m 'WITH_LIBS+=-lpci' LIBRESOLV= ;; - gnu) + gnu) + echo_n " hurd i386-ports" + echo >>$c '#define PCI_HAVE_PM_HURD_CONF' + echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' + ;; + djgpp) echo_n " i386-ports" echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' ;; @@ -132,12 +143,20 @@ case $sys in esac echo >>$c '#define PCI_HAVE_STDINT_H' ;; + sylixos) + echo >>$c '#define PCI_PATH_SYLIXOS_DEVICE "/proc/pci"' + echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' + echo >>$c '#define PCI_HAVE_PM_SYLIXOS_DEVICE' + IDSDIR="/etc/pci" + LIBRESOLV= + ;; *) echo " Unfortunately, your OS is not supported by the PCI Library" exit 1 ;; esac +echo >>$m "LIBEXT="$LIBEXT echo >>$c '#define PCI_HAVE_PM_DUMP' echo " dump" @@ -211,6 +230,23 @@ if [ "$sys" = linux ] ; then echo >>$m "LIBKMOD_CFLAGS=$($PKG_CONFIG --cflags libkmod)" echo >>$m "LIBKMOD_LIBS=$($PKG_CONFIG --libs libkmod)" fi + + echo_n "Checking for udev hwdb support... " + if [ "$HWDB" = yes -o "$HWDB" = no ] ; then + echo "$HWDB (set manually)" + else + if `which pkg-config >/dev/null && pkg-config --atleast-version=196 libudev` ; then + HWDB=yes + else + HWDB=no + fi + echo "$HWDB (auto-detected)" + fi + if [ "$HWDB" = yes ] ; then + echo >>$c '#define PCI_HAVE_HWDB' + echo >>$m 'LIBUDEV=-ludev' + echo >>$m 'WITH_LIBS+=$(LIBUDEV)' + fi fi echo "Checking whether to build a shared library... $SHARED (set manually)" @@ -219,13 +255,17 @@ if [ "$SHARED" = no ] ; then echo >>$m 'LDLIBS=$(WITH_LIBS)' echo >>$m 'LIB_LDLIBS=' else - echo >>$m 'PCILIB=$(LIBNAME).so.$(VERSION)' + if [ "$LIBEXT" = so ]; then + echo >>$m 'PCILIB=$(LIBNAME).$(LIBEXT).$(VERSION)' + else + echo >>$m 'PCILIB=$(LIBNAME).$(VERSION).$(LIBEXT)' + fi # 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)' + if [ "$SHARED" = yes -a "$LIBEXT" = so ]; then + echo >>$m 'SONAME=-Wl,-soname,$(LIBNAME).$(LIBEXT)$(ABI_VERSION)' fi fi echo >>$m 'PCILIBPC=$(LIBNAME).pc'