]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/configure
Merge with git+ssh://git.ucw.cz/home/mj/GIT/pciutils.git
[pciutils.git] / lib / configure
index 2fc33bb2e379a6611845b2eef75476720a18a869..468a29f5aa6c0ffdd6e4914e01b072107da8027b 100755 (executable)
@@ -22,12 +22,13 @@ then
 else
        cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/'`
 fi
-if [ "$sys" = "GNU/kFreeBSD" ]
+if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ]
 then
        sys=freebsd
 fi
 host=${3:-$cpu-$sys}
-host=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr 'A-Z' 'a-z'`
+# 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]'`
 cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 rel=${4:-$rel}
@@ -35,8 +36,10 @@ echo " $host $rel"
 zlib=$5
 
 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'`"
+m=config.mk
+echo >$c "#define PCI_ARCH_`echo $cpu | tr '[a-z]' '[A-Z]'`"
+echo >>$c "#define PCI_OS_`echo $sys | tr '[a-z]' '[A-Z]'`"
+rm -f $m
 
 echo_n "Looking for access methods..."
 
@@ -61,10 +64,11 @@ case $sys in
                                                echo >>$c "#define PCI_HAVE_PM_INTEL_CONF"
                                                ;;
                                *)
-                                               echo " The PCI library is does not support Solaris for this architecture: $cpu"
+                                               echo " The PCI library does not support Solaris for this architecture: $cpu"
                                                exit 1
                                                ;;
                esac
+               echo >>$c '#define PCI_HAVE_STDINT_H'
                ;;
        freebsd)
                echo_n " fbsd-device"
@@ -79,11 +83,16 @@ case $sys in
        aix)
                echo_n " aix-device"
                echo >>$c '#define PCI_HAVE_PM_AIX_DEVICE'
+               echo >>$m 'CFLAGS=-g'
+               echo >>$m 'INSTALL=installbsd'
+               echo >>$m 'DIRINSTALL=mkdir -p'
                ;;
        netbsd)
                echo_n " nbsd-libpci"
                echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI'
                echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"'
+               echo >>$m 'PCILIB=lib/libpciutils.a'
+               echo >>$m 'LDLIBS+=-lpci'
                ;;
        gnu)
                echo_n " i386-ports"
@@ -111,11 +120,13 @@ else
 fi
 if [ "$zlib" = yes ] ; then
        echo >>$c '#define PCI_COMPRESSED_IDS'
-       echo >>$c "#define PCI_IDS \"pci.ids.gz\""
+       echo >>$c '#define PCI_IDS "pci.ids.gz"'
+       echo >>$m 'LIBZ=-lz'
+       echo >>$m 'LDLIBS+=$(LIBZ)'
 else
-       echo >>$c "#define PCI_IDS \"pci.ids\""
+       echo >>$c '#define PCI_IDS "pci.ids"'
 fi
 echo >>$c "#define PCI_PATH_IDS_DIR \"$idsdir\""
 
 echo >>$c "#define PCILIB_VERSION \"$version\""
-sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >config.mk
+sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >>$m