xmbmon-2.05/0000755000175000017500000000000010120632750012256 5ustar agiagi00000000000000xmbmon-2.05/AC-TOOLS/0000755000175000017500000000000010113053054013433 5ustar agiagi00000000000000xmbmon-2.05/AC-TOOLS/config.guess0000555000175000017500000012206507740153742016000 0ustar agiagi00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/FreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xmbmon-2.05/AC-TOOLS/config.sub0000444000175000017500000004654607356733763015463 0ustar agiagi00000000000000#! /bin/sh # Configuration validation subroutine script, version 1.1. # Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. if [ x$1 = x ] then echo Configuration name missing. 1>&2 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 echo "or $0 ALIAS" 1>&2 echo where ALIAS is a recognized configuration type. 1>&2 exit 1 fi # First pass through any local machine types. case $1 in *local*) echo $1 exit 0 ;; *) ;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in linux-gnu*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple) os= basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ | mipstx39 | mipstx39el \ | sparc | sparclet | sparclite | sparc64 | v850) basic_machine=$basic_machine-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i[34567]86) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparc64-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mipstx39-* | mipstx39el-* \ | f301-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-cbm ;; amigaos | amigados) basic_machine=m68k-cbm os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [ctj]90-cray) basic_machine=c90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; i370-ibm* | ibm*) basic_machine=i370-ibm os=-mvs ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i[34567]86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i[34567]86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i[34567]86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i[34567]86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; miniframe) basic_machine=m68000-convergent ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; np1) basic_machine=np1-gould ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | nexen) basic_machine=i586-pc ;; pentiumpro | p6 | k6 | 6x86) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | nexen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | k6-* | 6x86-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=rs6000-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; symmetry) basic_machine=i386-sequent os=-dynix ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sparc) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -xenix) os=-xenix ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-semi) os=-aout ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f301-fujitsu) os=-uxpv ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -hpux*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os xmbmon-2.05/AC-TOOLS/install-sh0000755000175000017500000001272006713627630015463 0ustar agiagi00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 xmbmon-2.05/smbuses.h0000644000175000017500000000062407652045323014124 0ustar agiagi00000000000000/* SMBus IO for various chips */ #ifdef DEBUG #define SMB_DEBUG #endif #if !defined(__smbuses_h__) #define __smbuses_h__ struct smbus_io { int (*ReadB)(int, int, int); int (*ReadW)(int, int, int); int (*WriteB)(int, int, int, int); int (*WriteW)(int, int, int, int); }; typedef struct smbus_io SMBUS_IO; int set_smbus_io(int *, int *); int chk_smbus_io(int, int); #endif /*__smbues_h__*/ xmbmon-2.05/smbuses.c0000644000175000017500000000356010007414050014102 0ustar agiagi00000000000000/* setting SMBus IO routines for various chips */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "pci_pm.h" #include "smbuses.h" #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) extern int smbioctl_readB(int, int, int); #else /* using own SMBus IO routines */ /* smbus io routines, global */ SMBUS_IO *smbus; extern SMBUS_IO smbus_piix4; extern SMBUS_IO smbus_amd; extern SMBUS_IO smbus_ali; extern SMBUS_IO smbus_amd8; #endif int set_smbus_io(int *viahwm_base, int *smb_base) { int n; n = pci_pm_smb_prob(viahwm_base, smb_base); #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) return n; #else /* using own SMBus IO routines */ if (n <= 0) return n; if (n/10 == AMD756SMB/10) smbus = &smbus_amd; else if (n/10 == ALI1535SMB/10) smbus = &smbus_ali; else if (n/10 == AMD8111SMB/10) smbus = &smbus_amd8; else smbus = &smbus_piix4; return n; #endif } /* Blacklist slave addresses int blacklist[] is defined, because in some motherboard (Abit BH6, as an example) SMBus hangs up if accessing to it, even in read access (not write!). One must make hardware reset (or switching off) to recover! Reference: detect.c by Takanori Watanabe. */ int chk_smbus_io(int smb_chipset, int smb_base) { int n, i, j; int blacklist[] = {0xD2,-1}; int (*readB)(int, int, int); if (smb_chipset <= 0) return 0; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) readB = smbioctl_readB; #else if (smb_chipset/10 == AMD756SMB/10) smbus = &smbus_amd; else if (smb_chipset/10 == ALI1535SMB/10) smbus = &smbus_ali; else if (smb_chipset/10 == AMD8111SMB/10) smbus = &smbus_amd8; else smbus = &smbus_piix4; readB = smbus->ReadB; #endif n = 0; for (i = 0; i < 255; i += 2) { for (j = 0; blacklist[j] != -1; j++) { if (i != blacklist[j] && readB(smb_base, i, 0x00) != -1) n++; } } return n; } xmbmon-2.05/smbus_amd.c0000644000175000017500000001365310110432223014374 0ustar agiagi00000000000000 /* SMB handling routines for AMD7xx, by YRS 2002.07. Information on how to access SMBus is provided by ":p araffin.(Yoneya)", MANY THANKS!! Common to AMD756/766/768 and NVidia nForce SMBus IO method: smb_base : Base Address addr : Slave Device Address cmd : Command Register Note that SMBus Slave Device Address is totall 1byte data, whose upper 7bits is for address and the lowest bit for read (=1) and for write (=0). The input "addr" in the following routines is this 1byte data, where the lowest bit can be either 0 or 1. 7 0 +-+-+-+-+-+-+-+-+ | Slave addr. |f| f = 0 for write, =1 for read. +-+-+-+-+-+-+-+-+ Do not confuse "Slave address" which is "addr(here)"/2! */ #ifdef SMB_DEBUG extern int debug_flag; #include #endif #include #include #include #include "smbuses.h" #include "io_cpu.h" #define LSB 0x01 #define LOOP_COUNT 0x2000 /* command address */ #define SMBHSTS 0x0 #define SMBHCTRL 0x2 #define SMBHADDR 0x4 #define SMBHDATA 0x6 #define SMBHCMD 0x8 /* status flag */ #define SMBHSTS_TOSTS 0x20 /* ? not used */ #define SMBHSTS_DONE 0x10 /* host cycle (command) completed */ #define SMBHSTS_BUSY 0x08 /* host busy */ #define SMBHSTS_ERROR 0x04 /* device error */ #define SMBHSTS_COLLID 0x02 /* bus collision */ #define SMBHSTS_ABORT 0x01 /* abort */ #define SMBHSTS_CLEAR (SMBHSTS_TOSTS|SMBHSTS_DONE|SMBHSTS_ERROR|\ SMBHSTS_COLLID|SMBHSTS_ABORT) /* clear status*/ /* control command number */ #define SMBHCTRL_ABORT 0x20 /* abort */ #define SMBHCTRL_START 0x08 /* start command */ #define SMBHCTRL_WORD 0x03 /* word I/O */ #define SMBHCTRL_BYTE 0x02 /* byte I/O */ static int readbyte(int smb_base, int addr, int cmd) { u_char saddr = 2*(addr/2); u_short dat; int i; top: OUTw((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; OUTw((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTw((u_short) (smb_base + SMBHCTRL), SMBHCTRL_ABORT); WAIT; WAIT; step: OUTw((u_short) (smb_base + SMBHADDR), (saddr | LSB)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTw((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_BYTE)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_COLLID) { #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, "\n OH! collision! = 0x%02X\n", dat); #endif goto top; } if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, " Readbyte: flag = 0x%02X, loop#:%04d", dat, i); #endif if (dat & SMBHSTS_DONE) { dat = INw((u_short) (smb_base + SMBHDATA)); WAIT; WAIT; return (dat & 0x00FF); } else return -1; } static int readword(int smb_base, int addr, int cmd) { u_char saddr = 2*(addr/2); u_short dat; int i; top: OUTw((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; OUTw((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTw((u_short) (smb_base + SMBHCTRL), SMBHCTRL_ABORT); WAIT; WAIT; step: OUTw((u_short) (smb_base + SMBHADDR), (saddr | LSB)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTw((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_WORD)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_COLLID) goto top; if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } if (dat & SMBHSTS_DONE) { dat = INw((u_short) (smb_base + SMBHDATA)); WAIT; WAIT; return (dat & 0xFFFF); } else return -1; } static int writebyte(int smb_base, int addr, int cmd, int value) { u_char saddr = 2*(addr/2); u_short dat; int i; OUTw((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; OUTw((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTw((u_short) (smb_base + SMBHCTRL), SMBHCTRL_ABORT); WAIT; WAIT; step: OUTw((u_short) (smb_base + SMBHADDR), saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTw((u_short) (smb_base + SMBHDATA), (u_char) value); WAIT; WAIT; OUTw((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_BYTE)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } if (dat & SMBHSTS_DONE) return 0; else return -1; } static int writeword(int smb_base, int addr, int cmd, int value) { u_char saddr = 2*(addr/2); u_short dat; int i; OUTw((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; OUTw((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTw((u_short) (smb_base + SMBHCTRL), SMBHCTRL_ABORT); WAIT; WAIT; step: OUTw((u_short) (smb_base + SMBHADDR), saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTw((u_short) (smb_base + SMBHDATA), (u_short) value); WAIT; WAIT; OUTw((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_WORD)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INw((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } if (dat & SMBHSTS_DONE) return 0; else return -1; } struct smbus_io smbus_amd = { readbyte, readword, writebyte, writeword }; xmbmon-2.05/io_cpu.h0000644000175000017500000000363610113047031013707 0ustar agiagi00000000000000#if !defined(__io_cpu_h__) #define __io_cpu_h__ #ifdef LINUX /* LINUX */ #include #define SET_IOPL() iopl(3) #define RESET_IOPL() iopl(0) #elif defined(__svr4__) /* Solaris for x86 */ #include #include #ifndef SI86IOPL #define SET_IOPL() sysi86(SI86V86,V86SC_IOPL,PS_IOPL) #define RESET_IOPL() sysi86(SI86V86,V86SC_IOPL,0) #else #define SET_IOPL() sysi86(SI86IOPL,3) #define RESET_IOPL() sysi86(SI86IOPL,0) #endif #elif NETBSD /* NetBSD, OpenBSD */ #include "machine/sysarch.h" #define SET_IOPL() i386_iopl(1) #define RESET_IOPL() i386_iopl(0) #else /* FreeBSD */ extern int iofl; #define SET_IOPL() (iofl = open("/dev/io",000)) #define RESET_IOPL() close(iofl) #endif extern int iopl_counter; /* * These assume GCC is being used with GAS. */ static __inline__ unsigned char my_inb(unsigned short port) { unsigned char ret; __asm__ __volatile__("inb %1,%0" : "=a" (ret) : "d" (port)); return ret; } static __inline__ unsigned short my_inw(unsigned short port) { unsigned short ret; __asm__ __volatile__("inw %1,%0" : "=a" (ret) : "d" (port)); return ret; } static __inline__ unsigned int my_inl(unsigned short port) { unsigned int ret; __asm__ __volatile__("inl %1,%0" : "=a" (ret) : "d" (port)); return ret; } static __inline__ void my_outb(unsigned short port, unsigned char val) { __asm__ __volatile__("outb %0,%1" : : "a" (val), "d" (port)); } static __inline__ void my_outw(unsigned short port, unsigned short val) { __asm__ __volatile__("outw %0,%1" : : "a" (val), "d" (port)); } static __inline__ void my_outl(unsigned short port, unsigned int val) { __asm__ __volatile__("outl %0,%1" : : "a" (val), "d" (port)); } #define INb(x) my_inb((x)) #define INw(x) my_inw((x)) #define INl(x) my_inl((x)) #define OUTb(x,y) my_outb((x),(y)) #define OUTw(x,y) my_outw((x),(y)) #define OUTl(x,y) my_outl((x),(y)) #define WAIT my_outb(0xEB,0x00) #endif /*__io_cpu_h__*/ xmbmon-2.05/ReadMe0000644000175000017500000011225710120625312013342 0ustar agiagi00000000000000 ********************************************************* Mother Board Monitor Program for X Window System [only on x86 platforms!] XMBmon ver.2.05 for FreeBSD (and for NetBSD/OpenBSD, Linux, and Solaris on x86). ********************************************************* << 1. What's this software >> Recent motherboards have functionalities to monitor the CPU temperatures and the frequency of CPU cooling fans etc. Although some programs utilizing these hardware monitoring facilities have been developed for the Microsoft Windows platforms, no programs seem to exist for PC-UNIX and the X Windows System platforms. Thus, I have tried to make small programs. They have only least functionalities, the one "mbmon" used at the command line reports the temperatures, voltages and rpm (rounds per minute) of cooling fans, and the other "xmbmon" displays the three temperatures and a core voltage as simple curves. << 2. Supported hardware monitor chips >> The following hardware monitor chips are supported and the programs will work if your motherboard uses one of them or their compatible chip: National Semiconductor co. LM78/LM79, LM75, LM90, LM80, LM85 WinBond co. W83781D, W83782D, W83783S, W83627HF, W83697HF built-in, W83L784R, W83L785R, W83L785TS-S, W83627THF ASUSTek co. AS99127F, ASB100 (Bach), ASM58 etc. (Mozart-2) VIA Technology co. VT82C686A/B built-in Integrated Technology Express co. IT8705F, IT8712F built-in Genesys Logic GL518SM, GL520SM Analog Devices ADM1024/1025/1027, ADT7463, ADM1020/1021/1023 Standard Microsystem co. EMC6D100/101/102 << 3. Supported SMBus interface chipsets >> There are several methods of the interface to hardware monitor chips: one using ISA-IO port, or using specific method for VIA 82C686A/B chip (see below for details). But the most common way is the one through the so-called SMBus (System Management Bus), and the IO port is different for different SMBus interface chips. In this version, the following chips (the south bridge of the chipset) are supported: Intel: PIIX4 (440BX), ICH, ICH0, ICH2, ICH3, ICH4, ICH5, ICH6 (810, 815, ...) VIA: VT82C596/B, VT82C686A/B (KT133/A), VT8233A/C (KT266/A/KT333), VT8235(KT400), VT8237(KT600/KT880) AMD: AMD756(AMD750), AMD766(AMD760), AMD768(AMD760MP), AMD8111 NVidia: nForce, nForce2 Acer Lab. Inc.(ALi): M1535D+(MAGiK1/AladdinPro), M1541,1621(Aladdin IV, V) Here, I must confess that I myself did not check all the motherboards having the chipsets above. So I cannot guarantee the programs work for all motherboards using the following chipsets. The motherboards, which are checked by myself or beta testers and are reported to work by users: ABIT: VP6(ApolloPro133A(VIA686B)), KT7A(KT133A), KG7(AMD761+VIA686A), NF7(nForce2/ISA+W83627HF), IC7-G(i875P/ISA+W83627HF) ASUS: P2B,P2B-F,P2B-B(440BX+W83781D), P3B-F(440BX+AS99127F), K7VM(KT133+W83782D), A7V,A7V133(KT133/A+AS99127F), A7A266(ALi M1535D++AS99127F), A7V266(KT266/A+AS99127F), A7N266(nForce+AS99127F), A7M266-D(AMD768+AS99127F), A7V333(KT333+ASB100), A7V8X(KT400+ASB100), A7N8X(nForce2+ASB100+W83L785TS-S),A7V600(KT600+IT8712F), CUSL(Intel815E+AS99127F), TUSI-M(SiS630/ISA+IT8705F), P4B533-VM(Intel845(ICH4)+ASM58), P4PE(Intel845PE(ICH4)+ASM100), P4T533-C(Intel850E(ICH4)+AS99127F), P4C800ED (Intel875P(ICH5R)/ISA+W83627THF-A) EpoX: BX6SE(440BX/ISA+W83782D), 8KHA+(KT266A/ISA+W83697HF), 8RDA3+(nForce2/ISA+W83627HF) ECS: K7S5A(Sis735/ISA+IT8705F), D6VAA(AppoloPro133A(VIA686B)) Soltek: SL75DRV2(KT266+IT8705F) Freeway: FW-6280BXDR/155(440BX+W83781D/W83782S) Aopen: MX3S (i815E(ICH2)+W83627H), MX3S-U(i815E(ICH2)+ADM1024), MX36LE (PLE133(VIA686B)) Shuttle: FV24 (PLE133(VIA686B)) MSI: K7N2 Delta-L(nForce2/ISA+W83627HF) Tyan: TigerMP/MPX(S2460/S2462)(AMD766+W83782D+W83627HF)[Note], Trinity 100AT(VIA586A(viapm)+GL518SM), Trinity i875P(S5101ANNRF)(ICH5/ISA+W83627HF-AW) Gigabyte: GA-7VAXP (KT400/ISA+IT8705F+LM90), GA-SINXP-1394(SiS655/ISA+IT8705F), GA-7VM400M(KM400/ISA+IT8705F) GA-7VT880-L(KT880/ISA+IT8712F) Leadtek: K7NCR18D (nForce2+W83783S+W83L785TS-S) Albatron: KX400+Pro (KT333/ISA+W83697HF+W83L785TS-S) Aopen: AX4GER(Intel845GE(ICH4)/ISA+W83627HF) Intel: S845WD1(Intel845E(ICH4)+LM85), ISP1100(440BX+ADM9240), D815EPEA2(Intel815(ICH2)+ADM1025) ChainTech: CT-7VJL(KT333/ISA+ITE8705F+LM90) NMC: 6BAX+ (440BX/ISA+LM78+LM75) [Note] As for Tyan TigerMP/MPX, see [Note] at the end of 6.Option. << 4. How to use >> By using "./configure" and "make" under the directory where this package is unpacked, two binary programs mbmon Mother Board Monitor for tty-terminal xmbmon Mother Board Monitor for X will be generated. ((NOTICE)) These programs access SMBus or ISA-IO port without any kind of checking. It is, therefore, very dangerous and may cause system-crash in worst cases. Especially, accesses of IO port 0x295, 0x296 may conflict NE2000 boards' IO ports. Users are requested to be sure that access to those ports are allowed. I do not take any responsibilities for problems caused by using these programs. If you succeed compiling the programs, then it is better first to check they will work on your motherboard. Switch to the root user, and execute "mbmon" like this, # ./mbmon -d (or ./mbmon -d -A see below) in the debug mode. If you do NOT get the following error message, No Hardware Monitor found!! InitMBInfo: Undefined error: 0 but it displays information of the detected hardware monitor chip like this, Using SMBus access method[VIA8233/A(KT266/KT333)]!! * Asus Chip, ASB100 found. then the programs will most probably work. Try to execute "mbmon" now without "-d" option, and if the following output like this Temp.= 31.0, 37.0, 37.0; Rot.= 3970, 2576, 2700 Vcore = 1.74, 1.74; Volt. = 3.38, 5.08, 12.40, -11.35, -4.90 comes out every five seconds, congratulation!; the programs work on your system. If only one temperature is displayed and you are sure that your motherboard has a hardware monitoring facility of voltage and fan speed, then try to add "-A" option (see the next paragraph for explanation). If it is working fine, just stop it by typing "^C" (CTRL-C), and install these two programs (Only ^C can stop "mbmon"). Note that both programs, mbmon/xmbmon, access SMBus or ISA-IO port so that they should sit in a directory in the PATH variable with a "setuid root" permission. An example of installation is written in Makefile. If you put "mbmon" in /usr/local/bin and manual files in /usr/local/man/man1, and "xmbmon" in /usr/X11R6/bin and a manual file in /usr/X11R6/man/man1, then just type # make install # make install-man and then they are installed properly. In some motherboard, there exist two sensor chips, one is for a primary hardware monitor, and the other is a secondary one for measuring CPU temperature. From version 2.02, such a case is also supported. In order to see how many possible sensor chips are used in your motherboard, execute "mbmon" with "-A" option in the following way: # ./mbmon -d -A If the result is like this: Summary of Detection: * SMB monitor(s)[VT8233/A/8235(KT266/KT333/KT400)]: ** Winbond Chip W83L785TS-S found at slave address: 0x5C. * ISA monitor(s): ** Winbond Chip W83697HF found. It means that the primary monitor chip is W83697HF with a secondary sensor W83L785TS-S for CPU temperature (attached to the CPU on-die diode sensor). In this case, the default action is # ./mbmon Temp.= 76.0, 0.0, 0.0; Rot.= 0, 0, 0 Vcore = 0.00, 0.00; Volt. = 0.00, 0.00, 0.00, 0.00, 0.00 # ./mbmon -I Temp.= 41.0, 64.5, 0.0; Rot.= 4440, 0, 0 Vcore = 1.66, 0.00; Volt. = 3.26, 4.76, 12.65, -12.20, -5.15 But, with "-A", these output is unified such as, # ./mbmon -A Temp.= 41.0, 64.5, 76.0; Rot.= 4440, 0, 0 Vcore = 1.66, 0.00; Volt. = 3.26, 4.76, 12.65, -12.20, -5.15 where the appeared third temperature is the CPU temperature (76.0) detected by the W83L785TS-S chip. In this example, W83697HF has only two temperature sensors in it, so that the third temperature is naturally replaced with the value obtained by the extra sensor W83L785TS-S. But if the primary monitor chip can measure three temperatures, you have to choose which one should be replaced with the secondary sensor by option "-e [0|1|2]", which means the first, second, third temperature being replaced, respectively (default is the third one). In the present implement, the sensor chips treated as an extra sensor are the following: W83L785TS-S LM90/ADM1020/ADM1021/ADM1023 LM75 As I said, the programs access IO port directly, so even if the program has a "setuid root" permission, they won't work on the system where this IO port access is prohibited. If the following message, InitMBInfo: Operation not permitted This program needs "setuid root"!! comes on FreeBSD, the system security level is too strict and IO port access is not allowed (see kern_securelevel_enable, kern_securelevel in /etc/rc.conf). Make your security level lower, or just give up to use the programs. From version 2.01, "mbmon" can be executed in daemon mode, and one can check output from an another machine over network. By executing, # mbmon -P port_no at a remote host, which one wants to monitor, using telnet command from other machines like, $ telnet hostname port_no Trying xxx.xxx.xxx.xxx... Connected to hostname. Escape character is '^]'. Temp.= 29.0, 25.0, 38.5; Rot.= 3750, 3688, 2410 Vcore = 1.70, 1.70; Volt. = 3.31, 4.97, 12.40, -11.35, -4.87 Connection closed by foreign host. one can quite easily get output of "mbmon" at any time. Here, from version 2.04, the logging facility (the default logfile is /var/log/mombon.log) is included. The output record of the logfile is like this: ;;;TEMP0;TEMP1;TEMP2;FAN0;FAN1;FAN2; 5/ 2/2004; 3:56:35 AM;; 36.0 C; 40.0 C; 33.0 C; 2008 RPM; 3515 RPM; 0 RPM; 5/ 2/2004; 3:51:35 AM;; 36.0 C; 40.5 C; 33.0 C; 2020 RPM; 4017 RPM; 0 RPM; . . . If you want to enable this, you have to add -DLOGGING macro to the DEFS variable in Makefile. The logfile name, the interval for taking log, and the maximum record of logfile can be changed by defining each variable in "config.h". Depending on motherboards, the output of temperature takes a crazy value if the sensor is not attached to the chip. If you don't like this, by compiling the program with -DTEMP_LIMIT macro added to the DEFS variable in the Makefile, and setting TEMP_HIGH/TEMP_LOW in the "getMBinfo.c" file, the output value of temperature is set 0 when the read value is out of range in the TEMP_LOW and TEMP_HIGH. It has been known that the output values of negative voltages (the 4th [-12V] and 5th [-5V] column of "Volt. = ...") are not precise, depending on motherboards. This is because the motherboard maker does not follow the instruction of data sheet for each hardware monitor chip. So it is impossible to correct the inaccurate values. A motherboard of dual CPU (SMP) machines may have two hardware monitor chips, one of which is connected to the SMBus and the other to the ISA IO port (see 5. A bit of more details). If the result seems not proper, try to execute "mbmon" with -I option. For the Linux platforms -DLINUX macro should be added to the DEFS variable in Makefile. If "configure" script failed to add it, do it by yourself. I do not have Linux machines available around me. Therefore, I am afraid that the programs will not work, although I have checked to compile and run on the Linux emulation environment on FreeBSD. << 5. A bit of more details >> The first version of this software is programmed mainly to use the Winbond W86781D chip as a hardware monitor chip of motherboard. This chip can handle three temperatures (Temp0, Temp1, Temp2), seven voltages (V0 - V6), and three FAN rotational speeds (Fan0, Fan1, Fan2). The program, "mbmon", shows all the information in text on tty's, and "xmbmon" shows Temp0,1,2 and V0(Vcore) graphically on X. The units are degree in Celsius (C) for temperatures [it is now possible to show them in Fahrenheit (F) from version 1.07], Volt (V) for voltages, and rotations per minute (rpm) for Fan rotation speeds. Other chips may not support all of them. For example, VIA's VI82C686 will report on three temperatures, five voltages, and two fan speeds. The items which are not supported by chip are displayed by "0.0" or "0" in the "mbmon" output. The program "mbmon" can take a input of interval (in seconds, default value is 5 seconds) for showing the output monitor information. In the case of "xmbmon", Temp0,1,2 are depicted with legends "MB", "CPU", "chip", respectively. They are X resources and can be freely changed (see the included file, xmbmon.resources). Note that which temperature is assigned is different in each motherboard. If these legends are not appropriate for your motherboard, change them appropriately by yourself. If your motherboard has only two sensor and/or only two are connected, it is possible not to display one of the three temperatures by setting "NOTEMP" (or blank '') (see section 6. for details of options/resources ). If you do not know what kind of hardware monitor chips your mother board has, then by using the following "debug" option # mbmon -d or # mbmon -D # xmbmon -debug # xmbmon -DEBUG information of the monitor chip would be detected(-D/-DEBUG is for getting more detailed information). You can judge, more or less, whether these programs can run on your machine. Among the supported hardware monitor chips, LM78/79 has only Temp0 (measuring the temperature of motherboard) occasionally with LM75 which can monitor only temperature being used for CPU. The W83783S chip does not support Temp2. Some motherboard may not use all Temp0/1/2 functionalities even though the monitor chip has all. Usually, Temp0 is for measuring motherboard's temperature, which is about the room temperature and does not change. Temp1,2 are only effective when they are connected to external sensor chips explicitly in most cases. But in recent motherboards (like ASUS P3B-F) Temp1 is often connected to the inner sensor of Pentium II/III CPU by default. Generally, recent motherboards provide two access methods to the hardware monitor chip, namely those using the SMBus (System Management Bus) and the old fashioned ISA-IO port. New chips (like AS99127F on ASUS P3B-F motherboard) would only allow the SMBus access method. From the version 1.06 the program equipped its own access functions to the SMBus, and it is possible to read data from sensor chips directly through SMBus without any help of the OS supported device drivers (see 3. Supported SMBus interface chipsets). The present version (4.6R) of FreeBSD provides the following SMBus drivers, "intpm"(for PIIX4 south chip of 440BX), "amdpm"(for AMD756[Note1]), "alpm"(for ALi M15x3[Note2]), and "viapm"(for VIA586/596/686/8233). One can use these drivers in place of the SMBus access routines of the "xmbmon" package by compiling it with -DSUMBUS_IOCTL macro of the variable DEFS in the Makefile. If the "./configure" process finds a device file /dev/smb0, the program utilizes the ioctl calls to access SMBus through the device driver. The SMBus is one of general buses, and the hardware monitor chip is not necessarily the only device using the bus. For example, the driver "bktr" for the Brooktree chip adopted many TV tuner cards also uses /dev/smbX. Thus, if there are some devices on the bus, one must identify which device file, /dev/smbX, the hardware monitor chip is using by checking the output of the "dmesg" message. The system will crash or reboot if a wrong device file number is used for "xmbmon" (I have experienced this since I have a TV tuner card with the "bktr0" driver). Therefor, a new option for specifying the device file number X of /dev/smbX from the version 2.00, the -s/-smbdev option: # mbmon -s X[0-9] # xmbmon -smbdev X[0-9] the default of which is X=0 (/dev/smb0). The built-in hardware monitor in the VIA's south chipset VT82C686A/B has an another access method to the chip, by using a different ISA-IO port access from that of Winbond chips. Thus, including this for VT82C686A/B, there are three methods to access the supported hardware monitor chips. I call this specific method for the VIA's chip, method V, more general method using SMBus, method S, and the old fashioned ISA-IO port method for the LM78/79 or Winbond chips, method I. One can impose the programs to use one of these three methods by giving a method option; # mbmon -[V|S|I|A] # xmbmon -method [V|S|I|A] for method, V, S, I, respectively. To check your motherboard supports which access method, you just try to execute programs with this and the debug option (-d). If this method option is not supplied, the programs try to check method V, S, I in this order, and automatically choose the access method. There are many more options for "mbmon/xmbmon", which will be denoted by executing it with a help option (-h or -help). For X, resources can also be used by writing them in user's .Xdefaults file. They are explained in details in 6. Options, and X resources of "xmbmon". From version 2.00 another new option is supplied for specifying the hardware monitor chip used in order to avoid mis-detection of hardware monitor chips. It is useful if the users know which monitor chips are used on their motherboards. Try to use this option if the automatic detection fails. The chip names one can specify is the following; # mbmon -p [winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75] # xmbmon -probe [winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75] i.e. seven kinds of chips, which corresponds precisely to the following monitor chips, winbond: LM78/LM79, W83781D, W83782D, W83783S, W83627HF, W83697HF, AS99127F, ASB100 wl784: W83L784R, W83L785R, W83L785TS-S via686: VT82C686A/B it87: IT8705F, IT8712F gl52: GL518SM, GL520SM lm85: LM85, ADM1024, ADM1025, ADM1027, ADT7463, EMC6D10X lm80: LM80 lm90: LM90, ADM1020, ADM1021, ADM1023 lm75: LM75 [Note1] "amdpm" driver recently has supported the SMBus access of NVidia nForce chipset (but it is not yet committed). Moreover, a small patch make it possible to support AMD766/768 (see [FreeBSD-users-jp 68570]). If you want more detailed information, please contact me directly. [Note2] "alpm" driver supports a older ALi M15x3 chipset, but it is possible to support newer M1535D+ used in MAGiK1 or AladdinPro chipsets by a small patch. If you want more detailed information, please contact me directly. << 6. Options, and X resources of "xmbmon" >> "mbmon" has the following options: # mbmon -h MotherBoard Monitor, ver. 2.05 by YRS. Usage: mbmon [options...] (default 5 sec) options: -V|S|I: access method (using "VIA686 HWM directly"|"SMBus"|"ISA I/O port") -A: for probing all methods, all chips, and setting an extra sensor. -d/D: debug mode (any other options except (V|S|I) will be ignored) [-s [0-9]: for using /dev/smb[0-9]\n" ]<== compiled with -DSMBUS_IOCTL -e [0-2]: set extra temperature sensor to temp.[0|1|2] (need -A). -p chip: chip=winbond|wl784|via686|it87|lm80|lm90|lm75 for probing chips -Y: for Tyan Tiger MP/MPX motherboard -h: print help message(this) and exit -f: temperature in Fahrenheit -c count: repeat times and exit -P port: run in daemon mode, using given port for clients -T|F [1-7]: print Temperature|Fanspeed according to following styles style1: data1\n style2: data2\n style3: data3\n style4: data1\ndata2\n style5: data1\ndata3\n style6: data2\ndata3\n style7: data1\ndata2\ndata3\n -r: print TAG and Value format -u: print system uptime -t: print present time -n|N: print hostname(long|short style) -i: print integers in the summary(with -T option) Here, -V|S|I is specifying the access method to the hardware monitor chips mentioned above; -f is for showing temperatures in Fahrenheit rather than Celsius; -d/D for debugging; -s is for specifying the device file number X of /dev/smbX; -p is for specifying the monitor chip probed; -h for showing help messages above. The options below -c are for displaying various multi-purpose output of the hardware monitor: They are rather apparent from the message above; -c "count" is for exit of execution after showing the output "count" times; -P is, with giving port number, for executing "mbmon" in daemon mode (see section 4. How to use); -T|F for output of temperature or fan speed in the following "style"; -u, -t, -n|N for showing some machine information, which is not related to the hardware monitor actually; -i is for output in integer rather than floating point format. In version 2.02, new options -A and -e [0-2] are added in order to show the temperature measured by an extra sensor chip. -A is for forced detection of extra sensors if possible. -e [0|1|2] is for replacing the first, second, third temperature with the value of an extra sensor; default action is to replace the third one (-e 2). See section 4 How to use for details. Now by using this strong output functionality above, one can utilize outer programs of the "xmbmon" packages, something like MRTG or rrdtool. Especially, an convenient perl script for rrdtool is contributed by Shin-ichi Nagamura. If it is installed in a proper path place, # mbmon-rrd.pl [rrdfile] makes the data file for rrdtool quite easily. Of course, one has to install rrdtool package/port before using it. "xmbmon" is programmed with the X toolkit, and the standard X resources (like geometry, font) can be used. Other "xmbmon" specific resources are the following (file "xmbmon.resources"): XMBmon*count: counts to check temp. etc in "sec" below (default:4) XMBmon*sec: period in seconds for plot one point (default:20) XMBmon*wsec: total period in seconds for window width (default:1800) XMBmon*tmin: lowest scale of temperature in degree C (default:10.0) XMBmon*tmax: highest scale of temperature in degree C (default:50.0) XMBmon*vmin: lowest scale of V-core voltage in V (default:1.80) XMBmon*vmax: highest scale of V-core voltage in V (default:2.20) XMBmon*tick: number of ticks for temp. and V-core (default:3) XMBmon*cltmb: color for plotting Temp0 (default:blue) XMBmon*cltcpu: color for plotting Temp1 (default:red) XMBmon*cltcs: color for plotting Temp2 (default:cyan) XMBmon*clvc: color for plotting Vcore (default:green) XMBmon*cmtmb: legend of Temp0, NOTEMP for not showing (default:\ MB) XMBmon*cmtcpu: legend of Temp1, NOTEMP for not showing (default:CPU) XMBmon*cmtcs: legend of Temp2, NOTEMP for not showing (default:chip) XMBmon*cmvc: legend of Vcore (default:Vc\ ) XMBmon*method: access method (default:\ ) XMBmon*extratemp: temperature replaced with an extra sensor (default: 2) XMBmon*smbdev: number X of device file /dev/smbX (default:0) XMBmon*fahrn: temperature in Fahrenheit, True or False (default: False) XMBmon*TyanTigerMP: for Tyan Tiger MP/MPX motherboard (default:False) XMBmon*probe: chip name to be probed (default:\ ) XMBmon*label: label (default: ) XMBmon*labelcolor: color of label (default: black) The default behavior is that every 20(sec)/4(count)=5 seconds, the timer interrupt occurs and then hardware monitor information is read. The average value of four times' read-in is displayed as a colored curve. The width of the "xmbmon" window corresponds to 1800(wsec) seconds, i.e. 30 minutes. If time passes old plot data disappears and renew the display (just like the "xload" program). The resources above can be specified as options with the same name at the execution time. The help option (-h or -help) shows these options like this: # xmbmon -help X MotherBoard Monitor, ver. 2.05 by YRS. options: : -g (100x140) : -count (4) : -sec (20) : -wsec (1800) : -tmin (10.0) : -tmax (50.0) : -vmin (1.80) : -vmax (2.20) : -tick (3) : -cltmb (blue) : -cltcpu (red) : -cltcs (cyan) : -clvc (green) : -cmtmb ( MB) [Not shown ] : -cmtcpu (CPU) [if "NOTEMP"] : -cmtcs (chip) [set. ] : -cmvc (Vc ) : -fahrn (False) : -label ( ) for showing label [No label if null-string.] and -labelfont, -labelcolor : -method ( ) [: -smbdev [0-9] (0) for using /dev/smb[0-9]<== compiled with -DSMBUS_IOCTL] : -extratemp (2) set extra-temp. to temp[0|1|2] (need -A) : -probe chip ( ) chip=winbond|wl784|via686|it87|lm80|lm90|lm75 for probing monitor chips : -TyanTigerMP for Tyan Tiger MP motherboard : -debug/DEBUG for debug information [Note] From version 2.00 the special treatment of Tyan's dual CPU motherboard, TigerMP/MPX is supported. This motherboard has two sensor chips, and one has to enable the second one. In order to attach and enable the second sensor, one has to use a Tyan specific option(-Y for "mbmon", -TyanTigerMP for "xmbmon"). Then the first sensor is accessed through SMBus and the second one through ISA IO. Here the values are the followings: 1st sensor (SMBus, W83782D) temp0 VRM2 temperature temp1 CPU1 temperature temp2 CPU2 temperature Vcore0 CPU1 Vcore Vcore1 CPU2 Vcore Volt 0 AGP voltage Volt 1 system 5V Volt 2 DDR voltage Volt 3 ----- Volt 4 standby 3.3V 2nd sensor (ISA IO, W83627HF) temp0 VRM1 temperature temp1 AGP temperature temp2 DDR temperature Vcore0 CPU1 Vcore Vcore1 CPU2 Vcore Volt 0 system 3.3V Volt 1 system 5V Volt 2 system 12V Volt 3 system -12V Volt 4 ----- << 7. Bugs >> A serious bug of version prior to 1.06, i.e. "xmbmon" goes out of control while other processes keep opening /dev/io device file, is fixed in version 1.06pl1 (patch level 1). I hope there are no more serious bugs (but maybe there are!). However, among the reports I have received until now, it should be noticed that there are some motherboards where the hardware monitor chips are not equipped in accordance with the data sheet instruction. In such a case the program cannot read the data or the values read by it does not coincide with those shown in the BIOS. In such cases, it is not possible to make the program work properly as long as the specific information from the motherboard vendor is not provided. << 8. Those who want to support other hardware monitor chips >> One of the sales point of the present version is that the program codes are almost completely rewritten in order to make it easier to support new hardware monitor chips. This is done by dividing a part of program into modules (they are "sens_XXXX.c"), each of which corresponds to each monitor chip that requires different treatments to read data. Also, the methods to access SMBus provided by various Power Management Controllers in the chipsets are different and the corresponding codes are divided into modules (they are "smbus_XXXX.c"). However, I have just prepared and do not intend to support new monitor chips and/or other Power Management Controllers which are not supported in this version. If there is a person who has a hardware not supported yet and eagerly want to use it, I hope he or she try to hack the code and include the support code into the present version (see ReadMe.tech for a brief explanation). For such a hacker who wants to develop a support program of new monitor chips, the first step is to know which device is connected to the basic PCI bus. One has to use the FreeBSD command "pciconf". And in the present package, I have included some test programs for checking the PCI Configuration, "testpci.c", for checking SMBus Power Management Controller, "testsmb.c", and for checking the registers to read the data of Winbond-like monitor chips, "testhwm.c". For those who want to support other hardware monitor chips, I encourage them by providing these small tools. But don't forget to prepare unexpected accidents like OS crash, because these tools are more dangerous than "mbmon/xmbmon" themselves! (Actually, I have destroyed the file system once, by mis-opened the disk controller and write directly to the disk!). One may be interested in which motherboard uses what kind of hardware monitor chips. Such information is available at the homepage of Alex van Kaam, who is a developer of a famous MBM (Mother Board Monitor) program on Microsoft Windows platforms, http://mbm.livewiredev.com/ Or, in Japan, there is a useful information posted in the mailing-list run by :p araffin.(Yoneya), who is a developer of other famous monitoring software LM78mon on Windows platforms, http://homepage1.nifty.com/paraffin/ The technical information for Winbond chips are available as PDF files at Winbond homepage: http://www.winbond.com.tw/ And there are many technical informations in the PDF forms are collected at the hardware monitor (lm_sensor) homepage for Linux at http://www.lm-sensors.nu/ But the information on particular hardware monitor chip may not be necessarily available, then it is very difficult to support such a chip. << 9. Acknowledgments >> * The first version opened to the public is ver.1.04, which only supports ISA-IO port access method for Winbond chips. The information on actual access method to the chip was opened in the homepage of MBM by Alex van Kaam mentioned above (unfortunately, the information is not opened now). If I cannot find this information the programs "mbmon/xmbmon" would not appear. I appreciate that he opened this valuable information (which is now available as data sheet PDF files at the Winbond homepage now, as shown above). * For the next version 1.05, I got a great help by Takanori Watanabe at Kobe University, who is a developer of "intpm" driver and contributed a lot to support the SMBus ioctl access method. I have included other direct SMBus access method in the version 1.05, the SMBus ioctl method is still useful and even safer if there is a proper support of OS device drivers (like "intpm" or "viapm"). The separation of code for each access method is provided by him, and it is a great help for developing the following new version. I appreciate his help. The (partial) support for Linux has been done from ver.1.05 with the help of Koji Okamoto at Kyushu University. The information of ASUS AS99127F hardware monitor chip supported from ver.1.05 was provided by Noriyuki Yoneya (:p araffin.). I also appreciate their help. * In the next version 1.06, I wanted to use "mbmon/xmbmon" for the Athlon machines, the number of which are increasing around me because of it's fast numeric computing ability. Here all the Athlon machines I can use employ VIA's VT82C686A/B chipset, and it's information as a hardware monitor chip was not available. I got the information from, again, Noriyuki Yoneya (:p araffin.). Furthermore, I found that the ASUS motherboard uses their own monitor chip AS99127F, even though it employs VT82C686 south chipset. Then, (since I could not use "viapm" device driver on my old FreeBSD-3.X system at that time) I need to access the SMBus directly without any OS device driver. For this purpose, detailed technical information on the method for getting the PCI device configurations, and further, for accessing the SMBus directly, are totally provided by Noriyuki Yoneya (:p araffin.). Without his help, this version cannot emerge in the present form. I appreciate very much his generosity of helping me on this matter. * In the next version 1.07, I supported the more powerful facility of output in "mbmon" by considering the request of freely utilizing the output of the hardware monitor chip. For this purpose, I just included the patch provided by Koji MORITA (morita@cybird.co.jp). Thanks a lot for it. * The extension of the supporting chips of both the hardware monitor and SMBus interface in the version 1.07 has been done thanks to the information learned from the source codes of "lm_sensors-2.6.2", which is a product of the lm_sensors Project for the Linux platform. I greatly appreciate The Lm_sensors Group (http://www.lm-sensors.nu/) for developing and opening such useful source codes. * Until the previous version, the Linux users could not enjoy full functions of strong output provided by "mbmon", because some C functions are missing. Michael Lenzen kindly provided equivalent C functions and now it is possible to use full functions and the program can be executed in the same way in the Linux platform as in FreeBSD form version 2.00. I appreciate his help for that. * Dramatic changes of the code in the version 2.00 is motivated by the contribution of a LM80 chip support code and encouragements given by Shin-ichi Nagamura. Since it is not considered until the previous version that new hardware monitor chips will be further supported, it was very difficult to include the LM80 code. Shin-ichi Nagamura provided an good example to include a support code corresponding to each monitor chip as a module. Thus, the development of the present version started to rewrite the program to divide its part into modules for each monitor chip. I don't think this version would not appear if his contribution for separating the program into modules. Thanks a lot for this great contributions. * In verison 2.00, I have included the support of SMBus accesses methods for AMD756/766/768 and ALi M1535D+, which have been long desired. For these support I asked many things again to Noriyuki Yoneya (:p araffin.). Many thanks for giving me adequate advice. * And, again, the lm_sensor project, its present newest release version is 2.7.0, is always a nice teacher for learning about various monitor chips and SMBuses. Thanks a lot for its wonderful works. * As for the special treatment to enable the second sensor chip and to initialize the temperature sensors for the Tyan's TigerMP/MPX motherboard, Alex van Kaam (creator of MBM) and Tamas Miklos kindly gave me the information. I appreciate their help. * For version 2.00, I called for some beta testers: Tom Dean, Julian Elischer, Kou Fujimoto, Kazushi Nakamura. Thank a lot for testing. * In this version 2.01, the patch for executing "mbmon" as a daemon mode is a contribution by Jean-Marc Zucconi (jmz@FreeBSD.org). I believe it is useful for somebody monitoring many machines. Thanks a lot for the useful contribution. * The improved temperature readout of the ASB100 sensor chip, and the support of ASUS Mozart-2 sensor chip are based on the information given by the MBM creator, Alex van Kaam. Thanks a lot for teaching again this time. * Fixing the issue of "xmbmon"'s NFS ~/.Xauthority file by a patch from Kazushi NAKAMURA (kaz@kobe1995.net). Thank you. * The information of a new SMBus access method of AMD8111 and NVidia nForce2 chipsets is given by Alex van Kaam. Thanks Alex for all the helps every times. * The manual files are contributed by Nicolas Rueff I appreciate his works. * 2nd order IIR low pass filter patch contributed by Takayuki Hosoda is helpful to somewhat smooth the plot in xmbmon. Thanks Hosoda san very much. * The logging facility is a contribution of David Quattlebaum . I found it very convenient and appreciate his contribution. * John Wehle provided platform independent IO port read/write codes (inline x86 assembler) and some other changes (especially support for Solaris x86), which make the code more portable for other platforms. Thanks for the nice contributions. << 10. Finally >> The programs are under the modified BSD license (see the CopyRight file). Any modifications and changes to the programs, which do not conflict the license, are welcome. The author is not at all responsible if anyone have any problems or damages when using the programs. The author may not keep the development of the programs any further. But if someone develops any new better programs based on my own, I am very glad if feedback is made to me (of course, it is not at all any duties!). August 20, 2004 Yoshifumi R. Shimizu, Department of Physics, Kyushu University e-mail : yrsh2scp@mbox.nc.kyushu-u.ac.jp http://www.nt.phys.kyushu-u.ac.jp/shimizu/index.html xmbmon-2.05/pci_pm.h0000644000175000017500000000550310075245431013706 0ustar agiagi00000000000000 /* Looking for Power Management ChipSet by checking the PCI Configuration Register, by YRS 2001.08. Information on how to access SMBus is provided by ":p araffin.(Yoneya)", MANY THANKS!! Many information about PCI chipsets comes from the lm_sensors codes, MANY THANKS!! */ #include #include #include #include "io_cpu.h" #ifndef NULL #define NULL 0x00 #endif /* For getting the PCI Configuration */ #define PCI_BUSN 0x0000 /* assume PCI Bus number = 0x00 for chipset */ #define PCI_REGM 64 #define PCI_DEVM 32 #define PCI_FUNM 8 #define PCI_CFIO 0x0CF8 #define PCI_CREAD 0x0CFC /* The offset of the SMBus base address */ #define getSMBBA0 0x90 /* PIIX4, VIA596,686 */ #define getSMBBA1 0xD0 /* VT8233/A/C */ #define getSMBBA2 0x20 /* Intel801_ICH's */ #define getSMBBA3 0x58 /* AMD756,766,768 */ #define getSMBBA4 0x14 /* NVidia nForce */ #define getSMBBA5 0xE2 /* ALI7101 */ #define getSMBBA6 0x10 /* AMD8111 */ #define getSMBBA70 0x50 /* NVidia nForce2, bus0 */ #define getSMBBA71 0x54 /* NVidia nForce2, bus1 */ #define AMD_SMBOFF 0xE0 /* for AMD756, extra offset */ /* The PM chipset's chipID and vendorID (0x[chipID][vendorID]) */ #define ID_VIA586 0x30401106 #define ID_VIA596 0x30501106 #define ID_VIA596B 0x30511106 #define ID_VIA686 0x30571106 #define ID_VIA8233 0x30741106 #define ID_VIA8233A 0x31471106 #define ID_VIA8233C 0x31091106 #define ID_VIA8235 0x31771106 #define ID_VIA8235M 0x82351106 #define ID_VIA8237 0x32271106 #define ID_PIIX4 0x71138086 #define ID_PII440MX 0x719B8086 #define ID_SRVWSB4 0x02001166 #define ID_SRVWSB5 0x02011166 #define ID_EFVIC66 0x94631055 #define ID_I801AA 0x24138086 #define ID_I801AB 0x24238086 #define ID_I801BA 0x24438086 #define ID_I801CA 0x24838086 #define ID_I801DB 0x24C38086 #define ID_I801EB 0x24D38086 #define ID_I6300ESB 0x25A48086 #define ID_IICH6 0x266A8086 #define ID_AMD756 0x740B1022 #define ID_AMD766 0x74131022 #define ID_AMD768 0x74431022 #define ID_AMD8111 0x746A1022 #define ID_NFORCE 0x01B410DE #define ID_NFORCE2 0x006410DE #define ID_ALI7101 0x710110B9 #define ID_ALI1535 0x153510B9 #define ID_ALI1647 0x164710B9 #define VIA686HWM_prob 0x74 #define VIA686HWM_base 0x70 /* Here ID's for the class of SMBus used inside mbmon/xmbmon */ #define VIA686SMB 01 #define VIA686HWM 02 #define VIA596SMB 11 #define VIA8235PM 12 #define VIA586PM 13 #define PIIX4SMB 21 #define SRVWSSSMB 22 #define VIA8233SMB 31 #define ICH801SMB 41 #define AMD756SMB 51 #define NFORCESMB 52 #define ALI1535SMB 61 #define ALI15X3SMB 62 #define AMD8111SMB 71 #define NFORCE2SMB 72 int chk_port_byte(int); char *chk_smb_chip(int); int pci_pm_smb_prob(int *, int *); int pci_smb_prob(int [], u_int []); int is_ALI1535(void); u_char pci_conf_readb(u_char, u_char, u_char, u_char); u_short pci_conf_readw(u_char, u_char, u_char, u_char); u_int pci_conf_read(u_char, u_char, u_char, u_char); xmbmon-2.05/getMB-smb.c0000644000175000017500000000374007674513062014221 0ustar agiagi00000000000000 /* SMBus method for accessing Hardware Monitor Chip */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) /* Using SMBus ioctl, need "xxxpm" driver !! */ #include "getMB-smb_ioctl.c" #else /* SMBus direct access routines */ #include "methods.h" #include "smbuses.h" /* smbus io routine, global */ extern SMBUS_IO *smbus; /* SMBus Base Address, global */ int smb_base = -1; int smb_slave = LM_ADDR; int smb_wbtemp1_flag = 1; /* = 0 if enable */ int smb_wbtemp2_flag = 1; /* = 0 if eaable */ int smb_wbtemp1 = WBtemp1_ADDR; int smb_wbtemp2 = WBtemp2_ADDR; int smb_wbt1reg = 0x00; int smb_wbt2reg = 0x00; #include #include #include #include #include #include "io_static.c" static int ReadByte(int addr) { int ret; ret = smbus->ReadB(smb_base, smb_slave, addr); if (ret == -1) { /* perror("SMBus ReadB"); exit(-1); */ ret = 0xFF; } return (ret & 0xFF); } static void WriteByte(int addr, int value) { if(smbus->WriteB(smb_base, smb_slave, addr, value) == -1) { perror("SMBus WriteB"); exit(-1); } } static int ReadWord(int addr) { int ret; ret = smbus->ReadW(smb_base, smb_slave, addr); if (ret == -1) { /* perror("SMBus ReadW"); exit(-1); */ ret = 0xFFFF; } return (ret & 0xFFFF); } static void WriteWord(int addr, int value) { if(smbus->WriteW(smb_base, smb_slave, addr, value) == -1) { perror("SMBus WriteW"); exit(-1); } } static int ReadTemp1() { int ret; ret = smbus->ReadW(smb_base, smb_wbtemp1, smb_wbt1reg); if (ret == -1) { /* perror("SMBus ReadW"); exit(-1); */ ret = 0xFFFF; } return (ret & 0xFFFF); } static int ReadTemp2() { int ret; ret = smbus->ReadW(smb_base, smb_wbtemp2, smb_wbt2reg); if (ret == -1) { /* perror("SMBus ReadW"); exit(-1); */ ret = 0xFFFF; } return (ret & 0xFFFF); } struct lm_methods method_smb = { OpenIO, CloseIO, ReadByte, WriteByte, ReadWord, WriteWord, ReadTemp1, ReadTemp2 }; #endif xmbmon-2.05/sens_it87.c0000644000175000017500000001054607742450030014260 0ustar agiagi00000000000000/* * Integrated Technology Express IT8705F/IT8712F hardware monitor chip * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * Integrated Technology Express Chip Temp Volt Fan SMBus IOport it8705 3 8 3 yes yes it8712 3 8 3 yes yes SiS Chip Temp Volt Fan SMBus IOport sis950 3 8 3 yes yes * * by YRS */ #include #include "sensors.h" /* external (global) data */ extern int smb_slave; extern LM_METHODS method_isa, method_smb; extern int numSMBSlave, canSMBSlave[128]; #define IT87_ADDR_START 0x50 /*0x50-0x5E*/ #define IT87_ADDR_END 0x5E #define IT87_SMBADDR 0x48 #define IT87_REGCHIP 0x58 #define IT87_CHIPID 0x90 /* temp nr=0,1,2; volt nr=0,1,...6; fan nr=0,1,2 */ #define IT87_TEMP(nr) (0x29 + (nr)) #define IT87_VOLT(nr) (0x20 + (nr)) #define IT87_FAN(nr) (0x0D + (nr)) #define IT87_FANDIV 0x0B static int it87_probe(LM_METHODS *); static float it87_temp(LM_METHODS *, int); static int it87_fanrpm(LM_METHODS *, int); static float it87_volt(LM_METHODS *, int); SENSOR it87 = { "Int.Tec.Exp. Chip IT8705F/IT8712F or SIS950", it87_probe, it87_temp, it87_volt, it87_fanrpm }; #define IT87_chkRegNum 8 /* Register checked for probing */ static int chkReg[] = { 0x00, 0x01, 0x02, 0x03, 0x0A, 0x48, 0x50, 0x51, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x0B, 0x0D, 0x0E, 0x0F, -1 }; /* * return 0 if not probed */ static int it87_probe(LM_METHODS *method) { int n, save; if (method != &method_isa && method != &method_smb) return 0; save = smb_slave; if (method == &method_smb) { for (n = IT87_ADDR_START; n <= IT87_ADDR_END;) { if (!(smb_slave = get_smb_slave(n, IT87_ADDR_END))) goto ret0; else if (smb_slave != 2 * method->Read(IT87_SMBADDR)) goto ret0; else { if (method->Read(IT87_REGCHIP) == IT87_CHIPID && chkReg_Probe(smb_slave, "Probing ITE7805/7812/SIS950 chip:\n", chkReg, method) >= IT87_chkRegNum) goto ret1; else n = smb_slave + 2; } } goto ret0; } else { if (method->Read(IT87_REGCHIP) == IT87_CHIPID && chkReg_Probe(0, "Probing ITE7805/7812/SIS950 chip:\n", chkReg, method) >= IT87_chkRegNum) goto ret1; } ret0: smb_slave = save; return 0; ret1: if (method == &method_smb) kill_smb_slave(smb_slave); return 1; } /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,2,... */ static float it87_temp( LM_METHODS *method, int no ) { if (no < 0 || 2 < no) return 0xFFFF; return (float) method->Read(IT87_TEMP(no)); } /* * \retval 0x0000FFFF no sensor * no = 0,1,2,... */ static float it87_volt(LM_METHODS *method, int no) { float fac; if (no < 0 || 6 < no) return 0xFFFF; switch (no) { case 0: case 1: case 2: fac = 0.016; break; case 3: fac = 0.016 * 1.68; break; case 4: fac = 0.016 * 3.80; break; case 5: fac = - 0.016 * 3.477; break; case 6: fac = - 0.016 * 1.505; } return (float) method->Read(IT87_VOLT(no)) * fac; } /* Controlling Fan Divisor for 1st/2nd fans: CR = 0x0B. lowest three bits for fan1, next three bits for fan2 7 3 0 +-+-+-+-+-+-+-+-+ xxx = 000,..,111 div1fac = 1,..,128 | |y y y|x x x| yyy = 000,..,111 div2fac = 1,..,128 +-+-+-+-+-+-+-+-+ initial values: xx=001, yy=001 No divisor available for fan3. */ /* * \retval 0x0000FFFF no sensor * no = 0,1,2,... * * Clock is 22.5kHz (22,500 x 60 = 1350000 counts/minute) */ static int it87_fanrpm(LM_METHODS *method, int no) { int r, n; static int div[3] = {1,1,1}; if (no < 0 || 2 < no) return 0xFFFF; n = method->Read(IT87_FANDIV); div[0] = n & 0x07; div[1] = (n >> 3) & 0x07; r = method->Read(IT87_FAN(no)); if (r == 0xFF) { /* change divisor for the sake of next call ! */ if (no != 2) { if (div[no] < 7) ++(div[no]); else div[no] = 0; r = (n & 0x3F) | div[0] | (div[1] << 3); method->Write(IT87_FANDIV, r); } return 0xFFFF; } else if (r == 0) { return 0xFFFF; } return 1350000 / (r * (1 << div[no])); } xmbmon-2.05/sens_via686.c0000644000175000017500000001334507742450212014512 0ustar agiagi00000000000000/* * VIA VT82C686A/B hardware monitor chip * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * VIA Chip Temp Volt Fan SMBus IOport via686a 3 5 2 yes yes * * by YRS */ #include "pci_pm.h" #include "sensors.h" /* external (global) data */ extern int smb_slave; extern int pm_smb_detected; extern LM_METHODS method_via, method_smb; extern int numSMBSlave, canSMBSlave[128]; #define VIA_ADDR_START 0x50 /*0x50-0x5E*/ #define VIA_ADDR_END 0x5E /* temp nr=0,1,2; volt nr=0,...4; fan nr=0,1 */ #define VIA686_TEMP(nr) (0x1F + (nr)) #define VIA686_VOLT(nr) (0x22 + (nr)) #define VIA686_FAN(nr) (0x29 + (nr)) #define VIA686_FANDIV 0x47 static int via686_probe(LM_METHODS *methods); static float via686_temp(LM_METHODS *methods, int no); static int via686_fanrpm(LM_METHODS *methods, int no); static float via686_volt(LM_METHODS *methods, int no); SENSOR via686 = { "VIA Chip VT82C686A/B", via686_probe, via686_temp, via686_volt, via686_fanrpm }; #define VIA_chkRegNum 5 /* Register checked for probing */ static int chkReg[] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x47, 0x49, 0x4B, 0x3F, 0x14, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x29, 0x2B, -1 }; /* * return 0 if not probed */ static int via686_probe(LM_METHODS *method) { int n, save; if (method != &method_via && method != &method_smb) return 0; if (pm_smb_detected != VIA686HWM && pm_smb_detected != VIA686SMB) return 0; save = smb_slave; if (method == &method_smb) { for (n = VIA_ADDR_START; n <= VIA_ADDR_END;) { if (!(smb_slave = get_smb_slave(n, VIA_ADDR_END))) goto ret0; else { if (chkReg_Probe(smb_slave, "Probing VIA686A/B chip:\n", chkReg, method) >= VIA_chkRegNum) goto ret1; else n = smb_slave + 2; } } } else { if (chkReg_Probe(0, "Probing VIA686A/B chip:\n", chkReg, method) >= VIA_chkRegNum) goto ret1; } ret0: smb_slave = save; return 0; ret1: if (method == &method_smb) kill_smb_slave(smb_slave); return 1; } static const float via686temp_tab[256] = {\ .00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00,-50.00, -48.00,-46.09,-44.26,-42.52,-40.86,-39.28,-37.78,-36.35, -34.99,-33.70,-32.47,-31.31,-30.20,-29.15,-28.14,-27.18, -26.27,-25.39,-24.55,-23.73,-22.95,-22.18,-21.44,-20.70, -19.98,-19.27,-18.57,-17.87,-17.19,-16.51,-15.85,-15.20, -14.56,-13.93,-13.32,-12.72,-12.14,-11.58,-11.03,-10.50, -9.99, -9.50, -9.03, -8.57, -8.11, -7.67, -7.22, -6.77, -6.31, -5.85, -5.37, -4.87, -4.36, -3.81, -3.24, -2.64, -2.00, -1.33, -.65, .00, .59, 1.12, 1.60, 2.03, 2.42, 2.79, 3.12, 3.44, 3.75, 4.05, 4.35, 4.67, 4.99, 5.34, 5.71, 6.09, 6.49, 6.91, 7.34, 7.78, 8.23, 8.69, 9.15, 9.62, 10.09, 10.57, 11.04, 11.51, 11.98, 12.44, 12.90, 13.35, 13.80, 14.24, 14.68, 15.12, 15.55, 15.99, 16.42, 16.85, 17.27, 17.70, 18.13, 18.56, 18.99, 19.42, 19.85, 20.29, 20.72, 21.15, 21.59, 22.03, 22.47, 22.90, 23.34, 23.78, 24.22, 24.66, 25.10, 25.54, 25.99, 26.43, 26.87, 27.31, 27.75, 28.19, 28.63, 29.07, 29.51, 29.95, 30.38, 30.82, 31.25, 31.68, 32.11, 32.53, 32.96, 33.38, 33.80, 34.22, 34.63, 35.05, 35.48, 35.90, 36.33, 36.76, 37.20, 37.64, 38.09, 38.55, 39.02, 39.50, 39.99, 40.49, 41.00, 41.52, 42.06, 42.60, 43.15, 43.70, 44.27, 44.84, 45.41, 45.99, 46.57, 47.16, 47.75, 48.35, 48.94, 49.54, 50.13, 50.73, 51.33, 51.94, 52.55, 53.16, 53.78, 54.41, 55.04, 55.68, 56.32, 56.98, 57.64, 58.32, 59.00, 59.69, 60.40, 61.12, 61.85, 62.60, 63.36, 64.13, 64.93, 65.73, 66.56, 67.40, 68.26, 69.14, 70.05, 70.97, 71.91, 72.88, 73.86, 74.88, 75.92, 76.98, 78.08, 79.21, 80.36, 81.55, 82.78, 84.03, 85.33, 86.66, 88.04, 89.45, 90.90, 92.40, 93.94, 95.53, 97.16, 98.85,100.58,102.36, 104.19,106.07,108.01,110.00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00, .00 }; /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,2,... */ static float via686_temp(LM_METHODS *method, int no) { if (no < 0 || 2 < no) return 0xFFFF; return via686temp_tab[method->Read(VIA686_TEMP(no))]; } /* * \retval 0x0000FFFF no sensor * no = 0,1,2,... */ static float via686_volt(LM_METHODS *method, int no) { int n; float fac; if ( no < 0 || 4 < no ) return 0xFFFF; switch (no) { case 0: case 1: fac = 5. / 10512.; break; case 2: fac = 5. / 7884.; break; case 3: fac = 26. / 26280.; break; case 4: fac = 63. / 26280.; } if ((n = method->Read(VIA686_VOLT(no))) <= 0x40) n |= 0x100; return (float) (n * 25 + 133) * fac; } /* Controlling Fan Divisor: CR = 0x47. highest two bits for fan2, next two bits for fan1 7 3 0 +-+-+-+-+-+-+-+-+ xx = 00,01,10,11 div1fac = 1,2,4,8 |y y|x x| VolID | yy = 00,01,10,11 div2fac = 1,2,4,8 +-+-+-+-+-+-+-+-+ initial values: xx=01, yy=01 */ /* * \retval 0x0000FFFF no sensor * no = 0,1,2,... * * Clock is 22.5kHz (22,500 x 60 = 1350000 counts/minute) */ static int via686_fanrpm(LM_METHODS *method, int no) { int r, n; static int div[2] = {1,1}; if (no < 0 || 1 < no) return 0xFFFF; n = method->Read(VIA686_FANDIV); div[0] = (n >> 4) & 0x03; div[1] = n >> 6; r = method->Read(VIA686_FAN(no)); if (r == 0xFF) { /* change divisor for the sake of next call ! */ if (div[no] < 3) ++(div[no]); else div[no] = 0; r = (n & 0x0F) | (div[0] << 4) | (div[1] << 6); method->Write(VIA686_FANDIV, r); return 0xFFFF; } else if (r == 0) { return 0xFFFF; } return 1350000 / (r * (1 << div[no])); } xmbmon-2.05/smbus_piix4.c0000644000175000017500000001411110110432221014654 0ustar agiagi00000000000000 /* SMB handling routines for PIIX4, by YRS 2001.08. Information on how to access SMBus is provided by ":p araffin.(Yoneya)", MANY THANKS!! Common to PIIX4, ICHx, VIA686/VT8233 SMBus IO method: smb_base : Base Address addr : Slave Device Address cmd : Command Register Note that SMBus Slave Device Address is totall 1byte data, whose upper 7bits is for address and the lowest bit for read (=1) and for write (=0). The input "addr" in the following routines is this 1byte data, where the lowest bit can be either 0 or 1. 7 0 +-+-+-+-+-+-+-+-+ | Slave addr. |f| f = 0 for write, =1 for read. +-+-+-+-+-+-+-+-+ Do not confuse "Slave address" which is "addr(here)"/2! */ #ifdef SMB_DEBUG extern int debug_flag; #include #endif #include #include #include #include "smbuses.h" #include "io_cpu.h" #define LSB 0x01 #define LOOP_COUNT 0x2000 /* command address */ #define SMBHSTS 0x0 #define SMBHCTRL 0x2 #define SMBHCMD 0x3 #define SMBHADDR 0x4 #define SMBHDATA0 0x5 #define SMBHDATA1 0x6 /* status flag */ #define SMBHSTS_FAILED 0x10 /* failed bus transaction */ #define SMBHSTS_COLLID 0x08 /* bus collision */ #define SMBHSTS_ERROR 0x04 /* device error */ #define SMBHSTS_DONE 0x02 /* command completed */ #define SMBHSTS_BUSY 0x01 /* host busy */ #define SMBHSTS_CLEAR (SMBHSTS_FAILED|SMBHSTS_COLLID|\ SMBHSTS_ERROR|SMBHSTS_DONE) /* clear status */ /* control command number */ #define SMBHCTRL_START 0x40 /* start command */ #define SMBHCTRL_BYTE 0x08 /* byte I/O */ #define SMBHCTRL_WORD 0x0C /* word I/O */ #define SMBHCTRL_KILL 0x02 /* stop the current transaction */ #define SMBHCTRL_ENABLE 0x01 /* enable interrupts */ static int readbyte(int smb_base, int addr, int cmd) { u_char dat, saddr = 2*(addr/2); int i; top: OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; OUTb((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_KILL); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), (saddr | LSB)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_BYTE)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_COLLID) { #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, "\n OH! collision! = 0x%02X\n", dat); #endif goto top; } if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, " Readbyte: flag = 0x%02X, loop#:%04d", dat, i); #endif if (dat & SMBHSTS_DONE) { dat = INb((u_short) (smb_base + SMBHDATA0)); WAIT; WAIT; return (dat & 0xFF); } else return -1; } static int readword(int smb_base, int addr, int cmd) { u_char dat, saddr = 2*(addr/2); int i; top: OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; OUTb((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_KILL); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), (saddr | LSB)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_WORD)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_COLLID) goto top; if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } if (dat & SMBHSTS_DONE) { i = INb((u_short) (smb_base + SMBHDATA1)); WAIT; WAIT; dat = INb((u_short) (smb_base + SMBHDATA0)); WAIT; WAIT; return (((i << 8) + dat) & 0xFFFF); } else return -1; } static int writebyte(int smb_base, int addr, int cmd, int value) { u_char dat, saddr = 2*(addr/2); int i; OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; OUTb((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_KILL); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA0), (u_char) value); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_BYTE)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } if (dat & SMBHSTS_DONE) return 0; else return -1; } static int writeword(int smb_base, int addr, int cmd, int value) { u_char dat, saddr = 2*(addr/2); int i; OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; OUTb((u_short) smb_base, dat); WAIT; WAIT; if (!(dat & (SMBHSTS_COLLID | SMBHSTS_BUSY))) goto step; if (!(dat & SMBHSTS_BUSY)) break; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_KILL); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA0), (u_char) (value & 0xFF)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA1), (u_char) (value >> 8)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), (SMBHCTRL_START | SMBHCTRL_WORD)); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY) && (dat & (SMBHSTS_DONE | SMBHSTS_ERROR))) break; } if (dat & SMBHSTS_DONE) return 0; else return -1; } struct smbus_io smbus_piix4 = { readbyte, readword, writebyte, writeword }; xmbmon-2.05/getMB-isa.c0000644000175000017500000000252010110432103014156 0ustar agiagi00000000000000 /* ISA IO port method for accessing Hardware Monitor Chip */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "methods.h" /* ioport_base, global */ int isa_port_base = IOP_ADDR; #include #include #include "io_static.c" #define INDEX_REG_PORT (isa_port_base + 0x05) #define DATA_PORT (isa_port_base + 0x06) static int ReadByte(int addr) { int ret; OUTb(INDEX_REG_PORT, addr); WAIT; ret = INb(DATA_PORT); WAIT; return (ret & 0xFF); } static void WriteByte(int addr, int value) { OUTb(INDEX_REG_PORT, addr); WAIT; OUTb(DATA_PORT, value); WAIT; } static int ReadWord(int addr) { int ret; OUTb(INDEX_REG_PORT, addr); WAIT; ret = INw(DATA_PORT); WAIT; return (ret & 0xFFFF); } static void WriteWord(int addr, int value) { OUTb(INDEX_REG_PORT, addr); WAIT; OUTw(DATA_PORT, value); WAIT; } static int ReadTemp1() { int ret; WriteByte(0x4E, 0x01); /* changing to bank 1 */ ret = ReadByte(0x50) | (ReadByte(0x51) << 8); WriteByte(0x4E, 0x00); /* returning to bank 0 */ return ret; } static int ReadTemp2() { int ret; WriteByte(0x4E, 0x02); /* changing to bank 2 */ ret = ReadByte(0x50) | (ReadByte(0x51) << 8); WriteByte(0x4E, 0x00); /* returning to bank 0 */ return ret; } struct lm_methods method_isa = { OpenIO, CloseIO, ReadByte, WriteByte, ReadWord, WriteWord, ReadTemp1, ReadTemp2 }; xmbmon-2.05/configure0000755000175000017500000047163410107066052014205 0ustar agiagi00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="xmbmon.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell meta-characters. ac_configure_args= ac_sep= for ac_arg do case $ac_arg in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n ) continue ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in AC-TOOLS $srcdir/AC-TOOLS; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in AC-TOOLS $srcdir/AC-TOOLS" >&5 echo "$as_me: error: cannot find install-sh or install.sh in AC-TOOLS $srcdir/AC-TOOLS" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$as_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . case `(uname -sr) 2>/dev/null` in "SunOS 5"*) echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_R_nospace=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_R_nospace=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_R_nospace = yes; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_R_space=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_R_space=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_R_space = yes; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6 fi fi LIBS=$ac_xsave_LIBS esac fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XOpenDisplay (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dnet_ntoa (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dnet_ntoa (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else f = gethostbyname; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = no; then echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the nameserver (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else f = connect; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6 if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char remove (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_remove) || defined (__stub___remove) choke me #else f = remove; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6 if test $ac_cv_func_remove = no; then echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char remove (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6 if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shmat (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shmat) || defined (__stub___shmat) choke me #else f = shmat; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shmat (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char IceConnectionNumber (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi HOSTDEF="" ADDLIBS="" # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "${host}" in i?86-*-freebsd*) CC=cc ;; i?86-*-linux-*) CC=gcc HOSTDEF="-DLINUX" ;; i?86-*-netbsd* | i?86-*-openbsd*) CC=cc HOSTDEF="-DNETBSD" ADDLIBS="-li386" ;; *) CC=gcc ;; esac echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then LIBS="-lsocket -lnsl $LIBS" fi echo "$as_me:$LINENO: checking for fabs in -lm" >&5 echo $ECHO_N "checking for fabs in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_fabs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fabs (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fabs (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_fabs=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_m_fabs=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_fabs" >&5 echo "${ECHO_T}$ac_cv_lib_m_fabs" >&6 if test $ac_cv_lib_m_fabs = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h sys/ioctl.h sys/time.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in machine/smb.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_SMBUS 1 _ACEOF fi done if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strftime (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { strftime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_intl_strftime=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 if test $ac_cv_lib_intl_strftime = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF LIBS="-lintl $LIBS" fi fi done echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in gethostname getutent socket do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CPP@,$CPP,;t t s,@X_CFLAGS@,$X_CFLAGS,;t t s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t s,@X_LIBS@,$X_LIBS,;t t s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@HOSTDEF@,$HOSTDEF,;t t s,@ADDLIBS@,$ADDLIBS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi xmbmon-2.05/tyan_tiger.c0000644000175000017500000000432010110432176014565 0ustar agiagi00000000000000/* Specific treatment for Tyan TigerMP motherboard */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #undef TyanTigerMP_SMBUS #include #include #include "io_static.c" #define TTPortCTR 0x2E #define TTPortDAT 0x2F #define SENS2_IO_PORT 0xC00 /* external (global) data */ extern int isa_port_base; #define INDEX_REG_PORT (isa_port_base + 0x05) #define DATA_PORT (isa_port_base + 0x06) /* Winbond Registors */ #define WINBD_CONFIG 0x40 #define WINBD_SMBADDR 0x48 #define WINBD_VENDEX 0x4E #define WINBD_VENDID 0x4F #define WINBD_TEMPADDR 0x4A static int readbyte(int addr) { int ret; OUTb(INDEX_REG_PORT, addr); WAIT; ret = INb(DATA_PORT); WAIT; return (ret & 0xFF); } static void writebyte(int addr, int value) { OUTb(INDEX_REG_PORT, addr); WAIT; OUTb(DATA_PORT, value); WAIT; } static int vendercheck(void) { int nv, save, ret; ret = 0; save = isa_port_base; isa_port_base = SENS2_IO_PORT; nv = readbyte(WINBD_VENDID) & 0xFF; if (nv == 0xA3) { writebyte(WINBD_VENDEX, 0x80); nv = readbyte(WINBD_VENDID) & 0xFF; if (nv == 0x5C) ret = 1; } isa_port_base = save; return ret; } /* attach 2nd winbond 627HF */ void TyanTigerMPinit() { unsigned char c; OpenIO(); if (vendercheck()) { CloseIO(); /* change ISA IO-port to 627HF */ isa_port_base = SENS2_IO_PORT; return; } OUTb(TTPortCTR, 0x87); /* get access to 627HF on TTPortCTR */ OUTb(TTPortCTR, 0x87); OUTb(TTPortCTR, 0x07); OUTb(TTPortDAT, 0x0B); /* want device as 0x0B access */ OUTb(TTPortCTR, 0x60); /* want device 0x0B on ISA port base 0x0C00 */ c = SENS2_IO_PORT >> 8; OUTb(TTPortDAT, c); OUTb(TTPortCTR, 0x61); c = SENS2_IO_PORT & 0xFF; OUTb(TTPortDAT, c); /* change ISA IO-port to 627HF */ isa_port_base = SENS2_IO_PORT; OUTb(TTPortCTR, 0x30); /* now enabled */ OUTb(TTPortDAT, 0x01); #ifdef TyanTigerMP_SMBUS OUTb(TTPortCTR, 0x2B); /* SMBus access enabled */ c = INb(TTPortDAT) & 0x3F; OUTb(TTPortCTR, 0x2B); OUTb(TTPortDAT, c); writebyte(WINBD_SMBADDR, 0x2E); /* set 627HF on SMBus slave 0x5C(0x2E) */ writebyte(WINBD_TEMPADDR, 0x32); /* set temp2,3 on SMBus slave 0x94,0x96 */ #endif writebyte(WINBD_CONFIG, 0x80); /* kickstart it */ writebyte(WINBD_CONFIG, 0x01); CloseIO(); return; } xmbmon-2.05/sens_gl52.c0000644000175000017500000001213507742450046014241 0ustar agiagi00000000000000/* * Genesys Logic GL518SM/GL520SM hardware monitor chip * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * Genesys Logic Chip Temp Volt Fan SMBus IOport gl518sm 1 4 2 yes no gl520sm 2(1) 4(5) 2 yes no * * by YRS */ #include #include #include "sensors.h" /* external (global) data */ extern int smb_slave; extern LM_METHODS method_isa, method_smb; extern int numSMBSlave, canSMBSlave[128]; #define GL52_ADDR_START 0x58 /*0x58-0x5A*/ #define GL52_ADDR_END 0x5A #define GL52_CHIPID 0x00 #define GL52_REVNUM 0x01 #define GL52_CONF 0x03 #define GL52_TEMP1 0x04 #define GL52_TEMP2 0x0E #define GL52_VIN0 0x15 #define GL52_VIN1 0x14 #define GL52_VIN2 0x13 #define GL52_VIN3 0x0D #define GL52_VIN4 0x0E #define GL52_FANW 0x07 #define GL52_FANDIV 0x0F static int gl52chipid = 0; static int gl52_mode = 1; static int temp_offset = 130; static int gl52_probe(LM_METHODS *); static float gl52_temp(LM_METHODS *, int); static int gl52_fanrpm(LM_METHODS *, int); static float gl52_volt(LM_METHODS *, int); #define BUFF_LEN 128 static char buff[BUFF_LEN]; SENSOR gl52 = { buff, gl52_probe, gl52_temp, gl52_volt, gl52_fanrpm }; enum gl52_chips { NOSENSER, GL518SM_r00, GL518SM_r80, GL520SM }; static char *gl52chip[] = { "No Sensor", "GL518SM_rev00", "GL518SM_rev80", "GL520SM", NULL }; #define GL52_chkRegNum 10 /* Register checked for probing */ static int chkReg[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, -1 }; /* * return 0 if not probed */ static int gl52_probe(LM_METHODS *method) { int n, id, save; if (method != &method_smb) return 0; save = smb_slave; for (n = GL52_ADDR_START; n <= GL52_ADDR_END;) { if (!(smb_slave = get_smb_slave(n, GL52_ADDR_END))) goto ret0; else { id = method->Read(GL52_CHIPID); if ((id == 0x20 || id == 0x80) && chkReg_Probe(smb_slave, "Probing GL518SM/GL520SM chip:\n", chkReg, method) >= GL52_chkRegNum) goto ret1; else n = smb_slave + 2; } } ret0: smb_slave = save; return 0; ret1: kill_smb_slave(smb_slave); strcpy(buff, "Genesys Logic "); if (id == 0x20) { gl52chipid = GL520SM; temp_offset = 130; if (method->Read(GL52_CONF) & 0x10) gl52_mode = 2; } else { if (method->Read(GL52_REVNUM) == 0x80) gl52chipid = GL518SM_r80; else gl52chipid = GL518SM_r00; temp_offset = 119; } strcat(buff, gl52chip[gl52chipid]); return gl52chipid; } /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,... */ static float gl52_temp( LM_METHODS *method, int no ) { if (no < 0 || 2 < no) return 0xFFFF; if (no == 0) return (float) (method->Read(GL52_TEMP1) - temp_offset); else if (no == 1 && gl52chipid == GL520SM && gl52_mode == 1) return (float) (method->Read(GL52_TEMP2) - temp_offset); else return 0xFFFF; } /* * \retval 0x0000FFFF no sensor * no = 0,1,2,... */ static float gl52_volt(LM_METHODS *method, int no) { float facp12 = 1200./286.; /* from lm_sensors */ float facn12 = -1200./160.; /* from lm_sensors */ if (no < 0 || 6 < no) return 0xFFFF; if ((no > 0 && gl52chipid == GL518SM_r00) || (no > 4 && gl52chipid == GL518SM_r80)) return 0xFFFF; switch (no) { case 0: return (float) method->Read(GL52_VIN3) * 0.019; case 1: return 0.0; case 2: return (float) method->Read(GL52_VIN1) * 0.019; case 3: return (float) method->Read(GL52_VIN0) * 0.023; case 4: return (float) method->Read(GL52_VIN2) * 0.019 * facp12; case 5: if (gl52_mode == 2) return (float) method->Read(GL52_VIN4) * 0.019 * facn12; else return 0.0; case 6: return 0.0; default: return 0xFFFF; } } /* Controlling Fan Divisor: CR = 0x0F. highest 2bits for fan1, next 2bits for fan1. 7 4 0 +-+-+-+-+-+-+-+-+ xx = 00,..,11 div1fac = 1,..,8 |x x|y y| | yy = 00,..,11 div2fac = 1,..,8 +-+-+-+-+-+-+-+-+ initial values: xx=11, yy=11 Extra number of pulse per revolution is necessary! */ /* * \retval 0x0000FFFF no sensor * no = 0,1,... * * Clock is 16kHz (16,000 x 60 = 960000 counts/minute) */ static int gl52_fanrpm(LM_METHODS *method, int no) { int p = 2; /* default number of pulse per revolution */ int r, n; static int div[2] = {3,3}; if (no < 0 || 1 < no) return 0xFFFF; n = method->Read(GL52_FANDIV); div[0] = n >> 6; div[1] = (n >> 4) & 0x03; r = method->ReadW(GL52_FANW); if (no == 0) r &= 0xFF; else r >>= 8; if (r == 0xFF) { /* change divisor for the sake of next call ! */ if (div[no] < 3) ++(div[no]); else div[no] = 0; r = (n & 0x0F) | (div[0] << 6) | (div[1] << 4); method->Write(GL52_FANDIV, r); return 0xFFFF; } else if (r == 0) { return 0xFFFF; } return 960000 / (r * (1 << div[no]) * p); } xmbmon-2.05/getMB-smb_ioctl.c0000644000175000017500000000661307701565614015416 0ustar agiagi00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_SMBUS /* assume SMBus ioctl support, only for FreeBSD */ #include #include #include #include #include #include #include #include #include "methods.h" /* SMBus Base Address, global */ int smb_base = 2002; /* arbitrary positive number */ int smb_slave = LM_ADDR; int smb_wbtemp1_flag = 1; /* = 0 if enable */ int smb_wbtemp2_flag = 1; /* = 0 if eaable */ int smb_wbtemp1 = WBtemp1_ADDR; int smb_wbtemp2 = WBtemp2_ADDR; int smb_wbt1reg = 0x00; int smb_wbt2reg = 0x00; /* SMBus device file name, global */ extern char *smb_devfile; int smbioctl_readB(int, int); void smbioctl_writeB(int, int, int); int smbioctl_readW(int, int); void smbioctl_writeW(int, int, int); static int iosmb; static char buf[128]; #ifndef NO_INCLUDE_SMBIO static int OpenIO() { char byte; struct smbcmd cmd; cmd.slave = smb_slave; cmd.data.byte_ptr = &byte; if ((iosmb = open(smb_devfile, 000)) < 0) { strcpy(buf, "ioctl("); strcat(buf, smb_devfile + 5); strcat(buf, ":open)"); perror(buf); return -1; } /* command Reg:0x47 is not universal for all hardware monitor chips */ #if 0 cmd.cmd = 0x47; if (ioctl(iosmb, SMB_READB, &cmd) == -1) { strcpy(buf, "ioctl("); strcat(buf, smb_devfile + 5); strcat(buf, ":read Reg.0x47)"); perror(buf); return -1; } #endif return 0; } static void CloseIO() { close(iosmb); } static int ReadByte(int addr) { return smbioctl_readB(smb_slave, addr); } static void WriteByte(int addr, int value) { smbioctl_writeB(smb_slave, addr, value); } static int ReadWord(int addr) { return smbioctl_readW(smb_slave, addr); } static void WriteWord(int addr, int value) { smbioctl_writeW(smb_slave, addr, value); } static int ReadTemp1() { return smbioctl_readW(smb_wbtemp1, smb_wbt1reg); } static int ReadTemp2() { return smbioctl_readW(smb_wbtemp2, smb_wbt2reg); } struct lm_methods method_smb = { OpenIO, CloseIO, ReadByte, WriteByte, ReadWord, WriteWord, ReadTemp1, ReadTemp2 }; #endif /* From here global routines using smb_ioctl */ int smbioctl_readB(int slave, int addr) { struct smbcmd cmd; char ret; cmd.slave = slave; cmd.cmd = addr; cmd.data.byte_ptr = &ret; if (ioctl(iosmb, SMB_READB, &cmd) == -1) { /* strcpy(buf, "ioctl("); strcat(buf, smb_devfile + 5); strcat(buf, ":readbyte)"); perror(buf); exit(-1); */ ret = 0xFF; } return (ret & 0xFF); } void smbioctl_writeB(int slave, int addr, int value) { struct smbcmd cmd; cmd.slave = slave; cmd.cmd = addr; cmd.data.byte = value; if (ioctl(iosmb, SMB_WRITEB, &cmd) == -1) { strcpy(buf, "ioctl("); strcat(buf, smb_devfile + 5); strcat(buf, ":writebyte)"); perror(buf); exit(-1); } } int smbioctl_readW(int smb_slave, int addr) { struct smbcmd cmd; short ret; cmd.slave = smb_slave; cmd.cmd = addr; cmd.data.word_ptr = &ret; if (ioctl(iosmb, SMB_READW, &cmd) == -1) { /* strcpy(buf, "ioctl("); strcat(buf, smb_devfile + 5); strcat(buf, ":readword)"); perror(buf); exit(-1); */ ret = 0xFFFF; } return (ret & 0xFFFF); } void smbioctl_writeW(int slave, int addr, int value) { struct smbcmd cmd; cmd.slave = slave; cmd.cmd = addr; cmd.data.word = value; if (ioctl(iosmb, SMB_WRITEW, &cmd) == -1) { strcpy(buf, "ioctl("); strcat(buf, smb_devfile + 5); strcat(buf, ":writeword)"); perror(buf); exit(-1); } } #endif xmbmon-2.05/config.h.in0000644000175000017500000000056210107112322014275 0ustar agiagi00000000000000 /* LOGGING facility */ #ifdef LOGGING /* log file name */ #define LOGFILE "/var/log/mbmon.log" /* seconds between log entries */ #define LOGINTERVAL 300 /* maximum entries in log file */ #define LOGENTRIES 1024 #endif /* LOGGING */ /* Define if you have the `getutent' function. */ #undef HAVE_GETUTENT /* checking SMBus IOCTL (FreeBSD only) */ #undef HAVE_SMBUS xmbmon-2.05/testhwm.c0000644000175000017500000001251110106571505014121 0ustar agiagi00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) char * smb_devfile = "/dev/smb0"; #define NO_INCLUDE_SMBIO #include "getMB-smb_ioctl.c" #undef NO_INCLUDE_SMBIO #endif #include #include #include #include #undef PCI_LIST #define PCI_SMB_INCLUDED #include "pci_smb.c" #include "smbuses.h" int debug_flag = 0; /* smbus io routines, global */ extern SMBUS_IO smbus_piix4, smbus_amd, smbus_ali, smbus_amd8; static SMBUS_IO *smbus; #define LM_ADDR 0x5A #define ReadByte(x) (smbus->ReadB(smb_base, LM_ADDR, (x))) #define WriteByte(x, y) (smbus->WriteB(smb_base, LM_ADDR, (x), (y))) int main() { int i, n; int viahwm_base, smb_base; int Reg47, Reg48, Reg49; char *smb = ""; n = pci_pm_smb_prob(&viahwm_base, &smb_base); if (n <= 0) { fprintf(stderr, "No SMBus candidates found!!\n"); exit(-1); } else if (n > 0) { switch (n) { case VIA686SMB: smb = "VIA686SMB"; break; case VIA686HWM: smb = "VIA686HWM"; break; case VIA596SMB: smb = "VIA596SMB"; break; case PIIX4SMB: smb = "PIIX4SMB"; break; case SRVWSSSMB: smb = "SRVWSSSMB"; break; case VIA8233SMB: smb = "VIA8233SMB"; break; case ICH801SMB: smb = "ICH801SMB"; break; case AMD756SMB: smb = "AMD756SMB"; break; case NFORCESMB: smb = "NFORCESMB"; break; case ALI1535SMB: smb = "ALI1535SMB"; break; case ALI15X3SMB: smb = "ALI15X3SMB"; break; case AMD8111SMB: smb = "AMD8111SMB"; break; case NFORCE2SMB: smb = "NFORCE2SMB"; break; } printf(" *** SMBus %s found! --- SMBus Base=0x%04X.\n", smb, smb_base); } if (n/10 == AMD756SMB/10) smbus = &smbus_amd; else if (n/10 == ALI1535SMB/10) smbus = &smbus_ali; else if (n/10 == AMD8111SMB/10) smbus = &smbus_amd8; else smbus = &smbus_piix4; /* Big loop for smb_base candidates */ fprintf(stderr, "\n*** Testing SMBus base = 0x%04X ***\n", smb_base); if(OpenIO() == -1) return -1; Reg47 = ReadByte(0x47); i = Reg47; printf(" CheckingFanDV(CR47) = %02X\n", i); Reg48 = ReadByte(0x48); i = Reg48&0x7F; printf(" MainSMBusADDR(CR48) = %02X\n", 2*i); Reg49 = ReadByte(0x49); i = Reg49; printf(" DeviceID(CR49&0xFE) = %02X\n", i&0xFE); if (Reg47 == -1 && Reg48 == -1 && Reg49 == -1) { fprintf(stderr, "No Hardware Monitor found on this SMBus base!\n"); goto exit; } WriteByte(0x4E, 0x00); i = ReadByte(0x4F); printf(" VenderID(CR4E=0,CR4F)= %02X\n", i); i = ReadByte(0x58); printf(" ChipID(CR58) = %02X\n", i); i = ReadByte(0x27); printf(" Temp0(CR27) = %02X\n", i); i = ReadByte(0x20); printf(" Vcore(CR20) = %02X\n", i); i = ReadByte(0x22); printf(" V3.3 (CR22) = %02X\n", i); i = ReadByte(0x23); printf(" V5.0 (CR23) = %02X\n", i); i = ReadByte(0x24); printf(" V12.0(CR24) = %02X\n", i); #ifdef FAN_DIV_CHK /* NOTE: I don't know why, but if system function "sleep()" is called while "/dev/io" is being opened, "xmbmon" crashes (it goes into infinite loop somewhere in kernel or shared library). So, it is important to close it when calling sleep()! */ { int reg, i1, i2; CloseIO(); printf("\nFan Devisor(CR47) Check:\n"); if(OpenIO() == -1) return -1; reg = (Reg47 & 0x0F) | 0x00; /* 0000 : divisor 1 1 */ printf(" write(CR47,0?:11) --->"); WriteByte(0x47, reg); CloseIO(); sleep(2); if(OpenIO() == -1) return -1; i = ReadByte(0x28); i1 = ReadByte(0x29); i2 = ReadByte(0x2A); printf(" CR28,CR29,CR2A = %02X,%02X,%02X\n", i, i1, i2); reg = (Reg47 & 0x0F) | 0x10; /* 0001 : divisor 2 1 */ printf(" write(CR47,1?:21) --->"); WriteByte(0x47, reg); CloseIO(); sleep(2); if(OpenIO() == -1) return -1; i = ReadByte(0x28); i1 = ReadByte(0x29); i2 = ReadByte(0x2A); printf(" CR28,CR29,CR2A = %02X,%02X,%02X\n", i, i1, i2); reg = (Reg47 & 0x0F) | 0x20; /* 0010 : divisor 4 1 */ printf(" write(CR47,2?:41) --->"); WriteByte(0x47, reg); CloseIO(); sleep(2); if(OpenIO() == -1) return -1; i = ReadByte(0x28); i1 = ReadByte(0x29); i2 = ReadByte(0x2A); printf(" CR28,CR29,CR2A = %02X,%02X,%02X\n", i, i1, i2); reg = (Reg47 & 0x0F) | 0x30; /* 0011 : divisor 8 1 */ printf(" write(CR47,3?:81) --->"); WriteByte(0x47, reg); CloseIO(); sleep(2); if(OpenIO() == -1) return -1; i = ReadByte(0x28); i1 = ReadByte(0x29); i2 = ReadByte(0x2A); printf(" CR28,CR29,CR2A = %02X,%02X,%02X\n", i, i1, i2); reg = (Reg47 & 0x0F) | 0x40; /* 0100 : divisor 1 2 */ printf(" write(CR47,4?:12) --->"); WriteByte(0x47, reg); CloseIO(); sleep(2); if(OpenIO() == -1) return -1; i = ReadByte(0x28); i1 = ReadByte(0x29); i2 = ReadByte(0x2A); printf(" CR28,CR29,CR2A = %02X,%02X,%02X\n", i, i1, i2); reg = (Reg47 & 0x0F) | 0x80; /* 1000 : divisor 1 4 */ printf(" write(CR47,8?:14) --->"); WriteByte(0x47, reg); CloseIO(); sleep(2); if(OpenIO() == -1) return -1; i = ReadByte(0x28); i1 = ReadByte(0x29); i2 = ReadByte(0x2A); printf(" CR28,CR29,CR2A = %02X,%02X,%02X\n", i, i1, i2); reg = (Reg47 & 0x0F) | 0xC0; /* 1100 : divisor 1 8 */ printf(" write(CR47,C?:18) --->"); WriteByte(0x47, reg); CloseIO(); sleep(2); if(OpenIO() == -1) return -1; i = ReadByte(0x28); i1 = ReadByte(0x29); i2 = ReadByte(0x2A); printf(" CR28,CR29,CR2A = %02X,%02X,%02X\n", i, i1, i2); WriteByte(0x47, Reg47); } #endif exit: CloseIO(); return 0; } xmbmon-2.05/sens_lm90.c0000644000175000017500000000721707754352650014263 0ustar agiagi00000000000000/* * Natinal Semiconductor LM75 temperature sensor chip * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * National Semiconductor Chip Temp Volt Fan SMBus IOport lm90 2 - - yes no Analog Devices Chip Temp Volt Fan SMBus IOport ADM1020 2 - - yes no ADM1021 2 - - yes no ADM1023 2 - - yes no * * by YRS */ #include #include #include "sensors.h" /* external (global) data */ extern int smb_slave; extern LM_METHODS method_smb; #define LM90_ADDR_START 0x90 /*0x90-0x9E*/ #define LM90_ADDR_END 0x9E #define LM90_LTEMP 0x00 #define LM90_RTEMPH 0x01 #define LM90_RTEMPL 0x10 #define LM90_OFFSTH 0x11 #define LM90_OFFSTL 0x12 #define LM90_VENDID 0xFE #define LM90_DEVID 0xFF static int lm90chipid = 0; static int lm90_probe(LM_METHODS *); static int lm90_ident(LM_METHODS *); static float lm90_temp(LM_METHODS *, int); static int lm90_fanrpm(LM_METHODS *, int); static float lm90_volt(LM_METHODS *, int); #define BUFF_LEN 128 static char buff[BUFF_LEN]; SENSOR lm90 = { buff, lm90_probe, lm90_temp, lm90_volt, lm90_fanrpm }; enum lm90_chips { NOSENSER, LM90, ADM1020, ADM1023 }; static char *lm90chip[] = { "No Sensor", "Nat.Semi.Con. Chip LM90", "Analog Dev. Chip ADM1020", "Analog Dev. Chip ADM1021/1023", NULL }; #define LM90_chkRegNum 8 /* Register checked for probing */ static int chkReg[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x10, 0x11, 0x12, 0x13, 0x14, 0x19, 0x20, 0x21, 0xBF, 0xFE, 0xFF, -1 }; /* * return 0 if not probed */ static int lm90_probe(LM_METHODS *method) { int n, save; if (method != &method_smb) return 0; save = smb_slave; for (n = LM90_ADDR_START; n <= LM90_ADDR_END; ) { if (!(smb_slave = get_smb_slave(n, LM90_ADDR_END))) goto ret0; else { if (lm90_ident(method) && chkReg_Probe(smb_slave, "Probing LM90 chip:\n", chkReg, method) >= LM90_chkRegNum) goto ret1; else n = smb_slave + 2; } } ret0: smb_slave = save; return 0; ret1: kill_smb_slave(smb_slave); strcpy(buff, lm90chip[lm90chipid]); return lm90chipid; } static int lm90_ident(LM_METHODS *method) { int vend, revd; vend = method->Read(LM90_VENDID); revd = method->Read(LM90_DEVID); if (vend == 0x01 && revd == 0x21) lm90chipid = LM90; else if (vend == 0x41) { if ((revd && 0xF0) == 0x30) lm90chipid = ADM1023; else lm90chipid = ADM1020; } return lm90chipid; } /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,2,... */ static float lm90_temp( LM_METHODS *method, int no ) { int n = 0, k = 0; float offset = 0.0; if (no < 0 || 2 < no) return 0xFFFF; if (no == 0) n = method->Read(LM90_LTEMP); else if (no == 1) { if (lm90chipid != ADM1020) { if ((n = method->Read(LM90_OFFSTH)) == 0xFF) n = 0; if ((k = method->Read(LM90_OFFSTL)) == 0xFF) k = 0; else k >>= 5; offset = (float) n + 0.125 * (float) k; } n = method->Read(LM90_RTEMPH); if ((k = method->Read(LM90_RTEMPL)) == 0xFF) k = 0; else k >>= 5; } if (n >= 0x80) n = k = 0; return ((float) n + 0.125 * (float) k - offset); } /* lm90 is only for temperature sensor */ static float lm90_volt(LM_METHODS *method, int no) { return 0xFFFF; } static int lm90_fanrpm(LM_METHODS *method, int no) { return 0xFFFF; } xmbmon-2.05/smbus_amd8.c0000644000175000017500000001457210110432222014464 0ustar agiagi00000000000000 /* SMB handling routines for AMD8111, by YRS 2003.04. Information on how to access SMBus is provided by "Alex van Kaam", MANY THANKS!! Common to AMD8111 and NVidia nForce2 SMBus IO method: smb_base : Base Address addr : Slave Device Address cmd : Command Register The following note does not apply to NVidia nForce2! Uses always the lowest bit 1, and read/write is distinguished by the control command number. ------------------------------------------------------------------------ Note that SMBus Slave Device Address is totall 1byte data, whose upper 7bits is for address and the lowest bit for read (=1) and for write (=0). The input "addr" in the following routines is this 1byte data, where the lowest bit can be either 0 or 1. 7 0 +-+-+-+-+-+-+-+-+ | Slave addr. |f| f = 0 for write, =1 for read. +-+-+-+-+-+-+-+-+ Do not confuse "Slave address" which is "addr(here)"/2! ------------------------------------------------------------------------ */ #ifdef SMB_DEBUG extern int debug_flag; #include #endif #include #include #include #include "smbuses.h" #include "io_cpu.h" #define LOOP_COUNT 0x2000 #define LOOP_WAIT 0x20 /* command address */ #define SMBGLENB 0x0 /* SMBus global enable */ #define SMBGLSTS 0x1 /* SMBus global status */ #define SMBHADDR 0x2 /* host address register */ #define SMBHCMD 0x3 /* command register for host controller */ #define SMBHDATA0 0x4 /* data 0 register for host controller */ #define SMBHDATA1 0x5 /* data 1 register for host controller */ /* status flag */ #define SMBHSTS_OKOK 0x00 /* transaction successful */ #define SMBHSTS_NOACK 0x10 /* not acknowledged (no device) */ #define SMBHSTS_DEVERR 0x11 /* device error */ #define SMBHSTS_TIMEOUT 0x18 /* timeout */ #define SMBHSTS_PROTERR 0x19 /* protocol error */ #define SMBHSTS_BUSY 0x1A /* device busy or arbitration lost */ #define SMBHSTS_PECERR 0x1F /* PEC(Packet Error Checking) error */ #define SMBHSTS_ALLERR 0x1F /* all bits of error above */ #define SMBHSTS_ALRM 0x40 /* alarm message received */ #define SMBHSTS_DONE 0x80 /* command completed */ /* control command number */ #define SMBHCTRL_BYTEW 0x06 /* write byte */ #define SMBHCTRL_BYTER 0x07 /* read byte */ #define SMBHCTRL_WORDW 0x08 /* write word */ #define SMBHCTRL_WORDR 0x09 /* read word */ static int readbyte(int smb_base, int addr, int cmd) { u_char dat = 0, saddr = 2*(addr/2) + 1; int i; top: OUTb((u_short) (smb_base + SMBHADDR), (u_char) saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBGLENB), SMBHCTRL_BYTER); WAIT; WAIT; for (i = 0; i < LOOP_WAIT; ++i) WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) (smb_base + SMBGLSTS)); WAIT; WAIT; #ifdef SMB_DEBUG fprintf(stderr, " Readbyte: flag = 0x%02X, loop#:%04d\n", dat, i); #endif if (dat == SMBHSTS_BUSY || dat == SMBHSTS_TIMEOUT) goto top; if (dat & (SMBHSTS_DONE | SMBHSTS_ALLERR)) break; } #ifdef SMB_DEBUG if(i != LOOP_COUNT) fprintf(stderr, " fx:Readbyte: addr=0x%02X, cmd=0x%02X flag = 0x%02X, loop#:%04d\n", addr, cmd, dat, i); #endif if (dat == SMBHSTS_DONE) { dat = INb((u_short) (smb_base + SMBHDATA0)); WAIT; WAIT; #ifdef SMB_DEBUG fprintf(stderr, " fy:Readbyte: addr=0x%02X, cmd=0x%02X, dat = 0x%02X\n", addr, cmd, dat); #endif return (dat & 0xFF); } else return -1; } static int readword(int smb_base, int addr, int cmd) { u_char dat = 0, saddr = 2*(addr/2) + 1; int i; top: OUTb((u_short) (smb_base + SMBHADDR), (u_char) saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBGLENB), SMBHCTRL_WORDR); WAIT; WAIT; for (i = 0; i < LOOP_WAIT; ++i) WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) (smb_base + SMBGLSTS)); WAIT; WAIT; if (dat == SMBHSTS_BUSY || dat == SMBHSTS_TIMEOUT) goto top; if (dat & (SMBHSTS_DONE | SMBHSTS_ALLERR)) break; } #ifdef SMB_DEBUG if(i != LOOP_COUNT) fprintf(stderr, " fx:Readword: addr=0x%02X, cmd=0x%02X flag = 0x%02X, loop#:%04d\n", addr, cmd, dat, i); #endif if (dat == SMBHSTS_DONE) { i = INb((u_short) (smb_base + SMBHDATA1)); WAIT; WAIT; dat = INb((u_short) (smb_base + SMBHDATA0)); WAIT; WAIT; #ifdef SMB_DEBUG fprintf(stderr, " fy:Readword: addr=0x%02X, cmd=0x%02X, dat = 0x%02X\n", addr, cmd, dat); #endif return (((i << 8) + dat) & 0xFFFF); } else return -1; } static int writebyte(int smb_base, int addr, int cmd, int value) { u_char dat = 0, saddr = 2*(addr/2) + 1; int i; top: OUTb((u_short) (smb_base + SMBHADDR), (u_char) saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA0), (u_char) value); WAIT; WAIT; OUTb((u_short) (smb_base + SMBGLENB), SMBHCTRL_BYTEW); WAIT; WAIT; for (i = 0; i < LOOP_WAIT; ++i) WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) (smb_base + SMBGLSTS)); WAIT; WAIT; #ifdef SMB_DEBUG fprintf(stderr, " Writebyte: flag = 0x%02X, loop#:%04d\n", dat, i); #endif if (dat == SMBHSTS_BUSY || dat == SMBHSTS_TIMEOUT) goto top; if (dat & (SMBHSTS_DONE | SMBHSTS_ALLERR)) break; } #ifdef SMB_DEBUG if(i != LOOP_COUNT) fprintf(stderr, " fx:Writebyte: addr=0x%02X, cmd=0x%02X flag = 0x%02X, loop#:%04d\n", addr, cmd, dat, i); #endif if (dat == SMBHSTS_DONE) return 0; else return -1; } static int writeword(int smb_base, int addr, int cmd, int value) { u_char dat = 0, saddr = 2*(addr/2) + 1; int i; top: OUTb((u_short) (smb_base + SMBHADDR), (u_char) saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA0), (u_char) (value & 0xFF)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA1), (u_char) (value >> 8)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBGLENB), SMBHCTRL_WORDW); WAIT; WAIT; for (i = 0; i < LOOP_WAIT; ++i) WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) (smb_base + SMBGLSTS)); WAIT; WAIT; if (dat == SMBHSTS_BUSY || dat == SMBHSTS_TIMEOUT) goto top; if (dat & (SMBHSTS_DONE | SMBHSTS_ALLERR)) break; } #ifdef SMB_DEBUG if(i != LOOP_COUNT) fprintf(stderr, " fx:Writeword: addr=0x%02X, cmd=0x%02X flag = 0x%02X, loop#:%04d\n", addr, cmd, dat, i); #endif if (dat == SMBHSTS_DONE) return 0; else return -1; } struct smbus_io smbus_amd8 = { readbyte, readword, writebyte, writeword }; xmbmon-2.05/pci_smb.c0000644000175000017500000000327610110432153014040 0ustar agiagi00000000000000 /* Looking for Power Management ChipSet by checking the PCI Configuration Register, by YRS 2001.08. Information on how to access SMBus is provided by ":p araffin.(Yoneya)", MANY THANKS!! Information for SMBus access and PCI chipset comes from the Linux lm_sensor codes: http://www.lm-sensors.nu */ #include #include "pci_pm.h" #include "io_static.c" #ifndef PCI_SMB_INCLUDED /* counter for not calling iopl() multiply */ int iopl_counter = 0; /* file descripter for FreeBSD /dev/io */ int iofl; #endif int canSMBUS_base[] = { getSMBBA0, getSMBBA1, getSMBBA2, getSMBBA3, getSMBBA4, getSMBBA5, getSMBBA6, getSMBBA70, getSMBBA71, 0 }; int pci_smb_prob(int smb_base[], u_int chip_id[]) { u_int chip, dat, addr; u_char dev, fun; int i, n = 0; if(OpenIO() == -1) return -1; for (dev = 0; dev < PCI_DEVM; ++dev) { for (fun = 0; fun < PCI_FUNM; ++fun) { chip = pci_conf_read(PCI_BUSN, dev, fun, 0x00); if (chip != 0xFFFFFFFF) { for (i = 0; (addr = canSMBUS_base[i]) != 0; i++) { dat = pci_conf_readw(PCI_BUSN, dev, fun, (u_char) addr); #ifdef PCI_LIST if (i == 0) { printf("bus=0x00:dev=0x%02X:fun=0x%02X ---> ", dev, fun); printf("chip=0x%08X [0x%02X] SMBase=0x%08X\n", chip, addr, dat); } else { printf(" "); printf("[0x%02X] SMBase=0x%08X\n", addr, dat); } #endif if (dat != 0x0 && dat != 0xFFFFFFFF \ && (dat & 0x0F) == 1 && (dat & 0xFFF00000) == 0) { chip_id[n] = chip; if (chip == ID_AMD756 || chip == ID_AMD766 ) smb_base[n] = (dat & 0xFF00) + AMD_SMBOFF; else smb_base[n] = (dat & 0xFFF0); if (INb(smb_base[n]) != 0xFF) ++n; } } } } } CloseIO(); return n; } xmbmon-2.05/sensors.h0000644000175000017500000000444307675561045014153 0ustar agiagi00000000000000#if !defined(__sensor_h__) #define __sensor_h__ #include "methods.h" struct hwm_access { char *Name; int (*Probe)(LM_METHODS *pMethods); float (*Temp)(LM_METHODS *pMethods, int no); float (*Volt)(LM_METHODS *pMethods, int no); int (*FanRPM)(LM_METHODS *pMethods, int no); }; typedef struct hwm_access SENSOR; extern SENSOR winbond; extern SENSOR wl784; extern SENSOR via686; extern SENSOR it87; extern SENSOR gl52; extern SENSOR lm85; extern SENSOR lm80; extern SENSOR lm90; extern SENSOR lm75; /* should be larger than the number of "HWM_sensor_chip" */ #define SEARCH 2002 /* * Supported HWM, ordering is important!! * HWM_sensor_chip{} should be consistent with * HWM_module[] and HWM_name[] */ enum HWM_sensor_chip { c_winbond, c_wl784, c_via686, c_it87, c_gl52, c_lm85, c_lm80, c_lm90, c_lm75 }; #ifdef INCLUDE_HWM_MODULE /* Array of Supported HWM, ordering is important!! */ SENSOR *HWM_module[] = { &winbond, &wl784, &via686, &it87, &gl52, &lm85, &lm80, &lm90, &lm75, NULL }; /* HWM_name[] should have one-to-one correspondence to HWM_module[] */ char *HWM_name[] = { "winbond", "wl784", "via686", "it87", "gl52", "lm85", "lm80", "lm90", "lm75", NULL }; /* number of VIA device found */ int HWM_VIA = 0; /* number of SMB device found */ int HWM_SMB = 0; /* HWM_SMBchip[] should have one-to-one correspondence to HWM_module[] */ int HWM_SMBchip[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* HWM_smbslave[] should have one-to-one correspondence to HWM_module[] */ int HWM_smbslave[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* number of ISA device found */ int HWM_ISA = 0; /* HWM_ISAchip[] should have one-to-one correspondence to HWM_module[] */ int HWM_ISAchip[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #endif /* INCLUDE_HWM_MODULE */ /* functions commonly used in each HWM module */ extern int chkReg_Probe(int slave, char *comment, int Reg[], LM_METHODS *); extern int strict_chkReg_Probe(int Reg[], LM_METHODS *method); extern int scan_smbus(int addr_start, int addr_end, int result[]); extern int find_smb_dev(void); extern void kill_smb_slave(int slave); extern int get_smb_slave(int start, int end); extern int set_smb_Extemp(int start, int end, int *slavet1, int *slavet2); extern void info_Extemp(LM_METHODS *, int, int); #endif /*!__sensor_h__*/ xmbmon-2.05/sens_wl784.c0000644000175000017500000001520507742450237014360 0ustar agiagi00000000000000/* * Winbond new chips * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * * Winbond chip: W83L784R, W83L785R, W83L785TS-S * Winbond Chip Temp Volt Fan SMBus IOport W83L784R 3 4 2 yes no W83L785R 2 4 2 yes no W83L785TS-S 1 0 0 yes no * * by YRS */ /* To allow "unknown" (fuzzy probing), define this */ /* #define ALLOW_UNKNOWN */ #include #include #include #include "pci_pm.h" #include "sensors.h" #include "sens_wl784.h" /* external (global) data */ extern int pm_smb_detected; extern int smb_slave; extern int smb_wbtemp1, smb_wbtemp2; extern int smb_wbtemp1_flag, smb_wbtemp2_flag; extern LM_METHODS method_isa, method_smb; extern int numSMBSlave, canSMBSlave[128]; #define WINBD_ADDR_START 0x50 /* 0x50-0x5E (0x28-0x2F) */ #define WINBD_ADDR_END 0x5E #define WINBD_CONFIG 0x40 #define WINBD_SMBADDR 0x4A #define WINBD_VENDIDL 0x4C #define WINBD_VENDIDH 0x4D #define WINBD_CHIPID 0x4E /* temp nr=0,1,2; volt nr=0,...3; fan nr=0,1 */ #define WINBD_TEMP0 0x27 #define WINBD_TEMP1 0x26 #define WINBD_TEMPADDR 0x4B #define WINBD_VOLT(nr) (0x20 + (nr)) #define WINBD_FAN(nr) (0x28 + (nr)) #define WINBD_FANDIV 0x49 #define WINBD_DIOSEL 0x53 static int wl784_probe(LM_METHODS *); static int wl784_probe_act(LM_METHODS *, int); static float wl784_temp(LM_METHODS *, int); static int wl784_fanrpm(LM_METHODS *, int); static float wl784_volt(LM_METHODS *, int); #define BUFF_LEN 128 static char buff[BUFF_LEN]; SENSOR wl784 = { buff, wl784_probe, wl784_temp, wl784_volt, wl784_fanrpm }; /* chip idenfication */ static int wbdchipid = 0; /* temp1/2 flags address */ static int temp1_flag = 0; /* = 0 if enabled ! */ static int temp2_flag = 0; /* = 0 if enabled ! */ static int temp1_addr = 0; static int temp2_addr = 0; #define WINBD_chkRegNum 8 /* Register checked for probing */ static int chkReg[] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x20, 0x21, 0x22, 0x23, 0x26, 0x27, 0x28, 0x29, 0x2B, 0x2C, 0x2D, 0x2E, -1 }; /* * return 0 if not probed */ static int wl784_probe(LM_METHODS *method) { int n, save, slave; if (method != &method_smb) return 0; save = smb_slave; for (n = WINBD_ADDR_START; n <= WINBD_ADDR_END;) { if (!(slave = get_smb_slave(n, WINBD_ADDR_END))) goto ret0; else { if (wl784_probe_act(method, slave)) goto ret1; else n = slave + 2; } } ret0: smb_slave = save; return 0; ret1: kill_smb_slave(slave); if(!smb_wbtemp1_flag) kill_smb_slave(smb_wbtemp1); if(!smb_wbtemp2_flag) kill_smb_slave(smb_wbtemp2); return wbdchipid; } static int wl784_probe_act(LM_METHODS *method, int slave) { int n, nc, nvl, nvh; smb_slave = slave; if (chkReg_Probe(slave, "Probing Winbond W83L78x chip:\n", chkReg, method) < WINBD_chkRegNum) goto ret0; nvl = method->Read(WINBD_VENDIDL); nvh = method->Read(WINBD_VENDIDH); nc = method->Read(WINBD_CHIPID); #ifdef DEBUG printf("DEBUG 4C:0x%02X 4D:0x%02X 4E:0x%02X\n",nvl,nvh,nc); #endif if (nvl == 0xA3 && nvh == 0x5C) { /* Winbond Chip */ switch (nc & 0xFE) { case 0x50: /* 0x50 (or 0x51) */ wbdchipid = W83L784R; break; case 0x60: /* 0x60 (or 0x61) */ wbdchipid = W83L785R; break; case 0x70: /* 0x70 (or 0x71) */ wbdchipid = W83L785TS; break; default: goto ret0; } } else goto ret0; strcpy(wl784.Name, wlchip[wbdchipid]); /* Checking Extra temperatures Temp1, Temp2 */ if (wbdchipid != W83L784R) goto ret1; n = method->Read(WINBD_TEMPADDR); if (!(temp1_flag = (n & 0x08) >> 3)) { temp1_addr = smb_wbtemp1; smb_wbtemp1 = 2 * ( 0x48 + (n & 0x07) ); if (method->ReadTemp1() == 0xFFFF) { temp1_flag = 1; /* disable! */ smb_wbtemp1 = temp1_addr; } } if (!(temp2_flag = (n & 0x80) >> 7)) { temp2_addr = smb_wbtemp2; smb_wbtemp2 = 2 * ( 0x48 + ((n & 0x70) >> 4) ); if (method->ReadTemp2() == 0xFFFF) { temp2_flag = 1; /* disable! */ smb_wbtemp2 = temp2_addr; } } info_Extemp(method, temp1_flag, temp2_flag); ret1: smb_wbtemp1_flag = temp1_flag; smb_wbtemp2_flag = temp2_flag; return wbdchipid; ret0: return 0; } /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,2 */ static float wl784_temp(LM_METHODS *method, int no) { int n = 0; float f; if (no < 0 || 2 < no) return 0xFFFF; if (no == 2 && wbdchipid == W83L785R) return 0xFFFF; if (no >= 1 && wbdchipid == W83L785TS) return 0xFFFF; if (no == 0) return (float) method->Read(WINBD_TEMP0); else if (no == 1) { if (wbdchipid == W83L785R) return (float) method->Read(WINBD_TEMP1); else n = method->ReadTemp1(); } else if (no == 2) { n = method->ReadTemp2(); } if ((n & 0xFF) >= 0x80) n = 0; f = (float) (n & 0xFF) + 0.5 * ((n & 0xFF00) >> 15); return f; } /* * \retval 0x0000FFFF no sensor * no = 0,1,2,...,6 */ static float wl784_volt(LM_METHODS *method, int no) { int n; float f = 0.0; if (wbdchipid == W83L785TS) return 0xFFFF; if (no < 0 || 3 < no) return 0xFFFF; n = method->Read(WINBD_VOLT(no)); switch (no) { case 0: f = n * 0.016; case 1: if (wbdchipid == W83L784R) f = n * 0.016 * 3.3434; else f = n * 0.016 * 2; case 2: f = n * 0.016; break; case 3: if (wbdchipid == W83L784R) f = n * 0.016 * 1.68; else f = n * 0.016 * 3; break; } return f; } /* Controlling Fan Divisor: CR = 0x49. lowest 3bits for fan1, 4-6th bits for fan2. 7 3 0 +-+-+-+-+-+-+-+-+ xxx = 000,001,010,011,... div1fac = 1,2,4,8,... | y y y| x x x| yyy = 000,001,010,011,... div2fac = 1,2,4,8,... +-+-+-+-+-+-+-+-+ initial values: xx=001, yy=001 */ /* * \retval 0xFFFF no sensor * no = 0,1 * * Clock is 22.5kHz (22,500 x 60 = 1350000 counts/minute) */ static int wl784_fanrpm(LM_METHODS *method, int no) { int r, n1 = 0x11; static int div[2] = {1,1}; if (wbdchipid == W83L785TS) return 0xFFFF; if (no < 0 || 1 < no) return 0xFFFF; n1 = method->Read(WINBD_FANDIV); div[0] = n1 & 0x07 ; div[1] = (n1 >> 4) & 0x07; r = method->Read(WINBD_FAN(no)); if (r == 0xFF) { /* change divisor for the sake of next call ! */ if (div[no] < 7) ++(div[no]); else div[no] = 0; r = (n1 & 0x88) | div[0] | (div[1] << 4); method->Write(WINBD_FANDIV, r); return 0xFFFF; } else if (r == 0) { return 0xFFFF; } return 1350000 / (r * (1 << div[no])); } xmbmon-2.05/sens_winbond.h0000644000175000017500000000125107737031336015133 0ustar agiagi00000000000000/* Variety of Winbond and compatible chips */ enum winbond_chips { NOSENSER, W83781D, W83782D, W83783S, W83791D, W83627HF, W83697HF, WBUNKNOWN, AS99127F, ASB100, ASM58, LM78, LM79, ADM9240, UNKNOWN }; #ifndef NO_WINBCHIP static char *winbchip[] = { "No Sensor", "Winbond Chip W83781D", "Winbond Chip W83782D", "Winbond Chip W83783S", "Winbond Chip W83791D", "Winbond Chip W83627HF/THF/THF-A", "Winbond Chip W83697HF", "Winbond unknown Chip", "Asus Chip AS99127F", "Asus Chip ASB100(Bach)", "Asus Chip ASM58(Mozart-2)", "Nat.Semi.Con. Chip LM78", "Nat.Semi.Con. Chip LM79", "Analog Dev. Chip ADM9240", "Unknown Chip assuming LM78", NULL }; #endif xmbmon-2.05/smb_extemp.c0000644000175000017500000000377307701567705014621 0ustar agiagi00000000000000/* Getting temperature data from extra sensors Here, only the sensors connected to SMBus are used by YRS. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "smb_extemp.h" #include "smbuses.h" /* smb_extemp, global */ int num_extemp_chip = 0; int smb_extemp_chip[NUM_EXTEMP_MAX]; int smb_extemp_slave[NUM_EXTEMP_MAX]; /* smbus base address, global */ extern int smb_base; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) extern int smbioctl_readB(int, int, int); extern int smbioctl_readW(int, int, int); #else /* using own SMBus IO routines */ /* smbus io routine, global */ extern SMBUS_IO *smbus; #endif #define LM75_TEMP 0x00 #define LM90_LTEMP 0x00 #define LM90_RTEMPH 0x01 #define LM90_RTEMPL 0x10 #define LM90_OFFSTH 0x11 #define LM90_OFFSTL 0x12 #define WINBD_TEMP0 0x27 #define WINBD_TEMP1 0x26 float smb_ExtraTemp() { int slave, chipid, chip; int n = 0, k = 0; float f = 0.0, offset = 0.0; int (*readB)(int, int, int); int (*readW)(int, int, int); #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) readB = smbioctl_readB; readW = smbioctl_readW; #else readB = smbus->ReadB; readW = smbus->ReadW; #endif chip = num_extemp_chip - 1; /* using the last chip */ if (chip < 0) return 0xFFFF; chipid = smb_extemp_chip[chip]; slave = smb_extemp_slave[chip]; if (chipid == ex_wl785ts) { n = readB(smb_base, slave, WINBD_TEMP0); f = (float) n; } else if (chipid == ex_lm90) { if ((n = readB(smb_base, slave, LM90_OFFSTH)) == 0xFF) n = 0; if ((k = readB(smb_base, slave, LM90_OFFSTL)) == 0xFF) k = 0; else k >>= 5; offset = (float) n + 0.125 * (float) k; n = readB(smb_base, slave, LM90_RTEMPH); if ((k = readB(smb_base, slave, LM90_RTEMPL)) == 0xFF) k = 0; else k >>= 5; if (n >= 0x80) n = k = 0; f = (float) n + 0.125 * (float) k; } else if (chipid == ex_lm75) { n = readW(smb_base, slave, LM75_TEMP); if ((n & 0xFF) >= 0x80) n = 0; f = (float) (n & 0xFF) + 0.5 * ((n & 0xFF00) >> 15); } return f; } xmbmon-2.05/smb_extemp.h0000644000175000017500000000041607670464347014620 0ustar agiagi00000000000000#if !defined(__smb_extemp_h__) #define __smb_extemp_h__ #define NUM_EXTEMP_MAX 10 enum smb_extemp_chipid { ex_nochip, ex_wl785ts, ex_lm90, ex_lm75 }; #define NO_WLCHIP #include "sens_wl784.h" #undef NO_WLCHIP float smb_ExtraTemp(); #endif /*!__smb_extemp_h__*/ xmbmon-2.05/sens_wl784.h0000644000175000017500000000034107670667443014371 0ustar agiagi00000000000000enum wl784_chips { NOSENSER, W83L784R, W83L785R, W83L785TS, }; #ifndef NO_WLCHIP static char *wlchip[] = { "No Sensor", "Winbond Chip W83L784R", "Winbond Chip W83L785R", "Winbond Chip W83L785TS-S", NULL }; #endif xmbmon-2.05/getMB-via.c0000644000175000017500000000162310110432113014165 0ustar agiagi00000000000000 /* Direct access to VIA 686 Hardware Monitor Chip */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "methods.h" /* VIA's HWM Base Address, global */ int viahwm_base = -1; #include #include #include #include "io_static.c" static int ReadByte(int addr) { int ret; ret = INb(viahwm_base + addr); WAIT; return (ret & 0xFF); } static void WriteByte(int addr, int value) { OUTb(viahwm_base + addr, value); WAIT; } static int ReadWord(int addr) { int ret; ret = INw(viahwm_base + addr); WAIT; return (ret & 0xFFFF); } static void WriteWord(int addr, int value) { OUTw(viahwm_base + addr, value); WAIT; } static int ReadTemp1() { return ReadByte(viahwm_base + 0x21); } static int ReadTemp2() { return ReadByte(viahwm_base + 0x1F); } struct lm_methods method_via = { OpenIO, CloseIO, ReadByte, WriteByte, ReadWord, WriteWord, ReadTemp1, ReadTemp2 }; xmbmon-2.05/configure.in0000644000175000017500000000200210107064167014567 0ustar agiagi00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(xmbmon.c) AC_CONFIG_HEADER(config.h) AC_CONFIG_AUX_DIR(AC-TOOLS) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PATH_XTRA dnl Check for host. HOSTDEF="" ADDLIBS="" AC_CANONICAL_HOST case "${host}" in i?86-*-freebsd*) CC=cc ;; i?86-*-linux-*) CC=gcc HOSTDEF="-DLINUX" ;; i?86-*-netbsd* | i?86-*-openbsd*) CC=cc HOSTDEF="-DNETBSD" ADDLIBS="-li386" ;; *) CC=gcc ;; esac AC_SUBST(HOSTDEF) AC_SUBST(ADDLIBS) dnl Checks for libraries. AC_CHECK_LIB(socket, socket, [LIBS="-lsocket -lnsl $LIBS"], , -lnsl) AC_CHECK_LIB(m, fabs) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h) AC_CHECK_HEADERS(machine/smb.h,[AC_DEFINE(HAVE_SMBUS)]) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_STRFTIME AC_TYPE_SIGNAL AC_CHECK_FUNCS(gethostname getutent socket) AC_OUTPUT(Makefile) xmbmon-2.05/testpci.c0000644000175000017500000000555210007414213014100 0ustar agiagi00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) char * smb_devfile = "/dev/smb0"; #define NO_INCLUDE_SMBIO #include "getMB-smb_ioctl.c" #undef NO_INCLUDE_SMBIO #endif #include #include #include #include int debug_flag = 0; #define PCI_LIST #define PCI_SMB_INCLUDED #include "pci_smb.c" int main() { int hwm_base, smb_base, i, n; u_int chipA[256]; int smb_baseA[256]; printf("Listing Bus:0 PCI Configuration: ChipID\n"); if ((n = pci_smb_prob(smb_baseA, chipA)) == 1) { printf("\nOnly one SMBus candidate found! "); printf("ChipID=0x%08X SMBus Base(?)=0x%04X.\n\n",\ chipA[0], smb_baseA[0]); } else if (n > 0) { printf("\n"); printf("%d SMBus candidates found!\n", n); for(i = 0; i < n; ++i) printf("ChipID=0x%08X SMBus Base(?)=0x%04X.\n",\ chipA[i], smb_baseA[i]); printf("\n"); } else if (n == 0) { printf("No SMBus candidates found.\n"); } else if (n == -1) { fprintf(stderr, "Cannot open IO-port, needs privilege!\n"); exit(-1); } switch (pci_pm_smb_prob(&hwm_base, &smb_base)) { case VIA686HWM: printf("VIA686(KT133 south)'s HWM found,"); printf(" its Base Address: 0x%04X.\n", hwm_base); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case VIA686SMB: printf("VIA686(KT133 south) found, but HWM not available.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case VIA596SMB: printf("VIA596 found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case PIIX4SMB: printf("IntelPIIX4(440BX south) found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case SRVWSSSMB: printf("ServerWorks(ServerSet Chipset) found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case VIA8233SMB: printf("VIA8233(KT266/KT333 south) found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case ICH801SMB: printf("Intel801/810/815 (ICH/ICH2) found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case AMD756SMB: printf("AMD756/766/768 found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case NFORCESMB: printf("NVidia nForce found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case ALI1535SMB: printf("ALi M1535 found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case ALI15X3SMB: printf("ALi M1533/1543C found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case AMD8111SMB: printf("AMD8111 found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; case NFORCE2SMB: printf("NVidia nForce2 found.\n"); printf(" SMBus Base Address: 0x%04X.\n", smb_base); break; default: printf("No hardware managent found.\n"); } exit (0); } xmbmon-2.05/testsmb.c0000644000175000017500000000660210106571550014113 0ustar agiagi00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) char * smb_devfile = "/dev/smb0"; #define NO_INCLUDE_SMBIO #include "getMB-smb_ioctl.c" #undef NO_INCLUDE_SMBIO #endif #include #include #include #include #undef PCI_LIST #define PCI_SMB_INCLUDED #include "pci_smb.c" #include "smbuses.h" int debug_flag = 0; /* smbus io routines, global */ extern SMBUS_IO smbus_piix4, smbus_amd, smbus_ali, smbus_amd8; static SMBUS_IO *smbus; #define LM_ADDR 0x5A /* Blacklist slave addresses int blacklist[] is defined, because in some motherboard (Abit BH6, as an example) SMBus hangs up if accessing to it, even in read access (not write!). One must make hardware reset (or switching off) to recover! Reference: detect.c by Takanori Watanabe. */ int main() { int smb_base, i, j, k, n, num_smb; u_int chipID; u_int chipA[256]; int smb_baseA[256]; int blacklist[] = {0xD2,-1}; if ((n = pci_smb_prob(smb_baseA, chipA)) == 1) { smb_base = smb_baseA[0]; chipID = chipA[0]; printf("Only one SMBus candidate found! ChipID=0x%08X.\n", chipID); } else if (n == 0) { fprintf(stderr, "No SMBus candidates found!!\n"); exit(-1); } else if (n > 1) { printf("%d SMBus candidates found!??? Checking...\n", n); for(i = 0; i < n; ++i) printf("ChipID=0x%08X SMBus Base(?)=0x%04X.\n",\ chipA[i], smb_baseA[i]); } else if (n == -1) { fprintf(stderr, "Cannot open IO-port, needs privilege!\n"); exit(-1); } /* Big loop for smb_base candidates */ num_smb = n; for (n = 0; n < num_smb; n++) { smb_base = smb_baseA[n]; chipID = chipA[n]; fprintf(stderr, "\n*** Testing SMBus base = 0x%04X ***\n", smb_base); smbus = &smbus_piix4; switch (chipID) { case ID_VIA686: fprintf(stderr, "VIA686(KT133 south) found.\n"); break; case ID_VIA596: case ID_VIA596B: fprintf(stderr, "VIA596 found.\n"); break; case ID_PIIX4: case ID_PII440MX: case ID_EFVIC66: fprintf(stderr, "IntelPIIX4(440BX south) found.\n"); break; case ID_SRVWSB4: case ID_SRVWSB5: fprintf(stderr, "ServerWorks(ServerSet Chipset) found.\n"); break; case ID_VIA8233: case ID_VIA8233A: case ID_VIA8233C: case ID_VIA8235: fprintf(stderr, "VIA8233/A/8235(KT266/KT333/KT400 south) found.\n"); break; case ID_I801AA: case ID_I801AB: case ID_I801BA: case ID_I801CA: fprintf(stderr, "Intel801/810/815 (ICH/ICH2) found.\n"); break; case ID_AMD756: case ID_AMD766: case ID_AMD768: smbus = &smbus_amd; fprintf(stderr, "AMD756/766/768 found.\n"); break; case ID_NFORCE: smbus = &smbus_amd; fprintf(stderr, "NVidia nFORCE found.\n"); break; case ID_ALI7101: smbus = &smbus_ali; fprintf(stderr, "ALi M1535D+ found.\n"); break; case ID_AMD8111: smbus = &smbus_amd8; fprintf(stderr, "AMD8111 found.\n"); break; case ID_NFORCE2: smbus = &smbus_amd8; fprintf(stderr, "NVidia nForce2 found.\n"); break; default: fprintf(stderr, "No known SMBus(I2C) chip found.\n"); goto exit; } if(OpenIO() == -1) return -1; /* Testing SMBus devices */ for (i = 0; i < 255; i += 2) { for (j = 0; blacklist[j] != -1; j++) { if (i != blacklist[j] && (k = smbus->ReadB(smb_base, i, 0x00)) != -1) { printf(" addr:0x%02X ---> byte of Reg0 =0x%02X\n", i, k); } } } CloseIO(); exit: ; /* dummy statment for gcc 3.4 or after */ } /* endo of Big loop for smb_base candidates */ exit (0); } xmbmon-2.05/pci_pm.c0000644000175000017500000001534410110432154013673 0ustar agiagi00000000000000 /* Looking for Power Management ChipSet by checking the PCI Configuration Register, by YRS 2001.08. Information on how to access SMBus is provided by ":p araffin.(Yoneya)", MANY THANKS!! Information for SMBus access and PCI chipset comes from the Linux lm_sensor codes: http://www.lm-sensors.nu */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define PCI_DEBUG #include #endif #include #include "pci_pm.h" #include "io_static.c" #include "smbuses.h" /* counter for not calling iopl() multiply */ int iopl_counter = 0; /* file descripter for FreeBSD /dev/io */ int iofl; char *chk_smb_chip(int chip) { char *comt; switch (chip) { case VIA686HWM: case VIA686SMB: comt = "VIA82C686(KT133/A)"; break; case VIA596SMB: comt = "VIA596"; break; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) case VIA586PM: comt = "VIA586"; break; #endif case PIIX4SMB: comt = "IntelPIIX4(440BX/MX)"; break; case SRVWSSSMB: comt = "ServerWorks(ServerSet Chipset)"; break; case VIA8233SMB: comt = "VT8233/A/8235/8237(KT266/333/400/600/880)"; break; case VIA8235PM: comt = "VIA8231/8235PM"; break; case ICH801SMB: comt = "Intel8XX(ICH/ICH2/ICH3/ICH4/ICH5/ICH6)"; break; case AMD756SMB: comt = "AMD756/766/768"; break; case NFORCESMB: comt = "NVidia nForce"; break; case ALI1535SMB: comt = "ALi M1535"; break; case ALI15X3SMB: comt = "ALi M1533/1543C"; break; case AMD8111SMB: comt = "AMD8111"; break; case NFORCE2SMB: comt = "NVidia nForce2"; break; default: comt = NULL; break; } return comt; } int chk_port_byte(int addr) { int ret; if(OpenIO() == -1) return -1; ret = INb((u_short) addr); CloseIO(); return ret; } int pci_pm_smb_prob(int *hwm_base, int *smb_base) { u_int dat; u_char dev, fun; int ret = 0, inq_smbba = 0; if(OpenIO() == -1) return -1; *hwm_base = *smb_base = 0; for (dev = 0; dev < PCI_DEVM; ++dev) { for (fun = 0; fun < PCI_FUNM; ++fun) { switch (pci_conf_read(PCI_BUSN, dev, fun, 0x00)) { case ID_VIA686: dat = pci_conf_read(PCI_BUSN, dev, fun, VIA686HWM_prob); if (dat && 0x00000001) { *hwm_base = 0xFFFE & \ pci_conf_read(PCI_BUSN, dev, fun, VIA686HWM_base); ret = VIA686HWM; } else { ret = VIA686SMB; } inq_smbba = getSMBBA0; break; case ID_VIA596: case ID_VIA596B: ret = VIA596SMB; inq_smbba = getSMBBA0; break; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) case ID_VIA586: ret = VIA586PM; break; #endif case ID_VIA8235M: ret = VIA8235PM; inq_smbba = getSMBBA0; break; case ID_PIIX4: case ID_PII440MX: case ID_EFVIC66: ret = PIIX4SMB; inq_smbba = getSMBBA0; break; case ID_SRVWSB4: case ID_SRVWSB5: ret = SRVWSSSMB; inq_smbba = getSMBBA0; break; case ID_VIA8233: case ID_VIA8233A: case ID_VIA8233C: case ID_VIA8235: case ID_VIA8237: ret = VIA8233SMB; inq_smbba = getSMBBA1; break; case ID_I801AA: case ID_I801AB: case ID_I801BA: case ID_I801CA: case ID_I801DB: case ID_I801EB: case ID_I6300ESB: case ID_IICH6: ret = ICH801SMB; inq_smbba = getSMBBA2; break; case ID_AMD756: case ID_AMD766: case ID_AMD768: ret = AMD756SMB; inq_smbba = getSMBBA3; break; case ID_NFORCE: ret = NFORCESMB; inq_smbba = getSMBBA4; break; case ID_ALI7101: if (is_ALI1535()) { ret = ALI1535SMB; inq_smbba = getSMBBA5; } else { ret = ALI15X3SMB; inq_smbba = getSMBBA4; } break; case ID_AMD8111: ret = AMD8111SMB; inq_smbba = getSMBBA6; break; case ID_NFORCE2: ret = NFORCE2SMB; inq_smbba = getSMBBA71; break; default: break; } #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) if (ret) goto ending; #else if (ret) { *smb_base = pci_conf_readw(PCI_BUSN, dev, fun, (u_char) inq_smbba); if (ret/10 == AMD8111SMB/10) { *smb_base &= 0xFFFE; if (ret == NFORCE2SMB) { #ifdef PCI_DEBUG printf("DEBUG nForce2:SMBBA1(0x%02X) --->smb_base = 0x%0X\n", getSMBBA71, *smb_base); #endif if (!chk_smbus_io(NFORCE2SMB, *smb_base)) { *smb_base = pci_conf_readw(PCI_BUSN, dev, fun, (u_char) getSMBBA70) & 0xFFFE; #ifdef PCI_DEBUG printf("DEBUG nForce2:SMBBA0(0x%02X) --->smb_base = 0x%0X\n", getSMBBA70, *smb_base); #endif if (!chk_smbus_io(NFORCE2SMB, *smb_base)) *smb_base = 0x00; } } } else if (ret/10 == AMD756SMB/10) { *smb_base &= 0xFF00; if (ret == AMD756SMB) *smb_base += AMD_SMBOFF; } else if (ret == ALI1535SMB || ret == ALI15X3SMB) { *smb_base &= 0xFFE0; } else { *smb_base &= 0xFFF0; } goto ending; } #endif } } ending: #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) #else if (*smb_base < 0x100) { /* not so confident but ... */ ret = 0; } #endif CloseIO(); return ret; } /* checking ALI south/north chip set */ int is_ALI1535(void) { u_char dev, fun; int ret = 0; u_int id; if(OpenIO() == -1) return -1; for (dev = 0; dev < PCI_DEVM; ++dev) { for (fun = 0; fun < PCI_FUNM; ++fun) { id = pci_conf_read(PCI_BUSN, dev, fun, 0x00); if (id == ID_ALI1535 || id == ID_ALI1647) { ret = 1; break; } } if (ret) break; } CloseIO(); return ret; } /* Byte/Word read-out from PCI Configuration Registor. Here: Boundary considered. */ u_char pci_conf_readb(u_char bus, u_char dev, u_char fun, u_char reg) { u_int dat, n; n = reg % 4; dat = pci_conf_read(bus, dev, fun, (reg & 0xFC)); if (n == 0) { return (dat & 0xFF); } else { return ((dat >> (8*n)) & 0xFF); } } u_short pci_conf_readw(u_char bus, u_char dev, u_char fun, u_char reg) { u_int dat, n; n = reg % 4; dat = pci_conf_read(bus, dev, fun, (reg & 0xFC)); if (n == 0) { return (dat & 0xFFFF); } else if (n != 3) { return ((dat >> (8*n)) & 0xFFFF); } else { n = pci_conf_read(bus, dev, fun, (reg & 0xFC) + 4); return ((((dat >> (8*3)) & 0xFF) & (n << (8*1))) & 0xFFFF); } } /* PCI Configuration Registor 31 23 15 7 0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|0 0 0 0 0 0 0| Bus Num |Dev Num |Func |Reg Num |0 0| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ u_int pci_conf_read(u_char bus, u_char dev, u_char fun, u_char reg) { /* NOTE: do not check length of "bus, dev, fun, reg"!! */ /* reg = (Reg Num) << 2 */ /* reg & 0xFC */ /* fun & 0x07 */ /* dev & 0x1F */ /* bus & 0xFF */ u_int pix = 0, dat; pix |= reg; pix |= (fun << 8); pix |= (dev << 11); pix |= (bus << 16); pix |= 0x80000000; OUTl((unsigned int) PCI_CFIO, pix); WAIT; dat = INl((unsigned int) PCI_CREAD); WAIT; pix &= 0x7FFFFFFF; OUTl((unsigned int) PCI_CFIO, pix); WAIT; return dat; } xmbmon-2.05/ReadMe.tech0000644000175000017500000001372507701333173014300 0ustar agiagi00000000000000 *** Brief Summary of sensor chip modules and SMBus access modules *** (for hackers to include supports for new hardwares!) ************************************************************************** [1] sensor chip modules ************************************************************************** The treatments of reading data are different in each class of hardware monitor chips. They are separated into the following modules: sens_winbond.c --- LM78/79, Winbond W83XXX, Asus AS99127F ASB100 sens_wl784.c --- Winbond W83L784X, W83L785X sens_via68.c --- VIA82C686A/B sens_it87.c --- ITE IT85XX and SiS950 sens_gl52.c --- GL518SM/GL520SM sens_lm85.c --- LM85, ADM1027/ADT7463, EMC6D10X sens_lm80.c --- LM80 sens_lm90.c --- LM90, ADM1020/1021/1023 sens_lm75.c --- LM75 If one wants to add a support for new monitor chips, first prepare the corresponding module: sens_xxxx.c sens_yyyy.c Then, one has to change the file, "sensors.h", in the following way to add the new module: ----------------------------------------------------------------------- typedef struct hwm_access SENSOR; extern SENSOR winbond; extern SENSOR wl784; extern SENSOR via686; extern SENSOR it87; extern SENSOR gl52; extern SENSOR lm85; extern SENSOR lm80; extern SENSOR lm90; extern SENSOR lm75; extern SENSOR xxx; <--- add new one xxx extern SENSOR yyy; <--- add new one yyy /* should be larger than the number of "HWM_sensor_chip" */ #define SEARCH 2002 /* * Supported HWM, ordering is important!! * HWM_sensor_chip{} should be consistent with * HWM_module[] and HWM_name[] */ enum HWM_sensor_chip { c_winbond, c_wl784, c_via686, c_it87, c_gl52, c_lm85, c_lm80, c_lm90, c_lm75, c_xxxx, <--- add new one xxx c_yyyy <--- add new one yyy }; #ifdef INCLUDE_HWM_MODULE /* Array of Supported HWM, ordering is important!! */ SENSOR *HWM_module[] = { &winbond, &wl784, &via686, &it87, &gl52, &lm85, &lm80, &lm90, &lm75, &xxx, <--- add new one xxx &yyy, <--- add new one yyy NULL }; /* HWM_name[] should have one-to-one correspondence to HWM_module[] */ char *HWM_name[] = { "winbond", "wl784", "via686", "it87", "gl52", "lm85", "lm80", "lm90", "lm75", "xxx", <--- add new one xxx "yyy", <--- add new one yyy NULL }; int HWM_VIA = 0; /* HWM_SMBchip[] should have one-to-one correspondence to HWM_module[] */ int HWM_SMBchip[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <--- add new one xxx 0, <--- add new one yyy 0 }; /* HWM_smbslave[] should have one-to-one correspondence to HWM_module[] */ int HWM_smbslave[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <--- add new one xxx 0, <--- add new one yyy 0 }; /* HWM_ISAchip[] should have one-to-one correspondence to HWM_module[] */ int HWM_ISAchip[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <--- add new one xxx 0, <--- add new one yyy 0 }; #endif /* INCLUDE_HWM_MODULE */ ----------------------------------------------------------------------- Here, the global variable of data type SENSOR, xxx and yyy, should be defined in each module, sens_xxx.c and sens_yyy.c. And do not forget to add it to CHIPLIST macro in "mbmon.h". #define CHIPLIST "winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75" As for how to make each module, please refer existing ones above. ************************************************************************** [2] smbus modules ************************************************************************** The treatments of SMBus access are different for various Power Management Controllers (usually inside the south chipset). They are separated into the following modules: smbus_piix4.c --- PIIX4(440BX), VT82C586/596/686A/B(KT133 etc), VT8233(KT266/A, KT333), etc smbus_amd.c --- AMD756/766/768, NVidia nForce smbus_ali.c --- ALi M1535D+ smbus_amd8.c --- AMD8111, NVidia nForce2 If one wants to add a support for new PM chipset to access SMBus, first prepare the corresponding module: smbus_xxx.c smbus_yyy.c in each of which, struct smbus_io smbus_xxxx = .... or struct smbus_io smbus_yyyy = .... should be defined. This structure "smbus_xxxx/yyyy" is used in "smbuses.c" below. Next, one has to make the PM chip to be recognized in the search routine of the PCI Configuration in the files. For this purpose one has to modify the file "pci_pm.c" and "pci_pm.h". Include new macros in pci_pm.h, #define XXxxxSMB xx(int, appropriate number) #define YYyyySMB yy(int, appropriate number) and correspondingly change the file pci_pm.c. Here one needs the following information: (a)The PCI chip and vendor ID of the PM chip to be supported (b)The offset where the SMBus base address is stored For the supported chipsets, these information are included in pci_pm.h. Refer to it for adding new PM chipsets. Then one has to change the file, "smbuses.c", in the following way to add the module: ----------------------------------------------------------------------- /* smbus io routines, global */ #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) #else /* using own SMBus IO routines */ extern SMBUS_IO *smbus; extern SMBUS_IO smbus_piix4; extern SMBUS_IO smbus_amd; extern SMBUS_IO smbus_ali; extern SMBUS_IO smbus_amd8; extern SMBUS_IO smbus_xxx; <--- add new one xxx extern SMBUS_IO smbus_yyy; <--- add new one yyy #endif int set_smbus_io(int *viahwm_base, int *smb_base) { int n; n = pci_pm_smb_prob(viahwm_base, smb_base); #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) return n; #else /* using own SMBus IO routines */ if (n <= 0) return n; if (n/10 == AMD756SMB/10) smbus = &smbus_amd; else if (n/10 == ALI7101SMB/10) smbus = &smbus_ali; else if (n/10 == AMD8111SMB/10) smbus = &smbus_amd8; else if (n/10 == XXxxxSMB/10) <--- add new one xxx smbus = &smbus_xxx; else if (n/10 == YYyyySMB/10) <--- add new one yyy smbus = &smbus_yyy; else smbus = &smbus_piix4; return n; #endif } xmbmon-2.05/sens_lm85.c0000644000175000017500000001650307742450172014260 0ustar agiagi00000000000000/* * National Semiconductor LM85 and compatible hardware monitor chips * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * National Semiconductor Chip Temp Volt Fan SMBus IOport lm85 3 5 4 yes no Analog Devices Chip Temp Volt Fan SMBus IOport adm1024 2 5 2 yes no adm1025 2 5 - yes no adm1027 3 5 4 yes no adt7463 3 5 4 yes no Standard Microsystem Chip Temp Volt Fan SMBus IOport emc6d10x 3 5 4 yes no * * by YRS */ #include #include #include "sensors.h" /* external (global) data */ extern int smb_slave; extern LM_METHODS method_isa, method_smb; extern int numSMBSlave, canSMBSlave[128]; #define LM85_ADDR_START 0x58 /*0x58-0x5A*/ #define LM85_ADDR_END 0x5C #define LM85_DEVID 0x3D #define LM85_VENDID 0x3E #define LM85_VERSTEP 0x3F #define LM85_CONF 0x40 #define LM85_TEMP(nr) (0x25 + (nr)) #define LM85_VOLT(nr) (0x20 + (nr)) #define LM85_FANLSB(nr) (0x28 + (nr) * 2) #define LM85_FANMSB(nr) (0x29 + (nr) * 2) #define LM85_VID 0x43 #define ADM_24FAN(nr) (0x28 + (nr)) #define ADM_24FANDIV 0x47 #define ADM_24MODE 0x16 #define ADM_TEMPOFF(nr) (0x70 + (nr)) #define ADM_EXTRES1 0x76 #define ADM_EXTRES2 0x77 #define ADM_FANPPR 0x7B static int lm85chipid = 0; static float Vfac; static int lm85_probe(LM_METHODS *); static int lm85_chk(LM_METHODS *); static float lm85_temp(LM_METHODS *, int); static int lm85_fanrpm(LM_METHODS *, int); static float lm85_volt(LM_METHODS *, int); #if 0 static int lm85_fan_ppr(LM_METHODS *, int); static void lm85_fan_ppr_set(LM_METHODS *, int, int); #endif #define BUFF_LEN 128 static char buff[BUFF_LEN]; static int adm_24fan[2] = {0, 0}; SENSOR lm85 = { buff, lm85_probe, lm85_temp, lm85_volt, lm85_fanrpm }; enum lm85_chips { NOSENSER, LM85, EMC6D10X, ADM1024, ADM1025, ADM1027, ADT7463, }; static char *lm85chip[] = { "No Sensor", "Nat.Semi.Con. Chip LM85", "SMSC Chip EMC6D10X", "Analog Dev. Chip ADM1024", "Analog Dev. Chip ADM1025", "Analog Dev. Chip ADM1027", "Analog Dev. Chip ADT7463", NULL }; #define LM85_chkRegNum 20 /* Register checked for probing */ static int chkReg[] = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x70, 0x71, 0x72, 0x73, 0x76, 0x77, 0x78, 0x7B, -1 }; /* * return 0 if not probed */ static int lm85_probe(LM_METHODS *method) { int n, save; if (method != &method_smb) return 0; save = smb_slave; for (n = LM85_ADDR_START; n <= LM85_ADDR_END;) { if (!(smb_slave = get_smb_slave(n, LM85_ADDR_END))) goto ret0; else { if (lm85_chk(method) && chkReg_Probe(smb_slave, "Probing LM85/compatible chip:\n", chkReg, method) >= LM85_chkRegNum) goto ret1; else n = smb_slave + 2; } } ret0: smb_slave = save; return 0; ret1: kill_smb_slave(smb_slave); if (lm85chipid == ADM1024) { n = method->Read(ADM_24MODE); adm_24fan[0] = n & 0x01; /* fan1 present if n & 0x01 = 0 */ adm_24fan[1] = n & 0x02; /* fan2 present if n & 0x02 = 0 */ } if (lm85chipid < ADM1027) Vfac = 1. / (float) 0xFF; else Vfac = 1. / (float) 0x3FF; return lm85chipid; } static int lm85_chk(LM_METHODS *method) { int vendor, verstep; vendor = method->Read(LM85_VENDID); verstep = method->Read(LM85_VERSTEP); if (vendor == 0x01) { /* National Semicon. */ if ((verstep & 0xf0) == 0x60) lm85chipid = LM85; else goto ret0; } else if (vendor == 0x41) { /* Analog Devices */ if ((verstep & 0xF0) == 0x10) lm85chipid = ADM1024; else if ((verstep & 0xF0) == 0x20) lm85chipid = ADM1025; else if (verstep == 0x60) lm85chipid = ADM1027; else if (verstep == 0x62) lm85chipid = ADT7463; else goto ret0; } else if (vendor == 0x5C) { /* Standard Microsystem Corp. */ if ((verstep & 0xF0) == 0x60) lm85chipid = EMC6D10X; else goto ret0; } else goto ret0; strcpy(buff, lm85chip[lm85chipid]); return lm85chipid; ret0: return 0; } /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,... */ static float lm85_temp( LM_METHODS *method, int no ) { int n, ne; float ext = 0.0, offset = 0.0; if (no < 0 || 2 < no) return 0xFFFF; if (lm85chipid == ADM1024 || lm85chipid == ADM1025) { if (no == 2) return 0xFFFF; else no++; } else if (lm85chipid >= ADM1027) { ne = method->Read(ADM_EXTRES2); ext = 0.25 * ((ne >> ((no + 1) * 2)) & 0x03); n = method->Read(ADM_TEMPOFF(no)); if (n > 0x80) n -= 0xFF; offset = (float) n; } n = method->Read(LM85_TEMP(no)); if (n == 0x80) return 0xFFFF; else if (n > 0x80) return (float) (n - 0xFF) + ext - offset; else return (float) n + ext - offset; } /* * \retval 0x0000FFFF no sensor * no = 0,1,2,... */ static float Vtab[5] = { 2.5 * 4./3., /* 2.5V */ 2.25 * 4./3., /* Vcore (2.25) */ 3.3 * 4./3., /* 3.3V */ 5.0 * 4./3., /* 5.0V */ 12.0 * 4./3. /* 12.0V */ }; static float lm85_volt(LM_METHODS *method, int no) { int n, ne = 0; if (no < 0 || 4 < no) return 0xFFFF; if (lm85chipid >= ADM1027) { if (no == 4) ne = method->Read(ADM_EXTRES2) & 0x03; else ne = (method->Read(ADM_EXTRES1) >> (no * 2)) & 0x03; } n = method->Read(LM85_VOLT(no)); if (lm85chipid >= ADM1027) n = (n << 2) | ne; return Vtab[no] * Vfac * (float) n; } /* * \retval 0x0000FFFF no sensor * no = 0,1,... * * Clock is 90kHz (90,000 x 60 = 5400000 counts/minute) */ static int lm85_fanrpm(LM_METHODS *method, int no) { int lsb, msb, r, n; int p = 2; /* default number of pulse per revolution */ static int ppr[4] = {2,2,2,2}, div[2] = {1,1}; if (no < 0 || 3 < no || lm85chipid == ADM1025) return 0xFFFF; if (lm85chipid == ADM1024) { if (no > 1 || adm_24fan[no]) return 0xFFFF; n = method->Read(ADM_24FANDIV); div[0] = (n >> 4) & 0x03; div[1] = n >> 6; r = method->Read(ADM_24FAN(no)); if (r == 0) return 0xFFFF; else if (r == 0xFF) { /* change divisor for the sake of next call ! */ if (div[no] < 3) ++(div[no]); else div[no] = 0; r = (n & 0x0F) | (div[0] << 4) | (div[1] << 6); method->Write(ADM_24FANDIV, r); return 0xFFFF; } else return 1350000 / (r * (1 << div[no])); } if (lm85chipid >= ADM1027) p = ((method->Read(ADM_FANPPR) >> (no * 2)) & 0x03) + 1; ppr[no] = p; lsb = method->Read(LM85_FANLSB(no)); msb = method->Read(LM85_FANMSB(no)); if ((lsb == 0xFF && msb == 0xFF) || (lsb == 0 && msb == 0)) return 0xFFFF; else return 5400000 / (p * ((msb << 8) | lsb)); } #if 0 static int lm85_fan_ppr(LM_METHODS *method, int no) { int p = 2; if (lm85chipid >= ADM1027) p = ((method->Read(ADM_FANPPR) >> (no * 2)) & 0x03) + 1; return p; } static void lm85_fan_ppr_set(LM_METHODS *method, int no, int p) { int n; if (lm85chipid >= ADM1027) { n = method->Read(ADM_FANPPR); n &= ((p - 1) & 0x03) << (no * 2); method->Write(ADM_FANPPR, n); } } #endif xmbmon-2.05/mbmon_small.c0000644000175000017500000000541207701336350014734 0ustar agiagi00000000000000/* * mbmon --- command-line motherboard monitor * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "mbmon.h" int main(int argc, char *argv[]) { int n, sec; float temp1 = 0.0, temp2 = 0.0, temp3 = 0.0; float vc0, vc1, v33, v50p, v12p, v12n, v50n; int rot1, rot2, rot3; extern char *optarg; extern int optind; char *name; int ch, method = ' '; name = argv[0]; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) while ((ch = getopt(argc,argv,"VSIAfdDYe:p:s:")) != -1) { #else while ((ch = getopt(argc,argv,"VSIAfdDYe:p:")) != -1) { #endif switch(ch) { case 'V': method = 'V'; break; case 'S': method = 'S'; break; case 'I': method = 'I'; break; case 'A': method = 'A'; break; case 'f': fahrn_flag = 1; break; case 'd': debug_flag = 1; break; case 'D': debug_flag = 2; /* debug option level 2 */ break; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) case 's': n = atoi(optarg); if (n < 0 || n > 9) goto exit; if (n) smb_devbuf[8] = *optarg; break; #endif case 'e': n = atoi(optarg); if (0 <= n && n <= 2) extra_tempNO = n; break; case 'p': probe_request = optarg; break; case 'Y': TyanTigerMP_flag = 1; break; default: #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) exit: #endif fprintf(stderr, "Usage: %s (default %d sec)\n" " options: [-V|S|I|A (access method)] [-d/D (debug) -f (Fahrenheit)]\n" #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) " : [-s [0-9]: for using /dev/smb[0-9]]\n" #endif " : [-e [0-2] set extra temp. to temp.[0|1|2] (need -A).\n" " : [-p chip (chip=" CHIPLIST " for probing chips)]\n" " : [-Y for Tyan Tiger MP/MPX motherboard]\n" , argv[0], DEFAULT_SEC); exit(1); } } argc -= optind; argv += optind; if (argc >= 1) { if ((n = atoi(argv[0])) > 0) { sec = n; } else { fprintf(stderr, " argument (%s) should be integer, stop!\n", argv[0]); exit (1); } } else { sec = DEFAULT_SEC; } if ((n = InitMBInfo(method)) != 0) { perror("InitMBInfo"); if (n < 0) fprintf(stderr,"This program needs \"setuid root\"!!\n"); exit (1); } if (debug_flag) exit (0); while(1) { /* Temperature */ getTemp(&temp1, &temp2, &temp3); printf("Temp.= %4.1f, %4.1f, %4.1f;",temp1, temp2, temp3); /* Fan Speeds */ getFanSp(&rot1, &rot2, &rot3); printf(" Rot.= %4d, %4d, %4d\n", rot1, rot2, rot3); /* Voltages */ getVolt(&vc0, &vc1, &v33, &v50p, &v50n, &v12p, &v12n); printf(" Vcore = %4.2f, %4.2f; Volt. = %4.2f, %4.2f, %5.2f, %6.2f, %5.2f\n", vc0, vc1, v33, v50p, v12p, v12n, v50n); /* sleep */ sleep(sec); } } xmbmon-2.05/mbmon.c0000644000175000017500000003510310107066164013541 0ustar agiagi00000000000000/* * mbmon --- command-line motherboard monitor * */ #ifdef SMALL_MBMON /* small_mbmon */ #include "mbmon_small.c" #else /* ! small_mbmon */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_GETUTENT # include #else # include #endif #include "mbmon.h" static const char *MyName = "mbmon"; int port = 0; int usage(void) { fprintf(stderr, "MotherBoard Monitor, ver. %s by YRS.\n" "Usage: %s [options...] (default %d sec)\n" " options:\n" " -V|S|I: access method (using \"VIA686 HWM directly\"|\"SMBus\"|\"ISA I/O port\")\n" " -A: for probing all methods, all chips, and setting an extra sensor.\n" " -d/D: debug mode (any other options except (V|S|I) will be ignored)\n" #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) " -s [0-9]: for using /dev/smb[0-9]\n" #endif " -e [0-2]: set extra temperature sensor to temp.[0|1|2] (need -A).\n" " -p chip: chip="CHIPLIST"\n" " for probing chips\n" " -Y: for Tyan Tiger MP/MPX motherboard\n" " -h: print help message(this) and exit\n" " -f: temperature in Fahrenheit\n" " -c count: repeat times and exit\n" " -P port: run in daemon mode, using given port for clients\n" " -T|F [1-7]: print Temperature|Fanspeed according to following styles\n" " style1: data1\\n\n" " style2: data2\\n\n" " style3: data3\\n\n" " style4: data1\\ndata2\\n\n" " style5: data1\\ndata3\\n\n" " style6: data2\\ndata3\\n\n" " style7: data1\\ndata2\\ndata3\\n\n" " -r: print TAG and Value format\n" " -u: print system uptime\n" " -t: print present time\n" " -n|N: print hostname(long|short style)\n" " -i: print integers in the summary(with -T option)\n"\ , XMBMON_VERSION, MyName, DEFAULT_SEC); exit(1); } void uptime(time_t now) { int days, hrs, mins, secs; struct tm *local_time; time_t uptime = 0; #ifdef LINUX #define PROC_LOADAVG "/proc/loadavg" char file_buf[1024]; double avg[3]; int fd; ssize_t bytes; #endif #ifdef HAVE_GETUTENT int nusers = 0; struct utmp *utent; setutent(); while ( (utent = getutent()) ) { switch (utent->ut_type) { case BOOT_TIME: uptime = now - utent->ut_time; break; case USER_PROCESS: nusers++; break; default: break; } } endutent(); #else /* FreeBSD, NetBSD */ struct timeval boottime; int mib[2]; size_t size; mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) uptime = now - boottime.tv_sec; #endif /* display current time */ local_time = localtime(&now); printf("%2d:%02d%s ", local_time->tm_hour%12 ? local_time->tm_hour%12 : 12, local_time->tm_min, local_time->tm_hour > 11 ? "pm" : "am"); /* display uptime */ printf("up"); days = uptime / 86400; uptime %= 86400; hrs = uptime / 3600; uptime %= 3600; mins = uptime / 60; secs = uptime % 60; if (days > 0) printf(" %d day%s,", days, days > 1 ? "s" : ""); if (hrs > 0 && mins > 0) printf(" %2d:%02d", hrs, mins); else if (hrs > 0) printf(" %d hr%s", hrs, hrs > 1 ? "s" : ""); else if (mins > 0) printf(" %d min%s", mins, mins > 1 ? "s" : ""); else printf(" %d sec%s", secs, secs > 1 ? "s" : ""); #ifdef HAVE_GETUTENT /* display nusers */ printf(", %2d user%s", nusers, nusers == 1 ? "" : "s"); #endif #ifdef LINUX /* display load average */ if ((fd = open(PROC_LOADAVG, O_RDONLY)) == -1) { fprintf(stderr, "Error: /proc file system must be mounted\n"); close(fd); exit(1); } lseek(fd, 0L, SEEK_SET); if ((bytes = read(fd, file_buf, sizeof file_buf - 1)) < 0) { fprintf(stderr, "Error: can't read file \"%s\"\n", PROC_LOADAVG); close(fd); exit(1); } file_buf[bytes] = '\0'; close(fd); if (sscanf(file_buf, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]) < 3) { fprintf(stderr, "bad data in file \"%s\"\n", PROC_LOADAVG); exit(1); } printf(", load average: %.2f, %.2f, %.2f", avg[0], avg[1], avg[2]); #endif printf("\n"); } void hostname(int sh_flag) { #ifdef LINUX char domainname[MAXHOSTNAMELEN], hostname[MAXHOSTNAMELEN]; if (gethostname(hostname, (int)sizeof(hostname))) { fprintf(stderr, "%s: gethostname failed.\n", MyName); perror(MyName); exit(1); } if (getdomainname(domainname, (int)sizeof(domainname))) { fprintf(stderr, "%s: getdomainname failed.\n", MyName); perror(MyName); exit(1); } if (sh_flag) printf("%s\n", hostname); else printf("%s.%s\n", hostname, domainname); #else char *p, hostname[MAXHOSTNAMELEN]; if (gethostname(hostname, (int)sizeof(hostname))) { fprintf(stderr, "%s: gethostname failed.\n", MyName); perror(MyName); exit(1); } if (sh_flag && (p = strchr(hostname, '.'))) *p = '\0'; printf("%s\n", hostname); #endif } static void daemonize() { int fd; struct sigaction sa_ign, sa_save; #ifdef SIGTSTP signal(SIGTSTP, SIG_IGN); #endif #ifdef SIGTTIN signal(SIGTTIN, SIG_IGN); #endif #ifdef SIGTTOU signal(SIGTTOU, SIG_IGN); #endif memset(&sa_ign, 0, sizeof(sa_ign)); sa_ign.sa_handler = SIG_IGN; sa_ign.sa_flags = 0; sigaction(SIGHUP, &sa_ign, &sa_save); switch (fork()) { case 0: break; case -1: fprintf(stderr, "%s: daemonize -- fork failed.", MyName); perror(MyName); exit(1); /* NOTREACHED */ break; default: exit(0); /* NOTREACHED */ break; } setsid(); sigaction(SIGHUP, &sa_save, (struct sigaction *)0); if ((fd = open("/dev/null", O_RDWR)) == -1) { fprintf(stderr, "%s: daemonize -- open failed.", MyName); perror(MyName); exit(1); } dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); if (fd > 2) close (fd); } int main(int argc, char *argv[]) { int n, sec; int count = 0, temperature = 0, fanspeed = 0; float temp1 = 0.0, temp2 = 0.0, temp3 = 0.0; float vc0, vc1, v33, v50p, v12p, v12n, v50n; int rot1, rot2, rot3; extern char *optarg; extern int optind; char *name; int fd = 0; struct sockaddr_in server, client; FILE *out = stdout; char buf[256]; int ch, method = ' '; struct tm lt; time_t now; int time_flag = 0; int uptime_flag = 0; int hostname_flag = 0; int sh_flag = 0; int integer_flag = 0; int tagval_flag = 0 ; #ifdef LOGGING int nfd = 0; fd_set mstfdset, rd_fdset; logdata log_data[LOGENTRIES]; logdata *curdata = &log_data[0]; int index = 0; #endif name = argv[0]; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) while ((ch = getopt(argc,argv,"VSIAfdDYe:p:s:c:T:F:tunNirh")) != -1) { #else while ((ch = getopt(argc,argv,"VSIAfdDYe:p:c:T:F:tunNirhP:")) != -1) { #endif switch(ch) { case 'V': if (method == ' ') method = 'V'; else usage(); break; case 'S': if (method == ' ') method = 'S'; else usage(); break; case 'I': if (method == ' ') method = 'I'; else usage(); break; case 'A': if (method == ' ') method = 'A'; else usage(); break; case 'f': fahrn_flag = 1; break; case 'd': debug_flag = 1; break; case 'D': debug_flag = 2; /* debug option level 2 */ break; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) case 's': n = atoi(optarg); if (n < 0 || n > 9) usage(); if (n) smb_devbuf[8] = *optarg; break; #endif case 'e': n = atoi(optarg); if (0 <= n && n <= 2) extra_tempNO = n; break; case 'p': probe_request = optarg; break; case 'P': port = atoi (optarg); break; case 'Y': TyanTigerMP_flag = 1; break; case 'c': count = atoi(optarg); break; case 'T': if (fanspeed != 0) usage(); temperature = atoi(optarg); break; case 'F': if (temperature != 0) usage(); fanspeed = atoi(optarg); break; case 't': time_flag = 1; break; case 'u': uptime_flag = 1; break; case 'n': if (hostname_flag != 0) usage(); hostname_flag = 1; break; case 'N': if (hostname_flag != 0) usage(); hostname_flag = 1; sh_flag = 1; break; case 'i': integer_flag = 1; break; case 'r': tagval_flag = 1; break; case 'h': usage(); break; default: usage(); } } argc -= optind; argv += optind; if (argc >= 1) { if ((n = atoi(argv[0])) > 0) { sec = n; } else { fprintf(stderr, " argument (%s) should be integer, stop!\n", argv[0]); exit (1); } } else { sec = DEFAULT_SEC; } if ((n = InitMBInfo(method)) != 0) { perror("InitMBInfo"); if (n < 0) fprintf(stderr,"This program needs \"setuid root\"!!\n"); exit (1); } if (debug_flag) exit (0); if (port) { #ifdef LOGGING FILE *log; log = fopen(LOGFILE, "w"); if (log == NULL) { perror("fopen(LOGFILE)"); exit (1); } fclose(log); #endif fd = socket (AF_INET, SOCK_STREAM, 0); if (fd < 0) { perror("socket"); exit (1); } server.sin_family = AF_INET; server.sin_port = htons (port); server.sin_addr.s_addr = INADDR_ANY; if (bind (fd, (struct sockaddr *) &server, sizeof (server)) < 0) { perror("bind"); exit (1); } if (listen (fd ,5) < 0) { perror("listen"); exit (1); } daemonize(); #ifdef LOGGING /* clear out all entries for logging */ FD_ZERO(&mstfdset); FD_SET(fd, &mstfdset); for (index = 0; index < LOGENTRIES; index++) { logdata *ld; ld = &log_data[index]; ld->data = 0; ld->prev = &log_data[index-1]; ld->next = &log_data[index+1]; if (index == 0) { ld->prev = &log_data[LOGENTRIES-1]; } if (index == LOGENTRIES-1) { ld->next = &log_data[0]; } } #endif } while(1) { if (port) { int c, len = sizeof (struct sockaddr_in); #ifdef LOGGING struct timeval select_timeout = {LOGINTERVAL, 0}; memcpy(&rd_fdset, &mstfdset, sizeof(fd_set)); nfd = select(fd+1, (fd_set *)(&rd_fdset), NULL, NULL, &select_timeout); /* open socket as our fd if we accepted a new connection */ if (nfd > 0) { #endif c = accept (fd, (struct sockaddr *) &client, &len); if (c < 0) continue; out = fdopen (c, "w"); #ifdef LOGGING } #endif } /* get temperature */ getTemp(&temp1, &temp2, &temp3); /* get fan speeds */ getFanSp(&rot1, &rot2, &rot3); /* get voltages */ getVolt(&vc0, &vc1, &v33, &v50p, &v50n, &v12p, &v12n); #ifdef LOGGING /* log data */ if (port && !nfd) { time_t tim = time(NULL); struct tm *tm = localtime(&tim); char timebuf[24]; char *when; FILE *log; logdata *prtdata = 0; if (tm->tm_hour > 11) { when = "PM"; if (tm->tm_hour > 12) tm->tm_hour -= 12; } else { when = "AM"; if (tm->tm_hour == 0) tm->tm_hour = 12; } sprintf(timebuf, "%2d/%2d/%4d;%2d:%02d:%02d %s", tm->tm_mon + 1, tm->tm_mday, tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec, when); /* format of file is: */ /* ;;;CPU;Power;Case;CPU;Power; */ /* 7/10/2003;8:24:08 PM;2015 MHz;44 C;43 C;44 C;2220 RPM;5357 RPM; */ /* open (purge) log file here */ log = fopen(LOGFILE, "w"); /* move new data into first entry */ curdata = curdata->prev; if (!curdata->data) curdata->data = malloc(80); sprintf(curdata->data, "%s;;%5.1f C;%5.1f C;%5.1f C;%5d RPM;%5d RPM;%5d RPM;\n", timebuf, temp1, temp2, temp3, rot1, rot2, rot3); /* rewrite entire file */ fprintf(log, ";;;TEMP0;TEMP1;TEMP2;FAN0;FAN1;FAN2;\n"); for (index = 0, prtdata = curdata; index < LOGENTRIES; index++, prtdata = prtdata->next) { if (!prtdata->data) break; fprintf(log, prtdata->data); } /* close log file */ fclose(log); } else #endif /* print data */ if (tagval_flag) { fprintf(out, "TEMP0 : %4.1f\n", temp1 ) ; fprintf(out, "TEMP1 : %4.1f\n", temp2 ) ; fprintf(out, "TEMP2 : %4.1f\n", temp3 ) ; fprintf(out, "FAN0 : %4d\n", rot1 ) ; fprintf(out, "FAN1 : %4d\n", rot2 ) ; fprintf(out, "FAN2 : %4d\n", rot3 ) ; fprintf(out, "VC0 : %+6.2f\n", vc0 ) ; fprintf(out, "VC1 : %+6.2f\n", vc1 ) ; fprintf(out, "V33 : %+6.2f\n", v33 ) ; fprintf(out, "V50P : %+6.2f\n", v50p ) ; fprintf(out, "V12P : %+6.2f\n", v12p ) ; fprintf(out, "V12N : %+6.2f\n", v12n ) ; fprintf(out, "V50N : %+6.2f\n", v50n ) ; } else if (temperature == 0 && fanspeed == 0) { fprintf(out, "\n"); fprintf(out, "Temp.= %4.1f, %4.1f, %4.1f;",temp1, temp2, temp3); fprintf(out, " Rot.= %4d, %4d, %4d\n", rot1, rot2, rot3); fprintf(out, "Vcore = %4.2f, %4.2f; Volt. = %4.2f, %4.2f, %5.2f, %6.2f, %5.2f\n", vc0, vc1, v33, v50p, v12p, v12n, v50n); } else if (fanspeed == 0) { if (integer_flag == 0) { if (temperature == 1) fprintf(out, "%4.1f\n", temp1); else if (temperature == 2) fprintf(out, "%4.1f\n", temp2); else if (temperature == 3) fprintf(out, "%4.1f\n", temp3); else if (temperature == 4) fprintf(out, "%4.1f\n%4.1f\n", temp1, temp2); else if (temperature == 5) fprintf(out, "%4.1f\n%4.1f\n", temp1, temp3); else if (temperature == 6) fprintf(out, "%4.1f\n%4.1f\n", temp2, temp3); else if (temperature == 7) fprintf(out, "%4.1f\n%4.1f\n%4.1f\n", temp1, temp2, temp3); } else { if (temperature == 1) fprintf(out, "%2d\n", (int)(temp1 + 0.5)); else if (temperature == 2) fprintf(out, "%2d\n", (int)(temp2 + 0.5)); else if (temperature == 3) fprintf(out, "%2d\n", (int)(temp3 + 0.5)); else if (temperature == 4) fprintf(out, "%2d\n%2d\n", (int)(temp1 + 0.5), (int)(temp2 + 0.5)); else if (temperature == 5) fprintf(out, "%2d\n%2d\n", (int)(temp1 + 0.5), (int)(temp3 + 0.5)); else if (temperature == 6) fprintf(out, "%2d\n%2d\n", (int)(temp2 + 0.5), (int)(temp3 + 0.5)); else if (temperature == 7) fprintf(out, "%2d\n%2d\n%2d\n", (int)(temp1 + 0.5), (int)(temp2 + 0.5), (int)(temp3 + 0.5)); } } else if (temperature == 0) { if (fanspeed == 1) fprintf(out, "%4d\n", rot1); else if (fanspeed == 2) fprintf(out, "%4d\n", rot2); else if (fanspeed == 3) fprintf(out, "%4d\n", rot3); else if (fanspeed == 4) fprintf(out, "%4d\n%4d\n", rot1, rot2); else if (fanspeed == 5) fprintf(out, "%4d\n%4d\n", rot1, rot3); else if (fanspeed == 6) fprintf(out, "%4d\n%4d\n", rot2, rot3); else if (fanspeed == 7) fprintf(out, "%4d\n%4d\n%4d\n", rot1, rot2, rot3); } if (port) { #ifdef LOGGING if (nfd) #endif fclose (out); continue; } now = time(NULL); if (time_flag == 1) { lt = *localtime(&now); strftime(buf, sizeof(buf), "%a %b %e %T %Z %Y", <); printf("%s\n", buf); } if (uptime_flag == 1) { uptime(now); } if (hostname_flag == 1) { hostname(sh_flag); } /* count */ if (count != 0) { if (count > 1) count--; else exit(0); } /* sleep */ sleep(sec); } } #endif /* ! small_mbmon */ xmbmon-2.05/xmbmon.resources0000644000175000017500000000154607670643516015542 0ustar agiagi00000000000000! ! XMBmon resource file for .../app-defaults, by YRS, 2002.01.18 ! XMBmon*translations: #override \ : repaint_proc()\n\ : repaint_proc()\n\ : repaint_proc()\n\ Q: quit_proc() ! Add the followings to users default resources if one wishes XMBmon*geometry: 100x140 XMBmon*font: -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* XMBmon*count: 4 XMBmon*sec: 20 XMBmon*wsec: 1800 XMBmon*tmin: 10.0 XMBmon*tmax: 50.0 XMBmon*vmin: 1.80 XMBmon*vmax: 2.20 XMBmon*tick: 3 XMBmon*cltmb: blue XMBmon*cltcpu: red XMBmon*cltcs: cyan XMBmon*clvc: green XMBmon*cmtmb: \ MB XMBmon*cmtcpu: CPU XMBmon*cmtcs: chip XMBmon*cmvc: Vc\ XMBmon*method: XMBmon*extratemp: 2 XMBmon*smbdev: 0 XMBmon*fahrn: False XMBmon*probe: XMBmon*TyanTigerMP: False XMBmon*label: XMBmon*labelfont: -adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-* XMBmon*labelcolor: black xmbmon-2.05/xmbmon.c0000644000175000017500000006071410106571757013747 0ustar agiagi00000000000000/* * xmbmon --- X motherboard monitor * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "mbmon.h" /* X include files */ #include #include #define DEFAULT_METHOD ' ' #define RES_NAME "XMBmon" #define DEFAULT_GEOMETRY "100x140" #define DEFAULT_FONT "-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*" #define DEFAULT_LBFONT "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*" #define DEFAULT_LBCOLOR "black" #define DEFAULT_COUNT "4" #define DEFAULT_CSEC "20" #define DEFAULT_WSEC "1800" #define DEFAULT_TMIN "10.0" #define DEFAULT_TMAX "50.0" #define DEFAULT_TMINF "50.0" /* for Fahrenheit */ #define DEFAULT_TMAXF "130.0" /* for Fahrenheit */ #define DEFAULT_VMIN "1.80" #define DEFAULT_VMAX "2.20" #define DEFAULT_TICK "3" #define DEFAULT_CLTMB "blue" #define DEFAULT_CLTCPU "red" #define DEFAULT_CLTCS "cyan" #define DEFAULT_CLVC "green" #define DEFAULT_CMTMB "\\ MB" #define DEFAULT_CMTMB1 " MB" #define DEFAULT_CMTCPU "CPU" #define DEFAULT_CMTCS "chip" #define DEFAULT_CMVC "Vc\\ " #define DEFAULT_CMVC1 "Vc " #define DEFAULT_FAHRN "False" #define DEFAULT_EXTRAT "2" #define DEFAULT_SMB "0" #define DEFAULT_PROBE "none" #define DEFAULT_TYAN "False" #define NO_TEMP "NOTEMP" /* xmbmon variables */ /* temp1(MotherBoard), temp2(CPU) [,temp3(ChipSet)] and Vcore0 */ #define NUM_DATA 4 int noTemp3_flag = 0; int num_data = NUM_DATA; int t_indx[4] = {0, 1, 2, 3}; char access_method = DEFAULT_METHOD; char *font, *label; int width, height; int n_count, interval_sec, w_sec; int counter = 0; int w_counter = 0; int w_range; unsigned long t_sec, t_msec; float *fmean; float tmin, tmax, vmin, vmax; int n_tick; float tscl, vscl, sscl, htck; float cur_val[NUM_DATA]; float iir_reg[NUM_DATA]; float iir_tc = 0.25; /* IIR LPF time constant, 0 < iir_tc < 1.0 */ char *l_color[NUM_DATA]; unsigned long cpix[NUM_DATA], d_cpix[NUM_DATA]; #define C_LBL 10 char ctmin[C_LBL], ctmax[C_LBL]; char cvmin[C_LBL], cvmax[C_LBL]; char *c_rdv[NUM_DATA], *c_rdg[NUM_DATA]; char *c_rdp[NUM_DATA] = {"%4.1f", "%4.1f", "%4.1f", "%4.2f"}; char *lb_font, *lb_color; int lb_width, x_lb, c_lb = 0; /* the following arrays have variable dim. depending on "num_data" being 3 or 4. other arrays is fixed and used by using index array "t_indx[]". */ float scale[NUM_DATA]; float orign[NUM_DATA]; int x_rdg[NUM_DATA], x_rdv[NUM_DATA], y_rdg, y_rdv; int cg_width[NUM_DATA], cv_width[NUM_DATA]; int cg_w, cv_w, c_height, cm_width, cm_height; unsigned long cpixlb, d_cpixlb; typedef struct ring_data { /* def. of ring-buffer */ float val; struct ring_data *next; } ring_d; ring_d *rdp[NUM_DATA]; ring_d *rdpw[NUM_DATA]; /* variables for X11 */ Widget wgt; Display *disp; Window win; GC gct, gclb, gcl[NUM_DATA]; XPoint *points; XFontStruct *fontstr; XFontStruct *lb_fontstr; /* Xt Application Context */ XtAppContext app_con; /* functions */ void get_args(int argc, char *argv[]); void usage(void); void get_res(void); void init_dt(void); void getWH(int *width, int *height); void repaint_proc(void); void quit_proc(void); void draw_values(void); int ColorPix(Display *, char *, unsigned long *); void alarm_handler(void); /*---------- definitions of static data for X Toolkits ----------*/ static String fallback_resources[] = { "*translations: #override \ : repaint_proc()\\n\ : repaint_proc()\\n\ : repaint_proc()\\n\ Q: quit_proc()", "*geometry: " DEFAULT_GEOMETRY, "*font: " DEFAULT_FONT, "*count: " DEFAULT_COUNT, "*sec: " DEFAULT_CSEC, "*wsec: " DEFAULT_WSEC, "*tmin: " DEFAULT_TMIN, "*tmax: " DEFAULT_TMAX, "*vmin: " DEFAULT_VMIN, "*vmax: " DEFAULT_VMAX, "*tick: " DEFAULT_TICK, "*cltmb: " DEFAULT_CLTMB, "*cltcpu: " DEFAULT_CLTCPU, "*cltcs: " DEFAULT_CLTCS, "*clvc: " DEFAULT_CLVC, "*cmtmb: " DEFAULT_CMTMB, "*cmtcpu: " DEFAULT_CMTCPU, "*cmtcs: " DEFAULT_CMTCS, "*cmvc: " DEFAULT_CMVC, "*fahrn: " DEFAULT_FAHRN, "*label: " , "*labelfont: " DEFAULT_LBFONT, "*labelcolor: " DEFAULT_LBCOLOR, "*extratemp: " DEFAULT_EXTRAT, #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) "*smbdev: " DEFAULT_SMB, #endif "*probe: " DEFAULT_PROBE, "*TyanTigerMP: " DEFAULT_TYAN, NULL, }; static XtActionsRec actions[] = { {"repaint_proc", (XtActionProc) repaint_proc}, {"quit_proc", (XtActionProc) quit_proc}, }; static struct _app_res { char *font; int count; int sec; int wsec; float tmin; float tmax; float vmin; float vmax; int tick; char *cltmb; char *cltcpu; char *cltcs; char *clvc; char *cmtmb; char *cmtcpu; char *cmtcs; char *cmvc; Boolean fahrn; char *label; char *labelfont; char *labelcolor; char *method; int extratemp; char *probe; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) char *smbdev; #endif Boolean TyanTigerMP; } app_resources; static XtResource resources[] = { {"font", "Font", XtRString, sizeof(String), XtOffset(struct _app_res*, font), XtRString, (XtPointer) NULL}, {"count", "Count", XtRInt, sizeof(int), XtOffset(struct _app_res*, count), XtRImmediate, (XtPointer) NULL}, {"sec", "Sec", XtRInt, sizeof(int), XtOffset(struct _app_res*, sec), XtRImmediate, (XtPointer) NULL}, {"wsec", "wSec", XtRInt, sizeof(int), XtOffset(struct _app_res*, wsec), XtRImmediate, (XtPointer) NULL}, {"tmin", "Tmin", XtRFloat, sizeof(float), XtOffset(struct _app_res*, tmin), XtRImmediate, (XtPointer) NULL}, {"tmax", "Tmax", XtRFloat, sizeof(float), XtOffset(struct _app_res*, tmax), XtRImmediate, (XtPointer) NULL}, {"vmin", "Vmin", XtRFloat, sizeof(float), XtOffset(struct _app_res*, vmin), XtRImmediate, (XtPointer) NULL}, {"vmax", "Vmax", XtRFloat, sizeof(float), XtOffset(struct _app_res*, vmax), XtRImmediate, (XtPointer) NULL}, {"tick", "Tick", XtRInt, sizeof(int), XtOffset(struct _app_res*, tick), XtRImmediate, (XtPointer) NULL}, {"cltmb", "ClTmb", XtRString, sizeof(String), XtOffset(struct _app_res*, cltmb), XtRString, (XtPointer) NULL}, {"cltcpu", "ClTcpu", XtRString, sizeof(String), XtOffset(struct _app_res*, cltcpu), XtRString, (XtPointer) NULL}, {"cltcs", "ClTcs", XtRString, sizeof(String), XtOffset(struct _app_res*, cltcs), XtRString, (XtPointer) NULL}, {"clvc", "ClVc", XtRString, sizeof(String), XtOffset(struct _app_res*, clvc), XtRString, (XtPointer) NULL}, {"cmtmb", "CMTmb", XtRString, sizeof(String), XtOffset(struct _app_res*, cmtmb), XtRString, (XtPointer) NULL}, {"cmtcpu", "CMTcpu", XtRString, sizeof(String), XtOffset(struct _app_res*, cmtcpu), XtRString, (XtPointer) NULL}, {"cmtcs", "CMTcs", XtRString, sizeof(String), XtOffset(struct _app_res*, cmtcs), XtRString, (XtPointer) NULL}, {"cmvc", "CMVc", XtRString, sizeof(String), XtOffset(struct _app_res*, cmvc), XtRString, (XtPointer) NULL}, {"fahrn","Fahrn",XtRBoolean,sizeof(Boolean), XtOffset(struct _app_res*, fahrn), XtRImmediate, (XtPointer) NULL}, {"label","Label",XtRString,sizeof(String), XtOffset(struct _app_res*, label), XtRString,(XtPointer) NULL}, {"labelfont","LabelFont",XtRString,sizeof(String), XtOffset(struct _app_res*, labelfont), XtRString,(XtPointer) NULL}, {"labelcolor","LabelColor",XtRString,sizeof(String), XtOffset(struct _app_res*, labelcolor), XtRString,(XtPointer) NULL}, {"method","Method",XtRString,sizeof(String), XtOffset(struct _app_res*, method), XtRString,(XtPointer) NULL}, {"extratemp", "ExtraTemp", XtRInt, sizeof(int), XtOffset(struct _app_res*, extratemp), XtRImmediate, (XtPointer) NULL}, {"probe","Method",XtRString,sizeof(String), XtOffset(struct _app_res*, probe), XtRString,(XtPointer) NULL}, #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) {"smbdev","SMBDEV",XtRString,sizeof(String), XtOffset(struct _app_res*, smbdev), XtRString,(XtPointer) NULL}, #endif {"TyanTigerMP","tyantigermp",XtRBoolean,sizeof(Boolean), XtOffset(struct _app_res*, TyanTigerMP), XtRImmediate, (XtPointer) NULL}, }; static XrmOptionDescRec options[] = { {"-font", ".font", XrmoptionSepArg, NULL}, {"-count", ".count", XrmoptionSepArg, NULL}, {"-sec", ".sec", XrmoptionSepArg, NULL}, {"-wsec", ".wsec", XrmoptionSepArg, NULL}, {"-tmin", ".tmin", XrmoptionSepArg, NULL}, {"-tmax", ".tmax", XrmoptionSepArg, NULL}, {"-vmin", ".vmin", XrmoptionSepArg, NULL}, {"-vmax", ".vmax", XrmoptionSepArg, NULL}, {"-tick", ".tick", XrmoptionSepArg, NULL}, {"-cltmb", ".cltmb", XrmoptionSepArg, NULL}, {"-cltcpu", ".cltcpu", XrmoptionSepArg, NULL}, {"-cltcs", ".cltcs", XrmoptionSepArg, NULL}, {"-clvc", ".clvc", XrmoptionSepArg, NULL}, {"-cmtmb", ".cmtmb", XrmoptionSepArg, NULL}, {"-cmtcpu", ".cmtcpu", XrmoptionSepArg, NULL}, {"-cmtcs", ".cmtcs", XrmoptionSepArg, NULL}, {"-cmvc", ".cmvc", XrmoptionSepArg, NULL}, {"-fahrn",".fahrn",XrmoptionSepArg,NULL}, {"-label",".label",XrmoptionSepArg,NULL}, {"-labelfont",".labelfont",XrmoptionSepArg,NULL}, {"-labelcolor",".labelcolor",XrmoptionSepArg,NULL}, {"-method",".method",XrmoptionSepArg,NULL}, {"-extratemp",".extratemp",XrmoptionSepArg,NULL}, {"-probe",".probe",XrmoptionSepArg,NULL}, #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) {"-smbdev",".smbdev",XrmoptionSepArg,NULL}, #endif {"-TyanTigerMP",".TyanTigerMP",XrmoptionSepArg,NULL}, }; /*---------- end of static data for X Toolkits ----------*/ void get_args(int argc, char *argv[]) { int i; for (i = 1; i < argc; i++) { if (0 == strcmp("-d", argv[i]) || 0 == strcmp("-debug", argv[i])) { debug_flag = 1; } if (0 == strcmp("-D", argv[i]) || 0 == strcmp("-DEBUG", argv[i])) { debug_flag = 2; /* debug option level 2 */ } if (0 == strcmp("-Y", argv[i]) || 0 == strcmp("-TyanTigerMP", argv[i])) { TyanTigerMP_flag = 1; } if (0 == strcmp("-h", argv[i]) || 0 == strcmp("-help", argv[i])) { usage(); } } } int chk_notemp(char *p) { char *dum, *t; if (*p == (char) NULL) return (1); dum = (char *) malloc(strlen(p) + 1); strcpy(dum, p); for (t = dum; *t != (char) NULL; t++) if('a' <= *t && *t <= 'z') *t -= 'a' - 'A'; if (strcmp(dum, NO_TEMP) == 0) return (1); else return (0); } void usage(void) { fprintf(stderr, \ "X MotherBoard Monitor, ver. %s by YRS.\n" " options:\n" " : -g (" DEFAULT_GEOMETRY ") \n" " : -count (" DEFAULT_COUNT ") \n" " : -sec (" DEFAULT_CSEC ") \n" " : -wsec (" DEFAULT_WSEC ") \n" " : -tmin (" DEFAULT_TMIN ") \n" " : -tmax (" DEFAULT_TMAX ") \n" " : -vmin (" DEFAULT_VMIN ") \n" " : -vmax (" DEFAULT_VMAX ") \n" " : -tick (" DEFAULT_TICK ") \n" " : -cltmb (" DEFAULT_CLTMB ") \n" " : -cltcpu (" DEFAULT_CLTCPU ") \n" " : -cltcs (" DEFAULT_CLTCS ") \n" " : -clvc (" DEFAULT_CLVC ") \n" " : -cmtmb (" DEFAULT_CMTMB1 ") " " [Not shown ]\n" " : -cmtcpu (" DEFAULT_CMTCPU ") " " [if \"" NO_TEMP "\"]\n" " : -cmtcs (" DEFAULT_CMTCS ") " " [set. ]\n" " : -cmvc (" DEFAULT_CMVC1 ") \n" " : -fahrn (" DEFAULT_FAHRN ") \n" " : -label ( ) for showing label [No label if null-string.]\n" " and -labelfont, -labelcolor\n" " : -method (%c) \n" " : -extratemp (2) set extra-temp. to temp[0|1|2] (need -A)\n" #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) " : -smbdev [0-9] (0) for using /dev/smb[0-9]\n" #endif " : -probe chip ( ) chip="CHIPLIST"\n" " for probing monitor chips\n" " : -TyanTigerMP for Tyan Tiger MP motherboard\n" " : -debug/DEBUG for debug information\n" , XMBMON_VERSION, DEFAULT_METHOD); exit(1); } int main(int argc, char *argv[]) { { uid_t uid = getuid(); int r = seteuid(uid); if(r == -1) { perror("seteuid"); return 1; } } get_args(argc, argv); wgt = XtVaAppInitialize(&app_con, RES_NAME, options, XtNumber(options), &argc, argv, fallback_resources, NULL); XtVaGetApplicationResources(wgt, (caddr_t) &app_resources, resources, XtNumber(resources), NULL); XtAppAddActions(app_con, actions, XtNumber(actions)); XtRealizeWidget(wgt); get_res(); { int r = seteuid(0); if(r == -1) { perror("seteuid"); return 1; } } init_dt(); XtAppAddTimeOut(app_con, t_msec, (XtTimerCallbackProc) alarm_handler, NULL); XtAppMainLoop(app_con); return 0; } void get_res() { int n; font = app_resources.font; if(font == NULL) font = DEFAULT_FONT; n_count = app_resources.count; if(n_count <= 0) n_count = atoi(DEFAULT_COUNT); interval_sec = app_resources.sec; if(interval_sec <= 0) interval_sec = atoi(DEFAULT_CSEC); w_sec = app_resources.wsec; if(w_sec <= 0) w_sec = atoi(DEFAULT_WSEC); tmin = app_resources.tmin; if(tmin <= 0.0) tmin = (float) atof(DEFAULT_TMIN); tmax = app_resources.tmax; if(tmax <= 0.0) tmax = (float) atof(DEFAULT_TMAX); vmin = app_resources.vmin; if(vmin <= 0.0) vmin = (float) atof(DEFAULT_VMIN); vmax = app_resources.vmax; if(vmax <= 0.0) vmax = (float) atof(DEFAULT_VMAX); n_tick = app_resources.tick; if(n_tick <= 0) n_tick = atoi(DEFAULT_TICK); l_color[0] = app_resources.cltmb; if(l_color[0] == NULL) l_color[0] = DEFAULT_CLTMB; l_color[1] = app_resources.cltcpu; if(l_color[1] == NULL) l_color[1] = DEFAULT_CLTCPU; l_color[2] = app_resources.cltcs; if(l_color[2] == NULL) l_color[2] = DEFAULT_CLTCS; l_color[3] = app_resources.clvc; if(l_color[3] == NULL) l_color[3] = DEFAULT_CLVC; c_rdg[0] = app_resources.cmtmb; if(c_rdg[0] == NULL) c_rdg[0] = DEFAULT_CMTMB1; else if (chk_notemp(c_rdg[0])) noTemp3_flag = 1; c_rdg[1] = app_resources.cmtcpu; if(c_rdg[1] == NULL) c_rdg[1] = DEFAULT_CMTCPU; else if (chk_notemp(c_rdg[1])) noTemp3_flag = 2; c_rdg[2] = app_resources.cmtcs; if(c_rdg[2] == NULL) c_rdg[2] = DEFAULT_CMTCS; else if (chk_notemp(c_rdg[2])) noTemp3_flag = 3; c_rdg[3] = app_resources.cmvc; if(c_rdg[3] == NULL) c_rdg[3] = DEFAULT_CMVC1; if(app_resources.fahrn) { fahrn_flag = 1; if( tmin == (float) atof(DEFAULT_TMIN) && tmax == (float) atof(DEFAULT_TMAX) ) { tmin = (float) atof(DEFAULT_TMINF); tmax = (float) atof(DEFAULT_TMAXF); } } label = app_resources.label; lb_font = app_resources.labelfont; lb_color = app_resources.labelcolor; if(lb_color == NULL) lb_color = DEFAULT_LBCOLOR; if(app_resources.method != NULL) access_method = *app_resources.method; n = app_resources.extratemp; if (0 <= n && n <= 2) extra_tempNO = n; if(app_resources.probe != NULL) probe_request = app_resources.probe; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) if(app_resources.smbdev != NULL) { n = atoi(app_resources.smbdev); if (n >= 1 && n <= 9) smb_devbuf[8] = *app_resources.smbdev; } #endif if(app_resources.TyanTigerMP) { TyanTigerMP_flag = 1; } if(noTemp3_flag) { num_data = 3; switch(noTemp3_flag) { case 1: t_indx[0] = 1; t_indx[1] = 2; break; case 2: t_indx[0] = 0; t_indx[1] = 2; break; case 3: t_indx[0] = 0; t_indx[1] = 1; } t_indx[2] = 3; } } void quit_proc(void) { exit(1); } void repaint_proc(void) { int wwd, hht; int i, id, n, ww = width -1, hh = height - 1; ring_d *p; for (i = 0; i < num_data; i++) { id = t_indx[i]; sprintf(c_rdv[id], c_rdp[id], cur_val[id]); cv_width[i] = XTextWidth(fontstr, c_rdv[id], strlen(c_rdv[id])); } getWH(&wwd, &hht); if (wwd != width) { width = wwd; ww = width - 1; sscl = (float) width / (float) w_range; if (noTemp3_flag) { x_rdg[1] = (width - cg_width[1]) / 2; x_rdg[2] = width - cg_width[2] - 1; x_rdv[1] = (width - cv_width[1]) / 2; x_rdv[2] = width - cv_width[2] - 1; } else { x_rdg[1] = cg_width[0] / 2 + (width - cg_w) / 3 - cg_width[1] / 2; x_rdg[2] = cg_width[0] / 2 + (width - cg_w) * 2 / 3 - cg_width[2] / 2; x_rdg[3] = width - cg_width[3] - 1; cv_w = (cv_width[0] + cv_width[3]) / 2; x_rdv[1] = cv_width[0] / 2 + (width - cv_w) / 3 - cv_width[1] / 2; x_rdv[2] = cv_width[0] / 2 + (width - cv_w) * 2 / 3 - cv_width[2] / 2; x_rdv[3] = width - cv_width[3] - 1; } /* x_lb = (width - lb_width) / 2;*/ } if (hht != height) { height = hht; hh = height -1; tscl = (float) (height - c_lb - c_height)/ (tmax - tmin); vscl = (float) (height - c_lb - c_height)/ (vmax - vmin); htck = (float) (height - c_lb - c_height)/ (float) (n_tick + 1); scale[0] = tscl; scale[1] = tscl; if (noTemp3_flag) { scale[2] = vscl; } else { scale[2] = tscl; scale[3] = vscl; } } XClearWindow(disp, win); if(*label != (char) NULL) XDrawString(disp, win, gclb, x_lb, c_lb - 2, label, strlen(label)); for (i = 0; i < num_data; i++) { id = t_indx[i]; XDrawString(disp, win, gcl[id], x_rdg[i], y_rdg, \ c_rdg[id], strlen(c_rdg[id])); XDrawString(disp, win, gcl[id], x_rdv[i], y_rdv, \ c_rdv[id], strlen(c_rdv[id])); } XDrawString(disp, win, gct, 0, hh+1, ctmin, strlen(ctmin)); XDrawString(disp, win, gct, 0, cm_height, ctmax, strlen(ctmax)); XDrawString(disp, win, gct, ww-cm_width, hh+1, cvmin, strlen(cvmin)); XDrawString(disp, win, gct, ww-cm_width, cm_height, cvmax, strlen(cvmax)); for (i = 0; i < n_tick + 1; i++) { n = hh - (int) ((float) (i + 1) * htck + 0.5); XDrawLine(disp, win, gct, 0, n, ww, n); } for (i = num_data - 1; i >= 0; i--) { id = t_indx[i]; for (n = 0, p = rdp[i]; n < w_counter; n++) { (points + n)->x = (short) ((float) n * sscl + 0.5); (points + n)->y = hh \ - (short) ((p->val - orign[i]) * scale[i] + 0.5); p = p->next; } XDrawLines(disp, win, gcl[id], points, w_counter, CoordModeOrigin); } XFlush(disp); } void getWH(int *width, int *height) { Dimension wd, ht; XtVaGetValues(wgt, XtNwidth, &wd, XtNheight, &ht, NULL); *width = (int) wd; *height = (int) ht; } int ColorPix(Display *display, char *color, unsigned long *cpix) { Colormap cmap; XColor c0, c1; if (color == NULL) return (1); cmap = DefaultColormap(display, 0); if (XAllocNamedColor(disp, cmap, color, &c1, &c0)) { *cpix = c1.pixel; return (0); } else { return (1); } } void init_dt(void) { ring_d *p; int n, i, id; float d; if (w_sec < 10 * interval_sec) { fprintf(stderr,"wsec(%d) is too small w.r.t sec(%d) --- exit.\n",\ w_sec, interval_sec); exit (1); } if (tmax < tmin) { fprintf(stderr,"tmin(%f) > tmax(%f), not allowed! --- exit.\n",\ tmin, tmax); exit (1); } if (vmax < vmin) { fprintf(stderr,"vmin(%f) > vmax(%f), not allowed! --- exit.\n",\ vmin, vmax); exit (1); } if ((n = InitMBInfo(access_method)) != 0) { perror("InitMBInfo"); if(n < 0) fprintf(stderr,"This program needs \"setuid root\"!!\n"); exit (1); } if (debug_flag) exit (0); getTemp(&cur_val[0], &cur_val[1], &cur_val[2]); getVolt(&cur_val[3], &d, &d, &d, &d, &d, &d); disp = XtDisplay(wgt); win = XtWindow(wgt); getWH(&width, &height); if ((fontstr = XLoadQueryFont(disp, font)) == NULL) { fprintf(stderr,"Can't find font: %s\n", font); exit (1); } ColorPix(disp, DEFAULT_CLTMB, &(d_cpix[0])); ColorPix(disp, DEFAULT_CLTCPU, &(d_cpix[1])); ColorPix(disp, DEFAULT_CLTCS, &(d_cpix[2])); ColorPix(disp, DEFAULT_CLVC, &(d_cpix[3])); gct = XCreateGC(disp, win, 0, 0); XSetFont(disp, gct, fontstr->fid); for (i = 0; i < num_data; i++) { id = t_indx[i]; if (ColorPix(disp, l_color[id], &(cpix[id]))) cpix[id] = d_cpix[id]; gcl[id] = XCreateGC(disp, win, 0, 0); XSetLineAttributes(disp, gcl[id], 2, LineSolid, CapRound, JoinRound); XSetForeground(disp, gcl[id], cpix[id]); XSetFont(disp, gcl[id], fontstr->fid); c_rdv[id] = (char *) malloc(C_LBL); sprintf(c_rdv[id], c_rdp[id], cur_val[id]); cg_width[i] = XTextWidth(fontstr, c_rdg[id], strlen(c_rdg[id])); cv_width[i] = XTextWidth(fontstr, c_rdv[id], strlen(c_rdv[id])); } if(*label != (char) NULL) { if ((lb_fontstr = XLoadQueryFont(disp, lb_font)) == NULL) { fprintf(stderr,"Can't find font for label: %s\n", font); exit (1); } ColorPix(disp, DEFAULT_LBCOLOR, &d_cpixlb); if (ColorPix(disp, lb_color, &cpixlb)) cpixlb = d_cpixlb; gclb = XCreateGC(disp, win, 0, 0); XSetFont(disp, gclb, lb_fontstr->fid); XSetForeground(disp, gclb, cpixlb); lb_width = XTextWidth(lb_fontstr, label, strlen(label)); } sprintf(ctmin, "%2.0f", tmin); sprintf(ctmax, "%2.0f", tmax); sprintf(cvmin, "%3.1f", vmin); sprintf(cvmax, "%3.1f", vmax); w_range = w_sec / interval_sec; points = (XPoint *) malloc(sizeof(short) * 2 * (w_range + 1)); for (i = 0; i < num_data; i++) { rdp[i] = p = (ring_d *) malloc(sizeof(ring_d)); rdpw[i] = p; for (n = 1; n < (w_range + 1); n++) { p->next = (ring_d *) malloc(sizeof(ring_d)); p = p->next; } p->next = rdp[i]; } fmean = (float *) malloc(sizeof(float) * num_data * n_count); sscl = (float) width / (float) w_range; orign[0] = tmin; orign[1] = tmin; x_rdg[0] = 0; x_rdv[0] = 0; if (noTemp3_flag) { orign[2] = vmin; x_rdg[1] = (width - cg_width[1]) / 2; x_rdg[2] = width - cg_width[2] - 1; x_rdv[1] = (width - cv_width[1]) / 2; x_rdv[2] = width - cv_width[2] - 1; } else { orign[2] = tmin; orign[3] = vmin; cg_w = (cg_width[0] + cg_width[3]) / 2; x_rdg[1] = cg_width[0] / 2 + (width - cg_w) / 3 - cg_width[1] / 2; x_rdg[2] = cg_width[0] / 2 + (width - cg_w) * 2 / 3 - cg_width[2] / 2; x_rdg[3] = width - cg_width[3] - 1; cv_w = (cv_width[0] + cv_width[3]) / 2; x_rdv[1] = cv_width[0] / 2 + (width - cv_w) / 3 - cv_width[1] / 2; x_rdv[2] = cv_width[0] / 2 + (width - cv_w) * 2 / 3 - cv_width[2] / 2; x_rdv[3] = width - cv_width[3] - 1; } y_rdg = fontstr->max_bounds.ascent - 1; /* y_rdv = 2 * fontstr->max_bounds.ascent + fontstr->max_bounds.descent; y_rdv = 2 * fontstr->max_bounds.ascent;*/ y_rdv = 2 * y_rdg; /* c_height = 2 *(fontstr->max_bounds.ascent + fontstr->max_bounds.descent);*/ c_height = 2 * fontstr->max_bounds.ascent; if(*label != (char) NULL) { /* x_lb = (width - lb_width) / 2;*/ x_lb = 2; c_lb = lb_fontstr->max_bounds.ascent + 1; y_rdg += c_lb; y_rdv += c_lb; } cm_height = c_height + y_rdg - 1; cm_width = XTextWidth(fontstr, cvmin, strlen(cvmin)) - 1; tscl = (float) (height - c_lb - c_height)/ (tmax - tmin); vscl = (float) (height - c_lb - c_height)/ (vmax - vmin); htck = (float) (height - c_lb - c_height)/ (float) (n_tick + 1); scale[0] = tscl; scale[1] = tscl; if (noTemp3_flag) { scale[2] = vscl; } else { scale[2] = tscl; scale[3] = vscl; } t_sec = interval_sec / n_count; t_msec = (1000 * interval_sec) / n_count; iir_tc = t_msec > 500 ? 0.5 : 0.25; for (i = 0; i < NUM_DATA; i++) iir_reg[i] = 0; } #define THREDMAX 1.5 #define THREDMIN 0.5 void alarm_handler(void) { float d, *p; int i, id, n; float temp_in[4], tpd[4]; getTemp(&tpd[0], &tpd[1], &tpd[2]); getVolt(&tpd[3], &d, &d, &d, &d, &d, &d); if (t_msec <= 1000){ for (i = 0; i < NUM_DATA; i++) { if (THREDMIN < tpd[i]/cur_val[i] && tpd[i]/cur_val[i] < THREDMAX) temp_in[i] = tpd[i]; } /* apply 2nd order IIR LPF, by Takayuki Hosoda */ for (i = 0; i < NUM_DATA; i++) { d = iir_reg[i]; iir_reg[i] = d - (2.0 * d + temp_in[i] - cur_val[i]) * iir_tc; cur_val[i] -= d * iir_tc; } } else { for (i = 0; i < NUM_DATA; i++) { if (THREDMIN < tpd[i]/cur_val[i] && tpd[i]/cur_val[i] < THREDMAX) cur_val[i] = tpd[i]; } } draw_values(); p = fmean + counter; for (i = 0; i < num_data; i++) { id = t_indx[i]; *(p + i * n_count) = cur_val[id]; } counter++; if (counter == n_count) { if (w_counter <= w_range) w_counter++; else { for (i = 0; i < num_data; i++) rdp[i] = rdp[i]->next; } counter = 0; p = fmean; for (i = 0; i < num_data; i++) { for (n = 0, d = 0.0; n < n_count; n++, p++) d += *p; rdpw[i]->val = d / (float) n_count; rdpw[i] = rdpw[i]->next; } repaint_proc(); } XtAppAddTimeOut(app_con, t_msec, (XtTimerCallbackProc) alarm_handler, NULL); } void draw_values(void) { int i, id; XClearArea(disp, win, 0, y_rdg , 0, y_rdg - c_lb, False); for (i = 0; i < num_data; i++) { id = t_indx[i]; sprintf(c_rdv[id], c_rdp[id], cur_val[id]); XDrawString(disp, win, gcl[id], x_rdv[i], y_rdv, \ c_rdv[id], strlen(c_rdv[id])); } XFlush(disp); } xmbmon-2.05/methods.h0000644000175000017500000000106007674503135014105 0ustar agiagi00000000000000/* Winbond IO defaults address */ #if !defined(__methods_h__) #define __methods_h__ #define IOP_ADDR 0x290 #define WBIO1 (IOP_ADDR + 0x05) #define WBIO2 (IOP_ADDR + 0x06) /* Winbond registor address for SMBus method */ #define LM_ADDR 0x5A #define WBtemp1_ADDR 0x92 #define WBtemp2_ADDR 0x90 struct lm_methods { int (*Open)(); void (*Close)(); int (*Read)(int); void (*Write)(int, int); int (*ReadW)(int); void (*WriteW)(int, int); int (*ReadTemp1)(); int (*ReadTemp2)(); }; typedef struct lm_methods LM_METHODS; #endif /*__methods_h__*/ xmbmon-2.05/xmbmon.1x0000644000175000017500000000573007754354621014056 0ustar agiagi00000000000000.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH xmbmon 1x "November 10, 2003" XFree86 .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME xmbmon \- X MotherBoard Monitor .SH SYNOPSIS .B xmbmon .RI [ options ] .PP This manual page documents briefly the .B xmbmon command. This manual page was written for the Debian distribution because the original program does not have a manual page. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. Recent motherboards have functionalities to monitor the CPU temperatures and the frequency of CPU cooling fans etc. Although some programs utilizing these hardware monitoring facilities have been developed for the Microsoft Windows platforms, no programs seem to exist for PC-UNIX and the X Windows System platforms. .PP \fBxmbmon\fR displays the three temperatures and a core voltage as simple curves. .SH OPTIONS .TP .B \-h Show summary of options. .TP .B \-g Geometry (Toolkit option), default is "100x140". .TP .B \-count Counts in an interval, default is "4". .TP .B \-sec Seconds of an interval, default is "20". .TP .B \-wsec Total seconds shown, default is "1080" (18 min). .TP .B \-tmin Min. temperature, default is "10" (Celcius). .TP .B \-tmax Max. temperature, default is "50" (Celcius). .TP .B \-vmin Min. voltage, default is "1.8" (volts). .TP .B \-vmax Max. voltage, default is "2.2" (volts). .TP .B \-tick Ticks in ordinate, default is 3. .TP .B \-cltmb, \-cltcpu, \-cltcs, \-clvc Temp 1-3 + VCore colors, defaults are "blue", "red", "cyan", "green". .TP .B \-cmtmb, \-cmtcpu, \-cmtcs Comments of Temp 1-3, defaults are "MB", "CPU", "chip". Not shown if set to "NOTEMP". .TP .B \-cmvc Comment of Vcore, default is "Vc". .TP .B \-fahrn Display Temperature in Fahrenheit, can be "True" or "False", default is "False". .TP .B \-label, \-labelfont, \-labelcolor For showing label. No label if null-string. .TP .B \-method Chips access method (V|S|I|A). See mbmon(1). .TP .B \-probe chip For probing monitor chips, where chip=winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75. .TP .B \-TyanTigerMP For Tyan Tiger MP motherboard. .TP .B \-debug .TP To show debug information. .SH EXEMPLE xmbmon -tmin 25 -tmax 60 -vmin 1.65 -vmax 1.75 .SH SEE ALSO .B mbmon(1). .SH AUTHOR This manual page was written by Nicolas Rueff , for the Debian project (but may be used by others). xmbmon-2.05/mbmon.10000644000175000017500000000577407754354621013506 0ustar agiagi00000000000000.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH mbmon 1 "November 10, 2003" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME mbmon \- MotherBoard Monitor .SH SYNOPSIS .B mbmon .RI [ options ] (default 5 sec) .PP This manual page documents briefly the .B mbmon command. This manual page was written for the Debian distribution because the original program does not have a manual page. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. Recent motherboards have functionalities to monitor the CPU temperatures and the frequency of CPU cooling fans etc. Although some programs utilizing these hardware monitoring facilities have been developed for the Microsoft Windows platforms, no programs seem to exist for PC-UNIX and the X Windows System platforms. .PP \fBmbmon\fR used at the command line reports the temperatures, voltages and rpm (rounds per minute) of cooling fans. It can also be used .B remotly via telnet, thanks to the "-P" option. .SH OPTIONS .TP .B \-h Show summary of options. .TP .B \-V, \-S, \-I, \-A Access method (using "VIA686 HWM directly"|"SMBus"|"ISA I/O port"|"All this methods"). .TP .B \-d Debug mode (any other options except (V|S|I) will be ignored). .TP .B \-e [0-2] set extra temperature sensor to temp. Need -A. .TP .B \-p chip For probing chips. chip=winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75 .TP .B \-Y For Tyan Tiger MP/MPX motherboard. .TP .B \-f Display temperature in Fahrenheit. .TP .B \-c count Repeat times and exit. .TP .B \-P port Run in daemon mode, using given port for clients. .TP .B \-T|F [1-7] print Temperature|Fanspeed according to following styles: .br style1: data1\n .br style2: data2\n .br style3: data3\n .br style4: data1\ndata2\n .br style5: data1\ndata3\n .br style6: data2\ndata3\n .br style7: data1\ndata2\ndata3\n .br .TP .B \-r Print TAG and Value format. .TP .B \-u Print system uptime. .TP .B \-t Print present time. .TP .B \-n, \-N print hostname (long|short style). .TP .B \-i Print integers in the summary (with -T option). .SH EXEMPLES mbmon -P 11000; telnet localhost 11000; sudo killall mbmon .br mbmon -c1 .br mbmon 1 (yeah, real time baby !) .SH SEE ALSO /usr/share/doc/mbmon/* .SH AUTHOR This manual page was written by Nicolas Rueff , for the Debian project (but may be used by others). xmbmon-2.05/mbmon-rrd.10000644000175000017500000000333607754354622014264 0ustar agiagi00000000000000.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH mbmon-rrd.pl 1 "November 10, 2003" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME mbmon-rrd.pl \- MotherBoard Monitor .SH SYNOPSIS .B mbmon-rrd.pl .RI [ RRD file ] .PP This manual page documents briefly the .B mbmon-rrd.pl command. This manual page was written for the Debian distribution because the original program does not have a manual page. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. Recent motherboards have functionalities to monitor the CPU temperatures and the frequency of CPU cooling fans etc. Although some programs utilizing these hardware monitoring facilities have been developed for the Microsoft Windows platforms, no programs seem to exist for PC-UNIX and the X Windows System platforms. .PP \fBmbmon-rrd.pl\fR is a simple perl script using the rrdtools to put mbmon's results in. If the rrd database doesn't exists, it creates it. .SH SEE ALSO .B mbmon(1). .SH AUTHOR This manual page was written by Nicolas Rueff , for the Debian project (but may be used by others). xmbmon-2.05/sens_lm75.c0000644000175000017500000000565107701563274014264 0ustar agiagi00000000000000/* * Natinal Semiconductor LM75 temperature sensor chip * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * National Semiconductor Chip Temp Volt Fan SMBus IOport lm75 1 - - yes no (the following chips are detected as an lm75) Chip Temp Volt Fan SMBus IOport ds75 1 - - yes no ds1775 1 - - yes no tcn75 1 - - yes no lm77 1 - - yes no * * by YRS */ #include #include "sensors.h" /* external (global) data */ extern int smb_slave; extern int smb_wbtemp1, smb_wbtemp2; extern LM_METHODS method_smb; extern int numSMBSlave, canSMBSlave[128]; #define LM75_ADDR_START 0x90 /*0x90-0x9E*/ #define LM75_ADDR_END 0x9E static int lm75_probe(LM_METHODS *); static float lm75_temp(LM_METHODS *, int); static int lm75_fanrpm(LM_METHODS *, int); static float lm75_volt(LM_METHODS *, int); SENSOR lm75 = { "Nat.Semi.Con. Chip LM75", lm75_probe, lm75_temp, lm75_volt, lm75_fanrpm }; /* temp1/2 flags address*/ static int temp1_flag = 0; /* = 0 if enabled ! */ static int temp2_flag = 0; /* = 0 if enabled ! */ /* * return 0 if not probed */ static int lm75_probe(LM_METHODS *method) { int i, j, k, save; if (method != &method_smb) return 0; i = set_smb_Extemp(LM75_ADDR_START, LM75_ADDR_END, &smb_wbtemp1, &smb_wbtemp2); temp1_flag = i >> 1; temp2_flag = i & 0x01; if (temp1_flag && temp2_flag) return 0; save = smb_slave; smb_slave = smb_wbtemp1; i = method->Read(0x01); if (i > 0x1F) goto ret0; i = method->Read(0x00); j = method->Read(0x02); k = method->Read(0x03); if (j == 0xFF || j == 0 || k == 0xFF || k == 0 || (i == j && i == k)) goto ret0; #if DEBUG printf("DEBUG: 0x00=%d, 0x02=%d, 0x03=%d\n", i, j, k); #endif /* requiring j(0x02)=OS temp >= 40 deg.C, k(0x03)=HYST temp >= 20 */ if (j < 40 || k < 20) goto ret0; info_Extemp(method, temp1_flag, temp2_flag); kill_smb_slave(smb_slave); return 1; ret0: smb_slave = save; return 0; } /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,2,... */ static float lm75_temp( LM_METHODS *method, int no ) { int n = 0; if (no < 0 || 1 < no) return 0xFFFF; if (no == 0 && !temp1_flag) n = method->ReadTemp1(); else if (no == 1 && !temp2_flag) n = method->ReadTemp2(); if ((n & 0xFF) >= 0x80) n = 0; return ((float) (n & 0xFF) + 0.5 * ((n & 0xFF00) >> 15)); } /* lm75 is only for temperature sensor */ static float lm75_volt(LM_METHODS *method, int no) { return 0xFFFF; } static int lm75_fanrpm(LM_METHODS *method, int no) { return 0xFFFF; } xmbmon-2.05/CopyRight0000644000175000017500000000241610044757614014130 0ustar agiagi00000000000000Copyright (c) 1999-2004 Yoshifumi R. Shimizu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer, without modification, immediately at the beginning of the file. 2. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. xmbmon-2.05/ReadMe.jp0000644000175000017500000011771310120625312013754 0ustar agiagi00000000000000 ********************************************************* Mother Board Monitor Program for X Window System [only on x86 platforms!] XMBmon ver.2.05 for FreeBSD (and for NetBSD/OpenBSD, Linux, and Solaris on x86). ********************************************************* << 1. $B$I$s$J%=%U%H$+(B >> $B!!:G6a$O%^%6!<%\!<%I$K$O(B CPU $B$N29EY$d(B CPU Fan $B$N2sE>?t$J$I$r%b%K%?!<(B $B$9$k5!G=$,IU$$$F$$$^$9!#%^%$%/%m%=%U%H(B Windows $B>e$G$O$3$N%b%K%?!<5!G=$r(B $B;H$C$F%j%"%k%?%$%`$K(B CPU$B$N29EY$J$I$r%0%i%U2=$9$k%W%m%0%i%`$,$"$j$^$9$,!"(B X $B>e$G$=$N$h$&$J5!G=$r;}$C$?%W%m%0%i%`$,$J$$$h$&$J$N$G:n$C$F$_$^$7$?!#(B $B$?$@$7!"5!G=$O:GDc8B$N$b$N$7$+$"$j$^$;$s!#%3%^%s%I%i%$%sHG(B mbmon $B$G$O!"(B $B29EY!&EE05!&%U%!%s$N2sE>?t$r%j%"%k%?%$%`$KJs9p$7!"(BX Window System$BHG(B xmbmon $B$G$O(B 3$B$D$N29EY$H%3%"EE05$r6J@~%0%i%U$K$7$FI=<($7$^$9!#(B << 2. $B%5%]!<%H$7$F$$$k%O!<%I%&%(%"%b%K%?%A%C%W(B >> $B!!$b$7!"<+J,$N%^%6!<%\!<%I$K@Q$^$l$F$$$k%O!<%I%&%(%"4F;k5!G=$,0J2<$N(B $B%A%C%W$*$h$S$=$N8_49%A%C%W$r;H$C$F$$$k>l9g$K$OF0:n$9$k2DG=@-$,$"$j$^$9!#(B National Semiconductor$B> $B!!%O!<%I%&%(%"%b%K%?%A%C%W$X$N%$%s%?%U%'%$%9$H$7$F!"(BISA-IO port $B$r(B $BMQ$$$kJ}K!!"(BVIA VT82C686A/B $B%A%C%W@lMQ$NJ}K!(B ($B$$$E$l$b8e=R(B)$B!"$=$l0J30(B $B$N0lHLE*J}K!$H$7$F$O(B SMBus (System Management Bus) $B$,$"$k$,!"$3$l$r(B $Bl9g%A%C%W%;%C%H$N%5%&%9%V%j%C%8(B)$B$KBP1~!#(B Intel: PIIX4 (440BX), ICH, ICH0, ICH2, ICH3, ICH4, ICH5, ICH6 (810, 815, ...) VIA: VT82C596/B, VT82C686A/B (KT133/A), VT8233A/C (KT266/A/KT333), VT8235(KT400), VT8237(KT600/KT880) AMD: AMD756(AMD750), AMD766(AMD760), AMD768(AMD760MP), AMD8111 NVidia: nForce, nForce2 Acer Lab. Inc.(ALi): M1535D+(MAGiK1/AladdinPro), M1541,1621(Aladdin IV, V) $B$?$@$7!"I,$:$7$b$9$Y$F$N%A%C%W%;%C%H$r;H$C$?%^%6!<%\!<%I$G%A%'%C%/(B $B$5$l$F$$$k$o$1$G$O$J$/!"F0$/$3$H$rJ]>Z$O$G$-$^$;$s!#(B $B!!$J$*!"> $B!!%Q%C%1!<%8$r2rE`$7$F$G$-$?%G%#%l%/%H%j$G(B ./configure & make $B$9$l$P(B mbmon motherboard monitor for tty-terminal xmbmon motherboard monitor for X $B$NFs$D$N%P%$%J%j$,$G$-$^$9!#(B (($BCm0U(B)) $B$3$N%W%m%0%i%`$O(B SMBus $B$^$?$O(B ISA-IO port $B$KLdEzL5MQ$G(B $B%"%/%;%9$7!">l9g$K$h$C$F$O%7%9%F%`$r%/%i%C%7%e$5$;$k2DG=@-$,(B $B$"$k!V4m81!W$J%=%U%H%&%(%"$G$9!#$3$N$3$H$r==J,G'<1$7$F2<$5$$!#(B $BFC$K!"(BIO port 0x295, 0x296 $B$X$N%"%/%;%9$O(B NE2000 $B8_49%\!<%I$H(B $B=E$J$k>l9g$,$"$j$^$9$N$G!"$3$l$i$N(B port $B$X$N=q$-9~$_$,5v$5$l$k$+(B $B%A%'%C%/$7$F$/$@$5$$!#;d$O$3$N%W%m%0%i%`$K$h$C$F5/$-$?G!2?$J$k(B $BLdBj$K$b@UG$$OH(B) $B$H(B mbmon $B%W%m%0%i%`$r%G%P%C%0%b!<%I$GF0$+$7$F$_$F2<$5$$!#$3$l$G!"(B No Hardware Monitor found!! InitMBInfo: Undefined error: 0 $B$H$$$&%(%i!<%a%C%;!<%8$,I=<($5$l$:$K!"(B Using SMBus access method[VIA8233/A(KT266/KT333)]!! * Asus Chip, ASB100 found. $B$N$h$&$K8!CN$7$?%O!<%I%&%(%"%b%K%?%A%C%W$N>pJs$rI=<($9$l$P!"$3$N(B $B%W%m%0%i%`$,F0$/2DG=@-$,$"$j$^$9!#B3$1$F(B -d $B%*%W%7%g%s$J$7$G5/F0$7$F!"(B Temp.= 31.0, 37.0, 37.0; Rot.= 3970, 2576, 2700 Vcore = 1.74, 1.74; Volt. = 3.38, 5.08, 12.40, -11.35, -4.90 $B$N$h$&$JI=<($,(B 5$BIC$*$-$K7+$jJV$5$l$k$J$i$PBg>fIW$G$9!#$b$7!"29EY$,(B $B0l$D$@$1I=<($5$l!"$"$J$?$N%^%6!<%\!<%I$GEE05$H%U%!%s%9%T!<%I$N%O!<%I(B $B%&%(%"%b%K%?5!G=$,$"$k$3$H$,4V0c$$$J$1$l$P!"(B-A $B%*%W%7%g%s$rIU$12C$($F(B $B$_$F$/$@$5$$(B($B@bL@$OJ}$H$b(B IO port $B$KD>@\%"%/%;%9$9$k$N$G(B setuid root $B$7$F%Q%9$NDL$C$?(B $B$H$3$m$KCV$$$F$*$/I,MW$,$"$j$^$9!#(BMakefile $B$N(B make install $B$r;29M$K(B $B$7$F$/$@$5$$!#$b$7!"(Bmbmon $B$r(B /usr/local/bin $B$G%^%K%e%"%k$r(B /usr/local/man/man1$B!"(Bxmbmon $B$r(B /usr/X11R6/bin $B$G%^%K%e%"%k$r(B /usr/X11R6/man/man1 $B$KCV$/$N$G$h$1$l$P!"(B # make install # make install-man $B$G$3$l$i$N:n6H$r$d$C$F$/$l$^$9!#(B $B!!$"$k%^%6!<%\!<%I$G$O(B 2$B$D$N%;%s%5!<%A%C%W$,;H$o$l$F$$$^$9!#0l$D$Ol9g$b%5%]!<%H$5$l$^$7$?!#(B $B$"$J$?$N%^%6!<%\!<%I$G2?8D$N%;%s%5!<%A%C%W$,;H$o$l$F$$$k$+$r8+$k$?$a$K$O!"(B mbmon $B$r(B -A $B%*%W%7%g%sIU$Gl9g!"DL>o$N;HMQK!$G$O!"(B # ./mbmon Temp.= 76.0, 0.0, 0.0; Rot.= 0, 0, 0 Vcore = 0.00, 0.00; Volt. = 0.00, 0.00, 0.00, 0.00, 0.00 # ./mbmon -I Temp.= 41.0, 64.5, 0.0; Rot.= 4440, 0, 0 Vcore = 1.66, 0.00; Volt. = 3.26, 4.76, 12.65, -12.20, -5.15 $B$H$J$j$^$9$,!"(B-A $B%*%W%7%g%sIU$@$HN>l9g$O!"$I$N29EYCM$rJd=uE*%;%s%5!<$N$b$N$KCV$-49$($k$+$rA*$VI,MW$,$"$j(B $B$^$9!#$3$N$?$a$K!"(B-e [0|1|2] $B$H$$$&%*%W%7%g%s$,$"$j!"$=$l$>$l!"(B1$BHVL\!"(B 2$BHVL\!"(B 3$BHVL\$rCV$-49$($k$3$H$r0UL#$7$^$9(B($B%G%U%)%k%H$O(B 3$BHVL\(B)$B!#:#$N$H$3$m!"(B $BJd=uE*%;%s%5!<$H$7$F(B CPU$B29EYCM$rCV$-49$($i$l$k%A%C%W$O0J2<$NDL$j$G$9(B: W83L785TS-S LM90/ADM1020/ADM1021/ADM1023 LM75 $B!!>e$K$b=q$$$?$h$&$K$3$N%W%m%0%i%`$O(B IO port $B$X$N%"%/%;%9$r9T$J$$$^$9(B $B$N$G!"Nc$((B setuid root $B$7$F$b$3$N%"%/%;%9$,6X;_$5$l$F$$$l$PF0$-$^$;$s!#(B $B$b$7!"(B InitMBInfo: Operation not permitted This program needs "setuid root"!! $B$H$J$C$?$H$9$k$H!"(BFreeBSD $B$N%7%9%F%`$N(B security level $B$,87$7$$$?$a$K(B IO port $B$K%"%/%;%9$G$-$J$$$H;W$o$l$^$9(B(/etc/rc.conf $BCf$N(B kern_securelevel_enable, kern_securelevel $B;2>H(B)$B!#(Bsecurity level $B$r(B $B2<$2$k$+!"$9$J$*$K$"$-$i$a$F$/$@$5$$!#(B $B!!(Bversion 2.01 $B$+$i!"(Bmbmon $B$r(B $B%G!<%b%s%b!<%I$G5/F0$9$k$3$H$,$G$-$k$h$&$K(B $B$J$j!"%M%C%H%o!<%/1[$7$K(B mbmon $B$N(B output $B$rD4$Y$k$3$H$,$G$-$^$9!#(B # mbmon -P port_no $BD4$Y$?$$%[%9%HB&$G$3$&$7$F$*$/$H!"JL$N%^%7%s$+$i(B telnet $B$9$k$3$H$K$h$j!"(B $ telnet hostname port_no Trying xxx.xxx.xxx.xxx... Connected to hostname. Escape character is '^]'. Temp.= 29.0, 25.0, 38.5; Rot.= 3750, 3688, 2410 Vcore = 1.70, 1.70; Volt. = 3.31, 4.97, 12.40, -11.35, -4.87 Connection closed by foreign host. $B$H$$$&$h$&$K=PNO$r$$$D$G$bF@$k$3$H$,$G$-$^$9!#$3$3$G!"(Bversion 2.04 $B$+$i(B $B%m%0$N=PNO5!G=$,DI2C$5$l$^$7$?(B($B%G%U%)%k%H$N%m%0%U%!%$%k$O(B /var/log/mbmon.log)$B!#%m%0$N%l%3!<%I$NNc$O$3$N$h$&$K$J$j$^$9(B: ;;;TEMP0;TEMP1;TEMP2;FAN0;FAN1;FAN2; 5/ 2/2004; 3:56:35 AM;; 36.0 C; 40.0 C; 33.0 C; 2008 RPM; 3515 RPM; 0 RPM; 5/ 2/2004; 3:51:35 AM;; 36.0 C; 40.5 C; 33.0 C; 2020 RPM; 4017 RPM; 0 RPM; . . . $B$b$7!"$3$N5!G=$r@8$+$7$?$$;~$K$O!"(BMakefile $BCf$N(B DEFS $BJQ?t$K(B -DLOGGING $B%^%/%m$rIU$12C$($kI,MW$,$"$j$^$9!#%m%0%U%!%$%k$NL>A0!"%m%0$rl9g$K$O!"(B"getMBinfo.c" $B$G(B TEMP_HIGH/TEMP_LOW $B$rE,Ev$K@_Dj$7$F!"(B Makefile $BCf$N(B DEFS $BJQ?t$K(B -DTEMP_LIMIT $B$rIU$1$F%3%s%Q%$%k$9$k$H@_Dj(B $B$7$?(B TEMP_LOW, TEMP_HIGH $B$NHO0OFb$K29EY$,$J$$;~$K$O(B 0$B$HI=<($9$k$h$&$K(B $B$G$-$^$9!#(B $B!!$J$*!"Ii$NEE05(B(Volt. = $B$N(B 4$BHVL\(B[-12V]$B$H(B 5$BHVL\(B[-5V]) $B$OB?$/$N%^%6!<(B $B%\!<%I$GIT@53N$JCM$r<($9$3$H$,$o$+$C$F$$$^$9!#$3$l$K$D$$$F$O!"%a!<%+!<(B $B$,%O!<%I%&%(%"%b%K%?%A%C%W$N%G!<%?%7!<%H$K=>$C$F$$$J$$$3$H$,860x$J$N$G!"(B $BBP1~$N$7$h$&$,$"$j$^$;$s!#(B $B!!$^$?!"(Bdual CPU (SMP) $B;EMM$N%^%6!<%\!<%I$G$O(B SMBus $B$H(B ISA IO port ($B>\$7$/$O8e=R(B 5. $B$h$j>\$7$$2r@b(B $B$r;2>H(B)$B$NN>J}$K%b%K%?%A%C%W$,7R$,$C$F(B $B$$$k>l9g$,$"$j$^$9!#(B./mbmon $B$N7k2L$,$*$+$7$$;~$K$O(B -I $B%*%W%7%g%s$rIU$1$F(B $B;n$7$F$_$F$/$@$5$$!#(B $B!!(BLinux $B$N>l9g$O(B Makefile $BCf$N(B DEFS $BJQ?t$K(B -DLINUX $B$rIU$1$F%3%s%Q%$%k(B $B$9$kI,MW$,$"$j$^$9!#$b$7!"(Bconfigure $B%9%/%j%W%H$,<:GT$7$F$3$l$,IU$$$F(B $B$$$J$$>l9g$Oe$N(B Linux emulation $B4D6-$G$O%3%s%Q%$%k(B $B$*$h$SF0:n$N%A%'%C%/$O9T$J$C$F$$$^$9$NBg>fIW$@$H$O;W$$$^$9$,!"F0:n$7$J$$(B $B2DG=@-$b$"$j$^$9!#(B << 5. $B$h$j>\$7$$2r@b(B >> $B!!$3$N%W%m%0%i%`$N:G=i$N%t%!!<%8%g%s$O%^%6!<%\!<%I$K@Q$^$l$F$$$k(B $B%O!<%I%&%(%"%b%K%?!<%A%C%W$H$7$F(B Winbond $B$N(B W83781D chip $B$r%a%$%s$K(B $B9M$($i$l$F$$$^$7$?!#$3$N%A%C%W$G$O!"29EY$,(B 3$B$D(B(Temp0, Temp1, Temp2)$B!"(B $BEE05$,(B 7$B$D(B(V0 - V6)$B!"$*$h$S(B FAN $B$N2sE>?t$,(B 3$B$D(B(Fan0, Fan1, Fan2) $B$,(B $BB,Dj$G$-$k$h$&$K$J$C$F$$$^$9!#(B mbmon $B$G$O$9$Y$F$N>pJs$r%F%-%9%H$G(B xmbmon $B$G$O(B Temp0,1,2 $B$*$h$S(B V0(Vcore)$B$N>pJs$r%0%i%U$GI=<($7$^$9!#(B $BC10L$O29EY$K$D$$$F$O@];a(B(C) [version 1.07 $B$+$i2Z;a(B(F)$B$NI=<($b2DG=(B]$B!"(B $BEE05$K$D$$$F$O%t%)%k%H(B(V)$B!"(B FAN $B$N2sE>?t$K$D$$$F$O(B $B2s(B/$BJ,(B (rpm) $B$G$9!#(B $B8=:_$G$OB>$N$$$/$D$+$N%A%C%W$b%5%]!<%H$5$l$F$*$j!"JL$N%A%C%W$G$O$3$l$i(B $B$N>pJs$N$&$A$$$/$D$+$O%5%]!<%H$5$l$F$$$^$;$s!#Nc$($P!"(BVIA $B$N(BVT82C686A/B $B$N>l9g$O29EY$O(B 3$B$D!"EE05$O(B 5$B$D!"%U%!%s$N2sE>?t$O(B 2$B$D$N$_$,%b%K%?!<$5$l(B $B$^$9!#(Bmbmon $B$G$O%b%K%?!<$5$l$J$$9`L\$O(B 0.0 $B$^$?$O(B 0 $B$HI=<($5$l$^$9!#(B $B$J$*!"(Bmbmon $B$OF~NOCM$H$7$F%b%K%?!<>pJs$rI=<($9$k4V3V(B($BC10L(B:$BIC!"(B $B%G%U%)%k%H$O(B 5$BIC(B)$B$rl9g(B Temp0,Temp1,Temp2 $B$r$=$l$>$l(B "MB","CPU","chip" $B$H$$$&(B $B9`L\$GI=<($7$^$9$,!"$=$l$i$O(B X $B$N(B resource $B$H$7$FJQ992DG=$G$9(B (xmbmon.resources $B;2>H(B)$B!#%^%6!<%\!<%I$K$h$C$F$O!"$3$l$i(B 3$B$D$N29EY$,(B $B$K$J$C$F$$$J$$(B $B$H;W$$$^$9$N$G!"E,59JQ99$7$F$/$@$5$$!#$^$?!"(B2$B$D$7$+29EY%;%s%5!<$,$J$$!"(B $B$^$?$O!"7R$,$C$F$$$J$$>l9g$K$O$3$l$rI=<($5$;$J$$$h$&$K$G$-$^$9!#(B $B$=$N$?$a$K$O(B Temp0,Temp1,Temp2 $B$N$$$E$l$+(B 1$B$D$N9`L\$r(B "NOTEMP"($B$^$?$O(B $B%V%i%s%/(B '')$B$K@_Dj$7$F$/$@$5$$(B($B>\$7$/$O(B 6. $B$N%*%W%7%g%s$N9`;2>H(B)$B!#(B $B!!<+J,$N%^%6!<%\!<%I$G$I$N$h$&$J%O!<%I%&%(%"%b%K%?!<%A%C%W$,;H$o$l$F(B $B$$$k$+$o$+$i$J$$>l9g$O!"@h$K$b=q$$$?$h$&$K(B # mbmon -d $B$^$?$O!"(B # mbmon -D # xmbmon -debug # xmbmon -DEBUG $B$H$$$&%G%P%C%0%*%W%7%g%sIU$G5/F0$9$k$3$H$K$h$j%O!<%I%&%(%"%b%K%?!<(B $B%A%C%W$N>\$7$$%G%P%C%0>pJs$rF@$k$3$H$,$G$-$^$9(B(-D/-DEBUG $B$,$h$j>\$7$$(B $B>pJs$rI=<($9$k(B)$B!#$3$l$K$h$C$F$3$N%W%m%0%i%`$,;H$($k$+$I$&$+$,$+$J$j$N(B $BDxEYH=CG$G$-$k$G$7$g$&!#$3$N%W%m%0%i%`$G%5%]!<%H$5$l$F$$$k%O!<%I%&%(%"(B $B%b%K%?%A%C%W$NFb$G!"(BLM78/79 $B$O%^%6!<%\!<%I$N29EY(B Temp0 $B$N$_$G$"$j!"(B $B>l9g$K$h$C$F$O(B LM75 $B$H$$$&29EY$N$_$,%b%K%?!<$G$-$k%A%C%W$,J;MQ$5$l$F(B $B$$$k$3$H$,$"$j$^$9!#(B W83783S $B$N>l9g$O(B Temp3 $B$,$"$j$^$;$s!#$^$?!"%^%6!<(B $B%\!<%I$K$h$C$F$O%b%K%?!<%A%C%W$,%5%]!<%H$7$F$$$F$b$=$N5!G=$r@8$+$7$F(B $B$$$J$$$b$N$b$"$k$h$&$G$9!#$J$*!"DL>o(B Temp0 $B$,%^%6!<%\!<%I$N29EY$G!"(B $B$3$l$O$[$H$s$I<<29$K6a$/JQ2=$KK3$7$$$h$&$G$9!#(BTemp1,2 $B$O29EY%;%s%5!<(B $B%A%C%W$r7R$$$G;O$a$FM-8z$K$J$k>l9g$,B?$$$N$G$9$,!":G6a$N%^%6!<%\!<%I(B ($BNc$($P(B ASUS P3B-F) $B$G$O(B PentiumII/III $B$N(B CPU $BFbIt$K$"$k29EY%;%s%5!<$K(B Temp1 $B$,7R$,$l$F$$$k$3$H$b$"$k$h$&$G$9!#(B $B!!0lHL$K:G6a$N%^%6!<%\!<%I$G$O%O!<%I%&%(%"%b%K%?!<%A%C%W$K%"%/%;%9(B $B$9$kJ}K!$H$7$F!"(BSMBus (System Management Bus)$B$H(B $B8E$$(B ISA $B$N(B IO port $B$K$h$kJ}K!$,$"$j$^$9$,!"?7$7$$%A%C%W(B($BNc$($P(B ASUS $B$N(B $B%^%6!<%\!<%I$GB?$/(B $B;H$o$l$F$$$k(B AS99127F $B$J$I(B)$B$O(B SMBus $B$N$_$G$7$+;H$($J$$$b$N$b$"$j$^$9!#(B ver.1.06 $B$+$i$O(B SMBus $B%"%/%;%9$r9T$J$&<+A0$N%U%!%s%/%7%g%s$rMQ0U$9$k(B $B$3$H$K$h$C$F!"(BOS $B$N(B device driver $B$N%5%]!<%H$N$J$$>l9g$K$b(B SMBus $B$X$N(B $B%"%/%;%9$,$G$-$k$h$&$K$J$C$F$$$^$9(B(3. $B%5%]!<%H$7$F$$$k(B SMBus $B%$%s%?(B $B%U%'%$%9%A%C%W(B $B$r;2>H(B)$B!#8=:_$N(B FreeBSD $B$N%t%!!<%8%g%s(B(4.6R)$B$G$O!"(B device driver $B$H$7$F!"(Bintpm (440BX $B$N%5%&%9%A%C%W(B PIIX4)$B!"(B amdpm(AMD756[$BCm(B1])$B!"(Balpm(ALi M15x3[$BCm(B2])$B!"(Bviapm(VIA586/596/686/8233) $B$N(B 4$B$D$,%5%]!<%H$5$l$F$*$j!"(Bxmbmon$B%Q%C%1!<%8$N(B SMBus $B%"%/%;%9$r(B $B;H$o$:$K$3$N(B device driver $B$r;H$&$?$a$K$O!"%*%W%7%g%s$H$7$F(B Makefile $BCf$N(B DEFS $BJQ?t$K(B -DSMBUS_IOCTL $B$rIU$12C$($F$_$F$/$@$5$$!#(B./configure $B$G(B /dev/smb0 $B$,$"$k$3$H$,3NG'$5$l$F$$$l$P!"(Bdevice driver $B$N(B ioctl $B%"%/%;%9%U%!%s%/%7%g%s$K$h$j(B SMBus $B$K%"%/%;%9$7$^$9!#$3$N;~!"0lHL$K(B SMBus $B$O0lHLE*$J%P%9$G$"$j!"%O!<%I%&%(%"%b%K%?!<%A%C%W$N$_$,;H$C$F(B $B$$$k$H$O8B$j$^$;$s!#Nc$($P!"%F%l%S%A%e!<%J!<%+!<%I$GM-L>$J(B Brooktree $B$N%A%C%W$N$?$a$N(B device driver bktr $B$b(B /dev/smbX $B$r;HMQ$7$^$9!#=>$C$F!"(B $B$b$7!"(BSMBus $B$r;H$&(B device $B$,J#?t$"$k>l9g$K$O!"(Bdmesg $B$N=PNO$r8+$k$3$H$K(B $B$h$C$F!"$I$N(B device file $B$,%O!<%I%&%(%"%b%K%?!<%A%C%W$KBP1~$9$k$+$r(B $BCN$C$F$*$+$J$1$l$P$J$j$^$;$s!#$b$7!"4V0c$C$?(B device file $B$rMQ$$$k$H(B $B%7%9%F%`$r%O%s%0%"%C%W$5$;$?$j!":F5/F0$5$;$?$j$7$F$7$^$$$^$9(B($B;d<+?H$,(B bktr0 $B$H$NJ;MQ$G7P83:Q$_(B)$B!#$=$3$G!"$3$N;~$N(B device file $B$NHV9f!"(B /dev/smbX $B$N(B X[0-9] $B$r;XDj$9$k%*%W%7%g%s$,(B ver.2.00 $B$+$i?7@_$5$l$^$7$?!#(B $B$3$l$,(B -s/-smbdev $B$G$9!#(B # mbmon -s X[0-9] # xmbmon -smbdev X[0-9] $B%G%U%)%k%H$G$O(B X=0 (/dev/smb0)$B$K$J$C$F$$$^$9!#(B $B!!(BVIA $B$N(B VT82C686A/B $B$NFbB"%O!<%I%&%(%"%b%K%?5!G=$N>l9g$K$O(B Winbond $B$N%A%C%W$H$O0c$C$?J}K!$G(B ISA-IO port $B$K%"%/%;%9$9$k$3$H$K$h$C$F29EYEy(B $B$N>pJs$rF@$k$3$H$,$G$-$^$9!#=>$C$F!"$3$l$r9g$o$;$k$HA4It$G(B 3$B$D$NJ}K!$G(B $B%O!<%I%&%(%"%b%K%?%A%C%W$H%"%/%;%9$9$k$3$H$,$G$-$^$9!#$3$N(B VIA $B%A%C%W$K(B $BFCM-$NJ}K!$r(B method V$B!"(B $B$h$j0lHLE*$J%O!<%I%&%(%"%b%K%?%A%C%W$X$N%"%/%;%9(B $BJ}K!$G$"$k(B SMBus $B$K$h$kJ}K!$r(B method S$B!"$=$7$F(B LM78/79 $B$d(B Winbond $B$N(B $B%A%C%W!"$^$?!"(BITE $B$N(B IT8705F $B$J$I$N(B ISA-IO port $B$K$h$k%"%/%;%9J}K!$r(B method I$B!"$H$7$F6/@)E*$K$=$l$>$l$NJ}K!$G%O!<%I%&%(%"%b%K%?$+$i>pJs$r(B $BF@$k$?$a$N%*%W%7%g%s$,(B # mbmon -[V|S|I|A] # xmbmon -method [V|S|I|A] $B$G$9!#%^%6!<%\!<%I$K$h$C$F$I$NJ}K!$,%5%]!<%H$5$l$F$$$k$+$rD4$Y$k$K$O!"(B $B%G%P%C%0%*%W%7%g%s$K99$K$3$N%*%W%7%g%s$rIU$1$F5/F0$7$F$_$k$H$$$$$G$7$g$&!#(B $B$b$7!"$3$l$i$N(B method $B%*%W%7%g%s$rIU$1$J$$;~$K$O(B method V$B!"(BS$B!"(BI$B!"$N=g=x(B $B$G%A%'%C%/$7$F<+F0E*$KM-8z$J%"%/%;%9J}K!$rA*Br$7$F5/F0$9$k$h$&$K$7$F$$(B $B$^$9!#$J$*!"(Bmbmon $B$H(B xmbmon $B$K$O$3$NB>$K$bB?$/$N%*%W%7%g%s$,$"$j$^$9$,!"(B $B$3$l$i$O%X%k%W%*%W%7%g%s(B -h (or -help)$BIU$-$G5/F0$9$k$3$H$K$h$C$FI=<($5$l(B $B$^$9!#$^$?!"(Bxmbmon $B$N>l9g!"$=$l$i$O(B X $B$N(B resource $B$H$7$F(B .Xdefaults $B%U%!%$%k$K5-=R$7$F@)8f$9$k$3$H$b$G$-$^$9!#$3$l$i$O(B 6. $B%*%W%7%g%s$H(B xmbmon $B$N(B X resource $B$K$D$$$F(B $B$N$H$3$m$G>\$7$/@bL@$5$l$^$9!#(B $B!!$^$?!"(Bver.2.00 $B$+$i$O!"<+J,$N%^%6!<%\!<%I$,$I$N%O!<%I%&%(%"%b%K%?!<(B $B%A%C%W$r;H$C$F$$$k$+$rCN$C$F$$$k>l9g$K!"B>$N%A%C%W$H8mG'<1$rKI$0$?$a(B $B$K%b%K%?!<%A%C%W$r%W%m!<%V$5$;$k%*%W%7%g%s$rIU$1$^$7$?!#$b$7!"<+F0(B $BG'<1$K<:GT$9$k$h$&$G$"$l$P;n$7$F$_$F$/$@$5$$!#8=:_$N$H$3$m(B # mbmon -p [winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75] # xmbmon -probe [winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75] $B$N(B 7$B$r;XDj$G$-$^$9!#$?$@$7!"$=$l$>$l$O(B winbond: LM78/LM79, W83781D, W83782D, W83783S, W83627HF, W83697HF, AS99127F, ASB100 wl784: W83L784R, W83L785R, W83L785TS-S via686: VT82C686A/B it87: IT8705F, IT8712F gl52: GL518SM, GL520SM lm85: LM85, ADM1024, ADM1025, ADM1027, ADT7463, EMC6D10X lm80: LM80 lm90: LM90, ADM1020, ADM1021, ADM1023 lm75: LM75 $B$KBP1~$7$^$9!#(B [$BCm(B1] amdpm $B$O$4$/:G6a(B NVidia nForce chipset $B$N(B SMBus $B$K$bBP1~$7$^$7$?(B ($B$?$@$7!"$^$@(B commit $B$5$l$F$J$$$h$&$G$9(B)$B!#$^$?!"$4$/4JC1$J%Q%C%A$G(B AMD766/768 $B$K$bBP1~$5$;$k$3$H$,$G$-$^$9(B([FreeBSD-users-jp 68570])$B!#(B $B>\$7$$>pJs$r$4MWK>$NJ}$O;d$NJ}$^$GD>@\O"Mm$r$/$@$5$$!#(B [$BCm(B2] alpm $B$NBP1~%A%C%W%;%C%H(B ALi M15x3 $B$O0l@$Be8E$$%A%C%W$G!":G6a$N(B MAGiK1 $B$d(B AlladinPro $B$N(B M1535D+ $B$KBP1~$5$;$k$?$a$K$O4JC1$J%Q%C%A$,(B $BI,MW$G$9!#>\$7$$>pJs$r$4MWK>$NJ}$O;d$NJ}$^$GD>@\O"Mm$r$/$@$5$$!#(B << 6. $B%*%W%7%g%s$H(B xmbmon $B$N(B X resource $B$K$D$$$F(B >> mbmon $B$O0J2<$N$h$&$J%*%W%7%g%s$r;}$C$F$$$^$9!#(B # mbmon -h MotherBoard Monitor, ver. 2.05 by YRS. Usage: mbmon [options...] (default 5 sec) options: -V|S|I: access method (using "VIA686 HWM directly"|"SMBus"|"ISA I/O port") -d/D: debug mode (any other options except (V|S|I) will be ignored) -A: for probing all methods, all chips, and setting an extra sensor. [-s [0-9]: for using /dev/smb[0-9]\n" ]<== compiled with -DSMBUS_IOCTL -e [0-2]: set extra temperature sensor to temp.[0|1|2] (need -A). -p chip: chip=winbond|wl784|via686|it87|lm80|lm90|lm75 for probing chips -Y: for Tyan Tiger MP/MPX motherboard -h: print help message(this) and exit -f: temperature in Fahrenheit -c count: repeat times and exit -P port: run in daemon mode, using given port for clients -T|F [1-7]: print Temperature|Fanspeed according to following styles style1: data1\n style2: data2\n style3: data3\n style4: data1\ndata2\n style5: data1\ndata3\n style6: data2\ndata3\n style7: data1\ndata2\ndata3\n -r: print TAG and Value format -u: print system uptime -t: print present time -n|N: print hostname(long|short style) -i: print integers in the summary(with -T option) $B!!$3$3$G!"(B-V|S|I $B$O>e$G=R$Y$?%O!<%I%&%(%"%b%K%?%A%C%W$X$N%"%/%;%9K!(B $B$r;XDj$9$k$b$N!"(B-f $B$O29EY$r2Z;a$GI=<(!"(B-d/D $B$O%G%P%C%0%b!<%I$G5/F0(B $B$9$k$b$N!"(B-s $B$,(B /dev/smbX $B$r;XDj$9$k$b$N(B(SMBUS_IOCTL $B%*%W%7%g%sIU$G(B $B%3%s%Q%$%k$7$?;~$N$_(B)$B!"(B-p $B$O;HMQ$7$F$$$k%O!<%I%&%(%"%b%K%?%A%C%W$r;XDj(B $B$9$k$b$N!"(B-h $B$O%X%k%W$NI=<($G$9!#(B-c $B0J2<$O(B mbmon $B$N=PNO$rMxMQ$9$k$?$a(B $B$N%*%W%7%g%s$G!"@bL@$+$i$o$+$k$H;W$$$^$9$,!"(B-c count $B$O(B count $B2s=PNO$7$?(B $B8e=*N;$9$k!#(B-P $B$O(B port$BHV9f$rM?$($k$3$H$K$h$j!"(Bmbmon $B$r%G!<%b%s%b!<%I$G(B $B5/F0$7$^$9(B(4.$B$N;H$$J};2>H(B)$B!#(B -T|F$B$O29EY!"$^$?$O!"%U%!%s%9%T!<%I$r(B $B2<$N(B style $B$N7A$G=PNO$9$k$?$a$N$b$N!"(B-u, -t, -n|N $B$OD>@\%O!<%I%&%(%"(B $B%b%K%?5!G=$H$O4X78$"$j$^$;$s$,!"%^%7%s$NB>$N>pJs$r=PNO!"(B-i $B$O=PNO$r(B $BIbF0>.?tE@$G$O$J$/@0?t$G$9$k$?$a$N$b$N$J$I$G$9!#(B $B!!(Bversion 2.02 $B$G$O!"(BCPU$B29EY$rB,$kM>J,$J%;%s%5!<%A%C%W$r;H$($k$h$&$K$9$k(B $B$?$a$K(B -A $B$H(B -e [0|1|2] $B$H$$$&?7$7$$%*%W%7%g%s$,IU$12C$($i$l$^$7$?!#(B -A $B$K$h$jM>J,$J%A%C%W$,B8:_$9$k$+$I$&$+$rD4$Y!"$b$72DG=$J$i$=$l$r;HMQ2DG=(B $B$K$7$^$9!#$^$?!"$=$N=PNO$r$b$H$N%;%s%5!<$N(B 1$BHVL\!"(B2$BHVL\!"(B3$BHVL\$N29EYCM$H(B $BCV$-49$($k$?$a$K(B -e [0|1|2] $B%*%W%7%g%s$rMQ$$$^$9!#$?$@$7!"%G%U%)%k%H$G$O(B 3$BHVL\$N29EYCM$HCV49$($r9T$J$$$^$9!#>\$7$/$O(B 4. $B;H$$J}(B $B;2>H!#(B $B!!$J$*!"$3$N6/NO$J=PNO5!G=$K$h$C$F!"(BMRTG $B$d(B rrdtool $B$H$$$C$?30It(B $B%W%m%0%i%`$+$iMF0W$K=PNO$rMxMQ2DG=$G$9!#FC$K!"(Brrdtool $B$N$?$a$N(B perl script $B$,D9B<$5$s$K$h$C$F(B contribute $B$5$l$F$$$^$9!#$3$l$rE,Ev$J$H$3$m(B $B$K%$%s%9%H!<%k$9$l$P!"(B # mbmon-rrd.pl [rrdfile] $B$G!"(Brrdtool $BMQ$N%G!<%?$,@8@.$G$-$^$9!#$b$A$m$s!"$3$l$r;HMQ$9$k$?$a$K$O(B rrdtool $B$N(B package/port $B$r%$%s%9%H!<%k$7$F$*$/I,MW$,$"$j$^$9!#(B $B!!(Bxmbmon $B$O(B X toolkit $B$rMQ$$$F:n@.$5$l$F$*$j!"I8=`E*$J(B X resource (geometry, font $B$J$I(B)$B$,DL>oDL$j;H$($^$9!#$3$NB>$K(B xmbmon $B$KFCM-$N(B resource $B$O0J2<$NDL$j$G$9(B($B%U%!%$%k(B xmbmon.resources)$B!#(B XMBmon*count: $B2<$N(B sec $B$N4V$K29EYEy$rD4$Y$k2s?t(B (default:4) XMBmon*sec: $B%0%i%U$N(B 1$BE@$r=q$/4V3V$NIC?t(B (default:20) XMBmon*wsec: $B%0%i%U$NA4I}$KBP1~$9$kIC?t(B (default:1800) XMBmon*tmin: $B29EY$N2<8B$NL\@9!"EY(BC$BC10L(B (default:10.0) XMBmon*tmax: $B29EY$N>e8B$NL\@9!"EY(BC$BC10L(B (default:50.0) XMBmon*vmin: $B%3%"EE05$N2<8B$NL\@9!"(BV$BC10L(B (default:1.80) XMBmon*vmax: $B%3%"EE05$N>e8B$NL\@9!"(BV$BC10L(B (default:2.20) XMBmon*tick: $B29EY!&%3%"EE05$NL\@9$N%F%#%C%/$N?t(B (default:3) XMBmon*cltmb: Temp0 $B$N@~$N?'(B (default:blue) XMBmon*cltcpu: Temp1 $B$N@~$N?'(B (default:red) XMBmon*cltcs: Temp2 $B$N@~$N?'(B (default:cyan) XMBmon*clvc: Vcore $B$N@~$N?'(B (default:green) XMBmon*cmtmb: Temp0 $BMQ$N9`L\L>!"I=<($7$J$$;~$O(B NOTEMP (default:\ MB) XMBmon*cmtcpu: Temp1 $BMQ$N9`L\L>!"I=<($7$J$$;~$O(B NOTEMP (default:CPU) XMBmon*cmtcs: Temp2 $BMQ$N9`L\L>!"I=<($7$J$$;~$O(B NOTEMP (default:chip) XMBmon*cmvc: Vcore $BMQ$N9`L\L>(B (default:Vc\ ) XMBmon*method: $B;H$&%"%/%;%9J}K!(B (default:\ ) XMBmon*extratemp: $BM>J,$J%;%s%5!<$NFI$_$rCV$-49$($k29EY(B (default: 2) XMBmon*smbdev: /dev/smbX device file $B$NHV9f(B (default:0) XMBmon*fahrn: $B29EY$r2Z;a$GI=<(!"(BTrue $B$^$?$O(B False (default: False) XMBmon*probe: $B6/@)%W%m!<%V$5$;$k%A%C%WL>(B (default:\ ) XMBmon*TyanTigerMP: Tyan Tiger MP/MPX motherboard$BMQ(B (default:False) XMBmon*label: $BI=<($9$k%i%Y%k(B (default:$B$J$7(B) XMBmon*labelcolor: $B%i%Y%k$N?'(B (default: black) $B!!%G%U%)%k%H$G$O(B 20(sec)/4(count)=5 $BICKh$K%?%$%^!<3d$j9~$_$rH/@8$5$;$F(B $B29EYEy$N>pJs$rFI$_$H$j!"(B20$BIC4V$N(B 4$B2s$NFI$_$H$jCM$NJ?6QCM$r%0%i%U$K(B $B%W%m%C%H$9$k$3$H$K$J$j$^$9!#(Bxmbmon $B$N%&%$%s%I%&$N2#I}$KBP1~$9$k;~4V$,(B 1800(wsec)$BIC!"$9$J$o$A(B30$BJ,4V$G!"$b$7$3$l$r2a$.$k$H0JA0$N%0%i%U$NCM$O(B $B>C5n$5$l%0%i%U$O?7$7$$CM$r99?7$7$F$$$-$^$9(B($B$A$g$&$I(B xload $B$HF1$8$h$&$K(B)$B!#(B $B0J>e$N(B resource $B$O(B xmbmon $B$N$H$l$k%*%W%7%g%s$HF1$8$G!"(B xmbmon $B$r5/F0$9$k(B $B;~$K;XDj$9$k$3$H$b$G$-$^$9!#(B-help $B%*%W%7%g%s$rIU$1$F5/F0$9$k$H$3$N@bL@$,(B $B : -count (4) : -sec (20) : -wsec (1800) : -tmin (10.0) : -tmax (50.0) : -vmin (1.80) : -vmax (2.20) : -tick (3) : -cltmb (blue) : -cltcpu (red) : -cltcs (cyan) : -clvc (green) : -cmtmb ( MB) [Not shown ] : -cmtcpu (CPU) [if "NOTEMP"] : -cmtcs (chip) [set. ] : -cmvc (Vc ) : -fahrn (False) : -label ( ) for showing label [No label if null-string.] and -labelfont, -labelcolor : -method ( ) [: -smbdev [0-9] (0) for using /dev/smb[0-9]<== compiled with -DSMBUS_IOCTL] : -extratemp (2) set extra-temp. to temp[0|1|2] (need -A) : -probe chip ( ) chip=winbond|wl784|via686|it87|lm80|lm90|lm75 for probing monitor chips : -TyanTigerMP for Tyan Tiger MP motherboard : -debug/DEBUG for debug information [$BCm(B] version 2.00 $B$+$i!"FCl9g$O(B 2$B$D(B $B%;%s%5!<$NFb0l$D$r=i4|@_Dj$9$kI,MW$,$"$j$^$9!#$3$N$?$a$K%*%W%7%g%s$r(B $BIU$1$F5/F0$7$F$/$@$5$$(B(mbmon $B$N>l9g$O(B -Y$B!"(Bxmbmon $B$N>l9g$O(B -TyanTigerMP)$B!#(B $B$=$&$9$k$H(B SMBus $B$G%"%/%;%9$9$k$HBh0l$N%;%s%5!> $B!!(Bverion 1.06 $B$^$G$K$"$C$?!"B>$N%W%m%0%i%`$,(B /dev/io $B$r(B open $B$7$?$^$^(B $B$G$$$k$H(B xmbmon $B$,K=Av$9$k!"$H$$$&%P%0$O(B 1.06pl1 (patch level 1)$B$G(B fix $B$5$l$^$7$?!#:#$N$H$3$m$3$NB>$KCWL?E*$J%P%0$O$J$$$H;W$$$^$9!#(B $B!!$?$@$7!"$3$l$^$G?'!9$HF0:nJs9p$r$$$?$@$$$?Cf$G!"%^%6!<%\!<%I$K$h$C$F$O(B $B%O!<%I%&%(%"%b%K%?%A%C%W$N%G!<%?%7!<%HDL$j$Kl9g$,$"$k(B $B$h$&$G$9!#$=$N;~$OCM$,FI$_$H$l$J$$$+!"FI$_$H$l$F$b$=$l$,(B BIOS $B$G<($5$l$F(B $B$$$kCM$H$O$+$J$j0[$J$k$b$N$K$J$C$F$7$^$$$^$9!#$3$l$KBP$7$F$O!"$=$N%^%6!<(B $B%\!<%I%Y%s%@!<$N>pJs3+<($,$J$$8B$jBP1~$G$-$^$;$s!#(B << 8. $BB>$N%O!<%I%&%(%"%b%K%?%A%C%W$KBP1~$5$;$?$$?M$X(B >> $B!!(Bversion 2.00 $B$G$O$l$N%b%8%e!<%k(B)$B!#$^$?!"(BSMBus $B$X$N%"%/%;%9J}K!(B $B$bDL>o%A%C%W%;%C%H$N%5%&%9%A%C%W$KFbB"$5$l$F$$$k!"(BPower Management Controller $BKh$K0[$J$C$F$*$j!"$3$l$KBP$7$F$b%W%m%0%i%`$rJ,N%$7%b%8%e!<%k2=(B $B$7$^$7$?(B(smbus_XXXX.c $B$,$=$l$>$l$N%b%8%e!<%k(B)$B!#$H$$$C$F$b!":#$N$H$3$m(B $B;d<+?H$,$3$l0J>e$N%b%K%?%A%C%W$d(B Power Management Controller $B$KBP1~$9$k(B $B$3$H$O9M$($F$$$^$;$s$N$G!"$b$7!"8=:_$N%t%!!<%8%g%s$GBP1~$7$F$$$J$$%O!<%I(B $B%&%(%"$r$*;}$A$G!"%,%C%D$N$"$kJ}$O@'Hs(B hack $B$7$FBP1~$5$;$F$/$@$5$$!#(B $B$=$7$F!"$=$N7k2L$r8x3+$7$F$$$?$@$/$3$H$r4|BT$$$?$7$^$9(B($B4JC1$J@bL@$,(B ReadMe.tech $B$K$"$j$^$9!"$?$@$71Q8l$N$_(B)$B!#(B $B!!$=$N$h$&$J(B hack $B$N$?$a$K$O!"$^$:(B PCI bus $B$K7R$,$C$F$$$k(B device $B$r(B $BCN$k$3$H$+$i;O$a$J$1$l$P$J$j$^$;$s!#$=$N$?$a$K$O(B FreeBSD $B$K4^$^$l$F(B $B$$$k(B pciconf $B%3%^%s%I$r;H$$$^$9!#$^$?!"$3$N%Q%C%1!<%8$K$OFC$K%b%K%?(B $B%A%C%W$N$?$a$K(B PCI Configuration $B$rD4$Y$k%F%9%H%W%m%0%i%`$,(B testpci.c$B!"(B SMBus $B$r%A%'%C%/$9$k%W%m%0%i%`$,(B testsmb.c$B!"$^$?!"(B Winbond-like $B$J(B $B%O!<%I%&%(%"%b%K%?5!G=$r%A%'%C%/$9$k%W%m%0%i%`$,(B testhwm.c $B$H$7$F(B $B4^$^$l$F$$$^$9!#(Bhack $B$NBh0lJb$H$7$F;H$C$F$_$F$/$@$5$$!#$?$@$7!"$3$l$i(B $B$O(B mbmon/xmbmon $B<+?H$h$j99$K4m81$J%W%m%0%i%`$G$"$k$3$H$O8@$&$^$G$b$"$j(B $B$^$;$s$N$G!"(BOS $B$N%/%i%C%7%e$J$I$NITN8$N;vBV$KHw$($k$3$H$r$*K:$l$J$/(B ($B;d$b0lEY%G%#%9%/%3%s%H%m!<%i$r4V0c$C$F%*!<%W%s$7$F=q$-9~$_$r9T$J$$!"(B $B%U%!%$%k%7%9%F%`$rJx$7$F$7$^$$$^$7$?(B)$B!#(B $B!!$J$*!"$I$N%^%6!<%\!<%I$,$I$N$h$&$J%O!<%I%&%(%"%b%K%?%A%C%W$r;H$C$F(B $B$$$k$+$K4X$9$k>pJs$ONc$($P!"%^%$%/%m%=%U%H(B Windows $B>e$N(B MBM (Mother Board Monitor) $B$H$$$&%W%m%0%i%`$N3+H/\$7$$>pJs$O0J2<(B Winbond $B$N%[!<%`%Z!<%8$K(B PDF $B%U%!%$%k$H$7$F(B $B$"$j$^$9!#(B http://www.winbond.com.tw/ $B$^$?$O!"(BLinux $B$G$N(B hardware monitor (lm_sensor) $B$N%[!<%`%Z!<%8$K$b(B $B$3$l$i$NB?$/$N%A%C%W$N(B PDF $B%U%!%$%k$,=8$a$F$"$j$^$9!#(B http://www.lm-sensors.nu/ $B!!$7$+$7$J$,$i!"0lHL$K%O!<%I%&%(%"%b%K%?%A%C%W$N%"%/%;%9J}K!$N>pJs(B $B$OI,$:$7$b8x3+$5$l$F$$$k$H$O8B$i$:!"$=$N>l9g$O;DG0$J$,$iBP1~$O(B $BFq$7$$$+$b$7$l$^$;$s!#(B << 9. $B> $B!&:G=i$N8x3+(B version 1.04 $B$G$O(B ISA IO port $B$X$N%"%/%;%9$K$h$C$F(B Winbond chip $B$+$i$N>pJs$rF@$k$b$N$G$7$?!#$3$N;~!"$3$N%"%/%;%9J}K!(B $B$K$D$$$F$O!">e5-$N(B MBM $B$N:npJs$O8+Ev$?$j(B $B$^$;$s(B)$B!#$3$N>pJs$,$J$1$l$P$3$N%W%m%0%i%`$N3+H/$O9T$J$o$l$J$+$C$?(B $B$G$7$g$&!#BgJQ46\$7$$>pJs$O>e5-$N(B Winbond $B$N%[!<%`(B $B%Z!<%8>e$N%G!<%?%7!<%H(B PDF$B%U%!%$%k$K$"$j$^$9(B)$B!#(B $B!&o$K46pJs$K(B $B$D$$$F$O>e5-$N(B LM78mon $B$N:ne$NJ}!9$K46e5-$N(B :p araffin.($BJFC+(B)$B$5$s$KA4LLE*$K>pJs(B $B$r65$($F$$$?$@$-$^$7$?!#$^$?!"(BASUS $B$NB?$/$N%^%6!<%\!<%I$O(B VT82C686 $B$r;H$C$F$$$F$b!"%O!<%I%&%(%"%b%K%?$O<+@\%"%/%;%9$9$kI,MW$,$"$j$^$9!#$3$N$?$a$N(B PCI Configuration $B$d(B SMBus $B$X$ND>@\%"%/%;%9J}K!$J$I$N5;=Q>pJs$N>\:Y$K$D$$$F$b!">e5-$N(B :p araffin.($BJFC+(B)$B$5$s$NA4LLE*$J8f6(NO$rF@$^$7$?!#$3$N8f6(NO$,$J$1(B $B$l$P$3$N$h$&$J7A$N%t%!!<%8%g%s%"%C%WHG$O:n$l$J$+$C$?$G$7$g$&!#(B $B$$$m$$$m$H65$($F$$$?$@$$$?$3$H$K$OBgJQ46$rpJs$O(B Linux $BMQ$N(B lm_sensors Project $B$K$h$k(B lm_sensors-2.6.2 $B$N%=!<%9%3!<%I$+$i(B $BF@$^$7$?!#$3$N$h$&$JM-MQ$J%3!<%I$r8x3+$7$F$*$i$l$k(B The Lm_sensors Group (http://www.lm-sensors.nu/) $B$K46l9g$K$OBP1~$9$k(B C$B$N4X?t$,$J$$$?$a$K!"%5%]!<%H$5$l$J$$5!G=$,(B $B$"$j$^$7$?(B(mbmon $B$N6/2=$5$l$?=PNO(B)$B!#(BMichael Lenzen $B$5$s$+$i$3$l$rA4LL(B $B;Y1g$9$k(B Linux $BMQ$N4X?t$r$$$?$@$-$^$7$?!#(Bversion 2.00 $B$+$i$3$N%Q%C%A(B $B$rMxMQ$7$F!"(BLinux $B$G$b(B FreeBSD $B$HA4$/F1$8F0:n$,2DG=$K$J$j$^$7$?!#(B $B$I$&$b$"$j$,$H$&$4$6$$$^$7$?!#(B $B!&(Bversion 2.00 $B$N3+H/$N7@5!$H$J$C$?$N$O(B $BD9B$N%O!<%I%&%(%"%b%K%?%A%C%W$r%5%]!<%H$9$k$3$H$r9MN8(B $B$;$:$K:n$C$?$?$a$K!"?7$7$$(B LM80 $B$N%3!<%I$rAH$_9~$`$3$H$,Fq$7$/!"(B $BD9B$l$r(B $B3F%b%8%e!<%k$KJ,N%$9$k$3$H$+$i;O$a$^$7$?!#$3$ND9B<$5$s$N8+K\$,$J$1(B $B$l$P%3!<%I$NBg2~3W$O9T$J$&$3$H$,$G$-$J$+$C$?$H;W$$$^$9!#$3$N$3$H$K$O(B $BBgJQ46o$K?'!9$J%b%K%?%A%C%W$d(B SMBus $B%"%/%;%9$N>pJs$r65$($F$/$l$k$$$$>pJs8;(B $B$G$7$?!#46pJs$K$h$k$b$N$G$9!#(B $B$$$D$b$I$&$b$"$j$,$H$&$4$6$$$^$9!#(B $B!&(Bxmbmon $B$N(B NFS ~/.Xauthority $B%U%!%$%kLdBj$N=$@5$OCfBo$K(B $B46 $B$5$s$K46$B$5$s$,4sB#$7$F$/$@$5$C$?!"%m%0$ro$K46$B$5$s$K$O%W%i%C%H%U%)!<%`FHN)$N(B IO port$B$N(B $BFI$_=q$-$N%3!<%I(B(x86 $B%$%s%i%$%s%"%;%s%V%i(B)$B!"$=$NB>$NJL$N%W%i%C%H%U%)!<%`(B $B$X$N0\?"$,4JC1$K$J$k$h$&$J%3!<%I(B($BFC$K!"(BSolaris x86 $B$N%5%]!<%H(B)$B$r4sB#(B $B$7$F$$$?$@$-$^$7$?!#$I$&$b$"$j$,$H$&$4$6$$$^$9!#(B << 10. $B:G8e$K(B>> $B!!$3$N%W%m%0%i%`$O=$@5(BBSD$B%i%$%;%s%9$K=>$$$^$9!#$3$N%i%$%;%s%9$KL7=b(B $B$7$J$$8B$j!"$I$N$h$&$K2~JQ!&JQ99$7$F$b$+$^$$$^$;$s!#$3$N%W%m%0%i%`$r(B $B;H$C$?$?$a$K2?$+ITET9g$J$3$H$,5/$-$F$b:n ver. 2.05) * Bugs for detecting ALi chipset fixed. * Further smoothing for plotting curves in xmbmon. * SMBus accesses of VIA VT8237 and Intel ICH6 are supported. * Problem related to select() system call fixed (by Tsuneyuki Sakano). * The part of IO port read/write is unified into an gas in-line assembler code (so, gcc with x86-gas is assumed!); a contribution by John Wehle (john@feith.com). * Changes to work on Solaris for x86 platform and others for cleaning up the codes, contributed by John Wehle (john@feith.com). * Others: Fixing small bugs. ------------------------------------------------------------------ (ver. 2.03 ---> ver. 2.04) * The modified BSD license is set from this version. * Logging facility in the daemon mode is included (but unabled in default, contribution by David Quattlebaum ). * 2nd order IIR low pass filter smoothing method is included for plotting graphs in xmbmon (contribution by Takayuki Hosoda). * Manual files are provided by Nicolas Rueff . * Winbond W83791D, W83627THF chips are supported. * Initialization of ADM9240 chip for some Intel motherboards (by Alex Vasylenko). * SMBus access of ALI1533/1543 chipset (Aladdin IV, V) is supported. * ISA access of 2nd and 3rd temperatures for Winbond chips fails in most of motherboard. Due to this problem, fraction of these temperatures is always 0.5. This "bug" is fixed now. * Others: Fixing small bugs. ------------------------------------------------------------------ (ver. 2.02 ---> ver. 2.03) * Genesys Logic GL512SM and GL520SM sensors are supported. * Intel ICH5 SMBus access supported. * LM85, Analog Devices ADM1024/1025/1027/ADT7463, and SMSC EMC6D10X sensors are supported. * Analog Devices ADM1020/1021/1023 temperature sensors are supported. * A log standing bug from version 2.00 in the treatment of fan-divisor for the IT87xxF sensor chip is fixed. * Others: Fixing small bugs, clean-up the code. ------------------------------------------------------------------ (ver. 2.01 ---> ver. 2.02) * NetBSD/OpenBSD support is added (by a contribution of a patch given by Stephan Eisvogel). "./configure; make" just works. * The AMD8111 and NVidia nForce2 SMBus access is supported (by information from Alex van Kaam). * National Semiconductor LM90 temperature sensor is supported. * Winbond W83L784R, W83L785R, W83L785TS-S sensors are supported. * The case of two sensor chips are supported (see section 4 How to use for details). ------------------------------------------------------------------ (ver. 2.00 ---> ver. 2.01) * "mbmon" can be executed as a daemon program (contributed patch by Jean-Marc Zucconi). This make it possible to get output of "mbmon" over network by executing telnet command (see section 4 How to use). * Improved treatment of ASUS ASB100 ("Bach") sensor chip (by information from Alex van Kaam). The temperature of an internal Athlon XP diode is obtained (as a 2nd temp.) in ASUS motherboard of A7V333/A7V8X. * ASUS Mozart-2 sensor chip is supported (by information from Alex van Kaam). * Fixed the issue that "xmbmon" cannot read NFS mounted ~/.Xauthority file (contributed patch by Kazushi NAKAMURA). ------------------------------------------------------------------ (ver. 2.00) * Few more hardware monitor chips are supported; National Semiconductor LM75, LM80 (by Shin-ichi Nagamura), and ASUS ASB100 Bach. * Few more SMBus interface chipsets are supported; AMD7xx, NVidia nForce, and ALi MAGiK1/AladdinPro. * More powerful automatic detection of supported hardware monitor chips is provided, and one can specify a chip name for probing it. * Special Treatment for Tyan's Tiger MP/MPX motherboard is supported. * Further variety of output of the "mbmon" program is supported for purpose of utilizing its output for more fancy graphic programs rather than the "xmbmon", like MRTG or rrdtool. This time output for rrdtool and convenient perl script is provided (by Shin-ichi Nagamura). * One can specify the device file number X (/dev/smbX) for users who has more than two devices on SMBus with FreeBSD SMBus device driver (This is only for FreeBSD, not for Linux). * The whole program has been almost completely rewritten to make it easier for supporting new hardware monitor chips and/or new SMBus interfaces (see 00READEtech.txt). * The output values of negative voltages are changed partly, so they may not coincide with those of the previous version. * Others: Fixing small bugs. xmbmon-2.05/ChangeLog.jp0000644000175000017500000001263510111416321014441 0ustar agiagi00000000000000------------------------------------------------------------------ (ver. 2.04 ---> ver. 2.05) $B!&(BAli $B%A%C%W%;%C%H$NG'<1$N%P%0$r=$@5!#(B $B!&(Bxmbmon $B$G$N6J@~$r$5$i$K%9%`!<%:$J$k$h$&$K=$@5!#(B $B!&(BVIA VT8237 $B5Z$S(B Intel ICH6 $B$N(B SMBus $B%"%/%;%9$r%5%]!<%H!#(B $B!&(Bselect() $B%7%9%F%`4X?t$NLdBj$KBP=h(B(Tsuneyuki Sakano $B$5$s$K$h$k(B)$B!#(B $B!&(BIO port $B$X$NFI$_=q$-$NItJ,$r(B gas $B$K$h$k%$%s%i%$%s%"%;%s%V%i(B $B$N7A$KE}0l(B($B=>$C$F!"(Bx86-gas $BIU$-$N(B gcc $B$,I,MW(B)$B!#$3$l$O(B John Wehle (john@feith.com)$B$5$s$K$h$k$b$N$G$9!#(B $B!&(BSolaris on x86 $B$N%W%i%C%H%U%)!<%`$G$bF0:n$9$k$h$&$KJQ99!"(B $B$=$NB>$b$m$b$m$NBN:[$r@0$($k=$@5!#$3$l$i$b(B John Wehle (john@feith.com)$B$5$s$K$h$k$b$N$G$9!#(B $B!&$=$NB>!":Y$+$$%P%0$N(B fix$B!#(B ------------------------------------------------------------------ (ver. 2.03 ---> ver. 2.04) $B!&K\%t%!!<%8%g%s$+$i=$@5(BBSD$B%i%$%;%s%9$r@_Dj!#(B $B!&(Bdaemon$B%b!<%I;~$K%m%0$r$B$5$s$K$h$k(B)$B!#(B $B!&(Bxmbmon $B$N%0%i%U$N%W%m%C%H$K(B 2nd order IIR low pass filter $BK!$K$h$k(B $B%9%`!<%:2=$rF3F~(B($B:YED$5$s$K$h$k(B)$B!#(B $B!&(BNicolas Rueff $B$5$s4sB#$N%^%K%e%"%k%U%!%$%k!#(B $B!&(BWinbond $B$N(B W83791D, W83627THF $B%A%C%W$r%5%]!<%H!#(B $B!&$$$/$D$+$N%$%s%F%k@=$N%^%6!<%\!<%I$N$?$a$N(B ADM9240 $B%A%C%W$N=i4|2=(B (Alex Vasylenko $B$5$s$K$h$k(B)$B!#(B $B!&(BALI1533/1543 chipset (Aladdin IV, V) $B$N(B SMBus $B%"%/%;%9$r%5%]!<%H!#(B $B!&(BWinbond $B%A%C%W$N(B 2$BHVL\$H(B 3$BHVL\$N29EY$X$N(B ISA $B%"%/%;%9$,$[$H$s$I(B $B$N%^%6!<%\!<%I$G<:GT$7$F$$$^$7$?!#$3$N$?$a$K!"$3$l$i$N29EYI=<($N(B $B>.?tItJ,$,>o$K(B 0.5 $B$K$J$C$F$$$^$7$?!#$3$N!V%P%0!W$r:#2s(B fix $B$7$^$7$?!#(B $B!&$=$NB>!":Y$+$$%P%0$N(B fix$B!#(B ------------------------------------------------------------------ (ver. 2.02 ---> ver. 2.03) $B!&(BGenesys Logic $B$N(B GL512SM, GL520SM $B%;%s%5!<$r%5%]!<%H!#(B $B!&%$%s%F%k$N(B ICH5 $B$N(B SMBus $B%"%/%;%9$r%5%]!<%H!#(B $B!&(BLM85$B!"(BAnalog Devices ADM1024/1025/1027/ADT7463$B!"(B $B$*$h$S(B SMSC EMC6D10X $B%;%s%5!<$r%5%]!<%H!#(B $B!&(BAnalog Devices ADM1020/1021/1023 $B29EY%;%s%5!<$r%5%]!<%H!#(B $B!&(Bversin 2.00 $B$+$i$"$C$?(B IT78xxF $B$N%U%!%s%G%#%P%$%6!<$N%P%0$r(B $B%U%#%/%9!#(B $B!&$=$NB>!":Y$+$$%P%0$N(B fix$B!"%3!<%I$N%/%j!<%s%"%C%W!#(B ------------------------------------------------------------------ (ver. 2.01 ---> ver. 2.02) $B!&(BNetBSD/OpenBSD $B$G$b;H$($k$h$&$K$J$C$?(B(Stephan Eisvogel $B$5$s$N(B $B%Q%C%A$K$h$k(B)$B!#!V(B./configure; make$B!W$bF0$/!#(B $B!&(BAMD8111 $B$H(B NVidia nForce2 $B$N(B SMBus $B%"%/%;%9$r%5%]!<%H(B (Alex van Kaam $B;a$N>pJs$K$h$k(B)$B!#(B $B!&(BLM90 $B29EY%;%s%5!<$r%5%]!<%H!#(B $B!&(BWinbond $B$N(B W83L784R, W83L785R, W83L785TS-S $B%;%s%5!<$r%5%]!<%H!#(B $B!&(B2$B$D$N%;%s%5!<%A%C%W$r;H$C$F$$$k>l9g$KBP1~(B ($B>\$7$/$O(B 4. $B;H$$J}(B $B;2>H(B)$B!#(B ------------------------------------------------------------------ (ver. 2.00 ---> ver. 2.01) $B!&(Bmbmon $B$r(B daemon $B$H$7$F5/F0$9$k%*%W%7%g%s$rDI2C(B(Jean-Marc Zucconi $B$5$s$K$h$k%Q%C%A$rE}9g(B)$B!#$3$l$K$h$j!"(Btelnet $B$K$h$j%M%C%H%o!<%/1[$7(B $B$K(B mbmon $B$N(B output $B$rF@$k$3$H$,$G$-$k(B(4. $B;H$$J}(B $B;2>H(B)$B!#(B $B!&(BASUS ASB100 (Bach) sensor chip $B$NpJs$K$h$k(B)$B!#>/$J$/$H$b!"(BASUS A7V333/A7V8X $B$N%^%6!<%\!<%I$K(B $B$K$*$$$F$O(B Athlon XP $B$NFbB"%;%s%5!<$+$i$N29EY$rF@$k$3$H$,$G$-$k(B $B$h$&$K$J$C$?(B(2$BHVL\$N(B temp. $B$H$7$F(B)$B!#(B $B!&(BASUS Mozart-2 sensor chip $B$r%5%]!<%H$7$?(B(Alex van Kaam $B$5$s$+$i(B $B$N>pJs$K$h$k(B)$B!#(B $B!&(Bxmbmon $B$,(B NFS $B$N(B ~/.Xauthority $B%U%!%$%k$rFI$a$J$$$3$H$,$"$kE@$r(B $B=$@5(B($BCfB$r;XDj$9$k$3$H$b$G$-$k$h$&$K$7$?!#(B $B!&FCl9g(B($BNc$($P!"(BMRTG $B$d(B rrdtool $B$rMQ$$$k(B)$B$N$?$a$N(B mbmon $B$N=PNO5!G=$N99$J$k6/2=(B($BD9B<$5$s$K$h$k(B rrdtool$BMQ$N=PNO$H$=$l$rMQ$$$?(B perl script, mbmon-rrd.pl $B$rE:IU(B)$B!#(B $B!&J#?t$N(B SMBus $B$r;HMQ$7$F$$$k?M$N$?$a$K!"(BFreeBSD $B$N(B SMBus driver $B$rMQ$$$k;~$N(B device file$BL>$NHV9f(B X (/dev/smbX) $B$r;XDj$G$-$k$h$&$K(B $B$7$?(B($B$3$l$O(B FreeBSD $B$N$_$G!"(BLinux $B$K$O4X78$J$$(B)$B!#(B $B!&%W%m%0%i%`$NBgI}$J8+D>$7$r$7$F!"?7$7$$%b%K%?%A%C%W$d(B SMBus $B%$%s%?!<(B $B%U%'%$%9$KBP1~$70W$/$7$?(B(00READMEtech.txt $B;2>H!"$?$@$71Q8l$N$_(B)$B!#(B $B!&IiEE05$N=PNOCM$r0lIt8+D>$7$?$N$G!"$3$l$^$G$N%t%!!<%8%g%s$N=PNO$H$O(B $B0[$J$k>l9g$,$"$k!#(B $B!&$=$NB>!":Y$+$$%P%0$N(B fix$B!#(B xmbmon-2.05/getMBinfo.c0000644000175000017500000002514110110276616014303 0ustar agiagi00000000000000/************************************************ Subroutines to get Mother Board Information Information related to Winbond W83781D Chip and National Semiconductor LM78/LM79 Chips by Alex van Kaam Information for VIA VT82C686A/B by ":p araffin.(Yoneya)", MANY THANKS!! Information for SMBus access by Linux lm_sensor homepage, MANY THANKS!! http://www.netroedge.com/~lm78/ ************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "pci_pm.h" #include "smbuses.h" #include "methods.h" #include "sensors.h" #include "smb_extemp.h" #ifdef TEMP_LIMIT #define TEMP_HIGH 100.0 #define TEMP_LOW -10.0 #endif /* external (global) data */ extern int debug_flag, fahrn_flag; extern int TyanTigerMP_flag; extern int isa_port_base; extern int viahwm_base, smb_base; extern int pm_smb_detected; extern int smb_slave; extern char *probe_request; extern SENSOR *HWM_module[]; extern char *HWM_name[]; extern int HWM_VIA, HWM_SMB, HWM_ISA; extern int HWM_SMBchip[]; extern int HWM_smbslave[]; extern int HWM_ISAchip[]; extern int numSMBSlave; extern int canSMBSlave[]; extern int num_extemp_chip; extern int smb_extemp_chip[]; extern int smb_extemp_slave[]; extern int extra_tempNO; /* Access method functions, global */ extern LM_METHODS method_isa, method_smb, method_via; static LM_METHODS *this_method = NULL; static SENSOR *this_sensor = NULL; static int probe_flag = SEARCH; static int HWM_firstSMB_flag = 0; static char method; /* function declarations */ extern void TyanTigerMPinit(void); int Probe_method(void); int HWM_detection(int); void HWM_set_firstSMB(SENSOR *, int); int probe_HWMChip(LM_METHODS *, int); int via_set(void); int smb_set(int, int); int isa_set(int); int InitMBInfo(char); int getTemp(float *, float *, float *); int getVolt(float *, float *, float *, float *, float *, float *, float *); int getFanSp(int *, int *, int *); /*---------------------- Detecting HWM Chip ----------------------*/ int Probe_method(void) { int n; if (method != 'I') { pm_smb_detected = set_smbus_io(&viahwm_base, &smb_base); } if (method == 'V') { if ((n = pm_smb_detected) == VIA686HWM) { /* VIA VT82C686 HWM is available */ return via_set(); } else if (n != -1) { fprintf(stderr, "No VIA686 HWM available!!\n"); return 1; } } else if (method == 'S') { if ((n = pm_smb_detected) > 0) { /* SMBus PowerManagement, hardware monitor exist ? */ return smb_set(probe_flag, n); } else if (n != -1) { fprintf(stderr, "No SMBus HWM available!!\n"); return 1; } } else if (method == 'I') { /* Just try ISA-IO method */ if ((n = isa_set(probe_flag)) == 0) { return 0; } else if (n != -1) { fprintf(stderr, "No ISA-IO HWM available!!\n"); return 1; } } else { /* No input method option: Try probing each HWM type */ if ((probe_flag == SEARCH || probe_flag == c_via686) && (n = pm_smb_detected) == VIA686HWM) { if (via_set() == 0 && method != 'A') return 0; else if (n > 0) goto smb_chk; } else if ((n = pm_smb_detected) > 0) { smb_chk: if (smb_set(probe_flag, n) == 0 && method != 'A') return 0; goto isa_chk; } else { isa_chk: if ((n = isa_set(probe_flag)) == 0 && method != 'A') return 0; else if (n != -1 && method != 'A') { fprintf(stderr, "No Hardware Monitor found!!\n"); return 1; } } } if (method == 'A') { return HWM_detection(pm_smb_detected); } return -1; } int HWM_detection(int chip) { int n, j, k, ext; if (debug_flag) fprintf(stderr, "Summary of Detection:\n"); if (HWM_VIA + HWM_SMB + HWM_ISA <= 0) { if (debug_flag) fprintf(stderr, " * No monitors found.\n"); return -1; } if (HWM_VIA > 0) { this_method = &method_via; if (debug_flag) fprintf(stderr, " * VIA686A/B monitor found.\n"); } for (n = 0, k = 0; HWM_module[n] != NULL; n++) { if (HWM_SMBchip[n] != 0) { if (debug_flag) { if (!k) #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) fprintf(stderr, " * SMB monitor(s)[ioctl:%s]:\n", #else /* SMBus direct access routines */ fprintf(stderr, " * SMB monitor(s)[%s]:\n", #endif chk_smb_chip(chip)); fprintf(stderr, " ** %s found at slave address: 0x%02X.\n", HWM_module[n]->Name, HWM_smbslave[n]); } k++; ext = 0; j = num_extemp_chip; if (!strcmp(HWM_name[n], "lm75")) { smb_extemp_chip[j] = ex_lm75; ext = 1; } else if (!strcmp(HWM_name[n], "lm90")) { smb_extemp_chip[j] = ex_lm90; ext = 1; } else if (!strcmp(HWM_name[n], "wl784") && HWM_SMBchip[n] == W83L785TS) { smb_extemp_chip[j] = ex_wl785ts; ext = 1; } if (ext) { smb_extemp_slave[j] = HWM_smbslave[n]; num_extemp_chip++; } /* set the first SMB monitor found */ if (!ext && !HWM_firstSMB_flag && HWM_SMB > 1) HWM_set_firstSMB(HWM_module[n], HWM_smbslave[n]); } } for (n = 0, k = 0; HWM_module[n] != NULL; n++) { if (HWM_ISAchip[n] != 0) { if (debug_flag) { if (!k) fprintf(stderr, " * ISA monitor(s):\n"); fprintf(stderr, " ** %s found.\n", HWM_module[n]->Name); } k++; } } #ifdef DEBUG printf("HWM_VIA=%d, HWM_SMB=%d, HWM_ISA=%d\n", HWM_VIA, HWM_SMB, HWM_ISA); #endif if (HWM_VIA + HWM_SMB + HWM_ISA == num_extemp_chip) num_extemp_chip = 0; return 0; } void HWM_set_firstSMB(SENSOR *module, int slave) { int n; for (n = 0; n < numSMBSlave; n++) { if (canSMBSlave[n] == 0xFF) { canSMBSlave[n] = slave; break; } } this_method = &method_smb; this_sensor = module; n = debug_flag; debug_flag = 0; { this_method->Open(); this_sensor->Probe(this_method); this_method->Close(); } debug_flag = n; HWM_firstSMB_flag = 1; } int probe_HWMChip(LM_METHODS *methodp, int probe) { int i, n, n0 = 0, num = 0; if (methodp->Open() != 0) return -1; /* module order is important !! */ for (n = 0; HWM_module[n] != NULL; n++) { if ((probe == SEARCH || probe == n) && (i = HWM_module[n]->Probe(methodp)) != 0) { if (methodp == &method_smb) { HWM_SMBchip[n] = i; HWM_smbslave[n] = smb_slave; HWM_SMB++; } else if (methodp == &method_isa) { HWM_ISAchip[n] = i; HWM_ISA++; } else { HWM_VIA++; } num++; if (n0 == 0) n0 = n; if (method != 'A') break; } } if (num) this_sensor = HWM_module[n0]; /* set HWM found first */ methodp->Close(); return num; } int via_set(void) { if (debug_flag > 1) fprintf(stderr, ">>> Testing Reg's at VIA686 HWM <<<\n"); if (probe_HWMChip(&method_via, c_via686) > 0) { this_method = &method_via; if (debug_flag && method != 'A') fprintf(stderr, "Using VIA686 HWM directly!!\n"); return 0; } else { fprintf(stderr, "Something Wrong in detected VIA686 HWM!!\n"); return 1; } } int smb_set(int probe, int chip) { if (debug_flag > 1) { #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) fprintf(stderr, ">>> Testing Reg's at SMBus <<<\n"); #else /* SMBus direct access routines */ fprintf(stderr, ">>> Testing Reg's at SMBus <<<\n"\ "[%s, IO-Base:0x%0X]\n", chk_smb_chip(chip), smb_base); #endif } if (find_smb_dev() <= 0) goto ret1; if (probe_HWMChip(&method_smb, probe) > 0) { this_method = &method_smb; if (debug_flag && method != 'A') { #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) fprintf(stderr, "Using SMBus-ioctl access method[%s]!!\n", #else /* SMBus direct access routines */ fprintf(stderr, "Using SMBus access method[%s]!!\n", #endif chk_smb_chip(chip)); } return 0; } else { ret1: if (debug_flag) { fprintf(stderr, "SMBus[%s] found, but No HWM available on it!!\n", chk_smb_chip(chip)); } return 1; } } int isa_set(int probe) { int n; if (debug_flag > 1) fprintf(stderr, ">>> Testing Reg's at ISA-IO <<<\n"\ "[ISA Port IO-Base:0x%0X]\n", isa_port_base); if ((n = probe_HWMChip(&method_isa, probe)) > 0) { this_method = &method_isa; if (debug_flag && method != 'A') fprintf(stderr, "Using ISA-IO access method!!\n"); return 0; } else if (n == 0) n = 1; return n; } int InitMBInfo(char method_inp) { int n; /* this is TyanTigerMP specific treatment */ if (TyanTigerMP_flag) TyanTigerMPinit(); if (debug_flag > 1) fprintf(stderr, "Probe Request: %s\n", probe_request); for (n = 0; HWM_name[n] != NULL; n++) { if (strcmp(probe_request, HWM_name[n]) == 0) { probe_flag = n; break; } } method = method_inp; if ((n = Probe_method()) != 0) { return n; } if (this_method && this_sensor) { if (debug_flag && method != 'A') fprintf(stderr, "* %s found.\n", this_sensor->Name); return 0; } else { return -1; } } /*------------------------- Getting Temperatures -------------------------*/ #define traFahrn(x) ((x) * 1.8 + 32.0) int getTemp(float *t1, float *t2, float *t3) { int n; float f, t[3] = {0.0, 0.0, 0.0}; if (this_method->Open() != 0) return -1; if (this_sensor) { for (n = 0; n < 3; n++) { if ((f = this_sensor->Temp(this_method, n)) != 0xFFFF) { #ifdef TEMP_LIMIT if (f <= TEMP_HIGH || f >= TEMP_LOW) #endif t[n] = f; } } } if (this_sensor == &it87 || this_sensor == &via686) { /* special treatment of IT86 and VIA868 */ f = t[0]; t[0] = t[1]; t[1] = t[2]; t[2] = f; } else if (this_sensor == &lm85) { /* special treatment of LM85 */ f = t[0]; t[0] = t[1]; t[1] = f; } if (num_extemp_chip > 0) { if ((f = smb_ExtraTemp()) != 0xFFFF) t[extra_tempNO] = f; } if (fahrn_flag) { for (n = 0; n <= 2; n++) { if (t[n] != 0.0) t[n] = traFahrn(t[n]); } } *t1 = t[0]; *t2 = t[1]; *t3 = t[2]; this_method->Close(); return 0; } /*-------------------- Getting Voltages --------------------*/ int getVolt(float *vc0, float *vc1,\ float *v33, float *v50p, float *v50n,\ float *v12p, float *v12n) { int n; float f, v[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; if (this_method->Open() != 0) return -1; if (this_sensor) { for (n = 0; n < 7; n++) { if ((f = this_sensor->Volt(this_method, n)) != 0xFFFF) v[n] = f; } } if (this_sensor == &lm85) { /* special treatment of LM85 */ f = v[0]; v[0] = v[1]; v[1] = f; } *vc0 = v[0], *vc1 = v[1]; *v33 = v[2], *v50p = v[3], *v12p = v[4]; *v12n = v[5], *v50n = v[6]; this_method->Close(); return 0; } /*---------------------- Getting Fan Speed ----------------------*/ int getFanSp(int *r1, int *r2, int *r3) { int n; int i, r[3] = {0,0,0}; if (this_method->Open() != 0) return -1; if (this_sensor) { for (n = 0; n < 3; n++) { if ((i = this_sensor->FanRPM(this_method, n)) != 0xFFFF) r[n] = i; } } if (this_sensor == &lm85) { /* special treatment of LM85 */ i = r[0]; r[0] = r[1]; r[1] = i; } *r1 = r[0]; *r2 = r[1]; *r3 = r[2]; this_method->Close(); return 0; } xmbmon-2.05/Makefile.in0000644000175000017500000001012610107063765014334 0ustar agiagi00000000000000# # Makefile for xmbmon related things # (for FreeBSD) # srcdir = @srcdir@ VPATH = @srcdir@ # for Linux #DEFS=-DHAVE_CONFIG_H -Wall -DLINUX # for using SMBus ioctl #DEFS=-DHAVE_CONFIG_H -Wall -DSMBUS_IOCTL # for using temperature limit (see getMBinfo.c) #DEFS=-DHAVE_CONFIG_H -Wall -DTEMP_LIMIT # for using logging facility #DEFS=-DHAVE_CONFIG_H -Wall -DLOGGING # for making small_mbmon #DEFS=-DHAVE_CONFIG_H -Wall -DSMALL_MBMON DEFS=-DHAVE_CONFIG_H -Wall @HOSTDEF@ INCLUDES=-I$(srcdir) LIBS=@ADDLIBS@ @LIBS@ LIBSX=$(LIBS) @X_LIBS@ -lXt @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ #CC=/compat/linux/usr/bin/gcc CC=@CC@ CFLAGS=-O3 $(INCLUDES) $(DEFS) CFLAGSX=$(CFLAGS) @X_CFLAGS@ LDFLAGS=-s LINT=lint # LINT=$(CC) -c -Wall -Wshadow -Wpointer-arith # also maybe -Wcast-qual -Wwrite-strings RM=rm -f INSTALL=install INST_DIR=/usr/local/bin INST_MANDIR=/usr/local/man/man1 INST_XDIR=/usr/X11R6/bin INST_MANXDIR=/usr/X11R6/man/man1 INST_XRDIR=/usr/X11R6/lib/X11/app-defaults .c.o: $(CC) -c $(CFLAGS) $*.c MANPAGE = mbmon.1 xmbmon.1x PROGRAM = mbmon xmbmon TESTPROG = testpci testsmb testhwm testfan MB_OBJ = getMB-via.o getMB-smb.o getMB-isa.o SMB_OBJ = smbuses.o smbus_piix4.o smbus_amd.o smbus_ali.o smbus_amd8.o HWM_OBJ = sens_winbond.o sens_via686.o sens_it87.o sens_gl52.o sens_lm85.o sens_lm80.o sens_lm90.o sens_lm75.o sens_wl784.o smb_extemp.o OBJS = getMBinfo.o tyan_tiger.o pci_pm.o sensors.o $(MB_OBJ) $(SMB_OBJ) $(HWM_OBJ) all: $(PROGRAM) mbmon: mbmon.c mbmon.h methods.h pci_pm.h smbuses.h sensors.h $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mbmon.c $(OBJS) $(LIBS) mbmon_small: mbmon_small.c mbmon.h methods.h pci_pm.h smbuses.h sensors.h $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mbmon_small.c $(OBJS) $(LIBS) xmbmon: xmbmon.c mbmon.h methods.h pci_pm.h smbuses.h sensors.h $(OBJS) $(CC) $(CFLAGSX) $(LDFLAGS) -o $@ xmbmon.c $(OBJS) $(LIBSX) testprog: $(TESTPROG) testpci: testpci.c pci_smb.c pci_pm.o pci_pm.h $(CC) $(CFLAGS) $(LDFLAGS) -o $@ testpci.c pci_pm.o $(SMB_OBJ) $(LIBS) testsmb: testsmb.c pci_smb.c pci_pm.o pci_pm.h smbus_piix4.c smbus_amd.c smbus_ali.c smbus_amd8.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ testsmb.c pci_pm.o $(SMB_OBJ) $(LIBS) testhwm: testhwm.c pci_smb.c pci_pm.o pci_pm.h smbus_piix4.c smbus_amd.c smbus_ali.c smbus_amd8.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ testhwm.c pci_pm.o $(SMB_OBJ) $(LIBS) testfan: testhwm.c pci_smb.c pci_pm.o pci_pm.h smbus_piix4.c smbus_amd.c smbus_ali.c smbus_amd8.c $(CC) -DFAN_DIV_CHK $(CFLAGS) $(LDFLAGS) -o $@ testhwm.c pci_pm.o $(SMB_OBJ) $(LIBS) getMB-isa.o: getMB-isa.c methods.h io_static.c io_cpu.h getMB-smb.o: getMB-smb.c getMB-smb_ioctl.c methods.h smbuses.h io_static.c io_cpu.h getMB-via.o: getMB-via.c methods.h io_static.c io_cpu.h getMBinfo.o: getMBinfo.c methods.h pci_pm.h smbuses.h sensors.h sensors.c pci_pm.o: pci_pm.c pci_pm.h io_static.c io_cpu.h smbuses.o: smbuses.c smbuses.h smbus_piix4.o: smbus_piix4.c smbuses.h io_cpu.h smbus_amd.o: smbus_amd.c smbuses.h io_cpu.h smbus_ali.o: smbus_ali.c smbuses.h io_cpu.h smbus_amd8.o: smbus_amd8.c smbuses.h io_cpu.h sensors.o: sensors.c sensors.h sens_it87.o: sens_it87.c sensors.h sensors.c sens_gl52.o: sens_gl52.c sensors.h sensors.c sens_lm85.o: sens_lm85.c sensors.h sensors.c sens_lm80.o: sens_lm80.c sensors.h sensors.c sens_via686.o: sens_via686.c sensors.h sensors.c sens_winbond.o: sens_winbond.c sens_winbond.h sensors.h sensors.c sens_lm90.o: sens_lm90.c sensors.h sensors.c sens_lm75.o: sens_lm75.c sensors.h sensors.c sens_wl784.o: sens_wl784.c sens_wl784.h sensors.h sensors.c tyan_tiger.o: tyan_tiger.c io_static.c io_cpu.h smb_extemp.o: smb_extemp.c smb_extemp.h clean: $(RM) *.o *.bak a.out core *.core *~ $(PROGRAM) $(TESTPROG) mbmon_small distclean: clean $(RM) Makefile config.cache config.log config.h config.status install: $(PROGRAM) $(INSTALL) -o root -g wheel -m 4555 -c -p mbmon $(INST_DIR) $(INSTALL) -o root -g wheel -m 4555 -c -p xmbmon $(INST_XDIR) install-man: $(MANPAGE) $(INSTALL) -o root -g wheel -m 444 -c -p mbmon.1 $(INST_MANDIR) $(INSTALL) -o root -g wheel -m 444 -c -p xmbmon.1x $(INST_MANXDIR) lint: $(LINT) $(INCLUDES) $(DEFS) $(FONTDEFINES) $(SRCS) -lm xmbmon-2.05/mbmon.h0000644000175000017500000001202110116116344013534 0ustar agiagi00000000000000/* * Yoshifumi R. Shimizu * * ver.1.00, 1999.02.01-04 * Using only Xlib * * ver.1.01, 1999.02.06 * Using X Toolkit * * ver.1.02, 1999.02.09 * Using application resources and option tables * Winbond W83781D supported. * National Semiconductor LM78/79 supported (possibly). * * ver.1.03, 1999.02.20-23 * Adding temp3, and increasing resouces / option tables * -DNO_TEMP3 compiling option for not showing temp3 * * ver.1.04, 1999.05.04 * Slight improvement for getting resources * * ver.1.05, 1999.11.13 * Support SMBus access method. Debugging infomation. * Winbond W83781D, W83782D, W83783S supported. * Asus AS99127F HWM chip supported. * * ver.1.06, 2001.08.22 * New SMBus access method without "intpm" driver! * VIA VT82C686A/B's HWM chip supported. * * ver.1.07, 2002.01.16 * Patch for supporting detailed output for MRTG, * provided by Koji MORITA (morita@cybird.co.jp). * Showing temperture in Fahrenheit. * * ver.2.00, 2002.07.31 * Supported chips' codes are separated into modules. * National Semiconductor LM80 moudule contributed * by Shin-ichi Nagamura. * ASUS ASB100 chip is supported. * National Semiconductor LM75 supported (possibly). * SMBus access routines are also separated into modules. * New SMBus access routines for AMD7xx and ALi7101. * * ver.2.01, 2003.01.20 * New option to execute "mbmon" as a daemon contributed * by Jean-Marc Zucconi (jmz@FreeBSD.org). * ASUS Mozart-2 sensor chip is supported. * Special treatment of ASUS ASB100. * * ver.2.02, 2003.06.15 * Supporting patch of NetBSD/OpenBSD (by Stephan Eisvogel). * New SMBus access for AMD8111 and NVidia nForce2 chipsets. * LM90 sensor chip is supported. * Winbond W83L784R, W83L785R, W83L785TS-S are supported. * The case of two sensor chips, i.e. with an extra-CPU * temperature sensor for "CPU thermal protection", is supported! * * ver.2.03, 2003.06.25, 07.04, 07.30 * Fixing bugs about fan-divisor, clean up code * (no need & 0xFF for data by ReadByte). * Gensys Logic GL518SM/GL520SM chips are supported. * LM85 and compatible, Analog Devices ADM1024/1025/1027/ADT7463, * SMSC EMC6D100/101 chips are supported. * Analog Devices ADM1020/1021/1023 temperature sensors * are supported (LM90 compatible). * * ver.2.04, 2003.10.02, 2004.02.02, 03.31 * Winbond W83791D, W83627THF, W83627THF-A chips are supported. * 2nd order IIR Low Pass Filter (LPF) included * for graphs in xmbmon by Takayuki Hosoda. * ALI1533/1543 chipset are supported (change of only SMBBA). * Logging facility added by by David Quattlebaum. * * ver.2.05, 2004.06.04, 07.15 * Bug fixed for ALI chipset detection. * Abrupt change of values in xmbmon, which causes spikes of * curves, are avoided. * VIA VT8237 and Intel ICH6 supported. * Problem of select system call fixed (by Tsuneyuki Sakano). * IO port read/write code replaced by x86-gas inline assembler * (by John Wehle). * Supporting patch for Solaris on x86 (by John Wehle). * * * mbmon --- command-line motherboard monitor * * xmbmon --- X motherboard monitor * * * << Acknowledgements >> * * Information related to WinBond W83781D LM78/LM79 Chips by Alex van Kaam. * http://mbm.livewiredev.com/ * * Information on VT82C686A/B chips and many general things related to * both hardware monitor chips and SMBus access by ":p araffin(Yoneya)". * http://homepage1.nifty.com/paraffin * * Information for SMBus access by Linux lm_sensor homepage. * http://www.lm-sensors.nu/ * */ #if !defined(__mbmon_h__) #define XMBMON_VERSION "2.05" #define DEFAULT_SEC 5 #define CHIPLIST "winbond|wl784|via686|it87|gl52|lm85|lm80|lm90|lm75" /* Fahrenheit flag used in getTemp(), global */ int fahrn_flag = 0; /* Debug flag used in InitMBInfo(), global */ int debug_flag = 0; /* TyanTigerMP flag, global */ int TyanTigerMP_flag = 0; /* detected HWM or SMB ID number, global */ int pm_smb_detected = 0; /* Probe request characters for detecting hardware monitor chip */ char *probe_request = "none"; /* the number of temp.[0|1|2] to replace extra temperature with */ int extra_tempNO = 2; /* functions */ int InitMBInfo(char); int getTemp(float *, float *, float *); int getVolt(float *, float *, float *, float *, float *, float *, float *); int getFanSp(int *, int *, int *); #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) /* SMBus device file name */ char smb_devbuf[] = "/dev/smb0"; char *smb_devfile = smb_devbuf; #endif #ifdef LOGGING /* our circular list of log data */ typedef struct LOGDATA { struct LOGDATA *next; struct LOGDATA *prev; char *data; } logdata; /* log file name */ #if !defined(LOGFILE) #define LOGFILE "/var/log/mbmon.log" #endif /* seconds between log entries */ #if !defined(LOGINTERVAL) #define LOGINTERVAL 300 #endif /* maximum entries in log file */ #if !defined(LOGENTRIES) #define LOGENTRIES 1024 #endif #endif /* LOGGING */ #endif /*__mbmon_h__*/ xmbmon-2.05/mbmon-rrd.pl0000755000175000017500000000526607501531601014526 0ustar agiagi00000000000000#!/usr/bin/perl # # usage: # mbmon-rrd.pl # # description: # 5分毎にcronから起動すると、mbmonの出力をrrdtoolのRRDファイルに # 書き出す。 # # 指定したが存在しない場合は作成する。作成する際のRRDファ # イル中のデータソースは`mbmon -rc1`で出力されたタグ名(fan0等)を # 辞書順にソートした順序となる。 # use RRDs ; # ----- default settings ----- $dbg = 0 ; $usage = "usage: mbmon-rrd.pl \n" ; sub create_rrd() { local( $rrdfile, %status ) = @_ ; local( @args, $e ) ; print( "create_rrd(): \$rrdfile=\"$rrdfile\"\n" ) if($dbg) ; @args = ( $rrdfile ) ; foreach $_ ( sort( keys %status )) { push( @args, "DS:$_:GAUGE:600:U:U" ) ; } push( @args, "RRA:AVERAGE:0.5:1:600" ) ; push( @args, "RRA:AVERAGE:0.5:6:700" ) ; push( @args, "RRA:AVERAGE:0.5:24:775" ) ; push( @args, "RRA:AVERAGE:0.5:288:797" ) ; push( @args, "RRA:MAX:0.5:1:600" ) ; push( @args, "RRA:MAX:0.5:6:700" ) ; push( @args, "RRA:MAX:0.5:24:775" ) ; push( @args, "RRA:MAX:0.5:288:797" ) ; push( @args, "RRA:MIN:0.5:1:600" ) ; push( @args, "RRA:MIN:0.5:6:700" ) ; push( @args, "RRA:MIN:0.5:24:775" ) ; push( @args, "RRA:MIN:0.5:288:797" ) ; push( @args, "RRA:LAST:0.5:1:600" ) ; push( @args, "RRA:LAST:0.5:6:700" ) ; push( @args, "RRA:LAST:0.5:24:775" ) ; push( @args, "RRA:LAST:0.5:288:797" ) ; print( "create $rrdfile " . join( ", ", @args )) if($dbg) ; RRDs::create( @args ) ; $e = RRDs::error() ; die "ERROR: Cannot create logfile: $e\n" if( $e ) ; } sub read_status() { local( %status ) ; local( $key, $val ) ; open( FD, "mbmon -rc1|" ) || die "ERROR: Cannot run mbmon\n" ; while( $_ = ) { next unless( /^([A-Za-z][^:\s]+)\s*:\s*([+\-]{0,1}[\d\.]+)/ ) ; $key = $1 ; $val = $2 ; $key =~ y/A-Z/a-z/ ; $status{$key} = $val ; print( "\$status{$key} = \"$val\"\n" ) if($dbg) ; } close( FD ) ; return( %status ) ; } sub update_rrd() { local( %status ) = @_ ; local( @ds, @val ) ; local( $template, $value, $e ) ; foreach $_ ( sort ( keys %status )) { push( @ds, $_ ) ; push( @val, $status{$_} ) ; } $template = join( ':', @ds ) ; $value = "N:" . join( ':', @val ) ; print( "update template = '$template'\n" ) if($dbg) ; print( "update value = '$value'\n" ) if($dbg) ; RRDs::update( $rrdfile, "--template", $template, $value ) ; $e = RRDs::error() ; die "ERROR Cannot update $rrdfile with '$str' $e\n" if( $e ) ; } # ----- argument check ----- if( $#ARGV != 0 ) { print $usage ; exit( 1 ) ; } $rrdfile = $ARGV[0] ; # ----- read status from mbmon ----- %status = &read_status ; # ----- check and create rrdfile ----- if( ! -e $rrdfile ) { &create_rrd( $rrdfile, %status ) ; } # ----- parse status ----- &update_rrd( %status ) ; exit( 0 ) ; xmbmon-2.05/sens_winbond.c0000644000175000017500000003311710073427161015124 0ustar agiagi00000000000000/* * Winbond and Asus hardware monitor chip * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * * Winbond chip: W83781D, W83782D, W83783S, W83627HF, W83697HF * Asus chip : AS99127F, ASB100 * National Semiconductor: LM78, LM78-j, LM79 [+ [2*]LM75] * * Note: LM75 is temperature only sensor chip sometimes used * with LM78/79. * Winbond W83781D is LM78/79 + 2 * LM75 more or less. * Winbond Chip Temp Volt Fan SMBus IOport W83781D 3 7 3 yes yes W83782D 3 9 3 yes yes W83783S 1-2 5-6 3 yes no W83791D 3 10 5 yes no W83627HF 3 9 3 yes yes (LPC) W83627THF 3 7 3 yes yes (LPC) W83697HF 2 6 2 no yes (LPC) Asus Chip Temp Volt Fan SMBus IOport AS99127F 3 7 3 yes no ASB100(Bach) 3 7 3 yes no ASM58(Mozart-2) 2 4 2 yes no (Mozart-2 needs a specific treatment) National Semiconductor Chip Temp Volt Fan SMBus IOport lm78/lm78-j 1 7 3 yes yes lm79 1 7 3 yes yes Analog Devices Chip Temp Volt Fan SMBus IOport adm9240 1 6 2 yes yes * * by YRS */ /* To allow "unknown" (fuzzy probing), define this */ /* #define ALLOW_UNKNOWN */ #include #include #include #include "pci_pm.h" #include "sensors.h" #include "sens_winbond.h" /* external (global) data */ extern int pm_smb_detected; extern int smb_slave; extern int smb_wbtemp1, smb_wbtemp2; extern int smb_wbtemp1_flag, smb_wbtemp2_flag; extern LM_METHODS method_isa, method_smb; extern int numSMBSlave, canSMBSlave[128]; extern int TyanTigerMP_flag; #define LM75_ADDR_START 0x90 /* 0x90-0x9E (0x48-0x4F) */ #define LM75_ADDR_END 0x9E #define WINBD_ADDR_START 0x50 /* 0x50-0x5E (0x28-0x2F) */ #define WINBD_ADDR_END 0x5E #define ASUSM_ADDR_FIX 0xEE /* ASUS Mozart-2, 0xEE (0x77) only */ #define WINBD_CONFIG 0x40 #define WINBD_SMBADDR 0x48 #define WINBD_DEVCID 0x49 #define WINBD_CHIPID 0x58 #define WINBD_VENDEX 0x4E #define WINBD_VENDID 0x4F #define ANADM_VENDID 0x3E /* temp nr=0,1,2; volt nr=0,...6; fan nr=0,1,2 */ #define WINBD_TEMP0 0x27 #define ASUSB_TEMP4 0x17 #define ASUSM_TEMP2 0x13 #define WINBD_TEMPADDR 0x4A #define WINBD_VOLT(nr) (0x20 + (nr)) #define WINBD_FAN(nr) (0x28 + (nr)) #define WINBD_FANDIV 0x47 #define WINBD_REGPIN 0x4B #define ASUSM_FANDIV 0xA1 #define ANADM_TEMPCFG 0x4B #define WINBD_DIOSEL 0x59 #define WINBD_VMCTRL 0x5D static int winbond_probe(LM_METHODS *); static int winbond_probe_act(LM_METHODS *, int); static float winbond_temp(LM_METHODS *, int); static int winbond_fanrpm(LM_METHODS *, int); static float winbond_volt(LM_METHODS *, int); #define BUFF_LEN 128 static char buff[BUFF_LEN]; SENSOR winbond = { buff, winbond_probe, winbond_temp, winbond_volt, winbond_fanrpm }; /* chip idenfication */ static int wbdchipid = 0; static int wbdlmid = 0; /* temp1/2 flags address */ static int temp1_flag = 0; /* = 0 if enabled ! */ static int temp2_flag = 0; /* = 0 if enabled ! */ static int temp1_addr = 0; static int temp2_addr = 0; /* fan divisor register */ static int fan12div_reg = WINBD_FANDIV; #define WINBD_chkRegNum 8 /* Register checked for probing */ static int chkReg[] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x56, 0x58, 0x59, 0x5D, 0x3E, 0x13, 0x17, 0xA1, 0x20, 0x22, 0x23, 0x24, 0x27, 0x29, 0x2A, 0x2B, -1 }; static void Temp_Bipolar(LM_METHODS *method) { int n; n = method->Read(WINBD_DIOSEL) & 0x8F; method->Write(WINBD_DIOSEL, n); n = method->Read(WINBD_VMCTRL) | 0x0E; method->Write(WINBD_VMCTRL, n); } static void Init_FanDiv(LM_METHODS *method) { int n; n = (method->Read(WINBD_FANDIV) & 0x0F) | 0xA0; method->Write(WINBD_FANDIV, n); n = (method->Read(WINBD_REGPIN) & 0x3F) | 0x80; method->Write(WINBD_REGPIN, n); } /* * return 0 if not probed */ static int winbond_probe(LM_METHODS *method) { int n, save, slave = 0; if (method != &method_isa && method != &method_smb) return 0; save = smb_slave; if (method == &method_smb) { /* check ASUS Mozart Chip, first */ if ((slave = get_smb_slave(ASUSM_ADDR_FIX, ASUSM_ADDR_FIX))) { if (winbond_probe_act(method, slave)) goto ret1; } for (n = WINBD_ADDR_START; n <= WINBD_ADDR_END;) { if (!(slave = get_smb_slave(n, WINBD_ADDR_END))) goto ret0; else { if (winbond_probe_act(method, slave)) goto ret1; else n = slave + 2; } } goto ret0; } else { if (winbond_probe_act(method, slave)) goto ret1; } ret0: smb_slave = save; return 0; ret1: /* this is TyanTigerMP specific treatment */ if (TyanTigerMP_flag) { Temp_Bipolar(method); usleep(30000); Init_FanDiv(method); } if (method == &method_smb) { kill_smb_slave(slave); if(!smb_wbtemp1_flag) kill_smb_slave(smb_wbtemp1); if(!smb_wbtemp2_flag) kill_smb_slave(smb_wbtemp2); } return wbdchipid; } static int winbond_probe_act(LM_METHODS *method, int slave) { int i, n, nd, nc, nvl, nvu, nvx, nva; if (method == &method_smb) smb_slave = slave; else slave = 0; if (chkReg_Probe(slave, "Probing Winbond/Asus/LM78/79 chip:\n", chkReg, method) < WINBD_chkRegNum) goto ret0; nd = method->Read(WINBD_DEVCID) & 0xFE; nc = method->Read(WINBD_CHIPID); nvx = method->Read(WINBD_VENDEX); method->Write(WINBD_VENDEX, 0x00); nvl = method->Read(WINBD_VENDID); method->Write(WINBD_VENDEX, 0x80); nvu = method->Read(WINBD_VENDID); nva = method->Read(ANADM_VENDID); #ifdef DEBUG printf("DEBUG 49:0x%02X 58:0x%02X 4Fl:0x%02X 4Fu:0x%02X\n",nd,nc,nvl,nvu); #endif if (nvl == 0xA3 && nvu == 0x5C) { /* Winbond Chip */ switch (nc & 0xFE) { case 0x10: /* 0x10 (or 0x11) */ wbdchipid = W83781D; break; case 0x20: /* 0x20 (or 0x21) 627HF */ case 0x90: /* 0x90 (or 0x91?) 627THF */ case 0x1A: /* 0x1A (??) 627THF-A */ wbdchipid = W83627HF; break; case 0x30: /* 0x30 (or 0x31) */ wbdchipid = W83782D; if (nc == 0x31) wbdchipid = AS99127F; /* very special, but ... */ break; case 0x40: /* 0x40 (or 0x41) */ wbdchipid = W83783S; break; case 0x60: /* 0x60 (or 0x61) */ wbdchipid = W83697HF; break; case 0x70: /* 0x70 (or 0x71) */ wbdchipid = W83791D; break; default: #ifdef ALLOW_UNKNOWN wbdchipid = WBUNKNOWN; #else goto ret0; #endif } } else if ((nvl == 0xC3 && nvu == 0x12) && nc == 0x31) { /* Asus Chip */ wbdchipid = AS99127F; } else if ((nvl == 0x94 && nvu == 0x06) && nc == 0x31) { /* Asus Chip */ wbdchipid = ASB100; } else if ( smb_slave == ASUSM_ADDR_FIX && /* Mozart-2, special */ ((nvx == 0x94 && nvl == 0x36 && nc == 0x56) || (nvx == 0x94 && nvl == 0x06 && nc == 0x56) || (nvx == 0x5C && nvl == 0xA3 && nc == 0x10))) { wbdchipid = ASM58; } else if (nd == 0x20 || nd == 0x40) { /* 0x20, 0x40 */ wbdchipid = LM78; } else if (nd == 0xC0) { /* 0xC0 */ wbdchipid = LM79; } else if (nva == 0x23) { /* ADM9240 */ wbdchipid = ADM9240; } else #ifdef ALLOW_UNKNOWN wbdchipid = UNKNOWN; #else goto ret0; #endif strcpy(buff, winbchip[wbdchipid]); wbdlmid = wbdchipid; if (wbdchipid == WBUNKNOWN || wbdchipid >= LM78) wbdlmid = W83781D; if (wbdchipid == ASB100) /* Asus Bach */ wbdlmid = W83781D; if (wbdchipid == ASM58) { /* Asus Mozart-2 */ wbdlmid = W83781D; temp1_flag = temp2_flag = 1; /* disable! */ fan12div_reg = ASUSM_FANDIV; method->Write(WINBD_CONFIG, 0x01); /* init. chip */ goto ret1; } if (wbdchipid == ADM9240) { temp1_flag = temp2_flag = 1; /* disable! */ method->Write(WINBD_CONFIG, 0x01); /* init. chip */ goto ret1; } if (method == &method_isa && wbdchipid >= LM78) { temp1_flag = temp2_flag = 1; /* disable! */ goto ret1; } /* Checking Extra temperatures Temp1, Temp2 */ if (wbdchipid >= LM78) { /* possibility of LM75 sensor */ i = set_smb_Extemp(LM75_ADDR_START, LM75_ADDR_END, &smb_wbtemp2, &smb_wbtemp1); temp2_flag = i >> 1; temp1_flag = i & 0x01; info_Extemp(method, temp1_flag, temp2_flag); if (!temp1_flag || !temp2_flag) strcat(winbond.Name, "+LM75"); goto ret1; } n = method->Read(WINBD_TEMPADDR); if (!(temp1_flag = (n & 0x08) >> 3)) { temp1_addr = smb_wbtemp1; smb_wbtemp1 = 2 * ( 0x48 + (n & 0x07) ); if (method->ReadTemp1() == 0xFFFF) { temp1_flag = 1; /* disable! */ smb_wbtemp1 = temp1_addr; } } if (!(temp2_flag = (n & 0x80) >> 7)) { temp2_addr = smb_wbtemp2; smb_wbtemp2 = 2 * ( 0x48 + ((n & 0x70) >> 4) ); if (method->ReadTemp2() == 0xFFFF) { temp2_flag = 1; /* disable! */ smb_wbtemp2 = temp2_addr; } } info_Extemp(method, temp1_flag, temp2_flag); ret1: if (method == &method_smb) { smb_wbtemp1_flag = temp1_flag; smb_wbtemp2_flag = temp2_flag; } return wbdchipid; ret0: return 0; } /* * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,2 */ static float winbond_temp(LM_METHODS *method, int no) { int n = 0; float f; if (no < 0 || 2 < no) return 0xFFFF; if (no == 2 && (wbdchipid == W83783S || wbdchipid == W83697HF || wbdchipid == ASM58)) return 0xFFFF; if (no == 0) { f = (float) method->Read(WINBD_TEMP0); if (wbdchipid == ADM9240) { n = method->Read(ANADM_TEMPCFG); if (n & 0x80) f += 0.5; } return f; } else if (no == 1) { if (wbdchipid == ASB100) return (float) method->Read(ASUSB_TEMP4); if (wbdchipid == ASM58) return (float) method->Read(ASUSM_TEMP2); else if (!temp1_flag) n = method->ReadTemp1(); #ifdef SYRS } else if (no == 2 && !temp2_flag) { #else } else if (no == 2) { if (wbdchipid == ASB100) { if (!temp1_flag) n = method->ReadTemp1(); } else if (!temp2_flag) #endif n = method->ReadTemp2(); } if ((n & 0xFF) >= 0x80) n = 0; f = (float) (n & 0xFF) + 0.5 * ((n & 0xFF00) >> 15); if (wbdchipid == AS99127F && pm_smb_detected == ICH801SMB) { /* very special treatment for AS99127F with ICH chipsets */ if (no == 1 && (-32.0 < f && f <= 105.0)) { f *= 0.697; f += 25.0; } } return f; } /* * \retval 0x0000FFFF no sensor * no = 0,1,2,...,6 */ static float winbond_volt(LM_METHODS *method, int no) { int n; float f = 0.0; if (no < 0 || 6 < no) return 0xFFFF; if (wbdchipid == ASM58 && (no == 1 || no > 4)) return 0xFFFF; if (wbdchipid == ADM9240 && (no > 5)) return 0xFFFF; n = method->Read(WINBD_VOLT(no)); switch (no) { case 0: case 1: case 2: f = n * 0.016; break; case 3: f = n * 0.016 * 1.68; break; case 4: f = n * 0.016 * 3.800; break; case 5: if (wbdlmid == AS99127F) f = - n * 0.016 * 3.968; else if (wbdlmid == W83781D) f = - n * 0.016 * 3.477; else f = ( n * 0.016 - 3.6 * 0.8056) / 0.1944; break; case 6: if (wbdlmid == W83781D || wbdlmid == AS99127F) f = - n * 0.016 * 1.500; else f = ( n * 0.016 - 3.6 * 0.6818) / 0.3182; } return f; } /* Controlling Fan Divisor for 1st/2nd fans: CR = 0x47. 1st two bits for fan1, 2nd two bits for fan2 7 4 3 0 +-+-+-+-+-+-+-+-+ xx = 00,01,10,11 div1fac = 1,2,4,8 |y y|x x| VolID | yy = 00,01,10,11 div2fac = 1,2,4,8 +-+-+-+-+-+-+-+-+ initial values: xx=01, yy=01 Controlling Fan Divisor for 3rd fan: CR = 0x4B. 1st two bits for fan3 7 6 5 0 +-+-+-+-+-+-+-+-+ |z z| | zz = 00,01,10,11 div3fac = 1,2,4,8 +-+-+-+-+-+-+-+-+ initial values: zz=01 3rd fan divisor available for Winbond (not for LM78/79). Bit 2 of Fan Divisor: CR = 0x5D (Winbond chips except 781D). 7 6 5 0 +-+-+-+-+-+-+-+-+ |z|y|x| | x, y, z for bit 2 of fan 1, 2, 3 +-+-+-+-+-+-+-+-+ */ /* * \retval 0xFFFF no sensor * no = 0,1,2 * * Clock is 22.5kHz (22,500 x 60 = 1350000 counts/minute) */ static int winbond_fanrpm(LM_METHODS *method, int no) { int r, n1 = 0x50, n2 = 0x40, n3 = 0x00; static int div[3] = {1,1,1}; if (no < 0 || 2 < no) return 0xFFFF; if (no == 2 && (wbdchipid == W83697HF || wbdchipid == ASM58 || wbdchipid == ADM9240)) return 0xFFFF; if (W83782D <= wbdchipid && wbdchipid <= W83697HF) n3 = method->Read(WINBD_VMCTRL); /* bit 2 */ if (no != 2) { n1 = method->Read(fan12div_reg); /* bit 0,1 */ div[0] = ((n1 >> 4) & 0x03) | ((n3 & 0x20) >> 3); div[1] = (n1 >> 6) | ((n3 & 0x40) >> 4); } else if (wbdchipid < LM78) { n2 = method->Read(WINBD_REGPIN); /* bit 0,1 */ div[2] = (n2 >> 6) | ((n3 & 0x80) >> 5); } r = method->Read(WINBD_FAN(no)); if (r == 0xFF) { /* change divisor for the sake of next call ! */ if (no != 2) { if (div[no] < 3) ++(div[no]); else div[no] = 0; r = (n1 & 0x0F) | ((div[0] & 0x03) << 4) | ((div[1] & 0x03) << 6); method->Write(fan12div_reg, r); } else if (wbdchipid < LM78) { if (div[no] < 3) ++(div[no]); else div[no] = 0; r = (n2 & 0x3F) | ((div[2] & 0x03) << 6); method->Write(WINBD_REGPIN, r); } if (W83782D <= wbdchipid && wbdchipid <= W83697HF) { r = (n3 & 0x1F) | ((div[0] & 0x04) << 3) | ((div[1] & 0x04) << 4) | ((div[2] & 0x04) << 5); method->Write(WINBD_VMCTRL, r); } return 0xFFFF; } else if (r == 0) { return 0xFFFF; } return 1350000 / (r * (1 << div[no])); } xmbmon-2.05/sens_lm80.c0000644000175000017500000001313110052423114014225 0ustar agiagi00000000000000/* * Natinal Semiconductor LM80 hardware monitor chip * *************************************************************** * Before calling these routines, one must call method->Open() * * After calling these routines, one must call method->Close() * *************************************************************** * National Semiconductor Chip Temp Volt Fan SMBus IOport lm80 1 7 2 yes no * * Copyright Shin-ichi Nagamura */ #include #include "sensors.h" /* external (global) data */ extern int smb_slave; extern LM_METHODS method_smb; #undef DEBUG #define LM80_ADDR_START 0x50 /*0x50-0x5E*/ #define LM80_ADDR_END 0x5E #define LM80_CONFIG 0x00 #define LM80_ISR1 0x01 #define LM80_ISR2 0x02 #define LM80_FANDIV 0x05 #define LM80_RESOLUTION 0x06 #define LM80_IN0 0x20 #define LM80_TEMPERATURE 0x27 #define LM80_FANRPM1 0x28 #define LM80_FANRPM2 0x29 #define LM80_CONFIG_START 0x01 #define LM80_CONFIG_INTEN 0x02 #define LM80_CONFIG_INTOPEN 0x04 #define LM80_CONFIG_INTCLR 0x08 #define LM80_CONFIG_RESET 0x10 #define LM80_CONFIG_CHACLR 0x20 #define LM80_CONFIG_GPO 0x40 #define LM80_CONFIG_INIT 0x80 #define LM80_R06_OSACTHI 0x02 #define LM80_R06_TEMPRES 0x08 #define LM80_R06_TEMP11 0xF0 #define LM80_R06_TEMP8 0x80 static int lm80_probe(LM_METHODS *); static float lm80_temp(LM_METHODS *, int); static int lm80_fanrpm(LM_METHODS *, int); static float lm80_volt(LM_METHODS *, int); #if defined(DEBUG) static void dumpreg( void ); #endif /*DEBUG*/ SENSOR lm80 = { "Nat.Semi.Con. Chip LM80", lm80_probe, lm80_temp, lm80_volt, lm80_fanrpm }; #define LM80_chkRegNum 20 /* Register checked for probing */ static int chkReg[] = { 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2B, 0x2D, 0x2F, 0x31, 0x33, 0x35, 0x37, 0x39, 0x3B, 0x3C, 0x3D, -1 }; /* * return 0 if not probed */ static int lm80_probe(LM_METHODS *method) { int n, dat, reg, save; if( method != &method_smb ) return 0; save = smb_slave; for (n = LM80_ADDR_START; n <= LM80_ADDR_END;) { if (!(smb_slave = get_smb_slave(n, LM80_ADDR_END))) goto ret0; else { if (method->Read(LM80_ISR2) & 0xC0) { n = smb_slave + 2; continue; } for (reg = 0x2A; reg <= 0x3D; reg++) { dat = method->Read(reg); if (method->Read(reg + 0x40) != dat || method->Read(reg + 0x80) != dat || method->Read(reg + 0xC0) != dat) break; } if (reg > 0x3D && chkReg_Probe(smb_slave, "Probing LM80 chip:\n", chkReg, method) >= LM80_chkRegNum) goto ret1; else n = smb_slave + 2; } } ret0: smb_slave = save; return 0; ret1: if((method->Read(LM80_CONFIG ) & LM80_CONFIG_START) == 0) { method->Write(LM80_CONFIG, LM80_CONFIG_RESET); method->Write(LM80_CONFIG, LM80_CONFIG_START); } method->Write(LM80_FANDIV, (method->Read(LM80_FANDIV) & 0x3C) | 0x40); method->Write(LM80_RESOLUTION, LM80_R06_TEMPRES | LM80_R06_OSACTHI); #if defined(DEBUG) dumpreg(); #endif /*DEBUG*/ kill_smb_slave(smb_slave); return 1; } /*! * \retval 0xFFFF no sensor * \retval other temperature * no = 0,1,2,... */ static float lm80_temp(LM_METHODS *method, int no) { int reg, val, sft; float ret; if (no != 0) return 0xFFFF; reg = method->Read(LM80_RESOLUTION); val = method->Read(LM80_TEMPERATURE); sft = ((( reg & LM80_R06_TEMPRES ) >> 3 ) * 3 ) + 1; val <<= sft; val |= reg >> (8 - sft); ret = (float)val; if (reg & LM80_R06_TEMPRES) ret *= 0.0625; else ret *= 0.5; return ret; } /*! * \retval 0x0000FFFF no sensor * no = 0,1,2,... */ static float lm80_volt(LM_METHODS *method, int no) { const float r1[7] = { 23.7, 23.7, 22.1, 24, 160, 27, 180 }; const float r2[7] = { 75, 75, 30, 14.7, 30.1, 3.4, 42.2 }; float vout, val; if( no < 0 || 6 < no ) return 0xFFFF; vout = method->Read(LM80_IN0 + no); vout *= 0.01; /*LSB is 10mv*/ /* *VOUT = ( VCC * R2 ) / ( R1 + R2 ) *VCC = ( VOUT * ( R1 + R2 )) / R2 */ val = ( vout * ( r1[no] + r2[no] )) / r2[no]; if( no >= 5 ) val = ( val - 5 ) * -1; /* * ((( vout * ( r1[no] + r2[no] )) / r2[no] ) - 5 ) * -1; */ return val; } /*! * \retval 0x0000FFFF no sensor * \retval 0x00010000 unknown (maybe no sensor) * no = 0,1,2,... * * Clock is 22.5kHz (22,500 x 60 = 1350000 counts/minute) */ static int lm80_fanrpm(LM_METHODS *method, int no) { int reg, val; int div, sft; long rpm; #if defined(DEBUG) printf("lm80_fanrpm(): no=%d\n", no); #endif /*DEBUG*/ if (no < 0 || 1 < no) return 0xFFFF; reg = method->Read(LM80_FANDIV); val = method->Read(LM80_FANRPM1 + no); #if defined(DEBUG) printf("lm80_fanrpm(): reg=0x%02X, val=0x%02X\n", reg, val); #endif /*DEBUG*/ sft = (no + 1) * 2; div = (reg >> sft) & 0x03; #if defined(DEBUG) printf( "lm80_fanrpm(): sft=%d, div=%d\n", sft, div ); #endif /*DEBUG*/ if (val == 0xFF) { if (div < 3) { reg += 1 << sft; (*method->Write)(LM80_FANDIV, reg); } #if defined(DEBUG) printf( "lm80_fanrpm(): write new reg 0x%02X\n", reg ); #endif /*DEBUG*/ return 0x10000; } #if defined(DEBUG) printf( "lm80_fanrpm(): val=%d, div=%d\n", val, div ); #endif /*DEBUG*/ rpm = 1350000 / ( val * ( 1 << div )); return rpm; } #if defined(DEBUG) static void dumpreg(void) { int cmd; printf( "SlaveAddress=0x%04X", smb_slave ); #if 0 printf( "Reg00 :" ); for( cmd=0; cmd<=6; cmd++ ) printf( " 0x%02X", (*method_smb.Read)(cmd)); #endif for( cmd=0x00; cmd<=0x7F; cmd++ ) { if(( cmd & 0x0F ) == 0 ) printf( "\nReg%02X :", cmd ); printf("%c%02X", ((cmd&0x0F)==8)?'-':' ',(*method_smb.Read)(cmd)); } printf("\n"); } #endif /*DEBUG*/ xmbmon-2.05/sensors.c0000644000175000017500000001036510052423122014116 0ustar agiagi00000000000000/* functions used commonly in each hardware monitor module */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef DEBUG #define SMB_DEBUG #endif #include #define INCLUDE_HWM_MODULE #include "sensors.h" #undef INCLUDE_HWM_MODULE /* external (global) data */ extern int debug_flag; extern int smb_base; extern int smb_slave; extern int smb_wbtemp1, smb_wbtemp2; extern LM_METHODS method_smb; /* SMBus Slave Address Candidates, global */ int numSMBSlave = 0; int canSMBSlave[128]; int chkReg_Probe(int slave, char *comment, int Reg[], LM_METHODS *method) { int i, n, r, ret = 0; if (slave > 0 && debug_flag > 1) fprintf(stderr, "Set SMBus slave address: 0x%02X\n", slave); if (debug_flag > 1) fprintf(stderr, "%s", comment); for (i = 0; (r = Reg[i]) != -1; i++) { n = method->Read(r); if (n != 0xFF) ++ret; if (debug_flag > 1) { if ((i + 1) % 4 == 0) fprintf(stderr, " CR%02X:0x%02X\n", r, n); else fprintf(stderr, " CR%02X:0x%02X,", r, n); } } if (debug_flag > 1) { if(( i & 3 ) != 0 ) fprintf( stderr, "\n" ) ; } #if 0 if (debug_flag > 1) fprintf(stderr, "\n"); #endif return ret; } int chkReg_Probe_strict(int Reg[], LM_METHODS *method) { int i, r; for (i = 0; (r = Reg[i]) != -1; i++) { if (method->Read(r) == 0xFF) return 0; } return 1; } /* Register checked for scanning smbus */ static int smb_scanReg[] = { 0x00, 0x01, 0x20, 0x40, 0x48, -1 }; /* Blacklist slave address, do not access */ static int blacklist[] = { 0xD2, -1 }; int scan_smbus(int addr_start, int addr_end, int result[]) { int i, j, n, r, save, reg, ret = 0; LM_METHODS *method = &method_smb; #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL) #else if (smb_base <= 0) return ret; #endif addr_start = 2 * (addr_start/2); if (addr_start <= 0) addr_start = 2; if (addr_end > 0xFE) addr_end = 0xFE; save = smb_slave; method->Open(); for (j = addr_start, ret = 0; j <= addr_end; j += 2) { smb_slave = j; for (i = 0; blacklist[i] != -1; i++) if (j == blacklist[i]) goto skip; #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, "SLAVE::0x%02X\n", j); #endif for (i = 0, n = 0; (r = smb_scanReg[i]) != -1; i++) { /* != 0xFF is not enough; need to check more, but ... */ if (((reg = method->Read(r)) & 0xFF) != 0xFF) ++n; #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, " 0x%02X:0x%02X\n", r, reg); #endif } if (n) { result[ret++] = j; if (debug_flag > 1) fprintf(stderr, " SMBus slave 0x%02X(0x%02X) found...\n", j, j/2); } skip: continue; } method->Close(); smb_slave = save; return ret; } int find_smb_dev(void) { return (numSMBSlave = scan_smbus(0x00, 0xFE, canSMBSlave)); } int get_smb_slave(int start, int end) { int i; for (i = 0; i < numSMBSlave; i++) { if (start <= canSMBSlave[i] && canSMBSlave[i] <= end) break; } if (i >= numSMBSlave) return 0; else return canSMBSlave[i]; } void kill_smb_slave(int slave) { int i; for (i = 0; i < numSMBSlave; i++) { if (slave == canSMBSlave[i]) { canSMBSlave[i] = 0xFF; break; } } } int set_smb_Extemp(int start, int end, int *temp1, int *temp2) { int i, temp1_flag = 1, temp2_flag = 1; /* disable! */ for (i = 0; i < numSMBSlave; i++) { if (start <= canSMBSlave[i] && canSMBSlave[i] <= end) { if (temp1_flag) { temp1_flag = 0; /* enabled! */ *temp1 = canSMBSlave[i]; } else if (temp2_flag) { temp2_flag = 0; /* enabled! */ *temp2 = canSMBSlave[i]; } } } return ((temp1_flag << 1) + temp2_flag); } void info_Extemp(LM_METHODS *method, int temp1, int temp2) { if (!temp1) { if (debug_flag > 1) { if (method == &method_smb) fprintf(stderr,"* Temp1 exists at 0x%02X,", smb_wbtemp1); else fprintf(stderr,"* Temp1 exists at Bank 1,"); } } else { if (debug_flag > 1) fprintf(stderr,"* NO Temp1,"); } if (!temp2) { if (debug_flag > 1) { if (method == &method_smb) fprintf(stderr," Temp2 exists at 0x%02X.\n", smb_wbtemp2); else fprintf(stderr," Temp2 exists at Bank 2.\n"); } } else { if (debug_flag > 1) fprintf(stderr," NO Temp2.\n"); } } xmbmon-2.05/io_static.c0000644000175000017500000000045410104615160014401 0ustar agiagi00000000000000/* static open/close IO routines used some places */ #include "io_cpu.h" static int OpenIO() { if (iopl_counter == 0) { if (SET_IOPL() < 0) return -1; } ++iopl_counter; return 0; } static void CloseIO() { if (iopl_counter == 1) RESET_IOPL(); if (iopl_counter > 0) --iopl_counter; } xmbmon-2.05/smbus_ali.c0000644000175000017500000001424610110432223014377 0ustar agiagi00000000000000 /* SMB handling routines for ALi 1535D+, by YRS 2002.07. Information on how to access SMBus is provided by ":p araffin.(Yoneya)", MANY THANKS!! SMBus IO method: smb_base : Base Address addr : Slave Device Address cmd : Command Register Note that SMBus Slave Device Address is totall 1byte data, whose upper 7bits is for address and the lowest bit for read (=1) and for write (=0). The input "addr" in the following routines is this 1byte data, where the lowest bit can be either 0 or 1. 7 0 +-+-+-+-+-+-+-+-+ | Slave addr. |f| f = 0 for write, =1 for read. +-+-+-+-+-+-+-+-+ Do not confuse "Slave address" which is "addr(here)"/2! */ #ifdef SMB_DEBUG extern int debug_flag; #include #endif #include #include #include #include "smbuses.h" #include "io_cpu.h" #define LSB 0x01 #define LOOP_COUNT 0x2000 /* command address */ #define SMBHSTS 0x0 /* SMBus host/slave status register */ #define SMBHCTRL 0x1 /* SMBus host/slave control register */ #define SMBSTART 0x2 /* start to generate programmed cycle */ #define SMBHADDR 0x3 /* host address register */ #define SMBHDATA0 0x4 /* data A register for host controller */ #define SMBHDATA1 0x5 /* data B register for host controller */ #define SMBHCMD 0x7 /* command register for host controller */ /* status flag */ #define SMBHSTS_WRONG 0x00 /* something wrong, restart */ #define SMBHSTS_IDLE 0x04 /* host idle, can put commands */ #define SMBHSTS_BUSY 0x08 /* host busy */ #define SMBHSTS_DONE 0x10 /* command completed */ #define SMBHSTS_DEVERR 0x20 /* device error */ #define SMBHSTS_BUSERR 0x40 /* bus collision or no response */ #define SMBHSTS_FAILED 0x80 /* failed bus transaction */ #define SMBHSTS_ALLERR 0xE0 /* all the bad error bits */ #define SMBHSTS_CLEAR 0xFF /* clear status */ /* control command number */ #define SMBHCTRL_HRESET 0x04 /* host reset */ #define SMBHCTRL_BRESET 0x08 /* entire bus reset */ #define SMBHCTRL_RESET 0x0C /* reset */ #define SMBHCTRL_BYTE 0x20 /* write/read byte */ #define SMBHCTRL_WORD 0x30 /* write/read word */ static int readbyte(int smb_base, int addr, int cmd) { u_char dat, saddr = 2*(addr/2); int i; top: for (i = 0; i < LOOP_COUNT; ++i) { OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; dat = INb((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_IDLE) goto step; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_RESET); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), (saddr | LSB)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_BYTE); WAIT; WAIT; OUTb((u_short) (smb_base + SMBSTART), 0xFF); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY)) break; } #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, " Readbyte: flag = 0x%02X, loop#:%04d", dat, i); #endif if (dat == SMBHSTS_WRONG) { OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_RESET); WAIT; WAIT; #ifdef SMB_DEBUG if (debug_flag > 1) fprintf(stderr, "\n OH! wrong ! = 0x%02X\n", dat); #endif goto top; } else if (dat & SMBHSTS_DONE) { dat = INb((u_short) (smb_base + SMBHDATA0)); WAIT; WAIT; return (dat & 0xFF); } else return -1; } static int readword(int smb_base, int addr, int cmd) { u_char dat, saddr = 2*(addr/2); int i; top: for (i = 0; i < LOOP_COUNT; ++i) { OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; dat = INb((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_IDLE) goto step; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_RESET); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), (saddr | LSB)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_WORD); WAIT; WAIT; OUTb((u_short) (smb_base + SMBSTART), 0xFF); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY)) break; } if (dat == SMBHSTS_WRONG) { OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_RESET); WAIT; WAIT; goto top; } else if (dat & SMBHSTS_DONE) { i = INb((u_short) (smb_base + SMBHDATA1)); WAIT; WAIT; dat = INb((u_short) (smb_base + SMBHDATA0)); WAIT; WAIT; return (((i << 8) + dat) & 0xFFFF); } else return -1; } static int writebyte(int smb_base, int addr, int cmd, int value) { u_char dat, saddr = 2*(addr/2); int i; for (i = 0; i < LOOP_COUNT; ++i) { OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; dat = INb((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_IDLE) goto step; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_RESET); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA0), (u_char) value); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_BYTE); WAIT; WAIT; OUTb((u_short) (smb_base + SMBSTART), 0xFF); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY)) break; } if (dat & SMBHSTS_DONE) return 0; else return -1; } static int writeword(int smb_base, int addr, int cmd, int value) { u_char dat, saddr = 2*(addr/2); int i; for (i = 0; i < LOOP_COUNT; ++i) { OUTb((u_short) smb_base, SMBHSTS_CLEAR); WAIT; WAIT; dat = INb((u_short) smb_base); WAIT; WAIT; if (dat & SMBHSTS_IDLE) goto step; } OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_RESET); WAIT; WAIT; step: OUTb((u_short) (smb_base + SMBHADDR), saddr); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCMD), (u_char) cmd); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA0), (u_char) (value & 0xFF)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHDATA1), (u_char) (value >> 8)); WAIT; WAIT; OUTb((u_short) (smb_base + SMBHCTRL), SMBHCTRL_WORD); WAIT; WAIT; OUTb((u_short) (smb_base + SMBSTART), 0xFF); WAIT; WAIT; for (i = 0; i < LOOP_COUNT; ++i) { dat = INb((u_short) smb_base); WAIT; WAIT; if (!(dat & SMBHSTS_BUSY)) break; } if (dat & SMBHSTS_DONE) return 0; else return -1; } struct smbus_io smbus_ali = { readbyte, readword, writebyte, writeword };