X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fconfigure;h=3df057ad8ffebf6878085a5113350e7bd6b9ddaf;hb=42fc4263ec0e35ba6a5ac7c32956e25b4551c907;hp=90692482249541d161611387a679e0c7b52da451;hpb=d9a7eb8f55ca5b886682cedd19f69292752ebd6b;p=pciutils.git diff --git a/lib/configure b/lib/configure index 9069248..3df057a 100755 --- a/lib/configure +++ b/lib/configure @@ -64,46 +64,70 @@ LIBRESOLV=-lresolv LIBEXT=so EXEEXT= SYSINCLUDE=/usr/include +LSPCIDIR=SBINDIR case $sys in linux*) - echo_n " sysfs proc" + echo_n " sysfs proc mem-ports ecam" echo >>$c '#define PCI_HAVE_PM_LINUX_SYSFS' echo >>$c '#define PCI_HAVE_PM_LINUX_PROC' + echo >>$c '#define PCI_HAVE_PM_MMIO_CONF' + echo >>$c '#define PCI_HAVE_PM_ECAM' 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"' + echo >>$c '#define PCI_PATH_DEVMEM_DEVICE "/dev/mem"' + echo >>$c '#define PCI_PATH_ACPI_MCFG "/sys/firmware/acpi/tables/MCFG"' + echo >>$c '#define PCI_PATH_EFI_SYSTAB "/sys/firmware/efi/systab"' case $cpu in i?86|x86_64) echo_n " i386-ports" echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' ;; esac echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' + LSPCIDIR=BINDIR ;; sunos) + echo_n " mem-ports ecam" case $cpu in i?86) echo_n " i386-ports" echo >>$c "#define PCI_HAVE_PM_INTEL_CONF" ;; - *) - echo " The PCI library does not support Solaris for this architecture: $cpu" - exit 1 - ;; esac - echo >>$c '#define PCI_HAVE_STDINT_H' + echo >>$c '#define PCI_HAVE_PM_MMIO_CONF' + echo >>$c '#define PCI_HAVE_PM_ECAM' + echo >>$c '#define PCI_PATH_DEVMEM_DEVICE "/dev/xsvc"' + echo >>$c '#define PCI_PATH_ACPI_MCFG ""' + echo >>$c '#define PCI_PATH_EFI_SYSTAB ""' ;; freebsd*|kfreebsd*) - echo_n " fbsd-device" + echo_n " fbsd-device mem-ports ecam" echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE' + echo >>$c '#define PCI_HAVE_PM_MMIO_CONF' + echo >>$c '#define PCI_HAVE_PM_ECAM' echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"' + echo >>$c '#define PCI_PATH_DEVMEM_DEVICE "/dev/mem"' + echo >>$c '#define PCI_PATH_ACPI_MCFG ""' + echo >>$c '#define PCI_PATH_EFI_SYSTAB ""' if [ "$sys" != "kfreebsd" ] ; then LIBRESOLV= fi ;; openbsd) - echo_n " obsd-device" + echo_n " obsd-device mem-ports ecam" echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE' + echo >>$c '#define PCI_HAVE_PM_MMIO_CONF' + echo >>$c '#define PCI_HAVE_PM_ECAM' echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"' + echo >>$c '#define PCI_PATH_DEVMEM_DEVICE "/dev/mem"' + echo >>$c '#define PCI_PATH_ACPI_MCFG "/var/db/acpi/MCFG.*"' + echo >>$c '#define PCI_PATH_EFI_SYSTAB ""' + case $cpu in + i386|amd64) echo_n " i386-ports" + echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' + echo >>$m 'WITH_LIBS+=-l'$cpu + ;; + esac LIBRESOLV= ;; @@ -124,9 +148,14 @@ case $sys in echo >>$m 'DIRINSTALL=mkdir -p' ;; netbsd) - echo_n " nbsd-libpci" + echo_n " nbsd-libpci mem-ports ecam" echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI' + echo >>$c '#define PCI_HAVE_PM_MMIO_CONF' + echo >>$c '#define PCI_HAVE_PM_ECAM' echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"' + echo >>$c '#define PCI_PATH_DEVMEM_DEVICE "/dev/mem"' + echo >>$c '#define PCI_PATH_ACPI_MCFG ""' + echo >>$c '#define PCI_PATH_EFI_SYSTAB ""' echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' echo >>$m 'LIBNAME=libpciutils' echo >>$m 'WITH_LIBS+=-lpci' @@ -143,6 +172,17 @@ case $sys in EXEEXT=.exe ;; cygwin|windows) + echo_n " win32-cfgmgr32 win32-kldbg win32-sysdbg" + echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' + echo >>$c '#define PCI_HAVE_PM_WIN32_CFGMGR32' + echo >>$c '#define PCI_HAVE_PM_WIN32_KLDBG' + echo >>$c '#define PCI_HAVE_PM_WIN32_SYSDBG' + # Warning: MinGW-w64 (incorrectly) provides cfgmgr32 functions + # also in other import libraries, not only in libcfgmgr32.a. + # So always set -lcfgmgr32 as a first library parameter which + # instruct linker to prefer symbols from cfgmgr32.dll. + echo >>$m 'WITH_LIBS+=-lcfgmgr32' + case $cpu in i?86|x86_64) echo_n " i386-ports" echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' if [ "$sys" = "cygwin" ] ; then @@ -152,15 +192,22 @@ case $sys in # advapi32 is windows system library and used only by lib/i386-io-windows.h echo >>$m 'WITH_LIBS+=-ladvapi32' fi + ;; esac EXEEXT=.exe + LIBEXT=dll ;; beos|haiku) + echo_n " mem-ports ecam" case $cpu in i?86|x86_64) echo_n " i386-ports" echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' ;; esac - echo >>$c '#define PCI_HAVE_STDINT_H' + echo >>$c '#define PCI_HAVE_PM_MMIO_CONF' + echo >>$c '#define PCI_HAVE_PM_ECAM' + echo >>$c '#define PCI_PATH_DEVMEM_DEVICE "/dev/misc/mem"' + echo >>$c '#define PCI_PATH_ACPI_MCFG ""' + echo >>$c '#define PCI_PATH_EFI_SYSTAB ""' ;; sylixos) echo >>$c '#define PCI_PATH_SYLIXOS_DEVICE "/proc/pci"' @@ -169,6 +216,13 @@ case $sys in IDSDIR="/etc/pci" LIBRESOLV= ;; + amigaos) + echo_n " aos-expansion" + echo >>$c '#define PCI_HAVE_STDINT_H' + echo >>$c '#define PCI_HAVE_PM_AOS_EXPANSION' + IDSDIR="DEVS:" + echo >>$m 'CC=gcc' + ;; *) echo " Unfortunately, your OS is not supported by the PCI Library" exit 1 @@ -177,6 +231,7 @@ esac echo >>$m "LIBEXT="$LIBEXT echo >>$m "EXEEXT="$EXEEXT +echo >>$m "LSPCIDIR=\$($LSPCIDIR)" echo >>$c '#define PCI_HAVE_PM_DUMP' echo " dump" @@ -225,7 +280,7 @@ if [ "$sys" = linux ] ; then PKG_CONFIG=pkg-config fi if [ "$LIBKMOD" != no ] ; then - if ! which $PKG_CONFIG >/dev/null ; then + if ! command -v $PKG_CONFIG >/dev/null ; then echo_n "($PKG_CONFIG not found) " elif $PKG_CONFIG libkmod ; then LIBKMOD_DETECTED=1 @@ -255,7 +310,7 @@ if [ "$sys" = linux ] ; then 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 + if `command -v $PKG_CONFIG >/dev/null && $PKG_CONFIG --atleast-version=196 libudev` ; then HWDB=yes else HWDB=no @@ -277,6 +332,8 @@ if [ "$SHARED" = no ] ; then else if [ "$LIBEXT" = so ]; then echo >>$m 'PCILIB=$(LIBNAME).$(LIBEXT).$(VERSION)' + elif [ "$LIBEXT" = dll ]; then + echo >>$m 'PCILIB=$(LIBNAME)$(ABI_VERSION).$(LIBEXT)' else echo >>$m 'PCILIB=$(LIBNAME).$(VERSION).$(LIBEXT)' fi @@ -284,11 +341,25 @@ else echo >>$m 'LDLIBS=' echo >>$m 'LIB_LDLIBS=$(WITH_LIBS)' echo >>$c '#define PCI_SHARED_LIB' - if [ "$SHARED" = yes -a "$LIBEXT" = so ]; then - echo >>$m 'SONAME=-Wl,-soname,$(LIBNAME).$(LIBEXT)$(ABI_VERSION)' + if [ "$LIBEXT" = so ]; then + echo >>$m 'PCILIB_LDFLAGS+=-Wl,-soname,$(LIBNAME).$(LIBEXT).$(ABI_VERSION)' + echo >>$m 'PCILIB_LDFLAGS+=-Wl,--version-script=libpci.ver' + elif [ "$LIBEXT" = dylib ]; then + echo >>$m 'PCILIB_LDFLAGS+=-Wl,-install_name,$(LIBDIR)/$(PCILIB)' + elif [ "$LIBEXT" = dll ]; then + echo >>$m 'PCIIMPDEF=$(LIBNAME)$(ABI_VERSION).def' + # GCC's -fvisibility=hidden is broken for Windows targets, use -Wl,--exclude-all-symbols instead (supported since GNU LD 2.21) + echo >>$m 'PCILIB_LDFLAGS+=-Wl,--exclude-all-symbols' fi fi echo >>$m 'PCILIBPC=$(LIBNAME).pc' +if [ "$SHARED" != no ] && [ "$LIBEXT" = dll ]; then + echo >>$m 'PCIIMPLIB=$(PCILIB).a' +else + echo >>$m 'PCIIMPLIB=$(PCILIB)' +fi + echo >>$c "#define PCILIB_VERSION \"$VERSION\"" +echo >>$c "#define PCILIB_DATE_AMIGAOS \"`echo $DATE | sed 's/\(....\)-\(..\)-\(..\)/\3.\2.\1/'`\"" sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >>$m