powerman-2.3.5.orig/0000755000000000000000000000000011205355435011201 5ustar powerman-2.3.5.orig/config/0000755000000000000000000000000011205355435012446 5ustar powerman-2.3.5.orig/config/ac_wrap.m40000644000000000000000000000140411015151010014301 0ustar ##***************************************************************************** ## $Id: ac_ncurses.m4,v 1.1.1.1 2003/09/05 16:05:42 achu Exp $ ##***************************************************************************** # AUTHOR: # Albert Chu # # SYNOPSIS: # AC_WRAP # # DESCRIPTION: # Check for wrap library # # WARNINGS: # This macro must be placed after AC_PROG_CC or equivalent. ##***************************************************************************** AC_DEFUN([AC_WRAP], [ AC_CHECK_LIB([wrap], [hosts_ctl], [ac_have_wrap=yes], [ac_have_wrap=no]) if test "$ac_have_wrap" = "yes"; then LIBWRAP="-lwrap" AC_DEFINE([HAVE_TCP_WRAPPERS], [1], [Define if you have tcp wrappers]) fi AC_SUBST(LIBWRAP) ]) powerman-2.3.5.orig/config/ac_genders.m40000644000000000000000000000200611015653007014773 0ustar ##***************************************************************************** ## $Id: ac_genders.m4,v 1.6 2005/05/10 22:39:40 achu Exp $ ##***************************************************************************** AC_DEFUN([AC_GENDERS], [ AC_MSG_CHECKING([for whether to build genders support]) AC_ARG_WITH([genders], AC_HELP_STRING([--with-genders], [Build genders support]), [ case "$withval" in no) ac_genders_test=no ;; yes) ac_genders_test=yes ;; *) AC_MSG_ERROR([bad value "$withval" for --with-genders]) ;; esac ] ) AC_MSG_RESULT([${ac_genders_test=no}]) if test "$ac_genders_test" = "yes"; then AC_CHECK_LIB([genders], [genders_handle_create], [ac_have_genders=yes], []) fi if test "$ac_have_genders" = "yes"; then AC_DEFINE([WITH_GENDERS], [1], [Define if you have genders.]) AC_CHECK_HEADERS( genders.h ) LIBGENDERS="-lgenders" ac_with_genders=yes else LIBGENDERS= ac_with_genders=no fi AC_SUBST(LIBGENDERS) ]) powerman-2.3.5.orig/config/missing0000755000000000000000000002557711015104475014060 0ustar #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: powerman-2.3.5.orig/config/ltmain.sh0000644000000000000000000060334311015104475014272 0ustar # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. # for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` # done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: powerman-2.3.5.orig/config/ac_forkpty.m40000644000000000000000000000202211015653007015040 0ustar ##***************************************************************************** ## $Id: ac_forkpty.m4,v 1.1.1.1 2003/09/05 16:05:42 achu Exp $ ##***************************************************************************** # AUTHOR: # Albert Chu # # SYNOPSIS: # AC_FORKPTY # # DESCRIPTION: # Check for forkpty # # WARNINGS: # This macro must be placed after AC_PROG_CC or equivalent. ##***************************************************************************** AC_DEFUN([AC_FORKPTY], [ AC_CHECK_FUNC([forkpty], [ac_have_forkpty=yes], [ac_have_forkpty=no]) if test "$ac_have_forkpty" = "no"; then AC_CHECK_LIB([util], [forkpty], [LIBFORKPTY=-lutil], AC_CHECK_LIB([bsd], [forkpty], [LIBFORKPTY=-lbsd])) if test -n "$LIBFORKPTY"; then ac_have_forkpty=yes else ac_have_forkpty=no fi fi if test "$ac_have_forkpty" = "yes"; then AC_DEFINE([HAVE_FORKPTY], [1], [Define if you have forkpty]) AC_CHECK_HEADERS( pty.h util.h ) fi AC_SUBST(LIBFORKPTY) ]) powerman-2.3.5.orig/config/depcomp0000755000000000000000000004224611015104475014026 0ustar #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2006-10-15.18 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software # Foundation, Inc. # This program 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, 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 Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: powerman-2.3.5.orig/config/ac_runas.m40000644000000000000000000000101411113345200014462 0ustar AC_DEFUN([AC_RUNAS], [ RUN_AS_USER="daemon" AC_MSG_CHECKING(user to run as) AC_ARG_WITH(user, AC_HELP_STRING([--with-user=username], [user for powerman daemon (daemon)]), [ case "${withval}" in yes|no) ;; *) RUN_AS_USER="${withval}" ;; esac], ) AC_DEFINE_UNQUOTED(RUN_AS_USER, "${RUN_AS_USER}", [Powerman daemon user]) AC_MSG_RESULT(${RUN_AS_USER}) AC_SUBST(RUN_AS_USER) ]) powerman-2.3.5.orig/config/ac_curses.m40000644000000000000000000000361611042726422014662 0ustar ##***************************************************************************** ## $Id: ac_curses.m4,v 1.1.1.1 2003/09/05 16:05:42 achu Exp $ ##***************************************************************************** # AUTHOR: # Mark Pulford # # SYNOPSIS: # AC_CURSES # # DESCRIPTION: # Detect SysV compatible curses, such as ncurses. # # Defines HAVE_CURSES_H or HAVE_NCURSES_H if curses is found. # LIBCURSES is also set with the required libary, but is not appended # to LIBS automatically. If no working curses libary is found # LIBCURSES will be left blank. # # This macro adds the option "--with-ncurses" to configure which can # force the use of ncurses or nothing at all. # #***************************************************************************** AC_DEFUN([AC_CURSES], [AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,) mp_save_LIBS="$LIBS" LIBCURSES="" if test "$with_ncurses" != yes then AC_CACHE_CHECK([for working curses], mp_cv_curses, [LIBS="$LIBS -lcurses" AC_TRY_LINK( [#include ], [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], mp_cv_curses=yes, mp_cv_curses=no)]) if test "$mp_cv_curses" = yes then AC_DEFINE([HAVE_CURSES_H],[],[Define if you have curses.h]) LIBCURSES="-lcurses" fi fi if test ! "$LIBCURSES" then AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses, [LIBS="$mp_save_LIBS -lncurses" AC_TRY_LINK( [#include ], [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ], mp_cv_ncurses=yes, mp_cv_ncurses=no)]) if test "$mp_cv_ncurses" = yes then AC_DEFINE([HAVE_NCURSES_H],[],[Define if you have ncurses.h]) LIBCURSES="-lncurses" fi fi LIBS="$mp_save_LIBS" AC_SUBST(LIBCURSES) ])dnl powerman-2.3.5.orig/config/ac_curl.m40000644000000000000000000000140011015151010014271 0ustar ##***************************************************************************** ## $Id: ac_ncurses.m4,v 1.1.1.1 2003/09/05 16:05:42 achu Exp $ ##***************************************************************************** # AUTHOR: # Jim Garlick # # SYNOPSIS: # AC_CURL # # DESCRIPTION: # Check for curl library # # WARNINGS: # This macro must be placed after AC_PROG_CC or equivalent. ##***************************************************************************** AC_DEFUN([AC_CURL], [ AC_CHECK_LIB([curl], [curl_easy_setopt], [ac_have_curl=yes], [ac_have_curl=no]) if test "$ac_have_curl" = "yes"; then LIBCURL="-lcurl" AC_DEFINE([HAVE_CURL], [1], [Define if you have libcurl]) fi AC_SUBST(LIBCURL) ]) powerman-2.3.5.orig/config/config.guess0000755000000000000000000012626011015104475014770 0ustar #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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, 2002, 2003, 2004, 2005 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 ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # 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 "$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 ; set_cc_for_build= ;' # 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 ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # 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 Pn.n version is a patched version. # 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/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; 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 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; 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 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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 ;; 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 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; 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 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # 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 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; 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 && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; 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 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????: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 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; 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 ;; *: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 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi 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 ;; *: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 ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 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 eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 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 && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 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 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; 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 | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; 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 | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; 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 ;; 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 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; 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 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # 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 ;; 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 #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; 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 ;; 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 ;; 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 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; 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 ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. 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 ;; 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 ;; 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 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; 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 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*: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 | S7501*:*: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; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *: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 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; 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 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *: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 ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *: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 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; 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\n"); 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 && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # 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 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; 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: powerman-2.3.5.orig/config/config.h.in0000644000000000000000000001206511115072462014471 0ustar /* config/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW /* Define if you have libcurl */ #undef HAVE_CURL /* Define if you have curses.h */ #undef HAVE_CURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if you have forkpty */ #undef HAVE_FORKPTY /* Define to 1 if you have the header file. */ #undef HAVE_GENDERS_H /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have ncurses.h */ #undef HAVE_NCURSES_H /* Define if you have poll */ #undef HAVE_POLL /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_PTY_H /* Define to 1 if the system has the type `socklen_t'. */ #undef HAVE_SOCKLEN_T /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSCALL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if you have tcp wrappers */ #undef HAVE_TCP_WRAPPERS /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UTIL_H /* Define to 1 if you have the file `AC_File'. */ #undef HAVE__DEV_PTC /* Define to 1 if you have the file `AC_File'. */ #undef HAVE__DEV_PTMX /* Define the project alias string (name-ver or name-ver-rel). */ #undef META_ALIAS /* Define the project author. */ #undef META_AUTHOR /* Define the project release date. */ #undef META_DATE /* Define the libtool library 'age' version information. */ #undef META_LT_AGE /* Define the libtool library 'current' version information. */ #undef META_LT_CURRENT /* Define the libtool library 'revision' version information. */ #undef META_LT_REVISION /* Define the project name. */ #undef META_NAME /* Define the project release. */ #undef META_RELEASE /* Define the project version. */ #undef META_VERSION /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Powerman daemon user */ #undef RUN_AS_USER /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define if you have genders. */ #undef WITH_GENDERS /* Define lsd_fatal_error */ #undef WITH_LSD_FATAL_ERROR_FUNC /* Define lsd_fatal_error */ #undef WITH_LSD_NOMEM_ERROR_FUNC /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Expansion of the "bindir" installation directory. */ #undef X_BINDIR /* Expansion of the "datadir" installation directory. */ #undef X_DATADIR /* Expansion of the "exec_prefix" installation directory. */ #undef X_EXEC_PREFIX /* Expansion of the "includedir" installation directory. */ #undef X_INCLUDEDIR /* Expansion of the "infodir" installation directory. */ #undef X_INFODIR /* Expansion of the "libdir" installation directory. */ #undef X_LIBDIR /* Expansion of the "libexecdir" installation directory. */ #undef X_LIBEXECDIR /* Expansion of the "localstatedir" installation directory. */ #undef X_LOCALSTATEDIR /* Expansion of the "mandir" installation directory. */ #undef X_MANDIR /* Expansion of the "oldincludedir" installation directory. */ #undef X_OLDINCLUDEDIR /* Expansion of the "prefix" installation directory. */ #undef X_PREFIX /* Expansion of the "sbindir" installation directory. */ #undef X_SBINDIR /* Expansion of the "sharedstatedir" installation directory. */ #undef X_SHAREDSTATEDIR /* Expansion of the "sysconfdir" installation directory. */ #undef X_SYSCONFDIR /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `int' if doesn't define. */ #undef uid_t powerman-2.3.5.orig/config/ac_pkgconfig.m40000644000000000000000000000137611113333225015320 0ustar # Thanks to Arnaud Quette for this bit of m4 AC_DEFUN([AC_PKGCONFIG], [ pkgconfigdir='${libdir}/pkgconfig' AC_MSG_CHECKING(whether to install pkg-config *.pc files) AC_ARG_WITH(pkgconfig-dir, AC_HELP_STRING([--with-pkgconfig-dir=PATH], [where to install pkg-config *.pc files (EPREFIX/lib/pkgconfig)]), [ case "${withval}" in yes|auto) ;; no) pkgconfigdir="" ;; *) pkgconfigdir="${withval}" ;; esac ], ) if test -n "${pkgconfigdir}"; then AC_MSG_RESULT(${pkgconfigdir}) else AC_MSG_RESULT(no) fi AM_CONDITIONAL(WITH_PKG_CONFIG, test -n "${pkgconfigdir}") AC_SUBST(pkgconfigdir) ]) powerman-2.3.5.orig/config/ac_httppower.m40000644000000000000000000000137111015151046015400 0ustar ##***************************************************************************** ## $Id: ac_genders.m4,v 1.6 2005/05/10 22:39:40 achu Exp $ ##***************************************************************************** AC_DEFUN([AC_HTTPPOWER], [ AC_MSG_CHECKING([for whether to build httppower executable]) AC_ARG_WITH([httppower], AC_HELP_STRING([--with-httppower], [Build httppower executable]), [ case "$withval" in no) ac_httppower_test=no ;; yes) ac_httppower_test=yes ;; *) AC_MSG_ERROR([bad value "$withval" for --with-httppower]) ;; esac ] ) AC_MSG_RESULT([${ac_httppower_test=no}]) if test "$ac_httppower_test" = "yes"; then ac_with_httppower=yes else ac_with_httppower=no fi ]) powerman-2.3.5.orig/config/install-sh0000755000000000000000000003160011015104475014445 0ustar #!/bin/sh # install - install a program, script, or datafile scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # 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. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment 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}" posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix=/ ;; -*) prefix=./ ;; *) prefix= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # 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 $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: powerman-2.3.5.orig/config/x_ac_meta.m40000644000000000000000000000673111115072462014633 0ustar ##***************************************************************************** ## $Id: x_ac_meta.m4 525 2006-07-13 19:30:13Z dun $ ##***************************************************************************** # AUTHOR: # Chris Dunlap # # SYNOPSIS: # X_AC_META # # DESCRIPTION: # Read metadata from the META file. ##***************************************************************************** AC_DEFUN([X_AC_META], [ AC_MSG_CHECKING([metadata]) META="$srcdir/META" _x_ac_meta_got_file=no if test -f "$META"; then _x_ac_meta_got_file=yes META_NAME=_X_AC_META_GETVAL([(?:NAME|PROJECT|PACKAGE)]); if test -n "$META_NAME"; then AC_DEFINE_UNQUOTED([META_NAME], ["$META_NAME"], [Define the project name.] ) AC_SUBST([META_NAME]) fi META_VERSION=_X_AC_META_GETVAL([VERSION]); if test -n "$META_VERSION"; then AC_DEFINE_UNQUOTED([META_VERSION], ["$META_VERSION"], [Define the project version.] ) AC_SUBST([META_VERSION]) fi META_RELEASE=_X_AC_META_GETVAL([RELEASE]); if test -n "$META_RELEASE"; then AC_DEFINE_UNQUOTED([META_RELEASE], ["$META_RELEASE"], [Define the project release.] ) AC_SUBST([META_RELEASE]) fi if test -n "$META_NAME" -a -n "$META_VERSION"; then META_ALIAS="$META_NAME-$META_VERSION" test -n "$META_RELEASE" -a "$META_RELEASE" != "1" \ && META_ALIAS="$META_ALIAS-$META_RELEASE" AC_DEFINE_UNQUOTED([META_ALIAS], ["$META_ALIAS"], [Define the project alias string (name-ver or name-ver-rel).] ) AC_SUBST([META_ALIAS]) fi META_DATE=_X_AC_META_GETVAL([DATE]); if test -n "$META_DATE"; then AC_DEFINE_UNQUOTED([META_DATE], ["$META_DATE"], [Define the project release date.] ) AC_SUBST([META_DATE]) fi META_AUTHOR=_X_AC_META_GETVAL([AUTHOR]); if test -n "$META_AUTHOR"; then AC_DEFINE_UNQUOTED([META_AUTHOR], ["$META_AUTHOR"], [Define the project author.] ) AC_SUBST([META_AUTHOR]) fi m4_pattern_allow([^LT_(CURRENT|REVISION|AGE)$]) META_LT_CURRENT=_X_AC_META_GETVAL([LT_CURRENT]); META_LT_REVISION=_X_AC_META_GETVAL([LT_REVISION]); META_LT_AGE=_X_AC_META_GETVAL([LT_AGE]); if test -n "$META_LT_CURRENT" \ -o -n "$META_LT_REVISION" \ -o -n "$META_LT_AGE"; then test -n "$META_LT_CURRENT" || META_LT_CURRENT="0" test -n "$META_LT_REVISION" || META_LT_REVISION="0" test -n "$META_LT_AGE" || META_LT_AGE="0" AC_DEFINE_UNQUOTED([META_LT_CURRENT], ["$META_LT_CURRENT"], [Define the libtool library 'current' version information.] ) AC_DEFINE_UNQUOTED([META_LT_REVISION], ["$META_LT_REVISION"], [Define the libtool library 'revision' version information.] ) AC_DEFINE_UNQUOTED([META_LT_AGE], ["$META_LT_AGE"], [Define the libtool library 'age' version information.] ) AC_SUBST([META_LT_CURRENT]) AC_SUBST([META_LT_REVISION]) AC_SUBST([META_LT_AGE]) fi fi AC_MSG_RESULT([$_x_ac_meta_got_file]) ] ) AC_DEFUN([_X_AC_META_GETVAL], [`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key@<:@:=@:>@//i;"\ -e "s/^((?:@<:@^'\"#@:>@*(?:(@<:@'\"@:>@)@<:@^\2@:>@*\2)*)*)#.*/\\@S|@1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(@<:@'\"@:>@)(.*)\1/\\@S|@2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ '$1' $META`]dnl ) powerman-2.3.5.orig/config/x_ac_expand_install_dirs.m40000644000000000000000000000637211023600550017725 0ustar ##***************************************************************************** ## $Id: x_ac_expand_install_dirs.m4 494 2006-05-08 22:59:28Z dun $ ##***************************************************************************** # AUTHOR: # Chris Dunlap # # SYNOPSIS: # X_AC_EXPAND_INSTALL_DIRS # # DESCRIPTION: # Expand the installation directory variables. ##***************************************************************************** AC_DEFUN([X_AC_EXPAND_INSTALL_DIRS], [ AC_MSG_CHECKING([installation directory variables]) _x_ac_expand_install_dirs_prefix="$prefix" test "$prefix" = NONE && prefix="$ac_default_prefix" _x_ac_expand_install_dirs_exec_prefix="$exec_prefix" test "$exec_prefix" = NONE && exec_prefix="$prefix" eval X_PREFIX="$prefix" AC_DEFINE_UNQUOTED([X_PREFIX], ["$X_PREFIX"], [Expansion of the "prefix" installation directory.]) AC_SUBST([X_PREFIX]) eval X_EXEC_PREFIX="$exec_prefix" AC_DEFINE_UNQUOTED([X_EXEC_PREFIX], ["$X_EXEC_PREFIX"], [Expansion of the "exec_prefix" installation directory.]) AC_SUBST([X_EXEC_PREFIX]) eval X_BINDIR="$bindir" AC_DEFINE_UNQUOTED([X_BINDIR], ["$X_BINDIR"], [Expansion of the "bindir" installation directory.]) AC_SUBST([X_BINDIR]) eval X_SBINDIR="$sbindir" AC_DEFINE_UNQUOTED([X_SBINDIR], ["$X_SBINDIR"], [Expansion of the "sbindir" installation directory.]) AC_SUBST([X_SBINDIR]) eval X_LIBEXECDIR="$libexecdir" AC_DEFINE_UNQUOTED([X_LIBEXECDIR], ["$X_LIBEXECDIR"], [Expansion of the "libexecdir" installation directory.]) AC_SUBST([X_LIBEXECDIR]) eval X_DATADIR="$datadir" AC_DEFINE_UNQUOTED([X_DATADIR], ["$X_DATADIR"], [Expansion of the "datadir" installation directory.]) AC_SUBST([X_DATADIR]) eval X_SYSCONFDIR="$sysconfdir" AC_DEFINE_UNQUOTED([X_SYSCONFDIR], ["$X_SYSCONFDIR"], [Expansion of the "sysconfdir" installation directory.]) AC_SUBST([X_SYSCONFDIR]) eval X_SHAREDSTATEDIR="$sharedstatedir" AC_DEFINE_UNQUOTED([X_SHAREDSTATEDIR], ["$X_SHAREDSTATEDIR"], [Expansion of the "sharedstatedir" installation directory.]) AC_SUBST([X_SHAREDSTATEDIR]) eval X_LOCALSTATEDIR="$localstatedir" AC_DEFINE_UNQUOTED([X_LOCALSTATEDIR], ["$X_LOCALSTATEDIR"], [Expansion of the "localstatedir" installation directory.]) AC_SUBST([X_LOCALSTATEDIR]) eval X_LIBDIR="$libdir" AC_DEFINE_UNQUOTED([X_LIBDIR], ["$X_LIBDIR"], [Expansion of the "libdir" installation directory.]) AC_SUBST([X_LIBDIR]) eval X_INCLUDEDIR="$includedir" AC_DEFINE_UNQUOTED([X_INCLUDEDIR], ["$X_INCLUDEDIR"], [Expansion of the "includedir" installation directory.]) AC_SUBST([X_INCLUDEDIR]) eval X_OLDINCLUDEDIR="$oldincludedir" AC_DEFINE_UNQUOTED([X_OLDINCLUDEDIR], ["$X_OLDINCLUDEDIR"], [Expansion of the "oldincludedir" installation directory.]) AC_SUBST([X_OLDINCLUDEDIR]) eval X_INFODIR="$infodir" AC_DEFINE_UNQUOTED([X_INFODIR], ["$X_INFODIR"], [Expansion of the "infodir" installation directory.]) AC_SUBST([X_INFODIR]) eval X_MANDIR="$mandir" AC_DEFINE_UNQUOTED([X_MANDIR], ["$X_MANDIR"], [Expansion of the "mandir" installation directory.]) AC_SUBST([X_MANDIR]) prefix="$_x_ac_expand_install_dirs_prefix" exec_prefix="$_x_ac_expand_install_dirs_exec_prefix" AC_MSG_RESULT([yes]) ]) powerman-2.3.5.orig/config/compile0000755000000000000000000000717311015104475014027 0ustar #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: powerman-2.3.5.orig/config/config.sub0000755000000000000000000007746011015104475014442 0ustar #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-09-20' # 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # 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. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. 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.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; 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 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) 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 | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -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/'` ;; -sco5v6*) # 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/'` ;; -udk*) 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 ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; 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. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-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*86 | x86_64) 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. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; 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 | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; 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 ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-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 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; 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 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; 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 ;; necv70) basic_machine=v70-nec os=-sysv ;; 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 ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; 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 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-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/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; 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 ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; 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 ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; 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. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) 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* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -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|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -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 score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; 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 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-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 ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) 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 ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: powerman-2.3.5.orig/Makefile.in0000644000000000000000000005101211115072462013241 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/config/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO config/compile config/config.guess config/config.sub \ config/depcomp config/install-sh config/ltmain.sh \ config/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/ac_curl.m4 \ $(top_srcdir)/config/ac_curses.m4 \ $(top_srcdir)/config/ac_forkpty.m4 \ $(top_srcdir)/config/ac_genders.m4 \ $(top_srcdir)/config/ac_httppower.m4 \ $(top_srcdir)/config/ac_pkgconfig.m4 \ $(top_srcdir)/config/ac_runas.m4 \ $(top_srcdir)/config/ac_wrap.m4 \ $(top_srcdir)/config/x_ac_expand_install_dirs.m4 \ $(top_srcdir)/config/x_ac_meta.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GCCWARN = @GCCWARN@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURSES = @LIBCURSES@ LIBFORKPTY = @LIBFORKPTY@ LIBGENDERS = @LIBGENDERS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBWRAP = @LIBWRAP@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ META_ALIAS = @META_ALIAS@ META_AUTHOR = @META_AUTHOR@ META_DATE = @META_DATE@ META_LT_AGE = @META_LT_AGE@ META_LT_CURRENT = @META_LT_CURRENT@ META_LT_REVISION = @META_LT_REVISION@ META_NAME = @META_NAME@ META_RELEASE = @META_RELEASE@ META_VERSION = @META_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ WITH_HTTPPOWER_FALSE = @WITH_HTTPPOWER_FALSE@ WITH_HTTPPOWER_TRUE = @WITH_HTTPPOWER_TRUE@ WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ X_BINDIR = @X_BINDIR@ X_DATADIR = @X_DATADIR@ X_EXEC_PREFIX = @X_EXEC_PREFIX@ X_INCLUDEDIR = @X_INCLUDEDIR@ X_INFODIR = @X_INFODIR@ X_LIBDIR = @X_LIBDIR@ X_LIBEXECDIR = @X_LIBEXECDIR@ X_LOCALSTATEDIR = @X_LOCALSTATEDIR@ X_MANDIR = @X_MANDIR@ X_OLDINCLUDEDIR = @X_OLDINCLUDEDIR@ X_PREFIX = @X_PREFIX@ X_SBINDIR = @X_SBINDIR@ X_SHAREDSTATEDIR = @X_SHAREDSTATEDIR@ X_SYSCONFDIR = @X_SYSCONFDIR@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SUBDIRS = etc man scripts src lib test EXTRA_DIST = DISCLAIMER META all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config/config.h: config/stamp-h1 @if test ! -f $@; then \ rm -f config/stamp-h1; \ $(MAKE) config/stamp-h1; \ else :; fi config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status @rm -f config/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config/config.h $(top_srcdir)/config/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f config/stamp-h1 touch $@ distclean-hdr: -rm -f config/config.h config/stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/config $(distdir)/lib $(distdir)/man $(distdir)/scripts @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: powerman-2.3.5.orig/TODO0000644000000000000000000000255411027737652011706 0ustar * Add option to not maintain persistant connections to RPC's, e.g. log out after a timeout period and login again at the next command. * Store scripts in a list and search the list for the script name, rather than hard code the list. Make it possible to execute arbitrary scripts that are device specific, e.g. "pm --script scriptname". * Power sequencing. Provide a way of expressing the max number of outlets or power control devices which can be powered on in parallel. * Client should have option for verifying soft power status (expand hostranges and issue warnings where plug is on but node is off). Needs to be optional since would double cluster query latency. * Powermand should execute logoff scripts on devices upon receipt of a signal (with timeout). * Redesign the device language to be more general. * Turn off debugging in production release * Clean up argument passing into and results out of scripts * Work in something to allow error messages when running 'pm -1' and similar power control commands. Currently, on error, powerman will always output "Command Successful". * Make Powerman genders aware (add plug-in support like pdsh) [Trent D'Hooge] * Generate error if %s appears in script where it is undefined [Adam Bertsch] * Device timeout should be per expect line [Brian J. Murrell] * Allow %s to appear multiple times [Brian J. Murrell] powerman-2.3.5.orig/autogen.sh0000755000000000000000000000054111115072462013176 0ustar #!/bin/sh echo "Running aclocal ... " aclocal -I config echo "Running libtoolize ... " libtoolize --automake --copy echo "Running autoheader ... " autoheader echo "Running automake ... " automake --copy --add-missing echo "Running autoconf ... " autoconf echo "Cleaning up ..." mv aclocal.m4 config/ rm -rf autom4te.cache echo "Now run ./configure." powerman-2.3.5.orig/scripts/0000755000000000000000000000000011205355434012667 5ustar powerman-2.3.5.orig/scripts/Makefile.in0000644000000000000000000002602211172212766014741 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = scripts DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/powerman.init.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/ac_curl.m4 \ $(top_srcdir)/config/ac_curses.m4 \ $(top_srcdir)/config/ac_forkpty.m4 \ $(top_srcdir)/config/ac_genders.m4 \ $(top_srcdir)/config/ac_httppower.m4 \ $(top_srcdir)/config/ac_pkgconfig.m4 \ $(top_srcdir)/config/ac_runas.m4 \ $(top_srcdir)/config/ac_wrap.m4 \ $(top_srcdir)/config/x_ac_expand_install_dirs.m4 \ $(top_srcdir)/config/x_ac_meta.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = powerman.init SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GCCWARN = @GCCWARN@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURSES = @LIBCURSES@ LIBFORKPTY = @LIBFORKPTY@ LIBGENDERS = @LIBGENDERS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBWRAP = @LIBWRAP@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ META_ALIAS = @META_ALIAS@ META_AUTHOR = @META_AUTHOR@ META_DATE = @META_DATE@ META_LT_AGE = @META_LT_AGE@ META_LT_CURRENT = @META_LT_CURRENT@ META_LT_REVISION = @META_LT_REVISION@ META_NAME = @META_NAME@ META_RELEASE = @META_RELEASE@ META_VERSION = @META_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ WITH_HTTPPOWER_FALSE = @WITH_HTTPPOWER_FALSE@ WITH_HTTPPOWER_TRUE = @WITH_HTTPPOWER_TRUE@ WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ X_BINDIR = @X_BINDIR@ X_DATADIR = @X_DATADIR@ X_EXEC_PREFIX = @X_EXEC_PREFIX@ X_INCLUDEDIR = @X_INCLUDEDIR@ X_INFODIR = @X_INFODIR@ X_LIBDIR = @X_LIBDIR@ X_LIBEXECDIR = @X_LIBEXECDIR@ X_LOCALSTATEDIR = @X_LOCALSTATEDIR@ X_MANDIR = @X_MANDIR@ X_OLDINCLUDEDIR = @X_OLDINCLUDEDIR@ X_PREFIX = @X_PREFIX@ X_SBINDIR = @X_SBINDIR@ X_SHAREDSTATEDIR = @X_SHAREDSTATEDIR@ X_SYSCONFDIR = @X_SYSCONFDIR@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ EXTRA_DIST = \ powerman.init all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh powerman.init: $(top_builddir)/config.status $(srcdir)/powerman.init.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-local .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-info-am uninstall-local install-data-local: -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(sysconfdir)/init.d $(top_srcdir)/config/install-sh -m 755 $(srcdir)/powerman.init \ $(DESTDIR)$(sysconfdir)/init.d/powerman -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(libdir)/stonith/plugins/external $(top_srcdir)/config/install-sh -m 755 $(srcdir)/stonith-powerman \ $(DESTDIR)$(libdir)/stonith/plugins/external/powerman -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(localstatedir)/run -$(top_srcdir)/config/install-sh -o $(RUN_AS_USER) -m 755 -d \ $(DESTDIR)$(localstatedir)/run/powerman uninstall-local: $(RM) $(DESTDIR)$(sysconfdir)/init.d/powerman $(RM) $(DESTDIR)$(libdir)/stonith/plugins/external/powerman # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: powerman-2.3.5.orig/scripts/stonith-powerman0000755000000000000000000000251411172212766016140 0ustar #!/bin/bash # heartbeat STONITH module for powerman PATH=/bin:/usr/sbin:$PATH #ha_logger -t heartbeat "powerman stonith agent called with args: $*" case $1 in gethosts) exec pm -h $serverhost -lx ;; on) exec pm -h $serverhost -1 $2 ;; off) exec pm -h $serverhost -0 $2 ;; reset) if [ "$poweroff" == "1" ]; then exec pm -h $serverhost -0 $2 else exec pm -h $serverhost -c $2 fi ;; status) exec pm -h $serverhost -l >/dev/null ;; getconfignames) echo serverhost echo poweroff exit 0 ;; getinfo-devid|getinfo-devname|getinfo-devdescr) echo "powerman STONITH device" exit 0 ;; getinfo-devurl) echo "http://powerman.sourceforge.net/" exit 0 ;; getinfo-xml) cat < host:port of powerman server Specify the host:port of the powerman server, e.g. pmserver:10101 Power off when given reset command For V1 heartbeat which always resets to fence, power off when given the reset command. PMEOL exit 0 ;; *) exit 1 ;; esac powerman-2.3.5.orig/scripts/powerman.init.in0000644000000000000000000003360611155267246016030 0ustar #!/bin/sh ############################################################################### # $Id: powerman.init.in 808 2008-01-09 19:20:23Z dun $ ############################################################################### # Originally written by Chris Dunlap for ConMan: # Copyright (C) 2007-2008 Lawrence Livermore National Security, LLC. # Copyright (C) 2001-2007 The Regents of the University of California. # UCRL-CODE-2002-009. ############################################################################### # chkconfig: 2345 95 5 # Description: Start/Stop the PowerMan (remote power manager) daemon. ############################################################################### ### BEGIN INIT INFO # Provides: powerman # Required-Start: $local_fs $named $network # Required-Stop: $local_fs $named $network # Should-Start: $remote_fs $syslog $time # Should-Stop: $remote_fs $syslog $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop the PowerMan (remote power manager) daemon. ### END INIT INFO ############################################################################### unset DESC DAEMON DAEMON_ARGS CONFIG PIDFILE NICE USER SIGHUP_RELOAD prefix="@prefix@" exec_prefix="@exec_prefix@" sbindir="@sbindir@" sysconfdir="@sysconfdir@" localstatedir="@localstatedir@" DESC="PowerMan" DAEMON="$sbindir/powermand" #DAEMON_ARGS= CONFIG=$sysconfdir/powerman/powerman.conf PIDFILE="$localstatedir/run/powerman/powermand.pid" #NICE= USER=@RUN_AS_USER@ #SIGHUP_RELOAD= ############################################################################### service_init () { # Determine the system type and initialize the environment. # # Note that the shell positional parameters must be preserved when calling # this function in order for SuSE to initialize its environment properly. ## PATH=/sbin:/usr/sbin:/bin:/usr/bin DAEMON_NAME="`basename \"$DAEMON\"`" SCRIPT_NAME="`basename \"$0\" .init | sed 's/^[SK][0-9][0-9]*//'`" SIGTERM_TIMEOUT="3" STATUS=0 # Read configuration defaults to override variables: # $DAEMON_ARGS, $CONFIG, $PIDFILE, $USER, $NICE, $SIGHUP_RELOAD ## for dir in "$sysconfdir/default" "$sysconfdir/sysconfig"; do [ -r "$dir/$SCRIPT_NAME" ] && . "$dir/$SCRIPT_NAME" done [ -z "$DAEMON_ARGS" -a -n "$OPTIONS" ] && DAEMON_ARGS="$OPTIONS" [ "`id | sed 's/^uid=\([0-9]*\).*/\1/'`" -ne 0 ] && unset USER expr -- "$NICE" : '[0-9]*$' >/dev/null 2>&1 && NICE="+$NICE" [ -n "$SIGHUP_RELOAD" -a "$SIGHUP_RELOAD" != 0 ] \ && RELOAD=1 || unset RELOAD if [ -f /etc/debian_version -a -x /sbin/start-stop-daemon ]; then SYSTEM="DEBIAN" [ -x "$DAEMON" ] || exit 0 # pkg removed but not purged [ -r /etc/default/rcS ] && . /etc/default/rcS [ -r /lib/init/vars.sh ] && . /lib/init/vars.sh [ -r /lib/lsb/init-functions ] && . /lib/lsb/init-functions elif [ -f /etc/redhat-release -a -r /etc/init.d/functions ]; then SYSTEM="REDHAT" . /etc/init.d/functions RH_SUBSYS="/var/lock/subsys/$DAEMON_NAME" elif [ -f /etc/SuSE-release -a -r /etc/rc.status ]; then SYSTEM="SUSE" . /etc/rc.status rc_reset elif [ -r /lib/lsb/init-functions ]; then SYSTEM="LSB" . /lib/lsb/init-functions else SYSTEM="OTHER" fi # Exit if the package has been removed. ## [ -x "$DAEMON" ] || exit 5 # LSB: program not installed # Exit if the configuration has been removed. ## [ -z "$CONFIG" -o -r "$CONFIG" ] || exit 6 # LSB: program not configured } service_fini () { # Return the exit status. ## case $SYSTEM in SUSE) rc_exit ;; DEBIAN|REDHAT|LSB|*) exit $STATUS ;; esac } service_start () { # Start the service. # # Required by LSB, where running "start" on a service already running should be # considered successful. ## log_init "Starting $DESC" "$DAEMON_NAME" case $SYSTEM in DEBIAN) if $0 status >/dev/null 2>&1; then STATUS=0 else ERRMSG=`start-stop-daemon --start --quiet \ ${NICE:+"--nicelevel"} ${NICE:+"$NICE"} \ ${USER:+"--chuid"} ${USER:+"$USER"} \ ${PIDFILE:+"--pidfile"} ${PIDFILE:+"$PIDFILE"} \ --exec "$DAEMON" -- $DAEMON_ARGS 2>&1` STATUS=$? fi ;; REDHAT) if $0 status >/dev/null 2>&1; then STATUS=0 else daemon ${NICE:+"$NICE"} ${USER:+"--user"} ${USER:+"$USER"} \ "$DAEMON" $DAEMON_ARGS STATUS=$? fi [ $STATUS -eq 0 ] && touch "$RH_SUBSYS" >/dev/null 2>&1 ;; SUSE) ERRMSG=`startproc ${NICE:+"-n"} ${NICE:+"$NICE"} \ ${USER:+"-u"} ${USER:+"$USER"} \ ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} \ "$DAEMON" $DAEMON_ARGS 2>&1` rc_status -v STATUS=$? ;; LSB) if [ -n "$USER" ]; then ERRMSG=`su "$USER" -c "/sbin/start_daemon \ ${NICE:+\"-n\"} ${NICE:+\"$NICE\"} \ ${PIDFILE:+\"-p\"} ${PIDFILE:+\"$PIDFILE\"} \ \"$DAEMON\" $DAEMON_ARGS" 2>&1` else ERRMSG=`start_daemon ${NICE:+"-n"} ${NICE:+"$NICE"} \ ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" $DAEMON_ARGS 2>&1` fi STATUS=$? ;; *) if $0 status >/dev/null 2>&1; then STATUS=0 else [ -n "$NICE" ] && nice="nice -n $NICE" if [ -n "$USER" ]; then ERRMSG=`su "$USER" -c "$nice \"$DAEMON\" $DAEMON_ARGS" 2>&1` else ERRMSG=`$nice "$DAEMON" $DAEMON_ARGS 2>&1` fi STATUS=$? fi ;; esac log_fini "$STATUS" "$ERRMSG" } service_stop () { # Stop the service. # # Required by LSB, where running "stop" on a service already stopped or not # running should be considered successful. ## log_init "Stopping $DESC" "$DAEMON_NAME" case $SYSTEM in DEBIAN) if ! $0 status >/dev/null 2>&1; then STATUS=0 else start-stop-daemon --stop --quiet \ ${PIDFILE:+"--pidfile"} ${PIDFILE:+"$PIDFILE"} \ --name "$DAEMON_NAME" ${SIGTERM_TIMEOUT:+"--retry"} \ ${SIGTERM_TIMEOUT:+"$SIGTERM_TIMEOUT"} >/dev/null 2>&1 STATUS=$? fi ;; REDHAT) if ! $0 status >/dev/null 2>&1; then STATUS=0 else killproc "$DAEMON" STATUS=$? fi [ $STATUS -eq 0 ] && rm -f "$RH_SUBSYS" >/dev/null 2>&1 ;; SUSE) killproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} \ ${SIGTERM_TIMEOUT:+"-t"} ${SIGTERM_TIMEOUT:+"$SIGTERM_TIMEOUT"} \ "$DAEMON" rc_status -v ;; LSB) killproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" STATUS=$? ;; *) signal_process "$DAEMON" rc=$? [ $rc -eq 0 -o $rc -eq 2 ] && STATUS=0 || STATUS=1 ;; esac log_fini "$STATUS" [ -f "$PIDFILE" ] && rm -f "$PIDFILE" } service_restart () { # Stop and restart the service if it is already running; # otherwise, start the service. # # Required by LSB, where running "restart" on a service already stopped or not # running should be considered successful. ## if $0 status >/dev/null 2>&1; then $0 stop && $0 start else $0 start fi case $SYSTEM in SUSE) rc_status ;; DEBIAN|REDHAT|LSB|*) STATUS=$? ;; esac } service_try_restart () { # Restart the service if it is already running. # # Optional for LSB, where running "try-restart" on a service already stopped or # not running should be considered successful. # Also known as "condrestart" by RedHat. ## case $SYSTEM in REDHAT) [ -f "$RH_SUBSYS" ] && $0 restart || : STATUS=$? ;; SUSE) $0 status >/dev/null 2>&1 && $0 restart || rc_reset rc_status ;; DEBIAN|LSB|*) $0 status >/dev/null 2>&1 && $0 restart || : STATUS=$? ;; esac } service_reload () { # Reload the configuration without stopping and restarting the service. # # Optional for LSB. ## [ -z "$RELOAD" ] && STATUS=3 # LSB: unimplemented feature log_init "Reloading $DESC" "$DAEMON_NAME" case $SYSTEM in DEBIAN) if [ -n "$RELOAD" ]; then start-stop-daemon --stop --quiet --signal HUP \ ${PIDFILE:+"--pidfile"} ${PIDFILE:+"$PIDFILE"} \ --name "$DAEMON_NAME" >/dev/null 2>&1 STATUS=$? fi ;; REDHAT) if [ -n "$RELOAD" ]; then killproc "$DAEMON" -HUP STATUS=$? else echo_failure fi ;; SUSE) if [ -n "$RELOAD" ]; then killproc -HUP ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" else rc_failed $STATUS fi rc_status -v ;; LSB) if [ -n "$RELOAD" ]; then killproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" -HUP STATUS=$? fi ;; *) if [ -n "$RELOAD" ]; then signal_process "$DAEMON" "HUP" STATUS=$? fi ;; esac log_fini "$STATUS" } service_force_reload () { # Reload the configuration if the service supports this; # otherwise, restart the service if it is already running. # # Required by LSB, where running "force-reload" on a service already stopped or # not running should be considered successful. ## if [ -n "$RELOAD" ]; then $0 reload else $0 try-restart fi case $SYSTEM in SUSE) rc_status ;; DEBIAN|REDHAT|LSB|*) STATUS=$? ;; esac } service_status () { # Print the current status of the service. # # Required by LSB. ## case $SYSTEM in REDHAT) status "$DAEMON" STATUS=$? ;; SUSE) printf "Checking for service $DESC: " checkproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} "$DAEMON" rc_status -v ;; LSB) printf "Checking status of $DESC: " pids=`pidofproc ${PIDFILE:+"-p"} ${PIDFILE:+"$PIDFILE"} \ "$DAEMON" 2>/dev/null` STATUS=$? if [ $STATUS -eq 0 -a -n "$pids" ]; then echo "running." elif [ $STATUS -ne 0 -a -s "$PIDFILE" ]; then echo "dead." else echo "stopped." fi ;; DEBIAN|*) printf "Checking status of $DESC: " pids=`query_pids "$DAEMON" "$PIDFILE"` rc=$? if [ $rc -eq 0 -a -n "$pids" ]; then echo "running." STATUS=0 # LSB: program is running elif [ $rc -ne 0 -a -s "$PIDFILE" ]; then echo "dead." STATUS=1 # LSB: program is dead & pidfile exists elif [ $rc -ne 0 ]; then echo "stopped." STATUS=3 # LSB: program is not running else echo "unknown." STATUS=4 # LSB: program status unknown fi ;; esac } query_pids () { # Writes the matching PIDs to stdout. # Returns 0 on success (ie, pids found). ## PROCNAME="$1" PIDFILE="$2" if type pgrep >/dev/null 2>&1; then pids=`pgrep -d ' ' -x "\`basename \"$PROCNAME\"\`" 2>/dev/null` rc=$? elif type pidof >/dev/null 2>&1; then pids=`pidof -o $$ -x "$PROCNAME" 2>/dev/null` rc=$? else pids=`(ps awx -o pid -o command || ps -e -f -o pid -o args) 2>/dev/null \ | tail +2 | egrep "( |/)$PROCNAME( |$)" | grep -v egrep \ | sed 's/ *\([0-9]*\).*/\1/' | sort -n | tr '\012' ' '` [ -n "$pids" ] && rc=0 || rc=1 fi unset pids_running if [ -n "$pids" -a -r "$PIDFILE" ]; then read pid_line < "$PIDFILE" for pid in $pid_line; do expr -- "$pid" : '[0-9]*$' >/dev/null 2>&1 \ && expr -- " $pids " : ".* $pid .*" >/dev/null 2>&1 \ && pids_running="$pids_running $pid" done [ -n "$pids_running" ] && pids=$pids_running fi echo $pids return $rc } signal_process () { # Returns 0 on success, 1 if kill failed, 2 if PROCNAME is not running. ## PROCNAME="$1" SIGNUM="$2" pids=`query_pids "$DAEMON" "$PIDFILE"` [ $? -ne 0 -o -z "$pids" ] && return 2 kill ${SIGNUM:+"-$SIGNUM"} $pids >/dev/null 2>&1 [ $? -ne 0 ] && return 1 [ -n "$SIGNUM" ] && return 0 pids=`query_pids "$DAEMON" "$PIDFILE"` [ $? -ne 0 -o -z "$pids" ] && return 0 [ -z "$SIGTERM_TIMEOUT" ] && return 1 sleep "$SIGTERM_TIMEOUT" kill -KILL $pids >/dev/null 2>&1 pids=`query_pids "$DAEMON" "$PIDFILE"` [ $? -ne 0 -o -z "$pids" ] && return 0 return 1 } log_init () { # Output informational message at beginning of action. ## MESSAGE="$1" PROCNAME="$2" case $SYSTEM in DEBIAN) if [ "$VERBOSE" != no ]; then if type log_daemon_msg >/dev/null 2>&1; then log_daemon_msg "$MESSAGE" "$PROCNAME" else printf "$MESSAGE: $PROCNAME" fi fi ;; REDHAT|SUSE|LSB|*) printf "$MESSAGE: " ;; esac } log_fini () { # Output informational/error message at end of action. ## STATUS="$1" ERRMSG="$2" case $SYSTEM in DEBIAN) if [ "$VERBOSE" != no ]; then if ( type log_end_msg && type log_failure_msg ) >/dev/null 2>&1; then log_end_msg "$STATUS" [ $STATUS -eq 0 -o -z "$ERRMSG" ] || log_failure_msg "$ERRMSG" else [ $STATUS -eq 0 ] && echo "." || echo " (failed)." [ $STATUS -eq 0 -o -z "$ERRMSG" ] || echo "$ERRMSG" >&2 fi fi ;; REDHAT) echo ;; SUSE) [ $STATUS -eq 0 -o -z "$ERRMSG" ] || echo "$ERRMSG" >&2 ;; LSB|*) [ $STATUS -eq 0 ] && echo "." || echo " (failed)." [ $STATUS -eq 0 -o -z "$ERRMSG" ] || echo "$ERRMSG" >&2 ;; esac } ############################################################################### service_init "$@" case "$1" in start) service_start ;; stop) service_stop ;; restart) service_restart ;; try-restart|condrestart) service_try_restart ;; reload) service_reload ;; force-reload) service_force_reload ;; status) service_status ;; *) echo "Usage: `basename \"$0\"`" \ "(start|stop|restart|try-restart|reload|force-reload|status)" >&2 exit 2 # LSB: invalid or excess argument(s) ;; esac service_fini powerman-2.3.5.orig/scripts/Makefile.am0000644000000000000000000000214511172212766014730 0ustar ##***************************************************************************** ## $Id: Makefile.am,v 1.4 2005/07/27 00:03:37 achu Exp $ ##***************************************************************************** ## Process this file with automake to produce Makefile.in. ##***************************************************************************** install-data-local: -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(sysconfdir)/init.d $(top_srcdir)/config/install-sh -m 755 $(srcdir)/powerman.init \ $(DESTDIR)$(sysconfdir)/init.d/powerman -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(libdir)/stonith/plugins/external $(top_srcdir)/config/install-sh -m 755 $(srcdir)/stonith-powerman \ $(DESTDIR)$(libdir)/stonith/plugins/external/powerman -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(localstatedir)/run -$(top_srcdir)/config/install-sh -o $(RUN_AS_USER) -m 755 -d \ $(DESTDIR)$(localstatedir)/run/powerman uninstall-local: $(RM) $(DESTDIR)$(sysconfdir)/init.d/powerman $(RM) $(DESTDIR)$(libdir)/stonith/plugins/external/powerman EXTRA_DIST = \ powerman.init powerman-2.3.5.orig/man/0000755000000000000000000000000011205355435011754 5ustar powerman-2.3.5.orig/man/httppower.8.in0000644000000000000000000000272711123551157014514 0ustar .TH httppower 8 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME httppower \- communicate with HTTP based power distribution units .SH SYNOPSIS .B httppower .I "[--url URL]" .LP .SH DESCRIPTION .B httppower is a helper program for .B powerman which enables it to communicate with HTTP based power distribution units. It is run interactively by the powerman daemon. .SH OPTIONS .TP .I "-u, --url URL" Set the base URL. .SH INTERACTIVE COMMANDS The following commands are accepted at the httppower> prompt: .TP .I "auth user:pass" Authenticate to the base URL with specified user and password, using ``basic'' HTTP authentication which sends the user and password over the network in plain text. .TP .I "seturl URL" Set the base URL. Overrides the command line option. .TP .I "get [URL-suffix]" Send an HTTP GET to the base URL with the optional URL-suffix appended. .TP .I "post [URL-suffix] key=val[&key=val]..." Send an HTTP POST to the base URL with the optional URL-suffix appended, and key-value pairs as argument. .SH "FILES" @X_SBINDIR@/httppower .br @X_SYSCONFDIR@/powerman/powerman.conf .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/powerman.dev.5.in0000644000000000000000000001661711157752314015072 0ustar .TH powerman.dev 5 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME powerman.dev \- PowerMan device specification files .SH DESCRIPTION PowerMan device specifications are rather wierd. For this reason, we suggest that you leave the writing of these scripts to the PowerMan authors. However, if you insist, here is how they work. .LP Note: the authors do not guarantee that the PowerMan specification language will not change, however we are open to taking on maintenance of scripts submitted by PowerMan users. We can't guarantee that we'll be able to test new releases against all devices but we'll do our best not to break anything. NOTE: the best way to help us in this endeavor is to provide a ``simulator'' for your power controller and associated tests in the \fItest\fR subdirectory of the powerman source code. See the examples in that directory. .LP By convention, device scripts are one device per file and are included as needed from a powerman.conf file, like this: .IP .nf include "/etc/powerman/icebox3.dev" .fi .LP A device script is surrounded by an outer block: .IP .nf specification "my_device_name" { # configuration settings # script blocks } .fi .LP The possible configuration settings are: .TP .I "timeout " (optional) device script timeout in seconds - applies to each script, the whole thing, not just a particular "expect". .TP .I "plug name { }" (optional) if plug names are static, they should be defined. Any reference to a plug name in the powerman.conf must match one of the defined plug names. .TP .I "pingperiod " (optional) if a ping script is defined, and pingperiod is nonzero, the ping script will be executed periodically, every seconds. .LP Script blocks have the form: .IP .nf script { # statements } .fi .LP Script blocks should all be grouped together with no config lines in between. Scripts are for performing particular operations such as power on, get power status, etc. The various script names are listed below. Those marked with [%s] are called with a plug name "argument", which can be included in a send statements by including a %s (printf style). Warning: all the send strings are processed with printf and you can cause powermand to segfault if you include any printf tokens other than the appropriate zero or one %s. .TP .I "login" Executed immediately on (re-)connect. If you need to login to the box, do it here. This is also a good place to descend through a first layer of menus. Caveat: % occurring in passwords must be escaped as %%. Caveat: occurs outside of client session so cannot be debugged with -T. A trick when debugging is to move this code into the status script temporarily so you can see what is going on. .TP .I "logout" Executed prior to disconnect. Get device in a state so login script will work (though hopefully disconnecting will do that too). .TP .I "status_all, status[%s]" Obtain plug state for all plugs or only the specified plug. When all plugs of a device are involved in a plug status query, the status_all script, if defined, will be called in preference to the status script; otherwise the status script is called for each plug. .TP .I "on_all, on_range[%s], on[%s]" Power on all plugs, a range of plugs, or the specified plug. .TP .I "off_all, off_range[%s], off[%s]" Power off all plugs, a range of plugs, or the specified plug. .TP .I "cycle_all, cycle_range[%s], cycle[%s]" Power cycle all plugs, a range of plugs, or the specified plug. The intent of this command was to map to the RPC's cycle command; however, device script are increasingly implementing this in terms of a power off/delay/power so the off time can be controlled by the script. .TP .I "status_soft_all, status_soft[%s]" Obtain soft power state for all plugs or only the specified plug. Soft Power refers to the "standby state" of the node. On means the node is powered up. Off means either the node is powered off at the plug or is powered on at the plug and in standby mode. This is really only useful on devices that include both a plug relay and a probe into the node attached to a non-standby power source. .TP .I "status_temp_all, status_temp[%s]" Obtain temperature reading for all plugs or only the specified plug. Temperature is obtained by sampling a thermocouple in the node. Results are reported as a text string - not interpreted by Powerman beyond any regex chopping done by the script. .TP .I "status_beacon_all, status_beacon[%s]" Obtain beacon state for all plugs or only the specified plug. Some RPC's include a way to flash a light on a node. .TP .I "beacon_on[%s]" Flash beacon on the specified plug. .TP .I "beacon_off[%s]" Clear beacon on the specified plug. .TP .I "reset_all, reset_range[%s], reset[%s]" Reset all plugs, a range of plugs, or only the specified plug. Reset refers to signaling a motherboard reset butten header, not a plug cycle. .LP Within a script, the following statements can be used: .TP .I "send " Send to the device. .TP .I "delay " Pause script for seconds. .TP .I "expect " is compiled as a regular expression with regcomp(3). The regular expression is matched against device input. The script blocks until the regex is matched or the device timeout occurs (in which case the script is aborted). Upon matching, any parenthesized expressiones are assigned to variables: $1 for the first match, $2 for the second match, and so on. Warning: some implementations of regex(3) silently fail if the regular expression exceeds available static storage. .TP .I "setplugstate [|] [off=] [on=]" Set the plug state. The first argument, if present, is the literal plug name or a from the previous expect which contains the plug name. If omitted, the plug name is presumed to be the script argument. The off and on strings are compiled regexes, which if matched by the second argument, result in the plug state being set to off or on. Yes we are applying regexes to regmatches! If no off or on strings are provided, state will be unknown. .TP .I "ifoff, ifon" Script statements enclosed in an ifon/ifoff block are conditional executed based on the state of the plug passed in as an argument. Ifon/ifoff blocks can only be used in single plug scripts that take an argument. .TP .I "foreachplug" Script statements enclosed in a foreachplug block are executed iteratively with a %s argument defined for each target plug. Foreachplug blocks can only be used in all plug scripts that take no argument. .LP Script terminals are defined as follows: .TP .I "" decimal number - exponent forms not supported .TP .I "" Text surrounded by double quotes. May contain C style backslash-escaped characters, including three digit octal values, and most common backslash-escaped single character values. .TP .I "" Multiple values separated by white space. .TP .I "" Name of script (see above). .TP .I "" Results of a parenthesized regular expression match are assigned to $1, $2, ... $N. .SH "FILES" @X_SYSCONFDIR@/powerman/*.dev .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/Makefile.in0000644000000000000000000004774311115072462014034 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/httppower.8.in $(srcdir)/libpowerman.3.in \ $(srcdir)/plmpower.8.in $(srcdir)/powerman-devices.7.in \ $(srcdir)/powerman.1.in $(srcdir)/powerman.conf.5.in \ $(srcdir)/powerman.dev.5.in $(srcdir)/powermand.8.in \ $(srcdir)/vpcd.8.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/ac_curl.m4 \ $(top_srcdir)/config/ac_curses.m4 \ $(top_srcdir)/config/ac_forkpty.m4 \ $(top_srcdir)/config/ac_genders.m4 \ $(top_srcdir)/config/ac_httppower.m4 \ $(top_srcdir)/config/ac_pkgconfig.m4 \ $(top_srcdir)/config/ac_runas.m4 \ $(top_srcdir)/config/ac_wrap.m4 \ $(top_srcdir)/config/x_ac_expand_install_dirs.m4 \ $(top_srcdir)/config/x_ac_meta.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = powerman.1 libpowerman.3 powerman.conf.5 \ powerman.dev.5 powerman-devices.7 httppower.8 plmpower.8 \ powermand.8 vpcd.8 SOURCES = DIST_SOURCES = man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(man8dir)" man3dir = $(mandir)/man3 man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man7_MANS) $(man8_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GCCWARN = @GCCWARN@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURSES = @LIBCURSES@ LIBFORKPTY = @LIBFORKPTY@ LIBGENDERS = @LIBGENDERS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBWRAP = @LIBWRAP@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ META_ALIAS = @META_ALIAS@ META_AUTHOR = @META_AUTHOR@ META_DATE = @META_DATE@ META_LT_AGE = @META_LT_AGE@ META_LT_CURRENT = @META_LT_CURRENT@ META_LT_REVISION = @META_LT_REVISION@ META_NAME = @META_NAME@ META_RELEASE = @META_RELEASE@ META_VERSION = @META_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ WITH_HTTPPOWER_FALSE = @WITH_HTTPPOWER_FALSE@ WITH_HTTPPOWER_TRUE = @WITH_HTTPPOWER_TRUE@ WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ X_BINDIR = @X_BINDIR@ X_DATADIR = @X_DATADIR@ X_EXEC_PREFIX = @X_EXEC_PREFIX@ X_INCLUDEDIR = @X_INCLUDEDIR@ X_INFODIR = @X_INFODIR@ X_LIBDIR = @X_LIBDIR@ X_LIBEXECDIR = @X_LIBEXECDIR@ X_LOCALSTATEDIR = @X_LOCALSTATEDIR@ X_MANDIR = @X_MANDIR@ X_OLDINCLUDEDIR = @X_OLDINCLUDEDIR@ X_PREFIX = @X_PREFIX@ X_SBINDIR = @X_SBINDIR@ X_SHAREDSTATEDIR = @X_SHAREDSTATEDIR@ X_SYSCONFDIR = @X_SYSCONFDIR@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ man1_MANS = powerman.1 pm.1 man3_MANS = libpowerman.3 man5_MANS = powerman.conf.5 powerman.dev.5 man7_MANS = powerman-devices.7 man8_MANS = powermand.8 httppower.8 plmpower.8 vpcd.8 CLEANFILES = pm.1 EXTRA_DIST = \ powerman.1 \ libpowerman.3 \ powerman.conf.5 \ powerman.dev.5 \ powerman-devices.7 \ powermand.8 \ httppower.8 \ plmpower.8 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh powerman.1: $(top_builddir)/config.status $(srcdir)/powerman.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ libpowerman.3: $(top_builddir)/config.status $(srcdir)/libpowerman.3.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ powerman.conf.5: $(top_builddir)/config.status $(srcdir)/powerman.conf.5.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ powerman.dev.5: $(top_builddir)/config.status $(srcdir)/powerman.dev.5.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ powerman-devices.7: $(top_builddir)/config.status $(srcdir)/powerman-devices.7.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ httppower.8: $(top_builddir)/config.status $(srcdir)/httppower.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ plmpower.8: $(top_builddir)/config.status $(srcdir)/plmpower.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ powermand.8: $(top_builddir)/config.status $(srcdir)/powermand.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ vpcd.8: $(top_builddir)/config.status $(srcdir)/vpcd.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-man3: $(man3_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man3dir)" || $(mkdir_p) "$(DESTDIR)$(man3dir)" @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \ done uninstall-man3: @$(NORMAL_UNINSTALL) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man3dir)/$$inst"; \ done install-man5: $(man5_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ done uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done install-man7: $(man7_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man7dir)" || $(mkdir_p) "$(DESTDIR)$(man7dir)" @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.7*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 7*) ;; \ *) ext='7' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst"; \ done uninstall-man7: @$(NORMAL_UNINSTALL) @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.7*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 7*) ;; \ *) ext='7' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man7dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man7dir)/$$inst"; \ done install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-exec-am: install-info: install-info-am install-man: install-man1 install-man3 install-man5 install-man7 \ install-man8 installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 \ uninstall-man7 uninstall-man8 .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-man1 \ install-man3 install-man5 install-man7 install-man8 \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-info-am uninstall-man \ uninstall-man1 uninstall-man3 uninstall-man5 uninstall-man7 \ uninstall-man8 pm.1: powerman.1 cp powerman.1 $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: powerman-2.3.5.orig/man/powerman-devices.7.in0000644000000000000000000002234611164522265015731 0ustar .TH powerman-devices 7 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME powerman\(hydevices \- Powerman Device Configuration Notes .SH DESCRIPTION Following are notes on configuring various remote power controllers and related equipment supported by PowerMan. .SH CYCLADES TS-1000 A cyclades TS-1000 configured so that PowerMan can connect to serial-port-based remote power control devices using telnet is set up as follows: .P Attach console cable between laptop running minicom and console port at 9600,8n1 and authenticate with default account: root/tslinux. .P Edit the following files (assumes no off-subnet routing or name service required): .TP .I "/etc/portslave/portslave.conf" .nf conf.eth_ip 192.168.54.151 conf.eth_mask 255.255.255.0 conf.dhcp_client 0 # all.speed 9600 all.datasize 8 all.stopbits 1 all.parity none all.flow none all.dcd 0 all.DTR_reset 1 all.protocol socket_server all.authtype none #all.ipno all.socket_port 7001+ # s1.tty ttyS1 s2.tty ttyS2 s3.tty ttyS3 s4.tty ttyS4 s5.tty ttyS5 s6.tty ttyS6 s7.tty ttyS7 s8.tty ttyS8 s9.tty ttyS9 s10.tty ttyS10 s11.tty ttyS11 s12.tty ttyS12 s13.tty ttyS13 s14.tty ttyS14 s15.tty ttyS15 s16.tty ttyS16 .fi .TP .I "/etc/hostname" cyclades-ts-test .TP .I "/etc/hosts" .nf 127.0.0.1 localhost 192.168.54.151 cycaldes-ts-test .fi .P Next, run .B "signal_ras hup" and .B saveconf and finally, power cycle the unit. It should be possible to configure PowerMan to connect to hostname:7001 for port 1, hostname:7002 for port 2, etc.. .SH "BAYTECH RPC-3 (non-NC models) (network port 23)" Attach console cable between laptop running minicom and console port at 9600,8n1. Main menu should display. .P From main menu, select 3)...Configuration, then set IP parameters. .P From Configuration menu, select 5)...Access, then disable command confirmation, set admin password to baytech, and enable prompt for password. Exit Access menu by typing return. .P From Configuration menu, select 6)...Outlets. Ensure that 1)...Outlet Status display is disabled, and 2)...Command Confirmation is disabled. .P Exit back to main menu by typing return twice, then answer Y to the Accept changes? prompt. .SH "BAYTECH RPC-28-NC (serial 9600,8n1)" Attach console cable between laptop running minicom and console port at 9600,8n1. Type return to get RPC-28> prompt. Type Help for a list of commands. .P Select config. Select 3)...Enable/Disable Confirmation and disable confirmation. Select 4)...Enable/Disable Status Menu and disable status menu .SH "LNXI ICEBOX V2 (network port 1010)" Attach console cable between laptop running minicom and console port at 9600,8n1. Enter default password of icebox. .TP .I "net ip 192.168.54.153" Sets IP address. .TP .I "net mask 255.255.255.0" Sets network mask .TP .I "net gw 192.168.54.254" Set default gateway. Note: this may need to be set to an address in the same subnet as the ice box regardless of whether it is to be used or not. .TP .I "reboot" Reboots the icebox. .SH "LNXI ICEBOX V3 (network port 1010)" Attach console cable between laptop running minicom and console port at 9600,8n1. Authenticate with default account admin/icebox. Configuration is the same as the V2 ICE BOX. .SH "APC MASTERSWITCH MODEL AP9606 (network port 23)" Attach console cable between laptop running minicom and console port (may be labeled ``advanced port'') at 2400,8n1. Press enter, then authenticate with default account apc/apc. .P Choose Network from main menu. .P Choose TCP/IP from Network menu, then diable BOOTP, and accept changes. Set the IP address, subnet mask, and default gateway, and accept changes. .P Pres ESC until the main menu appears, then select Logout. .SH "WTI RPS10 (serial 9600,8n1)" Set address of box using the rotary dial on the back. The Master module must be set to address 0. Slave modules may be set to unique values from 1-9. The address corresponds to the plug name in the powerman.conf file. .P Setup switches on each module should be set to 9600 baud (sw1 down), 5 sec toggle delay (sw2 down), power up to previous state (sw3 down). .SH "WTI NPS (network port 23)" Attach console cable between laptop running minicom and console port at 9600,8n1. Try password "wti" if prompted. .P Select /N - View/set network parameters, then set the IP address, subnet mask, and gateway. .P Select /G - General paramters, then disable command confirmation, enable command echo, and set disconnect timeout to the maximum value (30 minutes). .P Set password to "wti". .SH "CYCLADES PM8 and PM8i (serial 9600,8n1)" Attach console cable between laptop running minicom and serial port 9600,8n1. Press enter, then authenticate with default account admin/pm8. .P Run factory_defaults command. .P The PM8 can run in a mode where it can be daisy chained from a Cyclades terminal server. This mode is not yet supported by PowerMan. .SH "Sun ILOM" The dedicated ILOM serial port (SER MGT RJ-45) runs at 9600,8n1 and the default login is root/changeme. Use a Sun/NETRA/Cisco RJ45 adapter to connect to Cyclades TS. .P The dedicated ILOM ethernet port (NET MGT RJ-45) can be configured for DHCP (the default) or static IP settings. To configure static IP via the ILOM serial port, run: .IP .nf cd /SP/network set pendingipdiscovery=static set pendingipaddress=xxx.xxx.xxx.xxx set pendingipnetmask=xxx.xxx.xxx.xxx set pendingipgateway=xxx.xxx.xxx.xxx set commitpending=true .fi .P The ILOM network configuration can alternatively be set up via the system BIOS setup screen. Hit F2 during boot to access BIOS setup, go to the "Advanced" tab, select "IPMI 2.0 configuration" and "set LAN configuration". Make your changes and commit them. .SH "IPMI (via Ipmipower)" IPMI based power control is supported via FreeIPMI's .B ipmipower. It is configured by running .B ipmipower in coprocess mode in powerman.conf Due to semantic differences between IPMI and traditional remote power control devices, some power control operations may not seem to work properly by default with .B Powerman. For example, several IPMI power control operations are allowed to return prior to the operation fully completing. A machine that has been powered off by IPMI may be later queried as being powered on. This is because IPMI may successfully return from a power off operation to the user, but the machine may elect to power itself off at a later time. In order to get around several of these issues, it is recommended that the user configure .B ipmipower with the \fB\-\-wait\-until\-on\fR and \fB\-\-wait\-until\-off\fR options. With these options set, .B ipmipower will behave more like traditional remote power control devices. In order to hide IPMI usernames and passwords from .B ps(1), it is also recommended that the user configure the username and password (and at your discretion, the above options) using the FreeIPMI configuration file and not in the powerman.conf file. Please see the .B ipmipower section of the .B freeipmi.conf(5) manpage for more information. Because IPMI usernames and passwords are sensitive, the default FreeIPMI configuration file is only readable and writable by root. This may conflict with the default .B powermand daemon settings, thus making the configuration file non-readable. Administrators may wish to run the .B powermand daemon as root or adjust the configuration file permissions as needed. .SH "HP iLO" The "hpilo" script supports the Integrated Lights-Out management processor in HP ProLiant servers, including both rack-mount and blade servers. Configure the iLO to allow Telnet access on port 23, and add a user "Admin" with password "Admin". You may have to reduce the minimum password length on the Administration/Access/Options tab of the web interface. .SH "HP MP" The "hpmp" script supports the Management Processor in HP non-cellular, rack-mount Integrity servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". If the MP enforces a minimum password length, you may have to use "uc -all default" to restore the default Admin/Admin user. .SH "HP MP (cellular)" The "hpmpcell" script supports the Management Processor in HP mid-range cellular servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". .SH "HP MP (Superdome)" The "hpmpdome" script supports the Management Processor in HP Superdome servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". .SH "HP MP (Integrity blades)" The "hpmpblade" script supports the Management Processor in HP Integrity blade servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/powerman.1.in0000644000000000000000000001112311123551157014267 0ustar .TH powerman 1 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME powerman \- power on/off nodes .SH SYNOPSIS .B pm .I "[-options] -action [targets] [-action [targets] ...]" .SH DESCRIPTION .B powerman provides power management in a data center or compute cluster environment. It performs operations such as power on, power off, and power cycle via remote power controller (RPC) devices. Target hostnames are mapped to plugs on RPC devices in .I powerman.conf(5). .SH OPTIONS .TP .I "-1, --on targets" Power ON targets. .TP .I "-0, --off targets" Power OFF targets. .TP .I "-c, --cycle targets" Power cycle targets. .TP .I "-r, --reset targets" Assert hardware reset for targets (if implemented by RPC). .TP .I "-f, --flash targets" Turn beacon ON for targets (if implemented by RPC). .TP .I "-u, --unflash targets" Turn beacon OFF for targets (if implemented by RPC). .TP .I "-l, --list" List available targets. If possible, output will be compressed into a host range (see TARGET SPECIFICATION below). .TP .I "-q, --query-all" Query plug status of all targets. Status is not cached; each time this option is used, powermand queries the appropriate RPC's. Targets connected to RPC's that could not be contacted (e.g. due to network failure) are reported as status "unknown". If possible, output will be compressed into host ranges. .TP .I "-Q, --query targets" Query plug status of specific targets. .TP .I "-n, --soft-all" Query soft power status of all targets (if implemented by RPC). In this context, a node in the OFF state could be ON at the plug but operating in standby power mode. .TP .I "-N, --soft targets" Query soft power status of specific targets (if implemented by RPC). .TP .I "-b, --beacon-all" Query beacon status of all targets (if implemented by RPC). .TP .I "-B, --beacon targets" Query beacon status of specific targets (if implemented by RPC). .TP .I "-t, --temp-all" Query node temperature of all targets (if implemented by RPC). Temperature information is not interpreted by powerman and is reported as received from the RPC on one line per target, prefixed by target name. .TP .I "-P, --temp targets" Query node temperature of specific targets (if implemented by RPC). .TP .I "-h, --help" Display option summary. .TP .I "-L, --license" Show powerman license information. .TP .I "-h, --server-host host[:port]" Connect to a powerman daemon on non-default host and optionally port. .TP .I "-V, --version" Display the powerman version number and exit. .TP .I "-D, --device" Displays RPC status information. If targets are specified, only RPC's matching the target list are displayed. .TP .I "-T, --telemetry" Causes RPC telemetry information to be displayed as commands are processed. Useful for debugging device scripts. .TP .I "-x, --exprange" Expand host ranges in query responses. .TP .I "-g, --genders" If configured with the genders(3) package, this option tells powerman that targets are genders attributes that map to node names rather than the node names themselves. .SH "TARGET SPECIFICATION" .B powerman target hostnames may be specified as comma separated or space separated hostnames or host ranges. Host ranges are of the general form: prefix[n-m,l-k,...], where n < m and l < k, etc., This form should not be confused with regular expression character classes (also denoted by ``[]''). For example, foo[19] does not represent foo1 or foo9, but rather represents a degenerate range: foo19. .LP This range syntax is meant only as a convenience on clusters with a prefixNN naming convention and specification of ranges should not be considered necessary -- the list foo1,foo9 could be specified as such, or by the range foo[1,9]. .LP Some examples of powerman targets follows: .LP Power on hosts bar,baz,foo01,foo02,...,foo05 powerman --on bar baz foo[01-05] .LP Power on hosts bar,foo7,foo9,foo10 powerman --on bar,foo[7,9-10] .LP Power on foo0,foo4,foo5 powerman --on foo[0,4-5] .LP As a reminder to the reader, some shells will interpret brackets ([ and ]) for pattern matching. Depending on your shell, it may be necessary to enclose ranged lists within quotes. For example, in tcsh, the last example above should be executed as: .nf powerman --on "foo[0,4-5]" .fi .SH "FILES" @X_BINDIR@/powerman .br @X_BINDIR@/pm .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/libpowerman.3.in0000644000000000000000000001270411123551157014766 0ustar .TH libpowerman 3 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME libpowerman \- PowerMan Client API .SH SYNOPSIS .nf .B #include .sp .BI "pm_err_t pm_connect (char *" server ", void *" arg ", pm_handle_t *" hp , .BI " int " flags ); .sp .BI "void pm_disconnect (pm_handle_t " h ); .sp .BI "pm_err_t pm_node_on (pm_handle_t " h ", char *" node ); .sp .BI "pm_err_t pm_node_off (pm_handle_t " h ", char *" node ); .sp .BI "pm_err_t pm_node_cycle (pm_handle_t " h ", char *" node ); .sp .BI "pm_err_t pm_node_status (pm_handle_t " h ", char *" node , .BI " pm_node_state_t " sp ); .sp .BI "pm_err_t pm_node_iterator_create (pm_handle_t " h , .BI " pm_node_iterator_t *" ip ); .sp .BI "void pm_node_iterator_destroy (pm_node_iterator_t " i ); .sp .BI "char * pm_node_next (pm_node_iterator_t " i ); .sp .BI "void pm_node_iterator_reset (pm_node_iterator_t " i ); .sp .BI "char * pm_strerror (pm_err_t " err ", char * " str ", int " len ); .sp .B cc ... -lpowerman .fi .SH DESCRIPTION The \fBpm_connect\fR() function establishes a connection with \fIserver\fR, a string containing \fIhost[:port]\fR or NULL for defaults; and returns a handle in \fIhp\fR. The \fIarg\fR parameter is currently unused. The \fIflags\fR parameter should be zero or one or more logically-OR'ed flags: .TP .B PM_CONN_INET6 Establish connection to the powerman server using (only) IPv6 protocol. Without this flag, any available address family will be used. .PP The \fBpm_disconnect\fR() function tears down the server connection and frees storage associated with handle \fIh\fR. .PP The \fBpm_node_on\fR(), \fBpm_node_off\fR(), and \fBpm_node_cycle\fR() functions issue on, off, and cycle commands acting on \fInode\fR to the server on handle \fIh\fR. .PP The \fBpm_node_status\fR() function issues a status query acting on \fInode\fR to the server on handle \fIh\fR. The result is resturned in \fIsp\fR which will be one of the values: .TP .B PM_ON Node is powered on. .TP .B PM_OFF Node is powered off. .TP .B PM_UNKNOWN Node state is unknown. Some devices may return this even when the query is successful, for example X10 devices controlled by \fBplmpower\fR. .PP To use the above functions you must know the name of the node you wish to control. Calling \fBpm_node_iterator_create\fR() on handle \fIh\fR returns an iterator \fIip\fR which can be used to walk the list of valid node names. \fBpm_node_next\fR() returns the next node in the list, or NULL when the end of the list is reached. \fBpm_node_iterator_reset\fR() rewinds iterator \fIi\fR to the beginning of the list. Finally, \fBpm_node_iterator_destroy\fR() destroys an iterator and reclaims its storage. .SH RETURN VALUE Most functions have a return type of \fIpm_err_t\fR. \fBpm_strerror\fR() is available to convert an error code \fIerr\fR to a human-readable string using storage \fIstr\fR of length \fIlen\fR passed in by the caller. .SH ERRORS .TP .B PM_ESUCCESS Success. .TP .B PM_ERRNOVALID System call failed, see system errno. .TP .B PM_ENOADDR Failed to get address info for server. .TP .B PM_ECONNECT Connect failed. .TP .B PM_ENOMEM Out of memory. .TP .B PM_EBADHAND Bad server handle. .TP .B PM_EBADARG Bad argument. .TP .B PM_ESERVEREOF Received unexpected EOF from server. .TP .B PM_ESERVERPARSE Received unexpected response from server. .TP .B PM_EUNKNOWN Server responded with ``unknown command''. .TP .B PM_EPARSE Server responded with ``parse error''. .TP .B PM_ETOOLONG Server responded with ``command too long''. .TP .B PM_EINTERNAL Server responed with ``internal error''. .TP .B PM_EHOSTLIST Server responded with ``hostlist error''. .TP .B PM_EINPROGRESS Server responded with ``command in progress''. .TP .B PM_ENOSUCHNODES Server responded with ``no such nodes''. .TP .B PM_ECOMMAND Server responded with ``command completed with errors''. .TP .B PM_EQUERY Server responded with ``query completed with errors''. .TP .B PM_EUNIMPL Server responded with ``not implemented by device''. .SH EXAMPLE This example program queries the list of valid nodes and turns them all on. .PP .nf #include #include #include .sp int main(int argc, char *argv[]) { pm_err_t err; pm_node_state_t s; pm_handle_t h; pm_node_iterator_t i; char ebuf[64], *node; .sp if ((err = pm_connect (NULL, NULL, &h, 0)) != PM_ESUCCESS) { fprintf (stderr, "pm_connect: %s\\n", pm_strerror (err, ebuf, sizeof (ebuf))); exit(1); } .sp if ((err = pm_node_iterator_create (h, &i)) != PM_ESUCCESS) { fprintf (stderr, "pm_node_iterator_create: %s\\n", pm_strerror (err, ebuf, sizeof (ebuf))); exit(1); } while ((node = pm_node_next (i))) { if ((err = pm_node_on (h, node)) != PM_ESUCCESS) { fprintf (stderr, "pm_node_on: %s\\n", pm_strerror (err, ebuf, sizeof(ebuf))); exit (1); } } pm_node_iterator_destroy (i); .sp pm_disconnect (h); exit (0); } .fi .SH "FILES" @X_LIBDIR@/libpowerman.* .br @X_INCLUDEDIR@/libpowerman.h .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/Makefile.am0000644000000000000000000000135411115072462014007 0ustar ##***************************************************************************** ## $Id: Makefile.am,v 1.32 2005/07/26 00:57:17 achu Exp $ ##***************************************************************************** ## Process this file with automake to produce Makefile.in. ##***************************************************************************** man1_MANS = powerman.1 pm.1 man3_MANS = libpowerman.3 man5_MANS = powerman.conf.5 powerman.dev.5 man7_MANS = powerman-devices.7 man8_MANS = powermand.8 httppower.8 plmpower.8 vpcd.8 pm.1: powerman.1 cp powerman.1 $@ CLEANFILES = pm.1 EXTRA_DIST = \ powerman.1 \ libpowerman.3 \ powerman.conf.5 \ powerman.dev.5 \ powerman-devices.7 \ powermand.8 \ httppower.8 \ plmpower.8 powerman-2.3.5.orig/man/powerman.conf.5.in0000644000000000000000000000454411164745453015241 0ustar .TH powerman.conf 5 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME powerman.conf \- configuration file for PowerMan .SH DESCRIPTION The powerman.conf file typically includes one or more of the remote power controller (RPC) device files provided in the /etc/powerman directory; sets a few global options; instantiates RPC devices with unique names, hostnames, and ports; and maps node names to RPC's and plug numbers. .LP Network-attached RPC's are instantiated with device lines of the form: .IP device "name" "type" "host:port" .LP Serial-attached RPC's are instantiated with device lines of the form: .IP device "name" "type" "special file" "flags" .LP where special file is the full path to a tty device, and flags is a serial parameter specification in a form similar to that used by lilo, e.g. "9600,8n1". RPC's that are accessed via coprocesses are instantiated as follows: .IP device "name" "type" "process |&" .LP where process is the full path to a process whose standard output and input will be controlled by powerman, e.g. "/usr/bin/conman -Q -j rpc0 |&". .SH EXAMPLE The following example is a 16-node cluster that uses two 8-plug Baytech RPC-3 remote power controllers. .LP .nf include "/etc/powerman/baytech.dev" # include def for "baytech" RPC tcpwrappers yes # enable TCP wrappers # listen "0.0.0.0:10101" # uncomment to listen on all interfaces # Alias example - alias can be used in target specifications alias "pengra_service" "pengra[0-1]" alias "pengra_compute" "pengra[2-15]" # Power controller: device [] device "pow0" "baytech" "pow0:23" # instantiate pow0 device "pow1" "baytech" "pow1:23" # instantiate pow1 # Plugs: node [] node "pengra[0-7]" "pow0" "[1-8]" # map pengra0...pengra7 to pow0 plug 1-8 node "pengra[8-15]" "pow1" "[1-8]" # map pengra8...pengra15 to pow1 plug 1-8 .fi .SH "FILES" @X_SYSCONFDIR@/powerman/powerman.conf .br @X_SYSCONFDIR@/powerman/*.dev .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/plmpower.8.in0000644000000000000000000000505611123551157014323 0ustar .TH plmpower 8 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME plmpower \- control Insteon/X10 devices via SmartLabs PLM 2412S .SH SYNOPSIS .B plmpower .I "--device serial-port" .LP .SH DESCRIPTION .B plmpower is a helper program for .B powerman which enables communication with Insteon/X10 devices via SmartLabs Power Line Modem, model 2412S. It is run interactively by the powerman daemon. It can also be useful as a standalone tool for debugging X10/Insteon networks based on the above device. .SH NETWORK SETUP Note the addresses of your Insteon/X10 devices. Plug the PLM into an AC outlet, preferably on the same electrical phase as the devices under control. Devices are available to bridge phases if this is not possible. .LP Attach the PLM's serial port to your computer, and ensure that nothing else is using the serial port such as the system console or getty(8). Run .B plmpower and try the interactive commands below to see if the devices respond reliably. .LP Once everything is working, configure .B powermand to run .B plmpower as a coprocess as described in powerman.conf(5). .SH OPTIONS .TP .I "-d, --device serial-port" Specify the path to the special file connected to the PLM's serial port. .TP .I "-t, --timeout msec" Set the Insteon timeout to the specified number of milliseconds (default 1000). .TP .I "-x, --x10-attempts number" Set the number of times to run every X10 command (default 3). X10 does not provide an ACK/NAK mechanism like Insteon so we cannot be certain that any particular X10 command completed, therefore X10 commands are issued multiple times to increase confidence. .SH INTERACTIVE COMMANDS The following commands are accepted at the plmpower> prompt. Address arguments may be Insteon (e.g. 1A.2B.3C) or X10 (e.g. G12). .TP .I "help" Display help on the available commands. .TP .I "info" Get info about the PLM. .TP .I "reset" Reset the PLM (clears the all-link db). .TP .I "on addr" Turn on device. .TP .I "off addr" Turn off device. .TP .I "status addr" Query status of device (Insteon only). .TP .I "ping addr" Time round trip request/response to device (Insteon only). .SH "FILES" @X_SBINDIR@/plmpower .br @X_SYSCONFDIR@/powerman/powerman.conf .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/vpcd.8.in0000644000000000000000000000410211123551157013401 0ustar .TH vpcd 8 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME vpcd \- virtual power control daemon .SH SYNOPSIS .B vpcd .I "[--port PORT]" .LP .SH DESCRIPTION .B vpcd is a test program for PowerMan which emulates a remote power control device. It can be run interactively by the powerman daemon, or it can listen on a port of your choosing. .SH OPTIONS .TP .I "-p, --port PORT" Instructs .B vpcd to listen for connections on the specified port instead of using stdin/stdout. Only one connection will be accepted. .SH INTERACTIVE COMMANDS The following commands are available at the vpcd> prompt: .TP .I "login" The login command must br run before any of the other commands will work. No username or password is required. .TP .I "logoff" Return .B vpcd to the initial state. .TP .I "stat PLUG|*" Show the power status of PLUG. If PLUG is ``*'', perform this action on all plugs. .TP .I "beacon PLUG|*" Show the beacon status of PLUG. If PLUG is ``*'', perform this action on all plugs. .TP .I "temp PLUG|*" Show the temperature of the node attached to PLUG. If PLUG is ``*'', perform this action on all plugs. .TP .I "spew COUNT" Print COUNT 80-char lines. This is the basis of a buffer handling test. .TP .I "on PLUG|*" Turn on PLUG. If PLUG is ``*'', perform this action on all plugs. .TP .I "off PLUG|*" Turn off PLUG. If PLUG is ``*'', perform this action on all plugs. .TP .I "flash PLUG|*" Light the beacon on PLUG. If PLUG is ``*'', perform this action on all plugs. .TP .I "unflash PLUG|*" Unlight the beacon on PLUG. If PLUG is ``*'', perform this action on all plugs. .TP .I "reset PLUG|*" Reset the node attached to PLUG. If PLUG is ``*'', perform this action on all plugs. .SH "FILES" @X_SBINDIR@/vpcd .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/man/powermand.8.in0000644000000000000000000000225411135425557014456 0ustar .TH powermand 8 "@META_DATE@" "@META_ALIAS@" "@META_NAME@" .SH NAME powermand \- power control and monitoring daemon .SH SYNOPSIS .B powermand .I "[-options]" .LP .SH DESCRIPTION .B powermand provides power management in a data center or compute cluster environment. .SH OPTIONS .TP .I "-c, --conf filename" Override the default location of the powerman configuration file .I /etc/powerman/powerman.conf. .TP .I "-f, --foreground" Do not daemonize, and send debugging/error messages to stderr instead of syslog. .TP .I "-d, --debug mask" Set mask for debugging output. .TP .I "-h, --help" Provide a synopsis of the command options. .TP .I "-V, --version" Display the powerman version number and exit. .B PowerMan and exit. .SH "FILES" @X_SBINDIR@/powermand .br @X_SYSCONFDIR@/powerman/powerman.conf .SH "ORIGIN" PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. .SH "SEE ALSO" .BR powerman (1), .BR powermand (8), .BR httppower (8), .BR plmpower (8), .BR vpcd (8), .BR powerman.conf (5), .BR powerman.dev (5), .BR powerman-devices (7). .PP \fBhttp://sourceforge.net/projects/powerman\fR powerman-2.3.5.orig/COPYING0000644000000000000000000004313107515121522012233 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. powerman-2.3.5.orig/lib/0000755000000000000000000000000011205355435011747 5ustar powerman-2.3.5.orig/lib/Makefile.in0000644000000000000000000004335311115072651014020 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/libpowerman.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/ac_curl.m4 \ $(top_srcdir)/config/ac_curses.m4 \ $(top_srcdir)/config/ac_forkpty.m4 \ $(top_srcdir)/config/ac_genders.m4 \ $(top_srcdir)/config/ac_httppower.m4 \ $(top_srcdir)/config/ac_pkgconfig.m4 \ $(top_srcdir)/config/ac_runas.m4 \ $(top_srcdir)/config/ac_wrap.m4 \ $(top_srcdir)/config/x_ac_expand_install_dirs.m4 \ $(top_srcdir)/config/x_ac_meta.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = libpowerman.pc am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libpowerman_la_LIBADD = am_libpowerman_la_OBJECTS = libpowerman.lo libpowerman_la_OBJECTS = $(am_libpowerman_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libpowerman_la_SOURCES) DIST_SOURCES = $(libpowerman_la_SOURCES) pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GCCWARN = @GCCWARN@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURSES = @LIBCURSES@ LIBFORKPTY = @LIBFORKPTY@ LIBGENDERS = @LIBGENDERS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBWRAP = @LIBWRAP@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ META_ALIAS = @META_ALIAS@ META_AUTHOR = @META_AUTHOR@ META_DATE = @META_DATE@ META_LT_AGE = @META_LT_AGE@ META_LT_CURRENT = @META_LT_CURRENT@ META_LT_REVISION = @META_LT_REVISION@ META_NAME = @META_NAME@ META_RELEASE = @META_RELEASE@ META_VERSION = @META_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ WITH_HTTPPOWER_FALSE = @WITH_HTTPPOWER_FALSE@ WITH_HTTPPOWER_TRUE = @WITH_HTTPPOWER_TRUE@ WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ X_BINDIR = @X_BINDIR@ X_DATADIR = @X_DATADIR@ X_EXEC_PREFIX = @X_EXEC_PREFIX@ X_INCLUDEDIR = @X_INCLUDEDIR@ X_INFODIR = @X_INFODIR@ X_LIBDIR = @X_LIBDIR@ X_LIBEXECDIR = @X_LIBEXECDIR@ X_LOCALSTATEDIR = @X_LOCALSTATEDIR@ X_MANDIR = @X_MANDIR@ X_OLDINCLUDEDIR = @X_OLDINCLUDEDIR@ X_PREFIX = @X_PREFIX@ X_SBINDIR = @X_SBINDIR@ X_SHAREDSTATEDIR = @X_SHAREDSTATEDIR@ X_SYSCONFDIR = @X_SYSCONFDIR@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CFLAGS = @GCCWARN@ -I$(top_srcdir)/src lib_LTLIBRARIES = libpowerman.la libpowerman_la_SOURCES = \ libpowerman.c @WITH_PKG_CONFIG_TRUE@pkgconfig_DATA = libpowerman.pc include_HEADERS = libpowerman.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh libpowerman.pc: $(top_builddir)/config.status $(srcdir)/libpowerman.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libpowerman.la: $(libpowerman_la_OBJECTS) $(libpowerman_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libpowerman_la_LDFLAGS) $(libpowerman_la_OBJECTS) $(libpowerman_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpowerman.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-pkgconfigDATA install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man \ install-pkgconfigDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: powerman-2.3.5.orig/lib/libpowerman.pc.in0000644000000000000000000000036711115072462015221 0ustar prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libpowerman Description: Centralized Power Distribution Unit (PDU) management Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lpowerman Cflags: -I${includedir} powerman-2.3.5.orig/lib/libpowerman.h0000644000000000000000000000745011115072462014441 0ustar /*****************************************************************************\ * $Id: libpowerman.h 1090 2008-12-01 23:37:22Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef LIBPOWERMAN_H #define LIBPOWERMAN_H #ifdef __cplusplus extern "C" { #endif typedef struct pm_handle_struct *pm_handle_t; typedef struct pm_node_iterator_struct *pm_node_iterator_t; typedef enum { PM_UNKNOWN = 0, PM_OFF = 1, PM_ON = 2, } pm_node_state_t; typedef enum { PM_ESUCCESS = 0, /* success */ PM_ERRNOVALID = 1, /* system call failed, see system errno */ PM_ENOADDR = 2, /* failed to get address info for server */ PM_ECONNECT = 3, /* connect failed */ PM_ENOMEM = 4, /* out of memory */ PM_EBADHAND = 5, /* bad server handle */ PM_EBADARG = 6, /* bad argument */ PM_ESERVEREOF = 7, /* received unexpected EOF from server */ PM_ESERVERPARSE = 8, /* unexpected response from server */ PM_EUNKNOWN = 201, /* server: unknown command (201) */ PM_EPARSE = 202, /* server: parse error (202) */ PM_ETOOLONG = 203, /* server: command too long (203) */ PM_EINTERNAL = 204, /* server: internal error (204) */ PM_EHOSTLIST = 205, /* server: hostlist error (205) */ PM_EINPROGRESS = 208, /* server: command in progress (208) */ PM_ENOSUCHNODES = 209, /* server: no such nodes (209) */ PM_ECOMMAND = 210, /* server: command completed with errors (210) */ PM_EQUERY = 211, /* server: query completed with errors (211) */ PM_EUNIMPL = 213, /* server: not implemented by device (213) */ } pm_err_t; /* flags for pm_connect() */ #define PM_CONN_INET6 1 /* connect using IPv6 only */ #define PM_CONN_COPROC 2 /* unimplemented */ pm_err_t pm_connect(char *server, void *arg, pm_handle_t *pmhp, int flags); void pm_disconnect(pm_handle_t pmh); pm_err_t pm_node_status(pm_handle_t pmh, char *node, pm_node_state_t *statep); pm_err_t pm_node_on(pm_handle_t pmh, char *node); pm_err_t pm_node_off(pm_handle_t pmh, char *node); pm_err_t pm_node_cycle(pm_handle_t pmh, char *node); pm_err_t pm_node_iterator_create(pm_handle_t pmh, pm_node_iterator_t *pmip); char * pm_node_next(pm_node_iterator_t pmi); void pm_node_iterator_reset(pm_node_iterator_t pmi); void pm_node_iterator_destroy(pm_node_iterator_t pmi); char * pm_strerror(pm_err_t err, char *str, int len); #define PM_DFLT_PORT "10101" #define PM_DFLT_HOST "localhost" #ifdef __cplusplus } #endif #endif /* PM_POWERMAN_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/lib/Makefile.am0000644000000000000000000000106611115072651014002 0ustar ##***************************************************************************** ## $Id: Makefile.am,v 1.72 2005/08/25 22:04:32 achu Exp $ ##***************************************************************************** ## Process this file with automake to produce Makefile.in. ##***************************************************************************** AM_CFLAGS = @GCCWARN@ -I$(top_srcdir)/src lib_LTLIBRARIES = libpowerman.la libpowerman_la_SOURCES = \ libpowerman.c if WITH_PKG_CONFIG pkgconfig_DATA = libpowerman.pc endif include_HEADERS = libpowerman.h powerman-2.3.5.orig/lib/libpowerman.c0000644000000000000000000004165011115237235014435 0ustar /*****************************************************************************\ * $Id: libpowerman.c 1098 2008-12-02 13:56:45Z garlick $ ***************************************************************************** * Copyright (C) 2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* * libpowerman.c - simple powerman client library */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "client_proto.h" #include "libpowerman.h" #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif #ifndef MAXPORTNAMELEN #define MAXPORTNAMELEN 64 #endif #define PMH_MAGIC 0x44445555 struct pm_handle_struct { int pmh_magic; int pmh_fd; }; typedef void (*list_free_t) (void *x); struct list_struct { char * data; struct list_struct *next; list_free_t freefun; }; #define PMI_MAGIC 0x41a452b5 struct pm_node_iterator_struct { int pmi_magic; struct list_struct *pmi_nodes; struct list_struct *pmi_pos; }; static pm_err_t _list_add(struct list_struct **head, char *s, list_free_t freefun); static void _list_free(struct list_struct **head); static int _list_search(struct list_struct *head, char *s); static int _strncmpend(char *s1, char *s2, int len); static char * _strndup(char *s, int len); static void _parse_hostport(char *s, char *host, char *port); static pm_err_t _connect_to_server_tcp(pm_handle_t pmh, char *server, int family); static pm_err_t _parse_response(char *buf, int len, struct list_struct **respp); static pm_err_t _server_recv_response(pm_handle_t pmh, struct list_struct **respp); static pm_err_t _server_send_command(pm_handle_t pmh, char *cmd, char *arg); static pm_err_t _server_command(pm_handle_t pmh, char *cmd, char *arg, struct list_struct **respp); /* Add [s] to the list referenced by [head], registering [freefun] to * be called on [s] when the list is freed. */ static pm_err_t _list_add(struct list_struct **head, char *s, list_free_t freefun) { struct list_struct *new; if (!(new = malloc(sizeof(struct list_struct)))) return PM_ENOMEM; new->data = s; new->next = *head; new->freefun = freefun; *head = new; return PM_ESUCCESS; } /* Free the list referred to by [head]. */ static void _list_free(struct list_struct **head) { struct list_struct *lp, *tmp; for (lp = *head; lp != NULL; lp = tmp) { tmp = lp->next; if (lp->freefun) lp->freefun(lp->data); free(lp); } *head = NULL; } /* Scan the list referenced by [head] looking for an element containing * exactly the string [s], returning true if found. */ static int _list_search(struct list_struct *head, char *s) { struct list_struct *lp; for (lp = head; lp != NULL; lp = lp->next) if (strcmp(lp->data, s) == 0) return 1; return 0; } /* Test if [s2] is a terminating substring of [s1]. */ static int _strncmpend(char *s1, char *s2, int len) { return strncmp(s1 + len - strlen(s2), s2, strlen(s2)); } /* Duplicate string [s] of length [len]. * Result will be NULL terminated. [s] doesn't have to be. */ static char * _strndup(char *s, int len) { char *c; if ((c = (char *)malloc(len + 1))) { memcpy(c, s, len); c[len] = '\0'; } return c; } static void _parse_hostport(char *s, char *host, char *port) { char *p; if (s) snprintf(host, MAXHOSTNAMELEN, "%s", s); else snprintf(host, MAXHOSTNAMELEN, "%s", PM_DFLT_HOST); if ((p = strchr(host, ':'))) { *p++ = '\0'; snprintf(port, MAXPORTNAMELEN, "%s", p); } else snprintf(port, MAXPORTNAMELEN, "%s", PM_DFLT_PORT); } /* Establish connection to powermand [server]. * Connection state is returned in the handle. */ static pm_err_t _connect_to_server_tcp(pm_handle_t pmh, char *server, int family) { struct addrinfo hints, *res, *r; pm_err_t err = PM_ECONNECT; char host[MAXHOSTNAMELEN], port[MAXPORTNAMELEN]; memset(&hints, 0, sizeof(hints)); hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; _parse_hostport(server, host, port); if (getaddrinfo(host, port, &hints, &res) != 0 || res == NULL) return PM_ENOADDR; for (r = res; r != NULL; r = r->ai_next) { if ((pmh->pmh_fd = socket(r->ai_family, r->ai_socktype, 0)) < 0) continue; if (connect(pmh->pmh_fd, r->ai_addr, r->ai_addrlen) < 0) { close(pmh->pmh_fd); continue; } err = PM_ESUCCESS; break; } freeaddrinfo(res); return err; } /* Parse a server response stored in [buf] of length [len] into * an array of lines stored in [respp] which caller must free. */ static pm_err_t _parse_response(char *buf, int len, struct list_struct **respp) { int i, l = strlen(CP_EOL); char *p, *cpy; struct list_struct *resp = NULL; pm_err_t err = PM_ESUCCESS; p = buf; for (i = 0; i < len - l; i++) { if (strncmp(&buf[i], CP_EOL, l) != 0) continue; if ((cpy = _strndup(p, &buf[i] - p + l)) == NULL) { err = PM_ENOMEM; break; } if ((err = _list_add(&resp, cpy, (list_free_t)free)) != PM_ESUCCESS) break; p = &buf[i + l]; } if (err == PM_ESUCCESS && respp != NULL) *respp = resp; else _list_free(&resp); return err; } /* Scan response from server for return code. */ static pm_err_t _server_retcode(struct list_struct *resp) { int code; pm_err_t err = PM_ESERVERPARSE; /* N.B. there will only be one 1xx or 2xx code in a response */ while (resp != NULL) { if (sscanf(resp->data, "%d ", &code) == 1) { switch (code) { case 1: /* hello */ case 101: /* goodbye */ case 102: /* command completed successfully */ case 103: /* query complete */ case 104: /* telemetry on|off */ case 105: /* hostrange expansion on|off */ err = PM_ESUCCESS; break; case PM_EUNKNOWN: case PM_EPARSE: case PM_ETOOLONG: case PM_EINTERNAL: case PM_EHOSTLIST: case PM_EINPROGRESS: case PM_ENOSUCHNODES: case PM_ECOMMAND: case PM_EQUERY: case PM_EUNIMPL: err = code; break; default: /* 3xx informational (ignore) */ break; } } resp = resp->next; } return err; } /* Read response from server handle [pmh] and store it in * [resp], an array of lines. Caller must free [resp]. */ static pm_err_t _server_recv_response(pm_handle_t pmh, struct list_struct **respp) { int buflen = 0, count = 0, n; char *buf = NULL; pm_err_t err = PM_ESUCCESS; struct list_struct *resp; do { if (buflen - count == 0) { buflen += CP_LINEMAX; buf = buf ? realloc(buf, buflen) : malloc(buflen); if (buf == NULL) { err = PM_ENOMEM; break; } } n = read(pmh->pmh_fd, buf + count, buflen - count); if (n == 0) { err = PM_ESERVEREOF; break; } if (n < 0) { err = PM_ERRNOVALID; break; } count += n; } while (_strncmpend(buf, CP_PROMPT, count) != 0); if (err == PM_ESUCCESS) { err = _parse_response(buf, count, &resp); if (err == PM_ESUCCESS) { err = _server_retcode(resp); if (err == PM_ESUCCESS && respp != NULL) *respp = resp; else _list_free(&resp); } } if (buf != NULL) free(buf); return err; } /* Send command [cmd] with argument [arg] to server handle [pmh]. * [cmd] is treated as a printf format string with [arg] as the * first printf argument (can be NULL). */ static pm_err_t _server_send_command(pm_handle_t pmh, char *cmd, char *arg) { char buf[CP_LINEMAX]; int count, len, n; pm_err_t err = PM_ESUCCESS; snprintf(buf, sizeof(buf), cmd, arg); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), CP_EOL); count = 0; len = strlen(buf); while (count < len) { n = write(pmh->pmh_fd, buf + count, len - count); if (n < 0) { err = PM_ERRNOVALID; break; } count += n; } return err; } /* Send command [cmd] with argument [arg] to server handle [pmh]. * If [respp] is non-NULL, return list of response lines which * the caller must free. */ static pm_err_t _server_command(pm_handle_t pmh, char *cmd, char *arg, struct list_struct **respp) { pm_err_t err; if ((err = _server_send_command(pmh, cmd, arg)) != PM_ESUCCESS) return err; if ((err = _server_recv_response(pmh, respp)) != PM_ESUCCESS) return err; return PM_ESUCCESS; } pm_err_t pm_connect(char *server, void *arg, pm_handle_t *pmhp, int flags) { pm_handle_t pmh = NULL; pm_err_t err; if (pmhp == NULL) return PM_EBADARG; if ((pmh = (pm_handle_t)malloc(sizeof(struct pm_handle_struct))) == NULL) return PM_ENOMEM; pmh->pmh_magic = PMH_MAGIC; if ((err = _connect_to_server_tcp(pmh, server, (flags & PM_CONN_INET6) ? PF_INET6 : PF_UNSPEC)) != PM_ESUCCESS) { (void)close(pmh->pmh_fd); free(pmh); return err; } if ((err = _server_recv_response(pmh, NULL)) != PM_ESUCCESS) { (void)close(pmh->pmh_fd); free(pmh); return err; } if ((err = _server_command(pmh, CP_EXPRANGE, NULL, NULL)) != PM_ESUCCESS) { (void)close(pmh->pmh_fd); free(pmh); return err; } if (err == PM_ESUCCESS) *pmhp = pmh; else free(pmh); return err; } static pm_err_t _node_iterator_create(pm_node_iterator_t *pmip) { pm_node_iterator_t pmi; if (!(pmi = malloc(sizeof(struct pm_node_iterator_struct)))) return PM_ENOMEM; pmi->pmi_magic = PMI_MAGIC; pmi->pmi_pos = pmi->pmi_nodes = NULL; *pmip = pmi; return PM_ESUCCESS; } void pm_node_iterator_destroy(pm_node_iterator_t pmi) { _list_free(&pmi->pmi_nodes); pmi->pmi_pos = NULL; pmi->pmi_magic = 0; free(pmi); } pm_err_t pm_node_iterator_create(pm_handle_t pmh, pm_node_iterator_t *pmip) { pm_node_iterator_t pmi; struct list_struct *lp, *resp; char *cpy, node[CP_LINEMAX]; pm_err_t err; if (pmh == NULL || pmh->pmh_magic != PMH_MAGIC) return PM_EBADHAND; if ((err = _node_iterator_create(&pmi)) != PM_ESUCCESS) return err; if ((err = _server_command(pmh, CP_NODES, NULL, &resp)) != PM_ESUCCESS) { pm_node_iterator_destroy(pmi); return err; } for (lp = resp; lp != NULL; lp = lp->next) { if (sscanf(lp->data, CP_INFO_XNODES, node) == 1) { if (!(cpy = strdup(node))) { err = PM_ENOMEM; break; } err = _list_add(&pmi->pmi_nodes, cpy, (list_free_t)free); if (err != PM_ESUCCESS) break; } } if (err == PM_ESUCCESS && pmip != NULL) { pm_node_iterator_reset(pmi); *pmip = pmi; } else pm_node_iterator_destroy(pmi); _list_free(&resp); return err; } char * pm_node_next(pm_node_iterator_t pmi) { struct list_struct *cur = pmi->pmi_pos; if (!cur) return NULL; pmi->pmi_pos = pmi->pmi_pos->next; return cur->data; } void pm_node_iterator_reset(pm_node_iterator_t pmi) { pmi->pmi_pos = pmi->pmi_nodes; } /* Disconnect from server handle [pmh] and free the handle. */ void pm_disconnect(pm_handle_t pmh) { if (pmh != NULL && pmh->pmh_magic == PMH_MAGIC) { (void)_server_command(pmh, CP_QUIT, NULL, NULL); /* PM_ESERVEREOF */ (void)close(pmh->pmh_fd); free(pmh); } } /* Query server [pmh] for the power status of [node], and store it * in [statep]. */ pm_err_t pm_node_status(pm_handle_t pmh, char *node, pm_node_state_t *statep) { char offstr[CP_LINEMAX], onstr[CP_LINEMAX]; pm_err_t err; struct list_struct *resp; pm_node_state_t state; if (pmh == NULL || pmh->pmh_magic != PMH_MAGIC) return PM_EBADHAND; if ((err = _server_command(pmh, CP_STATUS, node, &resp)) != PM_ESUCCESS) return err; snprintf(offstr, sizeof(offstr), CP_INFO_XSTATUS, node, "off"); snprintf(onstr, sizeof(onstr), CP_INFO_XSTATUS, node, "on"); if (_list_search(resp, offstr)) state = PM_OFF; else if (_list_search(resp, onstr)) state = PM_ON; else state = PM_UNKNOWN; _list_free(&resp); if (statep) *statep = state; return PM_ESUCCESS; } /* Tell server [pmh] to turn [node] on. */ pm_err_t pm_node_on(pm_handle_t pmh, char *node) { if (pmh == NULL || pmh->pmh_magic != PMH_MAGIC) return PM_EBADHAND; return _server_command(pmh, CP_ON, node, NULL); } /* Tell server [pmh] to turn [node] off. */ pm_err_t pm_node_off(pm_handle_t pmh, char *node) { if (pmh == NULL || pmh->pmh_magic != PMH_MAGIC) return PM_EBADHAND; return _server_command(pmh, CP_OFF, node, NULL); } /* Tell server [pmh] to cycle [node]. */ pm_err_t pm_node_cycle(pm_handle_t pmh, char *node) { if (pmh == NULL || pmh->pmh_magic != PMH_MAGIC) return PM_EBADHAND; return _server_command(pmh, CP_CYCLE, node, NULL); } /* Convert error code to human readable string. */ char * pm_strerror(pm_err_t err, char *str, int len) { switch (err) { case PM_ESUCCESS: strncpy(str, "success", len); break; case PM_ERRNOVALID: strncpy(str, strerror(errno), len); break; case PM_ENOADDR: strncpy(str, "failed to get address info for server", len); break; case PM_ECONNECT: strncpy(str, "connect failed", len); break; case PM_ENOMEM: strncpy(str, "out of memory", len); break; case PM_EBADHAND: strncpy(str, "bad server handle", len); break; case PM_EBADARG: strncpy(str, "bad argument", len); break; case PM_ESERVEREOF: strncpy(str, "received unexpected EOF from server", len); break; case PM_ESERVERPARSE: strncpy(str, "unexpected response from server", len); break; case PM_EUNKNOWN: strncpy(str, "server: unknown command", len); break; case PM_EPARSE: strncpy(str, "server: parse error", len); break; case PM_ETOOLONG: strncpy(str, "server: command too long", len); break; case PM_EINTERNAL: strncpy(str, "server: internal error", len); break; case PM_EHOSTLIST: strncpy(str, "server: hostlist error", len); break; case PM_EINPROGRESS: strncpy(str, "server: command in progress", len); break; case PM_ENOSUCHNODES: strncpy(str, "server: no such nodes", len); break; case PM_ECOMMAND: strncpy(str, "server: command completed with errors", len); break; case PM_EQUERY: strncpy(str, "server: query completed with errors", len); break; case PM_EUNIMPL: strncpy(str, "server: not implemented by device", len); break; } return str; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/ChangeLog-1.00000644000000000000000000014452511015151010013240 0ustar 2008-04-25 Jim Garlick * etc/powerman.dev : Remove status_all, add status. This is slower but unless all hosts are entered into both powerman.conf files, status_all doesn't work. 2008-03-19 Jim Garlick * etc/ibmbladecenter.dev : Clean up: - Simplify some regexes and delete commented out, non-working code. - Add delays to account for settling time after on/off commands. - Add command to login script to disable telnet session timeout. - Tested with "Advanced Management Module". * etc/baytech-rpc28-nc.dev : Clean up: - Fix problem problem with initial command failing (serial RPC-28A) by adding delay and "end of buffer" prompt matching. - Use \r not \r\n for line termination. 2008-02-19 Jim Garlick * src/client.c, parse.y, powerman.c, powermand.c, wrappers.c : Change a few #includes for gcc 4.3/Fedora 9. [Jarod Wilson] 2008-01-24 Jim Garlick * powerman.spec : BuildRequires changes: - change tcp_wrappers-devel to tcp_wrappers for RHEL 5 - add readline-devel * : tag powerman-1.0.32 2007-12-10 Jim Garlick * etc/swpdu.dev : New, for APPRO PDU. [Trent D'Hooge] 2007-12-04 Jim Garlick * etc/apcpdu3.dev : Make query response tolerant of configurable plug name strings [Trent D'Hooge] 2007-11-26 Jim Garlick * src/httppower.c : New httppower daemon for HTTP based power controllers. * etc/dli.dev : Support for Digital Loggers, Inc. power controllers. 2007-11-21 Jim Garlick * etc/apcpdu3.dev : New apc variant for new firmware [Trent D'Hooge] 2007-10-20 Jim Garlick * etc/ilom-inline.dev : Add support for Sun ILOM over system console. * man/powerman-devices.7 : Fix typo in cyclades section. * scripts/build : Remove, also rpm targets in Makefile. * : tag powerman-1.0.31 2007-10-05 Jim Garlick * powerman.spec : Add BuildRequries for bison. * src/parse.lex : Consider \r to be white space. * : tag powerman-1.0.30 2007-09-06 Albert Chu * etc/ipmipower.dev: Modify cycle/reset to use off and on. * man/powerman-devices.7: Adjust text appropriately for changes. * : tag powerman-1.0.29 2007-06-19 Jim Garlick * powerman.spec : Add flex to BuildRequires. 2007-06-13 Jim Garlick * scripts/build : Build .src.rpm and append %{?dist} to Release. 2007-05-07 Jim Garlick * etc/*.dev : Raise cycle and cycle_all delays from 2 sec to 4 sec to accomodate power supplies that take a while to bleed off. * : tag powerman-1.0.28 2007-04-24 Jim Garlick * Makefile : Added rpms-working, rpms-trunk, rpms-release, tagrel targets. * ChangeLog : Unexpand tabs to unconfuse vim syntax coloring. * : tag powerman-1.0.27 2007-03-05 Jim Garlick * scripts/stonith-powerman : New for heartbeat package. * etc/powerman.spec : Install stonith-powerman into the location where heartbeat expects it. * scripts/build : Added copy of Chris's build script. * Makefile : Added testrpm target. 2007-01-07 Jim Garlick * etc/baytech-rpc28-nc.dev : Fix problem problem with plugs >= 10. 2006-12-28 Albert Chu * man/powerman-devices.7: Add information about ipmipower. 2006-12-21 Jim Garlick * etc/baytech-rpc{3,28}-nc.dev: Work around problem with foreachplug where loop doesn't reset after a reconnect. * : tag powerman-1.0.26 2006-11-27 Jim Garlick * etc/baytech-rpc3-nc.dev: Fix status_all regex. * etc/baytech-rpc28-nc.dev: Bring over changes from rpc3-nc in anticipation of new firmware. 2006-11-15 Albert Chu * : Branched powerman-2-0-0 2006-11-14 Albert Chu Add ranged power control support. * src/parse.lex, src/parse.y, src/device.h : Add parsing support for on_range, off_range, cycle_range, and reset_range. * src/device.c (_get_ranged_script): New function. * src/device.c (_create_action, _create_exec_ctx, _destroy_exec_ctx, _process_ifonoff, _process_send, _process_setplugstate): Rearchitect to support multiple plugs. * src/device.c (_enqueue_targetted_actions): Call range script when appropriate. * man/powerman.dev.5: Updated appropriately. * etc/ipmipower.dev: Add ranged scripts. * META, powerman.spec: Update for pre-release. * : tag powerman-1.0.26-0-pre1 * NEWS: Updated with ranged support news. 2006-10-27 Jim Garlick * etc/apcold.dev: New. [Zach Brown] 2006-10-25 Jim Garlick * examples/*: Move tcpwrappers directive to after includes, otherwise it's a parse error. 2006-09-11 Albert Chu * etc/ipmipower.dev: Cleaned up regex for all possible outputs. 2006-09-08 Jim Garlick * etc/baytech-rpc3-nc.dev: tighten up expect script to avoid confusing status of outlet 1 with temperature in status screen on some units. 2006-08-29 Jim Garlick * etc/apc7900.dev: New. [Martin Petereson] 2006-08-22 Jim Garlick * src/device.c: handle_read(): log EOF only if DBG_DEVICE, not unconditionally on stderr. 2006-08-18 Jim Garlick * src/hostlist.[ch]: update to the latest from lsd-tools to fix memory leak regression [coverity]. 2006-08-16 Jim Garlick * test/vicebox.[ch], test/svicebox.c, etc/vicebox.dev: Removed. * scripts/*.sh: Removed (vicebox stuff). * Makefile, src/Makefile: Cleanup. * src/parse.y, src/device_tcp.c: Support 'quiet' TCP device option which suppresses connect/disconnect/telnet log messages. Undocumented for now (for Douglas Clay at Sandia CA). * src/device_tcp.c: Respond WONT to TELOPT_BINARY sent by Cyclades. * : tag powerman-1.0.25 2006-08-01 Jim Garlick * src/device_tcp.c: _telnet_recvopt(): Respond WONT to TELOPT_ECHO and TELOPT_LFLOW sent by newer baytechs. 2006-07-12 Jim Garlick * etc/baytech-rpc3-nc.dev: slight mods to support newer firmware. 2006-06-20 Jim Garlick * etc/icebox4.dev: New (from Jarod Wilson). 2006-05-30 Jim Garlick * : tag powerman-1.0.24 * powerman.spec: fixed typo in %defattr * : tag powerman-1.0.24-2 2006-05-25 Jim Garlick * src/hostlist.[ch]: update to the latest from lsd-tools to fix case where powerman would not expand [00-26]p. 2006-05-24 Jim Garlick * src/device_tcp.c: _telnet_recvopt(): log any ignored option negotiation requests. Respond WONT to TELOPT_NEW_ENVIRON, TELOPT_XDISPLOC, TELOPT_TSPEED to make Digi terminal server in telnet mode happy (gnat powerman/634). * powerman.spec: Include examples directory in RPM. * etc/cyclades-pm10.dev: New [Trent D'Hooge]. 2006-04-26 Jim Garlick * src/hostlist.c: hostlist_next(): call out_of_memory() on malloc failure [coverity]. * src/client.c: always free hostlist_next() result if non-null [coverity]. * src/device_serial.c: document valid return for sscanf() with an assert() [coverity]. * src/client.c: _client_query_status_reply_nointerp(): ensure hostlist_destroy() is called on all function exit paths [coverity]. 2006-03-27 Jim Garlick * etc/powerman.spec: Rework %files section per https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=180747 2006-03-27 Jim Garlick * man/powerman.dev.5: New. * man/powerman.conf.5: Tidy up. * etc/ibmbladecenter.dev: Tidy up. 2006-03-26 Jim Garlick * src/device_serial.c: support baud rates up to B460800 if system does. * etc/phantom4.dev: fix for early v4.0 firmware with broken P0|P1. * etc/cb-7050.dev: New, experimental. * etc/README: Removed. 2006-03-13 Jim Garlick * etc/ibmbladecenter.dev: New, experimental. 2006-02-16 Jim Garlick * test/vpcd.c: handle undefined PTHREAD_THREADS_MAX on FC4. * Makefile, src/Makefile: take release number out of version string. * powerman.spec: spec file changes for Fedora submission [Ben Woodard] * : tag powerman-1.0.23 2005-10-12 Jim Garlick * Makefile, Make-rpm.mk, META: Update for Chris's build script. * : tag powerman-1.0.22 2005-09-22 Jim Garlick * etc/apcpdu.dev: fixed script after debug on Gauss cluster. 2005-07-09 Jim Garlick * src/hprintf.c: fixed improper va_list handling (originally reported by Thayne Harbaugh at LNXI) that was causing powermand to segfault when the client used -T on a nakoma 64 bit system. * etc/apcpdu.dev: New (from Makia Minich) * Makefile: Added apcpdu.dev to install target. * etc/*, test/*.pl, test/*.c: Remove RCS Source keyword and fix some instances of Id that got mangled somewhere along the way. * contributed/pullizi.tgz: This tarball was corrupt. Removed for now. 2005-07-08 Jim Garlick * : Chris converted from CVS to subversion. Roughly here are his comments: I did not disable cvs2svn's keyword expansion. On the plus side, cvs2svn automatically sets the svn:keywords property on most files, which is the behavior you pro'ly want. On the down side, tagged releases are no longer byte-compatible with their former cvs counterparts since keyword expansion differs slightly under svn; the dollar-Id-dollar metadata is the same, just in a slightly different format. I've added our default hook scripts which requires you enter a commit message, allows you to modify the svn:log revision property, and prevents you from modifying anything under a /tags/ dir. 2005-03-22 Albert Chu * META: Updated for new release. * : tag powerman-1-0-21 2005-03-09 Jim Garlick * src/device.c: fixed memory leak dbg_actions (gnat powerman/233). * src/list.c: turn on MYALLOC. 2005-02-25 Jim Garlick * test/Makefile: run64vg and run2048vg targets added for valgrind. * src/list.[ch]: updated to latest from lsd-tools project. There appears to be a memory leak fix in here. * src/hash.c: fixed memory leak in hash_destroy(), also fixed in latest from lsd-tools. Didn't update because latest requires thread.h stuff and didn't want to hassle. * src/hostlist.c: updated to latest from lsd-tools project. Added "MYALLOC" define to allow local memory allocator to be turned on and off when debugging with valgrind. * src/arglist.c: fixed two memory leaks strings returned by hostlist_next() must be freed * src/client.c: fixed two memory leaks strings returned by hostlist_next() must be freed * src/parse_util.c: fixed three memory leaks strings returned by hostlist_next() must be freed * src/pluglist.c: fixed four memory leaks strings returned by hostlist_next() must be freed * src/device.c: fixed memory leak in dev_destroy(). * src/parse.y: add a missing 'break' after default case stmt. 2004-09-21 Albert Chu * ChangeLog: Fixed dates in ChangeLog. It's 2004 not 2003. * examples/powerman.conf-thundered: Fix typo in example and added a few notes. 2004-05-28 Jim Garlick * examples: added a few example powerman.conf files per Robin's request. 2004-03-19 Jim Garlick * etc/apc.dev, etc/apcnew.dev: changed comments about firmware revs supported by each APC script variant per report by Zach Brown . * : tag powerman-1-0-20 2004-03-17 Albert Chu * etc/ipmipower.dev: Updated regex with new possible output and fixed regex bug. 2004-02-24 Jim Garlick * powerman.spec: fixed default attrs for %doc files. 2004-02-19 Jim Garlick * src/pluglist.[ch]: new PlugList abstraction for lists of Plugs. * src/device.c, src/parse.y, src/client.c: use new PlugList code. * test/tpl.c: test driver for pluglist code. 2004-02-09 Jim Garlick * src/parse.lex: fixed for gnat 323: powerman core dumps on incorrect config file. 2004-01-12 Jim Garlick * src/arglist.[ch], src/device.c: further cleanup of ArgList abstraction 2004-01-12 Albert Chu * etc/ipmipower.dev: Fixed regex typo, it should now compile. 2004-01-10 Jim Garlick * src/parse.y: allow hostlists in the 'plug name' field of a node specification, e.g. this now works: node "thunder[0-63]" "i0" "pthunder[0-63]" * etc/ipmipower.dev: Last regex didn't compile - try this one? * powerman.spec: fix test in %post scriptlet 2004-01-09 Albert Chu * etc/ipmipower.dev: Added additional expressions that result in powerman returning an unknown state. 2003-12-22 Jim Garlick * etc/ibmh8.dev: Fixed regular expression bug in status_all script. 2003-12-22 Albert Chu * etc/ipmipower.dev: Removed "not discovered" as acceptable message to indicate power is off. Power status should be unknown. Fixed regular expression bug in status_all script. 2003-12-22 Jim Garlick * src/arglist.[ch]: Fixed thinko in arglist_get prototype. 2003-12-21 Jim Garlick * src/arglist.[ch]: New. Pulled content from device.c and tried to abstract more effectively. Make it possible to preserve order of ArgList despite the use of a hash table for efficiency. * src/device.c, src/client.c: use new arglist interfaces. * : tag powerman-1-0-19-argval 2003-12-19 Jim Garlick * Makefile, powerman.spec, man/powerman.1: remove 'on' and 'off' sym links. * etc/README: added statement description. * powerman.spec: post scriptlet stops and restarts powerman, if it was running. * etc/powerman.dev: New. 2003-12-17 Jim Garlick * src/device.c: remove _verify_plugassign (hold over from when we had setplugname commands in scripts). * src/device_pipe.c: assert no string overflow from forkpty(). 2003-12-08 Jim Garlick * etc/vpc.dev: implement status_all, on_all, off_all, and cycle_all for efficiency. * src/device.c, src/powermand.c, src/wrappers.c: introduce poll debugging code and fix bug where poll loop would spin when poll returned errors on devices. * src/device.c: rewrite dev_post_poll() for clarity. * src/device_pipe.c, Makefile: use openpty() from -lutil instead of local pty_open. This gets pty allocation right once and for all. * src/pty.[ch]: removed. * src/hash.[ch]: new from lsd-tools (courtesy Chris Dunlap) * src/device.[ch], src/client.c: changed ArgList to use hash_t instead of List since gprof showed list searching was the bottleneck in big configs. Caveat: unsorted output (-x, temperature) is no longer returned in config file order. * : tag powerman-1-0-19 2003-12-04 Jim Garlick * etc/cyclades-pm8.dev: fixed status script to not fail intermittently depending on breakdown of partial reads. * etc/cyclades-pm8.dev: device has a non-configurable inactivity timeout so log on and off for each command. * etc/baytech-rpc28-nc.dev: device has a non-configurable inactivity timeout so repeat login sequence before each command (it works whether logged in or not). * powerman.spec: add %dir entries for directories that may be inadvertantly created with too restrictive permissions like /usr/man/man7. 2003-12-03 Albert Chu * /etc/ipmipower.dev: Removed "timed out" as acceptable message to indicate power is off. Power status should be unknown when there is a timeout. 2003-12-02 Jim Garlick * man/powerman-devices.7: Added. 2003-12-02 Albert Chu * etc/ipmipower.dev: Replaced "failed to connect" with "timed out" and "not discovered". 2003-11-30 Jim Garlick * src/wrappers.[ch], src/device.[ch], src/client.[ch], powermand.c: Add logic to use poll() if available, or select() if not. This gets around the fixed 1024 bit size of FD_SETS used with select under Linux, which effectively limited the maximum number of devices to under 1024. 2003-11-30 Jim Garlick * src/powerman.c: handle partial reads on powermand socket. Fixes the very occasional 'unexpected response from server' errors. * src/powerman.c: don't initiate connect to server until options have been validated (avoids 'client read returned EOF' messages from server when someone mistypes a command). * src/client_proto.h, src/client.c: add connect_state to device query output. * test/vpcd.c, test/mkconf.pl, etc/vpc.dev: change vpcd plugs from 8 to 16. * src/pty.c: fixed _ptym_open to work beyond 176 ptys on Linux (up to 256). * test/Makefile: targets for testing scalability * test/testing.txt: added. * src/Makefile, src/debug.h: make dbg() macro a noop out if NDEBUG defined. * : tag powerman-1-0-18-prepoll 2003-11-28 Jim Garlick * src/wrappers.c, src/powerman.c, src/device_tcp.c: make Connect() non-fatal on ECONNREFUSED. * src/powermand.c: make daemonization happen after cli_listen() so errors about binding to the powermand port are reported on stderr. * src/pty.c: rework error handling. 2003-11-24 Jim Garlick * src/parse.y: add ability to put hostlists in 'node' line. If hardwired plug names, plug names are assigned in order. If not, plug names are set equal to node names. This should substantially reduce the size of powerman.conf files on large clusters. * test/vpcd.c: add --foreground option for running on a pty. * test/TESTRIG: removed * test/mkconf.pl: added 2003-10-29 Albert Chu * etc/ipmipower.dev: Added "failed to connect" to query checks. 2003-10-17 Albert Chu * etc/ipmipower.dev: New File * man/powerman.1: Added info about HOST RANGES under tcsh. Fixed typo in powerman examples. * Makefile: Install new ipmipower.dev file. 2003-10-16 Jim Garlick * src/device_pipe.c: after closing one side of the pty, send a SIGTERM to child processes before attempting to reap them. This solves a powerman deadlock observed with h8power on ALC. 2003-10-03 Jim Garlick * src/hostlist.[ch], src/config.h: updated to latest hostlist package from lsd-tools. 2003-09-26 Jim Garlick * etc/phantom-llnl.dev: remove this config file for LLNL-specific phantom3 functionality which was never deployed in production. * etc/phantom4.dev: New. 2003-09-18 Jim Garlick * src/device.c, src/parse.y, etc/ibmh8.dev: removed support for setplugname statement. Now if the 'plug name' line is omittted from the device.dev file, any plug name can be specified in the config file. Also, if the plug name is omitted in the config file, the node name is used. * NEWS: updated for 1.0.19 release. Include as news everything since 1.0.16 since 17 and 18 were not widely distributed. 2003-09-17 Jim Garlick * src/hprintf.[ch], src/argv.[ch], src/wrappers.[ch]: import stuff from h8power project. * src/device_serial.c: lockf serial devices, close fd on error path. 2003-09-03 Jim Garlick * etc/ibmrsa.dev, etc/ibmrsa-smc.dev: Removed support for IBM RSA adapter per request of IBM. * : tag powerman-1-0-18 2003-08-17 Jim Garlick * etc/ibmh8.dev: Added and got working with 'h8power' utility. 2003-08-06 Jim Garlick * etc/cyclades-pm8.dev: got working with PM8i over serial. * man/powerman.conf.5: document the three forms of device specification. * : tag powerman-1-0-17 2003-08-04 Jim Garlick * src/client.c: clean up disconnect logic. * etc/ipmi.dev: got working with Intel SE7501WV1 motherboard. * etc/baytech-rpc3-nc.dev: minor tweak to get working again on ILX cluster. * powerman.spec: don't start/stop daemon on install per Trent's request. 2003-08-03 Jim Garlick * src/device*.c: move all retry logic to device.c and enforce backoff on all reconnects whether they be due to inability to establish a connection or a script timeout. The only thing that resets the reconnect backoff count is a client request. 2003-08-02 Jim Garlick * src/device.c: print useful error message in process_setplugname if node does not exist. * src/client.c: pm --device output now lists nodes only if they have been mapped to plug names. * src/client.c: sort the list of nodes returned by pm --list. * src/device.c: emit warning if node does not have plug name assigned after login script completes (successfully or with timeout). * src/device.h: increase max buffer size from 8K to 64K as we were seeing the occasional ENOSPC error. 2003-08-01 Jim Garlick * src/device.h: decrease max buffer size from 1M to 8K. * src/client.c: sort the list of nodes returned by pm --device 2003-07-29 Jim Garlick * etc/phantom-llnl.dev,etc/phantom.dev: reduced timeout 20s->5s. * Makefile: distribute phantom-llnl.dev. 2003-07-23 Jim Garlick * etc/ibmrsa.dev: Tweaked for new firmware release. * etc/ibmrsa-smc.dev: New. Config for RSA connected to main board via system management connector. * etc/baytech-rpc3-nc.dev: Make it look more like the rpc28 config. 2003-07-21 Jim Garlick * : minor code cleanup 2003-07-16 Jim Garlick * etc/ipmi.dev: New. 2003-07-15 Jim Garlick * etc/baytech-rpc28-nc.dev, etc/baytech-rpc3-nc.dev: minor fine tuning based on IGS cluster experience with rpc28's. * src/device_pipe.[ch], src/pty.[ch]: New. * src/parse.y: Support for "pipe device". * etc/phantom-llnl.dev: New - phantom firmware with llnl mods. 2003-07-09 Jim Garlick * etc/baytech-rpc28-nc.dev, etc/baytech-rpc3-nc.dev, etc/baytech.dev: Make prompt recognition less restrictive. 2003-07-01 Jim Garlick * etc/phantom.dev: Reflect changes in 3.0.4b firmware. 2003-06-23 Jim Garlick * etc/baytech-rpc3-nc.dev: New for ilx RPC3 "NC" model with new/different firmware than expected in baytech.dev. * etc/baytech-rpc28-nc.dev: Renamed from baytech-rpc28.dev to reflect that this is the same "NC" firmware as above (but with 28 ports). * README, Makefile, powerman.spec: Cleanup. 2003-06-06 Jim Garlick * etc/README: New doc for specification syntax. * etc/parse.lex, etc/parse.y: Removed some unused tokens. 2003-06-04 Jim Garlick * etc/apcnew.dev: New device type for newer firmware APC masterswitches. 2003-05-20 Jim Garlick * etc/baytech-rpc28.dev: New 2003-05-06 Jim Garlick * src/{device*,parse.y}: abstract tcp- or serial-specific data in device_serial.c and device_tcp.c. 2003-05-05 Jim Garlick * src/{device.[ch],device_tcp.c,device_serial.c}: renamed dev->connect_status to dev->connect_state and fixed a couple of places where it was being treated as a bitmask instead of an enum. * src/device.[ch]: replaced dev->script_status with dev->logged_in flag and ExecCtx 'processing' flag. * src/device*: replaced conditional calls to tcp/serial connect/disconnect functions with function pointers. Moved device_telnet.c into device_tcp.c. * src/parse.y: cleaned up host/flags parsing. * src/powermand.c: ignore SIGPIPE. 2003-05-01 Jim Garlick * src/parse.y: destroyStmt was trying to destroy NULL setplugstate.interps list. * src/*: Eliminate device types. Deduce whether TCP or serial from presence of leading '/' in hostname. Change powerman.conf syntax to want hostname:port in the hostname field, reserving last position for flags (future use). Enable telnet option processing always. * etc/powerman.conf.vicebox: Removed. * etc/powerman.conf.vpc : Removed. 2003-05-01 Jim Garlick * etc/phantom.dev: got working with the actual hardware (all but temp) 2003-04-23 Jim Garlick * src/*: rename "setstatus" to "setplugstate". * etc/ibmrsa.dev: fix reversed regex parameters to setplugname command. 2003-04-21 Jim Garlick * src/{parse.y,parse.lex,device.c}: Add "ifon" and "ifoff" conditionals. * src/wrappers.c: workaround for RH9 getaddrinfo core dumps. * Makefile,powerman.spec: install phantom.dev. * test/vpcd.c,etc/vpc.dev: add toggle command to test ifoff/ifon functionality. * etc/phantom.dev: fix ifoff syntax and add cycle script. 2003-04-18 Jim Garlick * src/{parse.y,parse.lex,device.c}: Get rid of "onstring" and "offstring" and add optional on="regex" off="regex" parameters to setstatus stmt. * etc/phantom.dev: Beginnings of phantom device support. 2003-04-17 Jim Garlick * src/{parse.y,parse.lex,device.c}: Implement "foreachnode" and "foreachplug" constructs which will execute an inner block of statements N times, where N is the number of configured nodes on this device, or the number of plugs respectively. In the inner block, "%s" will iterate through the list of plugs (or plugs corresponding to configured nodes). 2003-04-16 Jim Garlick * src/parse.y: Remove ordering dependency of device config directives. Specify device name in front of spec open brace instead of "name" line. Plug names are now handled as single directive with a list of strings rather than individual plug name directives. Make device types known to the scanner and remove quotes around them. Move all "spec" handling to parse.y. Do away with maxplugcount directive. 2003-04-15 Jim Garlick * src/parse.y: Cleanup to prepare for nested blocks of script code. * src/{parse.y,parse.lex,device.c}: Add 'foreachplug' and 'foreachnode' script constructs to allow repeated execution of a subblock of statements. The number of iterations is the number of plugs configured or the number of nodes. (not yet tested) 2003-04-14 Jim Garlick * src/parse.lex: Renamed "plugcount" to "maxplugcount" in device conf. Renamed "map" to "setstatus". * src/{device.h,device.c}: Moved regex subexpression match buffer to the device structure. There will be a persistant copy per device so $N can reference the most recent expect results from a seperate statement. * src/{device.c,parse.lex,parse.y}: Make "setstatus" its own statement and change to work as follows - "setstatus [plugname] status", where status is a regex match, and name can be a regex match or a literal plug name in quotes. If omitted, the plug name defaults to the current target. * src/{device.c,parse.lex,parse.y}: Add "setplugname" statement, "setplugname nodename plugname", where both args are regex matches. Rework plug/node logic so plug names must either be defined in powerman.conf so that they match the plug names in the device config, or they are omitted along with the device config plug names. In the latter case, the plug names must come from a setplugname statement in a device script. 2003-04-13 Jim Garlick * README: began update for 1.0.17 release. 2003-04-12 Jim Garlick * src/{device.c,parse.y}: If no plugs defined in device config, allow the plug names to come from the node config lines. * src/{device_telnet.c,device.c}, etc/*: Implement TELNET_DEV and remove all the telnet escapes from device configurations. * src/{device.c,device_tcp.c,device_serial.c}: Split tcp, serial, and telnet device types off to seperate files. 2003-04-10 Jim Garlick * etc/ibmasm.dev: renamed to ibmrsa.dev and implemented first cut on RSA telnet protocol. 2003-03-31 Jim Garlick * etc/*: Adjust power cycle for all devices to wait at least 2 sec between off/on. Was 0.7sec on icebox and this seemed to cause initialization problems with SuperMicro P4DPR motherboards running LinuxBIOS. 2002-01-20 Jim Garlick * src/device.c: Make serial connections non-blocking. * ChangeLog: begin using more accepted format. 2002-01-20 garlick * Back out beacon change that requires B70 of ice box v3 firmware. Now we will work with all versions. * Check aliases for bogus nodes * Tagged powerman-1-0-16 2002-01-19 garlick * Add alias capability in powerman.conf. 2002-01-17 garlick * Map plug names to node names on the fly at each subexpression interpretation instead of caching mappings in the Interp struct. * Major Changes to device specifications (old style no longer supported) - "all string" deprecated (use _ALL script variant) - various strings shortened - begin/end changed to C-style braces - query scripts are now named with _all suffixes ("all" semantics were previously assumed). - new, single-plug (non "all") query scripts added - second argument of 'map' can be "%s" to support single-plug query * Minor changes to config file (old style causes warnings but still parsed) - "tcpwrappers" takes an on|off argument - "client listener port" shortened to "port" - "begin_nodes", "end_nodes", "begin global", "end_global" statements deprecated * Support wti-rps10. * Added support for setting serial parameters, e.g. "9600,8n1" 2002-01-16 garlick * Add SERIAL_DEV device type * Begin support for wti-rps10 device (serial) 2002-01-13 garlick * Update icebox3 beacon script for B70 of the ice box firmware. 2002-12-30 garlick * More refinement of device error handling. * Strip out unused DBG_* flags and redundant DBG_SCRIPT printfs. 2002-12-27 garlick * Clean up passing of errors to client action completion callback. * Make all informational message names CP_INFO_*. Delete some unused protocol responses. * Disable calling of err() function in hostlist.c. 2002-12-26 garlick * Beginnings of redundant power supply support. * Increase CP_LINEMAX to accomodate longer lines returned by --telemetry * Return powerman version in banner string and warn if version mismatch between server and client. * Add --exprange option to select one-line-per-node query responses * Added README 2002-12-25 garlick * Baytech cycle script based on 'reboot' is a no-op if plug is off. Do an explicit off then on instead. Reduce timeout from 20 to 10s. 2002-12-24 garlick * Fix POWERMAN_VERSION string to include %{release} when building with make rpm tag=HEAD. * Added --telemetry option for device telemetry 2002-12-23 garlick * Added -D,--device [targets] command for getting status of RPC controlling [targets]. * Suppress 'Query complete' message in client. * Sort hostlists before returning to client. 2002-12-22 garlick * Updated list.[ch] and cbuf.[ch] to latest lsd-tools versions. 2002-12-20 garlick * Added powerman/powermand --version option. 2002-11-21 garlick * Fixed etc/icebox3.dev to handle flashing multiple beacons. 2002-11-12 garlick * Added etc/apc.dev for APC MasterSwitch 2002-11-09 garlick * Updated list.[ch], hostlist.[ch], and cbuf.[ch] from lsd-tools. * Renamed config.[ch] to parse_util.[ch] and created config.h. * Tagged powerman-1-0-15 2002-11-04 garlick * Switched over to Chris Dunlap's circular buffer module. * Update list.[ch] and cbuf.[ch] from lsd-tools. 2002-10-28 garlick * Minor cosmetic cleanup of data structures 2002-10-27 garlick * Added client options -d host[:port] (use alt server/port), -L (display license). * Cleaned up server options. * Updated man pages. * Tagged powerman-1-0-14 2002-10-26 garlick * Fix bug where inappropriate match ($N) values caused a runtime assert. * Attempting to initiate a command to a device now short circuits exponential reconnect backoff. * Implemented --beacon, --flash, --unflash, --temp, and --node in client. * Fix bug where actions never make it to the head of the device queue to time out when the device is hung trying to login (e.g. vpcd --hung_rpc). Now all actions queued up behind a timing out action on a device are also timed out. 2002-10-24 garlick * Changed magic vim comment at bottom of each file for tab expansion. * Tagged before-2nd-indent * Ran indent --no-tabs -kr *.[ch] on everything in src except hostlist.[ch] and list.[ch] * Tagged after-2nd-indent * Removed /etc/powerman/powerman.conf from RPM so powermand won't start unless it has been properly configured. 2002-10-22 garlick * Fixed bug where buf_readline() would occasionally assert on the size of destination buffer on client read (gnat powerman/123) 2002-10-21 garlick * Added "devices" query to get mapping of devices to nodes and per-device statistics (reconnects, successful actions). * Renamed "TCP wrappers" to "tcpwrappers", added to etc/powerman.conf. * Fixed bug where tcp wrappers denial would kill powermand. * Tagged powerman-1-0-13 2002-10-21 grondo * hostlist.c : fixed bug where test matches testN 2002-10-20 garlick * Added temperature support for icebox.dev. * Added temperature and beacon support for icebox3.dev. 2002-10-19 garlick * Fixded bug in _update_timeout where usecs were not checked for zero when testing if timer is set. * Tagged powerman-1-0-12 2002-10-18 garlick * Added several new script types and factored code for building scripts in parse.y (now there is one function - makeScriptSec()). * Implemented "ping period N" directive in device scripts which enables PING_SCRIPT to run every N seconds. This works around broken TCP implementations in RPC's (such as Baytech's) which don't send a FIN when they tear down a connection (which would unblock powerman's select call and cause a reconnect). Configured 90 second ping period for Baytech. * Changed logic for "all" plug processing. If _ALL version of script is defined, use that. If all string "*" is defined, use that. If neither is defined, use one command per plug. 2002-10-16 garlick * Make Action struct private to device.c * Move script names to config.h. * Merged _match_regex into _match_subexpression. Removed intermediate regex match data from Interpretation struct (now temporary in _match_subexpression). * Fixed bug where query for N-1 plugs on an N-plug device resulted in N-1 separate queries, each acquiring state for the whole device. * Fixed bug where read returned EOF occasionally. This was a read attempt on a zero length buffer. It turns out the read buffer was huge and never was compacted. Reduced buffer size from 64K to 8K. * Tagged powerman-1-0-11. 2002-10-14 garlick * Remove RESET_SCRIPT definitions in wti and baytech device files. * Got rid of Cluster and Node data structures. * Plug state is no longer global - seperate copy for each client cmd. * Fixed memory leaks in _create_client/_destroy_client. * Trimmed TODO file. * Fixed bug where actions could not make progress torward timeout while device is in unconnected state. 2002-10-11 garlick * Fix bug in vpcd where empty line would look like EOF on socket. 2002-10-08 garlick * Fixed bug where Action "found" client by client struct address, but if client had died, address could still be valid. Now we use a unique integer identifier to find client. * Made device read/write error handling a little cleaner. * Don't set plug state to unknown before querying status to avoid triggering race described in FIXME comment in client.c _parse_input() * Tagged powerman-1-0-10. 2002-10-06 garlick * More man page edits. 2002-10-06 garlick * Updated hostlist.[ch] to latest from the pdsh sources. * Tagged powerman-1-0-9. 2002-10-06 garlick * _process_send can now time out. * Clean up device.c select handling a bit to make it clear why actions will not time out if device is not connected. * _handle_write now handles errors from buf_write. * Client now returns error on unimplemented commands. * Changed powerman "-z --report" option to "-q --query" * Added soft power status support to vpc, fixed login logic in vpc, Added --soft-off test. * Don't clear wset bit after finish_connect unless fd != -1. * Tagged powerman-1-0-8. 2002-10-05 garlick * More man page updates * Updated TODO, moved README to doc/Overview.txt, removed Retagging. * Removed various outdated scripts in scripts subdir. * Added --off_rpc and --hung_rpc options to vpcd for testing. * Updated timeouts from 0.3 to 0.5 in icebox3.dev (determined to be safe on MCR). 2002-10-04 garlick * Client now performs on and off command if executable is linked to "on" and "off". Install links "on", "off", and "pm" in spec file. * Set all plug/node state to ST_UNKNOWN prior to status query command. * Updated client man page. 2002-10-04 garlick * Now properly handles the case of one ice box hanging. (tested with vpcd --bad_response) * Don't call action callback from within dev_enqueue_actions (triggers act->cmd != NULL assertion in _act_finish). Error handling was inappropriate anyway - try silently ignoring unimplemented commands, and queuing actions for un-logged-in devices. * Client works again (though still minimal) * Tagged powerman-1-0-7. 2002-10-02 garlick * Created Command data structure to represent what was called a "server action" and moved device action functions to device.c and got rid of action.[ch] * Device actions now execute a callback to the client code rather than call exported functions. * Made the status command's hostlist argument optional. 2002-10-02 behlendo * Fixed memory leak in config parsing. Memory was being malloc'ed for each line in the config file as it was parsed; pointers to this memory were not preserved and the memory was never free'd. These pointers are now tracked and free'd after scanning completes. 2002-10-02 garlick * Changed protocol so query-status is now status and requires an argument, and query-nodes is now nodes. * No more server action queue. * Device actions notify client when they complete. A count of outstanding actions in the client structure is decremented as each completes and when zero, returns success or failure depending on wether any of the actions failed. * Device actions now have an error flag. If set, when the action completes, an error flag is set in the client. * More than one client may initiate actions in parallel across the cluster. This works as each device has a queue. 2002-09-30 garlick * Added debug.[ch] and changed --telemetry to --debug mask * Fixed bug where _reconnect did not update the file descriptor in the underlying buffer. 2002-09-29 garlick * Tagged powerman-1-0-6. 2002-09-25 garlick * Reimplement _process_delay() so it uses the select loop to time out. * Incomplete work on _process_expect() so it uses the select loop to time out. * Added separate ice box v3 config - i think the timeouts/delays are going to be subtly different but worth caring about at MCR scale. 2002-09-25 garlick * Removed inter-dev delay (behlendo) * Removed timeout interval and update interval. * Disabled automatic status queries. * Tagged powerman-1-0-5. 2002-09-23 garlick * Create per-device reconnect state (count and time stamp) * Removed seperate soft power monitoring device from Plug. * Remove periodic status query. * Implement a sane reconnect algorithm. * Handle 'quit' command immediately (don't queue it). 2002-09-22 garlick * Improve handling of numeric values in config files. They are no longer specified in quotes. Floats are parsed by strtod; integers are parsed by strtol. * Regex match positions in "map" lines are now specified as $N rathern than "N". * Changed "size" to "plug count" in device configuration. * Defined fatal out_of_memory function in powermand.c for list.[ch]. * Removed PM_CHECK_LOGIN script. * Renamed script names in config files (e.g. PM_LOG_IN -> LOGIN_SCRIPT). * Removed PM_NAMES and PM_ERROR action types. 2002-09-21 garlick * Got rid of unimplemented device types (SNMP, TTY, TELNET) and PMD device type. Deleted 'string interpretation mode' and associated code/data structures used for PMD device type. * Fixed lexer/parser to report correct file and line number when errors occur (works with include files). Reworded many parsing error messages. 2002-09-20 garlick * Moved vicebox stuff to test subdir and got rid of redundant exit_error.c and wrappers.c. Added virtual power controller vpcd.c. * Brian updated the TODO file. * Cleanup of functions in client.c, util.c. * Tagged powerman-1-0-4. 2002-09-18 garlick * Client protocol now in client_proto.h * Numbered response codes * Cleanup of control flow in client.c * Bad nodes in on/off/reset.. etc cause the whole command to abort * query-status command response is three hostlists rather than bitmap * soft power status deprecated in protocl (consider generating warnings when nodes are accessed which have soft != hard) 2002-09-18 behlendorf * Added some basic memory accounting functionality * Fixed several memory leaks * Removed string.[ch] and replaced all String structures and functions with equivilant char * replacements. * Parsed hostlists now stored in the action structure and free'd when the action is completed. * Badly formated hostlists no longer crash the daemon. * Fixed segfault related to quit command, client connections are now properly cleaned up on the daemon side. 2002-09-18 behlendorf * Fixed coalescing of actions to the devices. 2002-09-17 behlendorf * Reworked the powerman client/server protocol (highlights follow) * Removed send/expect parsing, replaced with a simple switch. * Host lists have replaced regexs in the protocol. * Powerman authentication step removed. * Check login command removed. 2002-09-17 garlick * Reformatting, cleanup, doc of data structures * Made device list static in device.c * Use static array allocation for scripts[] 2002-09-17 garlick * Fix bug introduced in cleanup where actions were initiated but not completed. Select loop should only set status to STAT_OCCUPIED if action was one requiring completion. * Tagged powerman-1-0-3. 2002-09-16 garlick * Got rid of remnants of second "completion" expect script * Got rid of cheat->g global structure. * Reduced interdependencies between modules. * Tagged powerman-1-0-2. 2002-09-14 garlick * Renamed functions to use lower case module prefix. * Renamed client.[ch] -> server.[ch]. * Renamed pm_string.[ch] -> string.[ch] * Renamed exit_error.[ch] -> error.[ch] * Indented inline comments. * Made some globals local to powermand.c 2002-09-13 garlick * Ran indent -kr *.[ch] on everything in src except hostlist.[ch], list.[ch] * Tagged src with after-indent. * Got rid of NDUMP code (deprecated debugging stuff). * Added "vi:softtabstop=4" to *.c 2002-09-12 garlick * Brian documented some problems in the top of TODO. * Chris cleaned up some type casting. * Chris fixed icebox.dev to add delay after cmds to prevent icebox "ERROR 5" (resource is busy). This was causing "bulk" commands to fail on MCR * Tagged powerman-1-0-1. 2002-09-06 dun * Fixed bug where downed network device would cause select to spin. 2002-08-16 auselton * Chris tells me he updated the date format in the "make rpm" target stuff. * icebox.dev's script for PM_UPDATE_NODES now allows for a node status of "2" (== "unavailable") in its expect. This is in keeping with the change to the protocol in V3.0 of the icebox firmware. * device.c (do_target_some) had a bug similar to that addressed by Gregg Hommes above. If a plug does not have a node plugged into it then a) it should be skipped when trying to determine the targets for a device, and b) that is a sufficient condition for not using the "all" target on the device. 2002-08-14 garlick * Split baytech.dev into baytechF500.dev and baytechF501.dev. Our test baytech has the f/w rev F 5.00, and pengra baytechs have rev F 5.01. The latter prompts (Y/N)> after every power action. * Put back baytech.dev, documenting that prompting is configurable. 2002-08-10 hommes * Modify do_PMD_semantics() in device.c to set plug->node->p_state and plug->node->n_state only if the plug is associated with node. (previous behavior was assertion failure) * Modify loops in do_Device_semantics() in device.c to skip iteration if variable interp->node is NULL. (previous behavior was assertion failure) * Fix dump_Plug() function in device.c to print node name only if variable plug->node is not NULL. * The match_Regex() function in device.c had duplicate tests for "pmatch[0].rm_so == -1". Changed second one to "pmatch[0].rm_se == -1" * Removed local variable which was set but never used in do_Action() in action.c. 2002-08-09 garlick * Sort hostlists before display in powerman.c * Comment out baytech password expect/send in baytech.dev. Pengra doesn't use passwords. 2002-08-08 garlick * Make some char *'s into unsigned char *'s that are carrying non-printable values such as \376 (baytech telnet handshake). * Redo telemetry logging to support callback at the Buffer level. * Fixed a memory leak where buffers were reallocated on a device reconnect but old ones weren't freed. * Telemetry logging on server now shows when expect or delay commands are being processed. * Updated baytech and icebox configs to use 10 sec timeout. Baytech at least seems to require > 2sec to respond sometimes. Fixed a thinko I introduced to the config file earlier. * Instead of stripping NULL's out of buffers when creating strings, convert them to \377. * Fix get_String_from_Buffer() to only consume buffer up to and including regex match - not whole buffer (Gregg H.) * Server telemetry now shows the buffer contents when reporting no match. 2002-08-07 garlick * Did away with Log - just use syslog. Removed log from configuration syntax. * Added delay back into default powerman.conf. * Added "\nnn" (octal byte) support to config file for expect/send sequences. 2002-08-06 garlick * Added --telemetry option to server. 2002-08-05 garlick * Moved string stuff out of buffer.c into util.c and refactored. * Found problem with short reads, process_script() would delete actions if they didn't match the partial buffer. * Config file cleanup (removed second expect "completion" regex, cluster name). * Took vicebox.dev out of spec file install. * Made a general helper function for wrapped regcomp special character expansion. 2002-08-02 garlick * A bit more cleanup in pm_string.c. * ON, OFF changed to ST_ON, ST_OFF * Transferred all remaining inline review comments. * Reworked log.c. * Fixed all [v]snprintf's to check for both result == -1 (glibc <= 2.0.6) and result > len (glibc >= 2.1, C99 standard). 2002-08-01 garlick * Do not use ${srcbin} for products. Clean up other Makefile targets. * Added --telemetry to client to allow us to watch protocol happen. * Change client to not request list of nodes from daemon unless requesting status. * Convert completely over to hostlist.c routines in client. * Remove --soft option and always warn if plug=on and node=off. * Removed duplicate hostlist handling from pm_string.c. * Added powerman init script 2002-07-29 dun * Fixed parms to gethostbyaddr(). 2002-07-29 garlick * Make --queryon, --queryoff work with or without targets on cmd line. 2002-07-28 garlick * Fixed bug where log fd was always being checked for writeability in main select loop, chewing 100% of a CPU. * Commenting out the "log file" config line now disables logging. * Made wrapper Malloc/Free more robust (embed size/magic cookie in each buffer allocated). Size is no longer a parameter to Free. 2002-07-27 garlick * Renamed main.[ch] to powermand.[ch]; renamed client.c to powerman.c. * Moved set_tv() from powermand.c to config.c. * Moved overdue() from powermand.c to device.c. * Moved read_Config_file() from config.c to powermand.c and exported init_Client_protocol() from config.c. * Created get_String_from_Buffer() buffer in util.[ch] to eliminate dependence of buffer.h pm_string.h. * Fixed Delay to account for select EINTR. * Created gettimeofday wrapper. * Fixed Read/Write to retry on EINTR and handle other errors gracefully * Have Free() wrapper clear memory to zero magic cookies, etc.. * Made Buffer an opaque type with magic cookie. * Made String an opaque type with magic cookie. * Give appropriate errors when powermand config file is not set or set improperly, and start with a default config file. * Powermand options changed per code review. * Moved system includes out of powerman.h. * Merged general code review suggestions in to TODO file (but not the specific yet) * Added support for quadrics style host ranges in powerman client. * Move powermand from bin to sbin. * Use standard assert instead of powerman.h one so we get killed with a SIGABORT and get debugger stack traces. * Added some list_iterator_destroy's to match list_iterator_create's in powerman.c * Pid file stuff moved to pidlock.c and disabled for the moment. 2002-07-26 garlick * Reformatted ChangeLog * Added 'make depend' target to address missing dependencies. Added .c.o production and removed some redundant targets. Modified powerman, powermand targets to match products to address extraneous relinks (src/Makefile). * Moved check for root to after process_command_line() so root privilege is not required to get --help (src/client.c) * Moved Report_Memory() to wrappers.c and made allocated_memory static (src/exit_error.c) * Added init_error() and exit_msg() functions to exit_error. The exit_error() function now uses strerror() and does not close file descriptors, flush stderr, or close log before exit. Added syslog_on_error() accessor function for syslog_on (src/exit_error.c) * Client now uses exit_error.c (src/client.c) * Rename some client options per code review. Reduced verbosity of usage() output. (src/client.c) * Config->com is now an enum and command format strings are individually #defined and end in _FMT (src/client.c) * Made all functions in client static and discovered duplicate functions defined in config.[ch]. Prepended 'x' to client versions for now (factor later) (src/client.h) * Added accessor functions and made 'log' private to log module (src/log.[ch]) * Made clean target clean up after default target, remove no-op cd commands, employ make -C where appropriate, do not build vicebox by default (Makefile) * Fixed compilation errors if NDUMP is not defined; added exit callback to init_error() (null in client, set in server if NDUMP defined). * Updated powerman.1 to match option changes. * bzero->memset * Took local includes out of powerman.h (still need to do sys includes) 2002-07-25 uselton * With the release of version 1.0.0 the code has been entirely rewritten. ChangeLog truncated. * Tagged powerman-1-0-0. # vi:tabstop=4 shiftwidth=4 powerman-2.3.5.orig/src/0000755000000000000000000000000011205355434011767 5ustar powerman-2.3.5.orig/src/error.c0000644000000000000000000000672411113347050013266 0ustar /*****************************************************************************\ * $Id: error.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "xtypes.h" #include "list.h" #include "error.h" #include "debug.h" #include "xmalloc.h" static char *err_prog = NULL; /* basename of calling program */ static bool err_ttyvalid = TRUE; /* use stderr until told otherwise */ #define ERROR_BUFLEN 1024 /* * Initialize this module with the name of the program. */ void err_init(char *prog) { char *p = strrchr(prog, '/'); /* store only the basename */ err_prog = p ? p + 1 : prog; } /* * Accessor function for syslog_enable. */ void err_notty(void) { err_ttyvalid = FALSE; } /* helper for err, err_exit */ static void _verr(bool errno_valid, const char *fmt, va_list ap) { char buf[ERROR_BUFLEN]; int er = errno; assert(err_prog != NULL); vsnprintf(buf, ERROR_BUFLEN, fmt, ap); /* overflow ignored on purpose */ if (errno_valid) { if (err_ttyvalid) fprintf(stderr, "%s: %s: %s\n", err_prog, buf, strerror(er)); else syslog(LOG_ERR, "%s: %s", buf, strerror(er)); } else { if (err_ttyvalid) fprintf(stderr, "%s: %s\n", err_prog, buf); else syslog(LOG_ERR, "%s", buf); } } /* * Report error message on either stderr or syslog, then exit. */ void err_exit(bool errno_valid, const char *fmt, ...) { va_list ap; va_start(ap, fmt); _verr(errno_valid, fmt, ap); va_end(ap); dbg(DBG_MEMORY, "err_exit: memory not reclaimed: %d\n", xmemory()); exit(1); } /* * Report error message on either stderr or syslog, then return. */ void err(bool errno_valid, const char *fmt, ...) { va_list ap; va_start(ap, fmt); _verr(errno_valid, fmt, ap); va_end(ap); } void lsd_fatal_error(char *file, int line, char *mesg) { err_exit(TRUE, "%s", mesg); } void *lsd_nomem_error(char *file, int line, char *mesg) { err_exit(FALSE, "%s: out of memory", mesg); /*NOTREACHED*/ return NULL; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/Makefile.in0000644000000000000000000005604211115104225014031 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = powerman$(EXEEXT) pm$(EXEEXT) sbin_PROGRAMS = powermand$(EXEEXT) plmpower$(EXEEXT) $(am__EXEEXT_1) subdir = src DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in parse_lex.c parse_tab.c parse_tab.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/ac_curl.m4 \ $(top_srcdir)/config/ac_curses.m4 \ $(top_srcdir)/config/ac_forkpty.m4 \ $(top_srcdir)/config/ac_genders.m4 \ $(top_srcdir)/config/ac_httppower.m4 \ $(top_srcdir)/config/ac_pkgconfig.m4 \ $(top_srcdir)/config/ac_runas.m4 \ $(top_srcdir)/config/ac_wrap.m4 \ $(top_srcdir)/config/x_ac_expand_install_dirs.m4 \ $(top_srcdir)/config/x_ac_meta.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) @WITH_HTTPPOWER_TRUE@am__EXEEXT_1 = httppower$(EXEEXT) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) am__httppower_SOURCES_DIST = httppower.c debug.c error.c hostlist.c \ list.c hprintf.c argv.c xread.c xpoll.c xmalloc.c xregex.c \ xpty.c xsignal.c am__objects_1 = debug.$(OBJEXT) error.$(OBJEXT) hostlist.$(OBJEXT) \ list.$(OBJEXT) hprintf.$(OBJEXT) argv.$(OBJEXT) \ xread.$(OBJEXT) xpoll.$(OBJEXT) xmalloc.$(OBJEXT) \ xregex.$(OBJEXT) xpty.$(OBJEXT) xsignal.$(OBJEXT) @WITH_HTTPPOWER_TRUE@am_httppower_OBJECTS = httppower.$(OBJEXT) \ @WITH_HTTPPOWER_TRUE@ $(am__objects_1) httppower_OBJECTS = $(am_httppower_OBJECTS) am__DEPENDENCIES_1 = @WITH_HTTPPOWER_TRUE@httppower_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @WITH_HTTPPOWER_TRUE@ $(am__DEPENDENCIES_1) am_plmpower_OBJECTS = plmpower.$(OBJEXT) $(am__objects_1) plmpower_OBJECTS = $(am_plmpower_OBJECTS) plmpower_DEPENDENCIES = $(am__DEPENDENCIES_1) am_pm_OBJECTS = pm_OBJECTS = $(am_pm_OBJECTS) pm_LDADD = $(LDADD) am_powerman_OBJECTS = powerman.$(OBJEXT) $(am__objects_1) powerman_OBJECTS = $(am_powerman_OBJECTS) powerman_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_powermand_OBJECTS = powermand.$(OBJEXT) arglist.$(OBJEXT) \ cbuf.$(OBJEXT) client.$(OBJEXT) daemon.$(OBJEXT) \ device.$(OBJEXT) device_pipe.$(OBJEXT) device_serial.$(OBJEXT) \ device_tcp.$(OBJEXT) hash.$(OBJEXT) parse_lex.$(OBJEXT) \ parse_tab.$(OBJEXT) parse_util.$(OBJEXT) pluglist.$(OBJEXT) \ $(am__objects_1) powermand_OBJECTS = $(am_powermand_OBJECTS) powermand_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ $(AM_YFLAGS) SOURCES = $(httppower_SOURCES) $(plmpower_SOURCES) $(pm_SOURCES) \ $(powerman_SOURCES) $(powermand_SOURCES) DIST_SOURCES = $(am__httppower_SOURCES_DIST) $(plmpower_SOURCES) \ $(pm_SOURCES) $(powerman_SOURCES) $(powermand_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GCCWARN = @GCCWARN@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURSES = @LIBCURSES@ LIBFORKPTY = @LIBFORKPTY@ LIBGENDERS = @LIBGENDERS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBWRAP = @LIBWRAP@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ META_ALIAS = @META_ALIAS@ META_AUTHOR = @META_AUTHOR@ META_DATE = @META_DATE@ META_LT_AGE = @META_LT_AGE@ META_LT_CURRENT = @META_LT_CURRENT@ META_LT_REVISION = @META_LT_REVISION@ META_NAME = @META_NAME@ META_RELEASE = @META_RELEASE@ META_VERSION = @META_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ WITH_HTTPPOWER_FALSE = @WITH_HTTPPOWER_FALSE@ WITH_HTTPPOWER_TRUE = @WITH_HTTPPOWER_TRUE@ WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ X_BINDIR = @X_BINDIR@ X_DATADIR = @X_DATADIR@ X_EXEC_PREFIX = @X_EXEC_PREFIX@ X_INCLUDEDIR = @X_INCLUDEDIR@ X_INFODIR = @X_INFODIR@ X_LIBDIR = @X_LIBDIR@ X_LIBEXECDIR = @X_LIBEXECDIR@ X_LOCALSTATEDIR = @X_LOCALSTATEDIR@ X_MANDIR = @X_MANDIR@ X_OLDINCLUDEDIR = @X_OLDINCLUDEDIR@ X_PREFIX = @X_PREFIX@ X_SBINDIR = @X_SBINDIR@ X_SHAREDSTATEDIR = @X_SHAREDSTATEDIR@ X_SYSCONFDIR = @X_SYSCONFDIR@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CFLAGS = @GCCWARN@ @WITH_HTTPPOWER_TRUE@HTTPPOWER = httppower noinst_HEADERS = \ arglist.h \ argv.h \ cbuf.h \ client.h \ client_proto.h \ daemon.h \ debug.h \ device.h \ device_pipe.h \ device_private.h \ device_serial.h \ device_tcp.h \ error.h \ hash.h \ hostlist.h \ hprintf.h \ list.h \ parse_util.h \ pluglist.h \ powerman.h \ xread.h \ xpoll.h \ xmalloc.h \ xregex.h \ xtime.h \ xtypes.h \ xpty.h \ xsignal.h COMMON_SOURCE = \ debug.c \ error.c \ hostlist.c \ list.c \ hprintf.c \ argv.c \ xread.c \ xpoll.c \ xmalloc.c \ xregex.c \ xpty.c \ xsignal.c powerman_SOURCES = powerman.c $(COMMON_SOURCE) powerman_LDADD = $(LIBGENDERS) $(LIBFORKPTY) @WITH_HTTPPOWER_TRUE@httppower_SOURCES = httppower.c $(COMMON_SOURCE) @WITH_HTTPPOWER_TRUE@httppower_LDADD = $(LIBCURL) $(LIBFORKPTY) plmpower_SOURCES = plmpower.c $(COMMON_SOURCE) plmpower_LDADD = $(LIBFORKPTY) powermand_SOURCES = \ powermand.c \ arglist.c \ cbuf.c \ client.c \ daemon.c \ device.c \ device_pipe.c \ device_serial.c \ device_tcp.c \ hash.c \ parse_lex.l \ parse_tab.y \ parse_util.c \ pluglist.c \ $(COMMON_SOURCE) powermand_LDADD = $(LIBWRAP) $(LIBFORKPTY) AM_YFLAGS = -d pm_SOURCES = all: all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done httppower$(EXEEXT): $(httppower_OBJECTS) $(httppower_DEPENDENCIES) @rm -f httppower$(EXEEXT) $(LINK) $(httppower_LDFLAGS) $(httppower_OBJECTS) $(httppower_LDADD) $(LIBS) plmpower$(EXEEXT): $(plmpower_OBJECTS) $(plmpower_DEPENDENCIES) @rm -f plmpower$(EXEEXT) $(LINK) $(plmpower_LDFLAGS) $(plmpower_OBJECTS) $(plmpower_LDADD) $(LIBS) powerman$(EXEEXT): $(powerman_OBJECTS) $(powerman_DEPENDENCIES) @rm -f powerman$(EXEEXT) $(LINK) $(powerman_LDFLAGS) $(powerman_OBJECTS) $(powerman_LDADD) $(LIBS) parse_tab.h: parse_tab.c @if test ! -f $@; then \ rm -f parse_tab.c; \ $(MAKE) parse_tab.c; \ else :; fi powermand$(EXEEXT): $(powermand_OBJECTS) $(powermand_DEPENDENCIES) @rm -f powermand$(EXEEXT) $(LINK) $(powermand_LDFLAGS) $(powermand_OBJECTS) $(powermand_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arglist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_pipe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_serial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_tcp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httppower.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_tab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plmpower.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pluglist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/powerman.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/powermand.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xregex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsignal.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .l.c: $(LEXCOMPILE) $< sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ rm -f $(LEX_OUTPUT_ROOT).c .y.c: $(YACCCOMPILE) $< if test -f y.tab.h; then \ to=`echo "$*_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \ y.tab.h >$*.ht; \ rm -f y.tab.h; \ if cmp -s $*.ht $*.h; then \ rm -f $*.ht ;\ else \ mv $*.ht $*.h; \ fi; \ fi if test -f y.output; then \ mv y.output $*.output; \ fi sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@ rm -f y.tab.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f parse_lex.c -rm -f parse_tab.c -rm -f parse_tab.h clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-sbinPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am \ uninstall-sbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am uninstall-sbinPROGRAMS pm: powerman $(LN_S) powerman pm # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: powerman-2.3.5.orig/src/device_pipe.c0000644000000000000000000001123311113347050014400 0ustar /*****************************************************************************\ * $Id: device_pipe.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* * Implement connect/disconnect device methods for pipes. * Well it started out as a pipe, now actually it's a "coprocess" on a pty. */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "hostlist.h" #include "list.h" #include "cbuf.h" #include "xtypes.h" #include "parse_util.h" #include "xmalloc.h" #include "xpoll.h" #include "pluglist.h" #include "arglist.h" #include "xregex.h" #include "device_private.h" #include "device_pipe.h" #include "error.h" #include "debug.h" #include "argv.h" #include "xpty.h" typedef struct { char **argv; pid_t cpid; } PipeDev; /* Create "pipe device" data struct. * cmdline would normally look something like "/usr/bin/conman -j -Q bay0 |&" * (Korn shell style "coprocess" syntax) */ void *pipe_create(char *cmdline, char *flags) { PipeDev *pd = (PipeDev *)xmalloc(sizeof(PipeDev)); pd->argv = argv_create(cmdline, "|&"); pd->cpid = -1; return (void *)pd; } /* Destroy pipe device data struct. */ void pipe_destroy(void *data) { PipeDev *pd = (PipeDev *)data; argv_destroy(pd->argv); xfree(pd); } /* Start the coprocess using forkpty(3). */ bool pipe_connect(Device * dev) { int fd; pid_t pid; PipeDev *pd = (PipeDev *)dev->data; char ptyname[64]; assert(dev->connect_state == DEV_NOT_CONNECTED); assert(dev->fd == NO_FD); pid = xforkpty(&fd, ptyname, sizeof(ptyname)); if (pid < 0) { err_exit(TRUE, "_pipe_connect(%s): forkpty error", dev->name); } else if (pid == 0) { /* child */ xcfmakeraw(STDIN_FILENO); execv(pd->argv[0], pd->argv); err_exit(TRUE, "exec %s", pd->argv[0]); } else { /* parent */ nonblock_set(fd); dev->fd = fd; dev->connect_state = DEV_CONNECTED; dev->stat_successful_connects++; pd->cpid = pid; err(FALSE, "_pipe_connect(%s): opened on %s", dev->name, ptyname); } return (dev->connect_state == DEV_CONNECTED); } /* * Close down the pipes/pty. */ void pipe_disconnect(Device * dev) { PipeDev *pd = (PipeDev *)dev->data; assert(dev->connect_state == DEV_CONNECTED); dbg(DBG_DEVICE, "_pipe_disconnect: %s on fd %d", dev->name, dev->fd); if (dev->fd >= 0) { if (close(dev->fd) < 0) err(TRUE, "_pipe_disconnect: %s close fd %d", dev->name, dev->fd); dev->fd = NO_FD; } /* reap child */ if (pd->cpid > 0) { int wstat; kill(pd->cpid, SIGTERM); /* ignore errors */ if (waitpid(pd->cpid, &wstat, 0) < 0) err(TRUE, "_pipe_disconnect(%s): wait", dev->name); if (WIFEXITED(wstat)) { err(FALSE, "_pipe_disconnect(%s): %s exited with status %d", dev->name, pd->argv[0], WEXITSTATUS(wstat)); } else if (WIFSIGNALED(wstat)) { err(FALSE, "_pipe_disconnect(%s): %s terminated with signal %d", dev->name, pd->argv[0], WTERMSIG(wstat)); } else { err(FALSE, "_pipe_disconnect(%s): %s terminated", dev->name, pd->argv[0]); } pd->cpid = -1; } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/error.h0000644000000000000000000000333011113347050013261 0ustar /*****************************************************************************\ * $Id: error.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_ERROR_H #define PM_ERROR_H void err_init(char *prog); void err_notty(void); void err_exit(bool errno_valid, const char *fmt, ...); void err(bool errno_valid, const char *fmt, ...); void lsd_fatal_error(char *file, int line, char *mesg); void *lsd_nomem_error(char *file, int line, char *mesg); #endif /* PM_ERROR_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xmalloc.c0000644000000000000000000000746111113347050013573 0ustar /*****************************************************************************\ * $Id: xmalloc.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * Select/Poll wrap and Malloc debug added by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "xtypes.h" #include "xmalloc.h" #include "error.h" #ifndef NDEBUG static int memory_alloc = 0; #endif /* Review: look into dmalloc */ #define MALLOC_MAGIC 0xf00fbaab #define MALLOC_PAD_SIZE 16 #define MALLOC_PAD_FILL 0x55 #ifndef NDEBUG int xmemory(void) { return memory_alloc; } static int _checkfill(char *buf, unsigned char fill, int size) { while (size-- > 0) if (buf[size] != fill) return 0; return 1; } #endif char *xmalloc(int size) { char *new; int *p; assert(size > 0); p = (int *) malloc(2*sizeof(int) + size + MALLOC_PAD_SIZE); if (p == NULL) err_exit(FALSE, "out of memory"); p[0] = MALLOC_MAGIC; /* magic cookie */ p[1] = size; /* store size in buffer */ #ifndef NDEBUG memory_alloc += size; #endif new = (char *) &p[2]; memset(new, 0, size); memset(new + size, MALLOC_PAD_FILL, MALLOC_PAD_SIZE); return new; } char *xrealloc(char *item , int newsize) { char *new; int *p = (int *)item - 2; int oldsize; assert(item != NULL); assert(newsize > 0); assert(p[0] == MALLOC_MAGIC); oldsize = p[1]; assert(_checkfill(item + oldsize, MALLOC_PAD_FILL, MALLOC_PAD_SIZE)); p = (int *)realloc(p, 2*sizeof(int) + newsize + MALLOC_PAD_SIZE); if (p == NULL) err_exit(FALSE, "out of memory"); assert(p[0] == MALLOC_MAGIC); p[1] = newsize; #ifndef NDEBUG memory_alloc += (newsize - oldsize); #endif new = (char *) &p[2]; if (newsize > oldsize) memset(new + oldsize, 0, newsize - oldsize); memset(new + newsize, MALLOC_PAD_FILL, MALLOC_PAD_SIZE); return new; } void xfree(void *ptr) { if (ptr != NULL) { int *p = (int *) ptr - 2; int size; assert(p[0] == MALLOC_MAGIC); /* magic cookie still there? */ size = p[1]; assert(_checkfill((char*)ptr + size, MALLOC_PAD_FILL, MALLOC_PAD_SIZE)); memset(p, 0, 2*sizeof(int) + size + MALLOC_PAD_SIZE); #ifndef NDEBUG memory_alloc -= size; #endif free(p); } } char *xstrdup(const char *str) { char *cpy; cpy = xmalloc(strlen(str) + 1); strcpy(cpy, str); return cpy; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xmalloc.h0000644000000000000000000000314011113347050013566 0ustar /*****************************************************************************\ * $Id: xmalloc.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_XMALLOC_H #define PM_XMALLOC_H char *xmalloc(int size); char *xrealloc(char *item, int newsize); void xfree(void *ptr); char *xstrdup(const char *str); int xmemory(void); #endif /* PM_XMALLOC_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/parse_tab.c0000644000000000000000000022356411164745453014117 0ustar /* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOK_LOGIN = 258, TOK_LOGOUT = 259, TOK_STATUS = 260, TOK_STATUS_ALL = 261, TOK_STATUS_TEMP = 262, TOK_STATUS_TEMP_ALL = 263, TOK_STATUS_BEACON = 264, TOK_STATUS_BEACON_ALL = 265, TOK_BEACON_ON = 266, TOK_BEACON_OFF = 267, TOK_ON = 268, TOK_ON_RANGED = 269, TOK_ON_ALL = 270, TOK_OFF = 271, TOK_OFF_RANGED = 272, TOK_OFF_ALL = 273, TOK_CYCLE = 274, TOK_CYCLE_RANGED = 275, TOK_CYCLE_ALL = 276, TOK_RESET = 277, TOK_RESET_RANGED = 278, TOK_RESET_ALL = 279, TOK_PING = 280, TOK_SPEC = 281, TOK_EXPECT = 282, TOK_SETPLUGSTATE = 283, TOK_SEND = 284, TOK_DELAY = 285, TOK_FOREACHPLUG = 286, TOK_FOREACHNODE = 287, TOK_IFOFF = 288, TOK_IFON = 289, TOK_OFF_STRING = 290, TOK_ON_STRING = 291, TOK_MAX_PLUG_COUNT = 292, TOK_TIMEOUT = 293, TOK_DEV_TIMEOUT = 294, TOK_PING_PERIOD = 295, TOK_PLUG_NAME = 296, TOK_SCRIPT = 297, TOK_DEVICE = 298, TOK_NODE = 299, TOK_ALIAS = 300, TOK_TCP_WRAPPERS = 301, TOK_LISTEN = 302, TOK_MATCHPOS = 303, TOK_STRING_VAL = 304, TOK_NUMERIC_VAL = 305, TOK_YES = 306, TOK_NO = 307, TOK_BEGIN = 308, TOK_END = 309, TOK_UNRECOGNIZED = 310, TOK_EQUALS = 311 }; #endif /* Tokens. */ #define TOK_LOGIN 258 #define TOK_LOGOUT 259 #define TOK_STATUS 260 #define TOK_STATUS_ALL 261 #define TOK_STATUS_TEMP 262 #define TOK_STATUS_TEMP_ALL 263 #define TOK_STATUS_BEACON 264 #define TOK_STATUS_BEACON_ALL 265 #define TOK_BEACON_ON 266 #define TOK_BEACON_OFF 267 #define TOK_ON 268 #define TOK_ON_RANGED 269 #define TOK_ON_ALL 270 #define TOK_OFF 271 #define TOK_OFF_RANGED 272 #define TOK_OFF_ALL 273 #define TOK_CYCLE 274 #define TOK_CYCLE_RANGED 275 #define TOK_CYCLE_ALL 276 #define TOK_RESET 277 #define TOK_RESET_RANGED 278 #define TOK_RESET_ALL 279 #define TOK_PING 280 #define TOK_SPEC 281 #define TOK_EXPECT 282 #define TOK_SETPLUGSTATE 283 #define TOK_SEND 284 #define TOK_DELAY 285 #define TOK_FOREACHPLUG 286 #define TOK_FOREACHNODE 287 #define TOK_IFOFF 288 #define TOK_IFON 289 #define TOK_OFF_STRING 290 #define TOK_ON_STRING 291 #define TOK_MAX_PLUG_COUNT 292 #define TOK_TIMEOUT 293 #define TOK_DEV_TIMEOUT 294 #define TOK_PING_PERIOD 295 #define TOK_PLUG_NAME 296 #define TOK_SCRIPT 297 #define TOK_DEVICE 298 #define TOK_NODE 299 #define TOK_ALIAS 300 #define TOK_TCP_WRAPPERS 301 #define TOK_LISTEN 302 #define TOK_MATCHPOS 303 #define TOK_STRING_VAL 304 #define TOK_NUMERIC_VAL 305 #define TOK_YES 306 #define TOK_NO 307 #define TOK_BEGIN 308 #define TOK_END 309 #define TOK_UNRECOGNIZED 310 #define TOK_EQUALS 311 /* Copy the first part of user declarations. */ #line 27 "parse_tab.y" #if HAVE_CONFIG_H #include "config.h" #endif #define YYSTYPE char * /* The generic type returned by all parse matches */ #undef YYDEBUG /* no debug code plese */ #include #include #include #include #include /* for HUGE_VAL and trunc */ #include #include #include #include #include #include #include #include "list.h" #include "cbuf.h" #include "hostlist.h" #include "xtypes.h" #include "xmalloc.h" #include "xpoll.h" #include "xregex.h" #include "pluglist.h" #include "arglist.h" #include "device_private.h" #include "device_serial.h" #include "device_pipe.h" #include "device_tcp.h" #include "parse_util.h" #include "error.h" /* * A PreScript is a list of PreStmts. */ #define PRESTMT_MAGIC 0x89786756 typedef struct { int magic; StmtType type; /* delay/expect/send */ char *str; /* expect string, send fmt, setplugstate plug */ struct timeval tv; /* delay value */ int mp1; /* setplugstate plug match position */ int mp2; /* setplugstate state match position */ List prestmts; /* subblock */ List interps; /* interpretations for setplugstate */ } PreStmt; typedef List PreScript; /* * Unprocessed Protocol (used during parsing). * This data will be copied for each instantiation of a device. */ typedef struct { char *name; /* specification name, e.g. "icebox" */ struct timeval timeout; /* timeout for this device */ struct timeval ping_period; /* ping period for this device 0.0 = none */ List plugs; /* list of plug names (e.g. "1" thru "10") */ PreScript prescripts[NUM_SCRIPTS]; /* array of PreScripts */ } Spec; /* script may be NULL if undefined */ /* powerman.conf */ static void makeNode(char *nodestr, char *devstr, char *plugstr); static void makeAlias(char *namestr, char *hostsstr); static Stmt *makeStmt(PreStmt *p); static void destroyStmt(Stmt *stmt); static void makeDevice(char *devstr, char *specstr, char *hoststr, char *portstr); /* device config */ static PreStmt *makePreStmt(StmtType type, char *str, char *tvstr, char *mp1str, char *mp2str, List prestmts, List interps); static void destroyPreStmt(PreStmt *p); static Spec *makeSpec(char *name); static Spec *findSpec(char *name); static int matchSpec(Spec * spec, void *key); static void destroySpec(Spec * spec); static void _clear_current_spec(void); static void makeScript(int com, List stmts); static void destroyInterp(Interp *i); static Interp *makeInterp(InterpState state, char *str); static List copyInterpList(List ilist); /* utility functions */ static void _errormsg(char *msg); static void _warnmsg(char *msg); static long _strtolong(char *str); static double _strtodouble(char *str); static void _doubletotv(struct timeval *tv, double val); extern int yylex(); void yyerror(); static List device_specs = NULL; /* list of Spec's */ static Spec current_spec; /* Holds a Spec as it is built */ /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 216 of yacc.c. */ #line 318 "parse_tab.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 23 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 130 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 57 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 24 /* YYNRULES -- Number of rules. */ #define YYNRULES 78 /* YYNRULES -- Number of states. */ #define YYNSTATES 136 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 311 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 8, 10, 11, 13, 15, 17, 19, 21, 23, 25, 28, 31, 34, 40, 45, 50, 54, 58, 64, 67, 69, 71, 73, 75, 77, 80, 83, 86, 88, 93, 96, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 197, 199, 202, 205, 208, 212, 217, 221, 226, 229, 233, 236, 239, 242, 245, 248, 250, 254, 258 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 58, 0, -1, 59, -1, 59, 60, -1, 60, -1, -1, 62, -1, 61, -1, 63, -1, 64, -1, 65, -1, 66, -1, 46, -1, 46, 51, -1, 46, 52, -1, 47, 49, -1, 43, 49, 49, 49, 49, -1, 43, 49, 49, 49, -1, 44, 49, 49, 49, -1, 44, 49, 49, -1, 45, 49, 49, -1, 26, 49, 53, 67, 54, -1, 67, 68, -1, 68, -1, 69, -1, 70, -1, 72, -1, 73, -1, 39, 50, -1, 40, 50, -1, 71, 49, -1, 49, -1, 41, 53, 71, 54, -1, 73, 74, -1, 74, -1, 42, 3, 75, -1, 42, 4, 75, -1, 42, 5, 75, -1, 42, 6, 75, -1, 42, 7, 75, -1, 42, 8, 75, -1, 42, 9, 75, -1, 42, 10, 75, -1, 42, 11, 75, -1, 42, 12, 75, -1, 42, 13, 75, -1, 42, 14, 75, -1, 42, 15, 75, -1, 42, 16, 75, -1, 42, 17, 75, -1, 42, 18, 75, -1, 42, 19, 75, -1, 42, 20, 75, -1, 42, 21, 75, -1, 42, 22, 75, -1, 42, 23, 75, -1, 42, 24, 75, -1, 42, 25, 75, -1, 53, 76, 54, -1, 76, 77, -1, 77, -1, 27, 49, -1, 29, 49, -1, 30, 50, -1, 28, 49, 80, -1, 28, 49, 80, 78, -1, 28, 80, 80, -1, 28, 80, 80, 78, -1, 28, 80, -1, 28, 80, 78, -1, 32, 75, -1, 31, 75, -1, 33, 75, -1, 34, 75, -1, 78, 79, -1, 79, -1, 13, 56, 49, -1, 16, 56, 49, -1, 48, 50, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 154, 154, 160, 161, 162, 164, 165, 166, 167, 168, 169, 171, 174, 176, 180, 184, 187, 191, 193, 197, 204, 210, 211, 213, 214, 215, 216, 218, 222, 226, 229, 234, 240, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 291, 295, 298, 303, 305, 307, 309, 311, 314, 316, 318, 320, 322, 325, 328, 331, 336, 339, 344, 346, 350 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "TOK_LOGIN", "TOK_LOGOUT", "TOK_STATUS", "TOK_STATUS_ALL", "TOK_STATUS_TEMP", "TOK_STATUS_TEMP_ALL", "TOK_STATUS_BEACON", "TOK_STATUS_BEACON_ALL", "TOK_BEACON_ON", "TOK_BEACON_OFF", "TOK_ON", "TOK_ON_RANGED", "TOK_ON_ALL", "TOK_OFF", "TOK_OFF_RANGED", "TOK_OFF_ALL", "TOK_CYCLE", "TOK_CYCLE_RANGED", "TOK_CYCLE_ALL", "TOK_RESET", "TOK_RESET_RANGED", "TOK_RESET_ALL", "TOK_PING", "TOK_SPEC", "TOK_EXPECT", "TOK_SETPLUGSTATE", "TOK_SEND", "TOK_DELAY", "TOK_FOREACHPLUG", "TOK_FOREACHNODE", "TOK_IFOFF", "TOK_IFON", "TOK_OFF_STRING", "TOK_ON_STRING", "TOK_MAX_PLUG_COUNT", "TOK_TIMEOUT", "TOK_DEV_TIMEOUT", "TOK_PING_PERIOD", "TOK_PLUG_NAME", "TOK_SCRIPT", "TOK_DEVICE", "TOK_NODE", "TOK_ALIAS", "TOK_TCP_WRAPPERS", "TOK_LISTEN", "TOK_MATCHPOS", "TOK_STRING_VAL", "TOK_NUMERIC_VAL", "TOK_YES", "TOK_NO", "TOK_BEGIN", "TOK_END", "TOK_UNRECOGNIZED", "TOK_EQUALS", "$accept", "configuration_file", "config_list", "config_item", "TCP_wrappers", "listen", "device", "node", "alias", "spec", "spec_item_list", "spec_item", "spec_timeout", "spec_ping_period", "string_list", "spec_plug_list", "spec_script_list", "spec_script", "stmt_block", "stmt_list", "stmt", "interp_list", "interp", "regmatch", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 57, 58, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 62, 63, 63, 64, 64, 65, 66, 67, 67, 68, 68, 68, 68, 69, 70, 71, 71, 72, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 79, 79, 80 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 5, 4, 4, 3, 3, 5, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 4, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 2, 2, 2, 3, 4, 3, 4, 2, 3, 2, 2, 2, 2, 2, 1, 3, 3, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 5, 0, 0, 0, 0, 12, 0, 0, 2, 4, 7, 6, 8, 9, 10, 11, 0, 0, 0, 0, 13, 14, 15, 1, 3, 0, 0, 19, 20, 0, 0, 0, 0, 0, 23, 24, 25, 26, 27, 34, 17, 18, 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 33, 16, 31, 0, 0, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 30, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 61, 0, 0, 68, 62, 63, 71, 70, 72, 73, 58, 59, 78, 64, 0, 0, 69, 75, 66, 65, 0, 0, 74, 67, 76, 77 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 33, 34, 35, 36, 73, 37, 38, 39, 75, 108, 109, 126, 127, 113 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -82 static const yytype_int8 yypact[] = { -3, -25, -2, 5, 7, -13, 55, 103, -3, -82, -82, -82, -82, -82, -82, -82, 52, 57, 60, 61, -82, -82, -82, -82, -82, 54, 62, 63, -82, 64, 65, 66, 59, -5, -82, -82, -82, -82, 71, -82, 67, -82, -82, -82, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, -82, -82, -82, -82, -82, 1, 58, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, 72, 50, 74, 70, 69, 69, 69, 69, -1, -82, -82, 75, 76, 9, -82, -82, -82, -82, -82, -82, -82, -82, -82, 84, 51, 73, 84, -82, 84, 84, 77, 78, -82, 84, -82, -82 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -82, -82, -82, 100, -82, -82, -82, -82, -82, -82, -82, 85, -82, -82, -82, -82, -82, 90, -46, -82, 22, -77, -81, -11 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 124, 1, 16, 125, 100, 101, 102, 103, 104, 105, 106, 107, 29, 30, 31, 32, 20, 21, 2, 3, 4, 5, 6, 132, 129, 17, 132, 68, 98, 133, 132, 120, 18, 99, 19, 111, 116, 117, 118, 119, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 100, 101, 102, 103, 104, 105, 106, 107, 29, 30, 31, 32, 124, 111, 112, 125, 123, 128, 23, 22, 25, 26, 130, 24, 27, 28, 40, 41, 32, 42, 43, 71, 72, 69, 44, 115, 110, 74, 114, 111, 122, 134, 135, 70, 131, 121 }; static const yytype_uint8 yycheck[] = { 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 13, 26, 49, 16, 27, 28, 29, 30, 31, 32, 33, 34, 39, 40, 41, 42, 51, 52, 43, 44, 45, 46, 47, 126, 123, 49, 129, 54, 49, 128, 133, 54, 49, 54, 49, 48, 104, 105, 106, 107, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 39, 40, 41, 42, 13, 48, 49, 16, 112, 113, 0, 49, 53, 49, 56, 8, 49, 49, 49, 49, 42, 50, 50, 49, 49, 33, 53, 50, 49, 53, 49, 48, 50, 49, 49, 38, 56, 108 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 26, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 64, 65, 66, 49, 49, 49, 49, 51, 52, 49, 0, 60, 53, 49, 49, 49, 39, 40, 41, 42, 67, 68, 69, 70, 72, 73, 74, 49, 49, 50, 50, 53, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 54, 68, 74, 49, 49, 71, 53, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 49, 54, 27, 28, 29, 30, 31, 32, 33, 34, 76, 77, 49, 48, 49, 80, 49, 50, 75, 75, 75, 75, 54, 77, 50, 80, 13, 16, 78, 79, 80, 78, 56, 56, 79, 78, 49, 49 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 12: #line 171 "parse_tab.y" { _warnmsg("'tcpwrappers' without yes|no"); conf_set_use_tcp_wrappers(TRUE); } break; case 13: #line 174 "parse_tab.y" { conf_set_use_tcp_wrappers(TRUE); } break; case 14: #line 176 "parse_tab.y" { conf_set_use_tcp_wrappers(FALSE); } break; case 15: #line 180 "parse_tab.y" { conf_add_listen((yyvsp[(2) - (2)])); } break; case 16: #line 185 "parse_tab.y" { makeDevice((yyvsp[(2) - (5)]), (yyvsp[(3) - (5)]), (yyvsp[(4) - (5)]), (yyvsp[(5) - (5)])); } break; case 17: #line 187 "parse_tab.y" { makeDevice((yyvsp[(2) - (4)]), (yyvsp[(3) - (4)]), (yyvsp[(4) - (4)]), NULL); } break; case 18: #line 191 "parse_tab.y" { makeNode((yyvsp[(2) - (4)]), (yyvsp[(3) - (4)]), (yyvsp[(4) - (4)])); } break; case 19: #line 193 "parse_tab.y" { makeNode((yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), NULL); } break; case 20: #line 197 "parse_tab.y" { makeAlias((yyvsp[(2) - (3)]), (yyvsp[(3) - (3)])); } break; case 21: #line 206 "parse_tab.y" { makeSpec((yyvsp[(2) - (5)])); } break; case 28: #line 218 "parse_tab.y" { _doubletotv(¤t_spec.timeout, _strtodouble((yyvsp[(2) - (2)]))); } break; case 29: #line 222 "parse_tab.y" { _doubletotv(¤t_spec.ping_period, _strtodouble((yyvsp[(2) - (2)]))); } break; case 30: #line 226 "parse_tab.y" { list_append((List)(yyvsp[(1) - (2)]), xstrdup((yyvsp[(2) - (2)]))); (yyval) = (yyvsp[(1) - (2)]); } break; case 31: #line 229 "parse_tab.y" { (yyval) = (char *)list_create((ListDelF)xfree); list_append((List)(yyval), xstrdup((yyvsp[(1) - (1)]))); } break; case 32: #line 234 "parse_tab.y" { if (current_spec.plugs != NULL) _errormsg("duplicate plug list"); current_spec.plugs = (List)(yyvsp[(3) - (4)]); } break; case 35: #line 243 "parse_tab.y" { makeScript(PM_LOG_IN, (List)(yyvsp[(3) - (3)])); } break; case 36: #line 245 "parse_tab.y" { makeScript(PM_LOG_OUT, (List)(yyvsp[(3) - (3)])); } break; case 37: #line 247 "parse_tab.y" { makeScript(PM_STATUS_PLUGS, (List)(yyvsp[(3) - (3)])); } break; case 38: #line 249 "parse_tab.y" { makeScript(PM_STATUS_PLUGS_ALL, (List)(yyvsp[(3) - (3)])); } break; case 39: #line 251 "parse_tab.y" { makeScript(PM_STATUS_TEMP, (List)(yyvsp[(3) - (3)])); } break; case 40: #line 253 "parse_tab.y" { makeScript(PM_STATUS_TEMP_ALL, (List)(yyvsp[(3) - (3)])); } break; case 41: #line 255 "parse_tab.y" { makeScript(PM_STATUS_BEACON, (List)(yyvsp[(3) - (3)])); } break; case 42: #line 257 "parse_tab.y" { makeScript(PM_STATUS_BEACON_ALL, (List)(yyvsp[(3) - (3)])); } break; case 43: #line 259 "parse_tab.y" { makeScript(PM_BEACON_ON, (List)(yyvsp[(3) - (3)])); } break; case 44: #line 261 "parse_tab.y" { makeScript(PM_BEACON_OFF, (List)(yyvsp[(3) - (3)])); } break; case 45: #line 263 "parse_tab.y" { makeScript(PM_POWER_ON, (List)(yyvsp[(3) - (3)])); } break; case 46: #line 265 "parse_tab.y" { makeScript(PM_POWER_ON_RANGED, (List)(yyvsp[(3) - (3)])); } break; case 47: #line 267 "parse_tab.y" { makeScript(PM_POWER_ON_ALL, (List)(yyvsp[(3) - (3)])); } break; case 48: #line 269 "parse_tab.y" { makeScript(PM_POWER_OFF, (List)(yyvsp[(3) - (3)])); } break; case 49: #line 271 "parse_tab.y" { makeScript(PM_POWER_OFF_RANGED, (List)(yyvsp[(3) - (3)])); } break; case 50: #line 273 "parse_tab.y" { makeScript(PM_POWER_OFF_ALL, (List)(yyvsp[(3) - (3)])); } break; case 51: #line 275 "parse_tab.y" { makeScript(PM_POWER_CYCLE, (List)(yyvsp[(3) - (3)])); } break; case 52: #line 277 "parse_tab.y" { makeScript(PM_POWER_CYCLE_RANGED, (List)(yyvsp[(3) - (3)])); } break; case 53: #line 279 "parse_tab.y" { makeScript(PM_POWER_CYCLE_ALL, (List)(yyvsp[(3) - (3)])); } break; case 54: #line 281 "parse_tab.y" { makeScript(PM_RESET, (List)(yyvsp[(3) - (3)])); } break; case 55: #line 283 "parse_tab.y" { makeScript(PM_RESET_RANGED, (List)(yyvsp[(3) - (3)])); } break; case 56: #line 285 "parse_tab.y" { makeScript(PM_RESET_ALL, (List)(yyvsp[(3) - (3)])); } break; case 57: #line 287 "parse_tab.y" { makeScript(PM_PING, (List)(yyvsp[(3) - (3)])); } break; case 58: #line 291 "parse_tab.y" { (yyval) = (yyvsp[(2) - (3)]); } break; case 59: #line 295 "parse_tab.y" { list_append((List)(yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); (yyval) = (yyvsp[(1) - (2)]); } break; case 60: #line 298 "parse_tab.y" { (yyval) = (char *)list_create((ListDelF)destroyPreStmt); list_append((List)(yyval), (yyvsp[(1) - (1)])); } break; case 61: #line 303 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_EXPECT, (yyvsp[(2) - (2)]), NULL, NULL, NULL, NULL, NULL); } break; case 62: #line 305 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_SEND, (yyvsp[(2) - (2)]), NULL, NULL, NULL, NULL, NULL); } break; case 63: #line 307 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_DELAY, NULL, (yyvsp[(2) - (2)]), NULL, NULL, NULL, NULL); } break; case 64: #line 309 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_SETPLUGSTATE, (yyvsp[(2) - (3)]), NULL, NULL, (yyvsp[(3) - (3)]), NULL, NULL); } break; case 65: #line 311 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_SETPLUGSTATE, (yyvsp[(2) - (4)]), NULL, NULL, (yyvsp[(3) - (4)]), NULL, (List)(yyvsp[(4) - (4)])); } break; case 66: #line 314 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, (yyvsp[(2) - (3)]), (yyvsp[(3) - (3)]), NULL, NULL); } break; case 67: #line 316 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, (yyvsp[(2) - (4)]), (yyvsp[(3) - (4)]), NULL,(List)(yyvsp[(4) - (4)])); } break; case 68: #line 318 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, NULL, (yyvsp[(2) - (2)]), NULL, NULL); } break; case 69: #line 320 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, NULL,(yyvsp[(2) - (3)]),NULL,(List)(yyvsp[(3) - (3)])); } break; case 70: #line 322 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_FOREACHNODE, NULL, NULL, NULL, NULL, (List)(yyvsp[(2) - (2)]), NULL); } break; case 71: #line 325 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_FOREACHPLUG, NULL, NULL, NULL, NULL, (List)(yyvsp[(2) - (2)]), NULL); } break; case 72: #line 328 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_IFOFF, NULL, NULL, NULL, NULL, (List)(yyvsp[(2) - (2)]), NULL); } break; case 73: #line 331 "parse_tab.y" { (yyval) = (char *)makePreStmt(STMT_IFON, NULL, NULL, NULL, NULL, (List)(yyvsp[(2) - (2)]), NULL); } break; case 74: #line 336 "parse_tab.y" { list_append((List)(yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); (yyval) = (yyvsp[(1) - (2)]); } break; case 75: #line 339 "parse_tab.y" { (yyval) = (char *)list_create((ListDelF)destroyInterp); list_append((List)(yyval), (yyvsp[(1) - (1)])); } break; case 76: #line 344 "parse_tab.y" { (yyval) = (char *)makeInterp(ST_ON, (yyvsp[(3) - (3)])); } break; case 77: #line 346 "parse_tab.y" { (yyval) = (char *)makeInterp(ST_OFF, (yyvsp[(3) - (3)])); } break; case 78: #line 350 "parse_tab.y" { (yyval) = (yyvsp[(2) - (2)]); } break; /* Line 1267 of yacc.c. */ #line 2075 "parse_tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } #line 354 "parse_tab.y" void scanner_init(char *filename); void scanner_fini(void); int scanner_line(void); char *scanner_file(void); /* * Entry point into the yacc/lex parser. */ int parse_config_file (char *filename) { extern FILE *yyin; /* part of lexer */ scanner_init(filename); yyin = fopen(filename, "r"); if (!yyin) err_exit(TRUE, "%s", filename); device_specs = list_create((ListDelF) destroySpec); _clear_current_spec(); yyparse(); fclose(yyin); scanner_fini(); list_destroy(device_specs); return 0; } /* makePreStmt(type, str, tv, mp1(plug), mp2(stat/node), prestmts, interps */ static PreStmt *makePreStmt(StmtType type, char *str, char *tvstr, char *mp1str, char *mp2str, List prestmts, List interps) { PreStmt *new; new = (PreStmt *) xmalloc(sizeof(PreStmt)); new->magic = PRESTMT_MAGIC; new->type = type; new->mp1 = mp1str ? _strtolong(mp1str) : -1; new->mp2 = mp2str ? _strtolong(mp2str) : -1; if (str) new->str = xstrdup(str); if (tvstr) _doubletotv(&new->tv, _strtodouble(tvstr)); new->prestmts = prestmts; new->interps = interps; return new; } static void destroyPreStmt(PreStmt *p) { assert(p->magic == PRESTMT_MAGIC); p->magic = 0; if (p->str) xfree(p->str); p->str = NULL; if (p->prestmts) list_destroy(p->prestmts); p->prestmts = NULL; if (p->interps) list_destroy(p->interps); p->interps = NULL; xfree(p); } static void _clear_current_spec(void) { int i; current_spec.name = NULL; current_spec.plugs = NULL; timerclear(¤t_spec.timeout); timerclear(¤t_spec.ping_period); for (i = 0; i < NUM_SCRIPTS; i++) current_spec.prescripts[i] = NULL; } static Spec *_copy_current_spec(void) { Spec *new = (Spec *) xmalloc(sizeof(Spec)); int i; *new = current_spec; for (i = 0; i < NUM_SCRIPTS; i++) new->prescripts[i] = current_spec.prescripts[i]; _clear_current_spec(); return new; } static Spec *makeSpec(char *name) { Spec *spec; current_spec.name = xstrdup(name); /* FIXME: check for manditory scripts here? what are they? */ spec = _copy_current_spec(); assert(device_specs != NULL); list_append(device_specs, spec); return spec; } static void destroySpec(Spec * spec) { int i; if (spec->name) xfree(spec->name); if (spec->plugs) list_destroy(spec->plugs); for (i = 0; i < NUM_SCRIPTS; i++) if (spec->prescripts[i]) list_destroy(spec->prescripts[i]); xfree(spec); } static int matchSpec(Spec * spec, void *key) { return (strcmp(spec->name, (char *) key) == 0); } static Spec *findSpec(char *name) { return list_find_first(device_specs, (ListFindF) matchSpec, name); } static void makeScript(int com, List stmts) { if (current_spec.prescripts[com] != NULL) _errormsg("duplicate script"); current_spec.prescripts[com] = stmts; } static Interp *makeInterp(InterpState state, char *str) { Interp *new = (Interp *)xmalloc(sizeof(Interp)); new->magic = INTERP_MAGIC; new->str = xstrdup(str); new->re = xregex_create(); new->state = state; return new; } static void destroyInterp(Interp *i) { assert(i->magic == INTERP_MAGIC); i->magic = 0; xfree(i->str); xregex_destroy(i->re); xfree(i); } static List copyInterpList(List il) { ListIterator itr; Interp *ip, *icpy; List new = list_create((ListDelF) destroyInterp); if (il != NULL) { itr = list_iterator_create(il); while((ip = list_next(itr))) { assert(ip->magic == INTERP_MAGIC); icpy = makeInterp(ip->state, ip->str); xregex_compile(icpy->re, icpy->str, FALSE); assert(icpy->magic == INTERP_MAGIC); list_append(new, icpy); } list_iterator_destroy(itr); } return new; } /** ** Powerman.conf stuff. **/ static void destroyStmt(Stmt *stmt) { assert(stmt != NULL); switch (stmt->type) { case STMT_SEND: xfree(stmt->u.send.fmt); break; case STMT_EXPECT: xregex_destroy(stmt->u.expect.exp); break; case STMT_DELAY: break; case STMT_SETPLUGSTATE: list_destroy(stmt->u.setplugstate.interps); break; case STMT_FOREACHNODE: case STMT_FOREACHPLUG: case STMT_IFON: case STMT_IFOFF: list_destroy(stmt->u.foreach.stmts); break; default: break; } xfree(stmt); } static Stmt *makeStmt(PreStmt *p) { Stmt *stmt; PreStmt *subp; ListIterator itr; assert(p->magic == PRESTMT_MAGIC); stmt = (Stmt *) xmalloc(sizeof(Stmt)); stmt->type = p->type; switch (p->type) { case STMT_SEND: stmt->u.send.fmt = xstrdup(p->str); break; case STMT_EXPECT: stmt->u.expect.exp = xregex_create(); xregex_compile(stmt->u.expect.exp, p->str, TRUE); break; case STMT_SETPLUGSTATE: stmt->u.setplugstate.stat_mp = p->mp2; if (p->str) stmt->u.setplugstate.plug_name = xstrdup(p->str); else stmt->u.setplugstate.plug_mp = p->mp1; stmt->u.setplugstate.interps = copyInterpList(p->interps); break; case STMT_DELAY: stmt->u.delay.tv = p->tv; break; case STMT_FOREACHNODE: case STMT_FOREACHPLUG: stmt->u.foreach.stmts = list_create((ListDelF) destroyStmt); itr = list_iterator_create(p->prestmts); while((subp = list_next(itr))) { assert(subp->magic == PRESTMT_MAGIC); list_append(stmt->u.foreach.stmts, makeStmt(subp)); } list_iterator_destroy(itr); break; case STMT_IFON: case STMT_IFOFF: stmt->u.ifonoff.stmts = list_create((ListDelF) destroyStmt); itr = list_iterator_create(p->prestmts); while((subp = list_next(itr))) { assert(subp->magic == PRESTMT_MAGIC); list_append(stmt->u.ifonoff.stmts, makeStmt(subp)); } list_iterator_destroy(itr); break; default: break; } return stmt; } static void _parse_hoststr(Device *dev, char *hoststr, char *flagstr) { /* pipe device, e.g. "conman -j baytech0 |&" */ if (strstr(hoststr, "|&") != NULL) { dev->data = pipe_create(hoststr, flagstr); dev->destroy = pipe_destroy; dev->connect = pipe_connect; dev->disconnect = pipe_disconnect; dev->finish_connect = NULL; dev->preprocess = NULL; /* serial device, e.g. "/dev/ttyS0" */ } else if (hoststr[0] == '/') { struct stat sb; if (stat(hoststr, &sb) == -1 || (!(sb.st_mode & S_IFCHR))) _errormsg("serial device not found or not a char special file"); dev->data = serial_create(hoststr, flagstr); dev->destroy = serial_destroy; dev->connect = serial_connect; dev->disconnect = serial_disconnect; dev->finish_connect = NULL; dev->preprocess = NULL; /* tcp device, e.g. "cyclades0:2001" */ } else { char *port = strchr(hoststr, ':'); int n; if (port) { /* host='host:port', flags=NULL */ *port++ = '\0'; } else _errormsg("hostname is missing :port"); n = _strtolong(port); /* verify port number */ if (n < 1 || n > 65535) _errormsg("port number out of range"); dev->data = tcp_create(hoststr, port, flagstr); dev->destroy = tcp_destroy; dev->connect = tcp_connect; dev->disconnect = tcp_disconnect; dev->finish_connect = tcp_finish_connect; dev->preprocess = tcp_preprocess; } } static void makeDevice(char *devstr, char *specstr, char *hoststr, char *flagstr) { ListIterator itr; Device *dev; Spec *spec; int i; /* find that spec */ spec = findSpec(specstr); if ( spec == NULL ) _errormsg("device specification not found"); /* make the Device */ dev = dev_create(devstr); dev->specname = xstrdup(specstr); dev->timeout = spec->timeout; dev->ping_period = spec->ping_period; _parse_hoststr(dev, hoststr, flagstr); /* create plugs (spec->plugs may be NULL) */ dev->plugs = pluglist_create(spec->plugs); /* transfer remaining info from the spec to the device */ for (i = 0; i < NUM_SCRIPTS; i++) { PreStmt *p; if (spec->prescripts[i] == NULL) { dev->scripts[i] = NULL; continue; /* unimplemented script */ } dev->scripts[i] = list_create((ListDelF) destroyStmt); /* copy the list of statements in each script */ itr = list_iterator_create(spec->prescripts[i]); while((p = list_next(itr))) { list_append(dev->scripts[i], makeStmt(p)); } list_iterator_destroy(itr); } dev_add(dev); } static void makeAlias(char *namestr, char *hostsstr) { if (!conf_add_alias(namestr, hostsstr)) _errormsg("bad alias"); } static void makeNode(char *nodestr, char *devstr, char *plugstr) { Device *dev = dev_findbyname(devstr); if (dev == NULL) _errormsg("unknown device"); /* plugstr can be NULL - see comment in pluglist.h */ switch (pluglist_map(dev->plugs, nodestr, plugstr)) { case EPL_DUPNODE: _errormsg("duplicate node"); case EPL_UNKPLUG: _errormsg("unknown plug name"); case EPL_DUPPLUG: _errormsg("plug already assigned"); case EPL_NOPLUGS: _errormsg("more nodes than plugs"); case EPL_NONODES: _errormsg("more plugs than nodes"); default: break; } if (!conf_addnodes(nodestr)) _errormsg("duplicate node name"); } /** ** Utility functions **/ static double _strtodouble(char *str) { char *endptr; double val = strtod(str, &endptr); if (val == 0.0 && endptr == str) _errormsg("error parsing double value"); if ((val == HUGE_VAL || val == -HUGE_VAL) && errno == ERANGE) _errormsg("double value would cause overflow"); return val; } static long _strtolong(char *str) { char *endptr; long val = strtol(str, &endptr, 0); if (val == 0 && endptr == str) _errormsg("error parsing long integer value"); if ((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE) _errormsg("long integer value would cause under/overflow"); return val; } static void _doubletotv(struct timeval *tv, double val) { tv->tv_sec = (val * 10.0)/10; /* crude round-down without -lm */ tv->tv_usec = ((val - tv->tv_sec) * 1000000.0); } static void _errormsg(char *msg) { err_exit(FALSE, "%s: %s::%d", msg, scanner_file(), scanner_line()); } static void _warnmsg(char *msg) { err(FALSE, "warning: %s: %s::%d", msg, scanner_file(), scanner_line()); } void yyerror() { _errormsg("parse error"); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xpty.c0000644000000000000000000001365111113347050013136 0ustar /*****************************************************************************\ * $Id: xpty.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #if HAVE_PTY_H #include #endif #if HAVE_UTIL_H #include #endif #if ! HAVE_FORKPTY #include #include #include #if HAVE_SYS_SYSCALL_H #include #endif #endif #include #include #include "xtypes.h" #include "xpty.h" #include "error.h" void nonblock_set(int fd) { int flags; flags = fcntl(fd, F_GETFL, 0); if (flags < 0) err_exit(TRUE, "fcntl F_GETFL"); if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) err_exit(TRUE, "fcntl F_SETFL"); } void nonblock_clr(int fd) { int flags; flags = fcntl(fd, F_GETFL, 0); if (flags < 0) err_exit(TRUE, "fcntl F_GETFL"); if (fcntl(fd, F_SETFL, flags & ~(O_NONBLOCK)) < 0) err_exit(TRUE, "fcntl F_SETFL"); } static int tiocmp(struct termios *a, struct termios *b) { if ( memcmp(a->c_cc, b->c_cc, sizeof(a->c_cc)) == 0 && a->c_cc[VTIME] == b->c_cc[VTIME] && a->c_iflag == b->c_iflag && a->c_oflag == b->c_oflag && a->c_cflag == b->c_cflag && a->c_lflag == b->c_lflag) return 1; return 0; } /* tcsetattr returns success if anything succeeds so we must verify * with another tcgetattr. */ static void xtcsetattr(int fd, int flags, struct termios *tio) { struct termios act; if (tcsetattr(fd, flags, tio) < 0) err_exit(TRUE, "tcsetattr"); memset(&act, 0, sizeof(act)); if (tcgetattr(fd, &act) < 0) err_exit(TRUE, "tcgetattr"); if (!tiocmp(tio, &act)) err_exit(FALSE, "tcsetattr failed"); } void xcfmakeraw(int fd) { struct termios tio; if (tcgetattr(fd, &tio) < 0) err_exit(TRUE, "xcfmakeraw: tcgetattr"); #if HAVE_CFMAKERAW && !defined(_AIX) cfmakeraw(&tio); #else /* Stevens: Adv. Prog. in the UNIX Env. 1ed p.345 */ tio.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); tio.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); tio.c_cflag &= ~(CSIZE | PARENB); tio.c_cflag |= CS8; tio.c_oflag &= ~(OPOST); tio.c_cc[VMIN] = 1; tio.c_cc[VTIME] = 0; #endif xtcsetattr(fd, TCSANOW, &tio); } pid_t xforkpty(int *amaster, char *name, int len) { pid_t pid; #if HAVE_FORKPTY pid = forkpty(amaster, name, NULL, NULL); if (pid > 0 && name != NULL) { /* XXX forkpty takes no len parameter */ assert(strlen(name) < len); } #else #if HAVE__DEV_PTMX /* solaris style - this code initially borrowed from * http://bugs.mysql.com/bug.php?id=22429 */ int master, slave; char *slave_name; master = open("/dev/ptmx", O_RDWR); if (master < 0) return -1; if (grantpt (master) < 0) { close (master); return -1; } if (unlockpt (master) < 0) { close (master); return -1; } slave_name = ptsname (master); if (slave_name == NULL) { close (master); return -1; } slave = open (slave_name, O_RDWR); if (slave < 0) { close (master); return -1; } if (ioctl (slave, I_PUSH, "ptem") < 0 || ioctl (slave, I_PUSH, "ldterm") < 0) { close (slave); close (master); return -1; } #elif HAVE__DEV_PTC /* aix style */ int master, slave; char *slave_name; master = open("/dev/ptc", O_RDWR); if (master < 0) return -1; if (grantpt (master) < 0) { close (master); return -1; } if (unlockpt (master) < 0) { close (master); return -1; } slave_name = ttyname (master); if (slave_name == NULL) { close (master); return -1; } slave = open (slave_name, O_RDWR); if (slave < 0) { close (master); return -1; } #else #error unknown pty master device path #endif if (amaster) *amaster = master; if (name) strncpy (name, slave_name, len); pid = fork (); switch (pid) { case -1: /* Error */ return -1; case 0: /* Child */ close (master); dup2 (slave, STDIN_FILENO); dup2 (slave, STDOUT_FILENO); dup2 (slave, STDERR_FILENO); return 0; default: /* Parent */ close (slave); break; } #endif return pid; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/client.h0000644000000000000000000000327011113347050013411 0ustar /*****************************************************************************\ * $Id: client.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_CLIENT_H #define PM_CLIENT_H void cli_init(void); void cli_fini(void); void cli_start(bool use_stdio, bool one_client); void cli_listen_fds(int **fds, int *len); bool cli_server_done(void); void cli_post_poll(xpollfd_t pfd); void cli_pre_poll(xpollfd_t pfd); #endif /* PM_CLIENT_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xregex.c0000644000000000000000000001455611113347050013441 0ustar /*****************************************************************************\ * $Id: xregex.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "xtypes.h" #include "error.h" #include "xregex.h" #include "xmalloc.h" #define XREGEX_MAGIC 0x3456aaaa struct xregex_struct { int xr_magic; int xr_cflags; regex_t *xr_regex; }; #define XREGEX_MATCH_MAGIC 0x3456aaba struct xregex_match_struct { int xm_magic; int xm_nmatch; regmatch_t *xm_pmatch; char *xm_str; int xm_result; bool xm_used; }; xregex_t xregex_create(void) { xregex_t xrp = (xregex_t)xmalloc(sizeof(struct xregex_struct)); xrp->xr_magic = XREGEX_MAGIC; xrp->xr_regex = NULL; return xrp; } void xregex_destroy(xregex_t xrp) { assert(xrp->xr_magic == XREGEX_MAGIC); if (xrp->xr_regex) { regfree(xrp->xr_regex); xfree(xrp->xr_regex); } xrp->xr_magic = 0; xfree(xrp); } /* Substitute all occurrences of s2 with s3 in s1, * e.g. _str_subst(str, "\\r", "\r") */ static void _str_subst(char *s1, int len, const char *s2, const char *s3) { int s2len = strlen(s2); int s3len = strlen(s3); char *p; while ((p = strstr(s1, s2)) != NULL) { assert(strlen(s1) + (s3len - s2len) + 1 <= len); memmove(p + s3len, p + s2len, strlen(p + s2len) + 1); memcpy(p, s3, s3len); } } void xregex_compile(xregex_t xrp, const char *regex, bool withsub) { char tmpstr[256]; char *cpy; int n; assert(regex != NULL); assert(xrp->xr_magic == XREGEX_MAGIC); assert(xrp->xr_regex == NULL); /* No particular limit is imposed on the length of REs(!). Programs * intended to be portable should not employ REs longer than 256 bytes, as * an implementation can refuse to accept such REs and remain POSIX-com- * pliant. -- regex(7) on RHEL 5 */ if (strlen(regex) > 256) err_exit(FALSE, "refusing to compile regex > 256 bytes"); xrp->xr_regex = (regex_t *)xmalloc(sizeof(regex_t)); xrp->xr_cflags = REG_EXTENDED; if (!withsub) xrp->xr_cflags |= REG_NOSUB; cpy = xstrdup(regex); _str_subst(cpy, strlen(cpy) + 1, "\\r", "\r"); _str_subst(cpy, strlen(cpy) + 1, "\\n", "\n"); n = regcomp(xrp->xr_regex, cpy, xrp->xr_cflags); xfree(cpy); if (n != 0) { regerror(n, xrp->xr_regex, tmpstr, sizeof(tmpstr)); err_exit(FALSE, "regcomp failed: %s", tmpstr); } } bool xregex_exec(xregex_t xrp, const char *s, xregex_match_t xm) { int eflags = REG_NOTEOL; int res; assert(xrp->xr_magic == XREGEX_MAGIC); assert(xrp->xr_regex != NULL); if (xm != NULL) { assert(xm->xm_magic == XREGEX_MATCH_MAGIC); assert(xm->xm_used == FALSE); } res = regexec(xrp->xr_regex, s, xm ? xm->xm_nmatch : 0, xm ? xm->xm_pmatch : NULL, eflags); if (xm != NULL) { xm->xm_result = res; xm->xm_used = TRUE; if (res == 0) { if (xm->xm_str) xfree(xm->xm_str); xm->xm_str = xstrdup(s); } } return res == 0 ? TRUE : FALSE; } xregex_match_t xregex_match_create(int nmatch) { xregex_match_t xm; xm = (xregex_match_t)xmalloc(sizeof(struct xregex_match_struct)); xm->xm_magic = XREGEX_MATCH_MAGIC; xm->xm_nmatch = nmatch + 1; xm->xm_pmatch = (regmatch_t *)xmalloc(sizeof(regmatch_t) * (nmatch + 1)); xm->xm_str = NULL; xm->xm_result = -1; xm->xm_used = FALSE; return xm; } void xregex_match_destroy(xregex_match_t xm) { assert(xm->xm_magic == XREGEX_MATCH_MAGIC); xfree(xm->xm_pmatch); if (xm->xm_str) xfree(xm->xm_str); xm->xm_magic = 0; xfree(xm); } void xregex_match_recycle(xregex_match_t xm) { if (xm->xm_str) { xfree(xm->xm_str); xm->xm_str = NULL; } xm->xm_result = -1; xm->xm_used = FALSE; } char * xregex_match_strdup(xregex_match_t xm) { char *s = NULL; assert(xm->xm_magic == XREGEX_MATCH_MAGIC); assert(xm->xm_used); if (xm->xm_result == 0) { s = (char *)xmalloc(xm->xm_pmatch[0].rm_eo + 1); assert(xm->xm_str != NULL); memcpy(s, xm->xm_str, xm->xm_pmatch[0].rm_eo); s[xm->xm_pmatch[0].rm_eo] = '\0'; } return s; } int xregex_match_strlen(xregex_match_t xm) { assert(xm->xm_magic == XREGEX_MATCH_MAGIC); assert(xm->xm_used); return xm->xm_pmatch[0].rm_eo; } char * xregex_match_sub_strdup(xregex_match_t xm, int i) { char *s = NULL; assert(xm->xm_magic == XREGEX_MATCH_MAGIC); assert(xm->xm_used); if (xm->xm_result == 0 && i >= 0 && i < xm->xm_nmatch && xm->xm_pmatch[i].rm_so != -1) { regmatch_t m = xm->xm_pmatch[i]; assert(xm->xm_str != NULL); assert(m.rm_so < m.rm_eo); s = xmalloc(m.rm_eo - m.rm_so + 1); memcpy(s, xm->xm_str + m.rm_so, m.rm_eo - m.rm_so); s[m.rm_eo - m.rm_so] = '\0'; } return s; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/parse_tab.y0000644000000000000000000005754711164745453014153 0ustar /*****************************************************************************\ * $Id: parse_tab.y 1125 2009-04-01 20:14:35Z garlick $ ***************************************************************************** * Copyright (C) 2001-2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton (uselton2@llnl.gov> * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ %{ #if HAVE_CONFIG_H #include "config.h" #endif #define YYSTYPE char * /* The generic type returned by all parse matches */ #undef YYDEBUG /* no debug code plese */ #include #include #include #include #include /* for HUGE_VAL and trunc */ #include #include #include #include #include #include #include #include "list.h" #include "cbuf.h" #include "hostlist.h" #include "xtypes.h" #include "xmalloc.h" #include "xpoll.h" #include "xregex.h" #include "pluglist.h" #include "arglist.h" #include "device_private.h" #include "device_serial.h" #include "device_pipe.h" #include "device_tcp.h" #include "parse_util.h" #include "error.h" /* * A PreScript is a list of PreStmts. */ #define PRESTMT_MAGIC 0x89786756 typedef struct { int magic; StmtType type; /* delay/expect/send */ char *str; /* expect string, send fmt, setplugstate plug */ struct timeval tv; /* delay value */ int mp1; /* setplugstate plug match position */ int mp2; /* setplugstate state match position */ List prestmts; /* subblock */ List interps; /* interpretations for setplugstate */ } PreStmt; typedef List PreScript; /* * Unprocessed Protocol (used during parsing). * This data will be copied for each instantiation of a device. */ typedef struct { char *name; /* specification name, e.g. "icebox" */ struct timeval timeout; /* timeout for this device */ struct timeval ping_period; /* ping period for this device 0.0 = none */ List plugs; /* list of plug names (e.g. "1" thru "10") */ PreScript prescripts[NUM_SCRIPTS]; /* array of PreScripts */ } Spec; /* script may be NULL if undefined */ /* powerman.conf */ static void makeNode(char *nodestr, char *devstr, char *plugstr); static void makeAlias(char *namestr, char *hostsstr); static Stmt *makeStmt(PreStmt *p); static void destroyStmt(Stmt *stmt); static void makeDevice(char *devstr, char *specstr, char *hoststr, char *portstr); /* device config */ static PreStmt *makePreStmt(StmtType type, char *str, char *tvstr, char *mp1str, char *mp2str, List prestmts, List interps); static void destroyPreStmt(PreStmt *p); static Spec *makeSpec(char *name); static Spec *findSpec(char *name); static int matchSpec(Spec * spec, void *key); static void destroySpec(Spec * spec); static void _clear_current_spec(void); static void makeScript(int com, List stmts); static void destroyInterp(Interp *i); static Interp *makeInterp(InterpState state, char *str); static List copyInterpList(List ilist); /* utility functions */ static void _errormsg(char *msg); static void _warnmsg(char *msg); static long _strtolong(char *str); static double _strtodouble(char *str); static void _doubletotv(struct timeval *tv, double val); extern int yylex(); void yyerror(); static List device_specs = NULL; /* list of Spec's */ static Spec current_spec; /* Holds a Spec as it is built */ %} /* script names */ %token TOK_LOGIN TOK_LOGOUT TOK_STATUS TOK_STATUS_ALL %token TOK_STATUS_TEMP TOK_STATUS_TEMP_ALL %token TOK_STATUS_BEACON TOK_STATUS_BEACON_ALL TOK_BEACON_ON TOK_BEACON_OFF %token TOK_ON TOK_ON_RANGED TOK_ON_ALL TOK_OFF TOK_OFF_RANGED TOK_OFF_ALL %token TOK_CYCLE TOK_CYCLE_RANGED TOK_CYCLE_ALL %token TOK_RESET TOK_RESET_RANGED TOK_RESET_ALL TOK_PING TOK_SPEC /* script statements */ %token TOK_EXPECT TOK_SETPLUGSTATE TOK_SEND TOK_DELAY %token TOK_FOREACHPLUG TOK_FOREACHNODE TOK_IFOFF TOK_IFON /* other device configuration stuff */ %token TOK_OFF_STRING TOK_ON_STRING %token TOK_MAX_PLUG_COUNT TOK_TIMEOUT TOK_DEV_TIMEOUT TOK_PING_PERIOD %token TOK_PLUG_NAME TOK_SCRIPT /* powerman.conf stuff */ %token TOK_DEVICE TOK_NODE TOK_ALIAS TOK_TCP_WRAPPERS TOK_LISTEN /* general */ %token TOK_MATCHPOS TOK_STRING_VAL TOK_NUMERIC_VAL TOK_YES TOK_NO %token TOK_BEGIN TOK_END TOK_UNRECOGNIZED TOK_EQUALS %% /* Grammar Rules for the powerman.conf config file */ configuration_file : config_list ; /**************************************************************/ /* config_list */ /**************************************************************/ config_list : config_list config_item | config_item | ; config_item : listen | TCP_wrappers | device | node | alias | spec ; TCP_wrappers : TOK_TCP_WRAPPERS { _warnmsg("'tcpwrappers' without yes|no"); conf_set_use_tcp_wrappers(TRUE); } | TOK_TCP_WRAPPERS TOK_YES { conf_set_use_tcp_wrappers(TRUE); } | TOK_TCP_WRAPPERS TOK_NO { conf_set_use_tcp_wrappers(FALSE); } ; listen : TOK_LISTEN TOK_STRING_VAL { conf_add_listen($2); } ; device : TOK_DEVICE TOK_STRING_VAL TOK_STRING_VAL TOK_STRING_VAL TOK_STRING_VAL { makeDevice($2, $3, $4, $5); } | TOK_DEVICE TOK_STRING_VAL TOK_STRING_VAL TOK_STRING_VAL { makeDevice($2, $3, $4, NULL); } ; node : TOK_NODE TOK_STRING_VAL TOK_STRING_VAL TOK_STRING_VAL { makeNode($2, $3, $4); } | TOK_NODE TOK_STRING_VAL TOK_STRING_VAL { makeNode($2, $3, NULL); } ; alias : TOK_ALIAS TOK_STRING_VAL TOK_STRING_VAL { makeAlias($2, $3); } ; /**************************************************************/ /* specifications */ /**************************************************************/ spec : TOK_SPEC TOK_STRING_VAL TOK_BEGIN spec_item_list TOK_END { makeSpec($2); } ; spec_item_list : spec_item_list spec_item | spec_item ; spec_item : spec_timeout | spec_ping_period | spec_plug_list | spec_script_list ; spec_timeout : TOK_DEV_TIMEOUT TOK_NUMERIC_VAL { _doubletotv(¤t_spec.timeout, _strtodouble($2)); } ; spec_ping_period: TOK_PING_PERIOD TOK_NUMERIC_VAL { _doubletotv(¤t_spec.ping_period, _strtodouble($2)); } ; string_list : string_list TOK_STRING_VAL { list_append((List)$1, xstrdup($2)); $$ = $1; } | TOK_STRING_VAL { $$ = (char *)list_create((ListDelF)xfree); list_append((List)$$, xstrdup($1)); } ; spec_plug_list : TOK_PLUG_NAME TOK_BEGIN string_list TOK_END { if (current_spec.plugs != NULL) _errormsg("duplicate plug list"); current_spec.plugs = (List)$3; } ; spec_script_list : spec_script_list spec_script | spec_script ; spec_script : TOK_SCRIPT TOK_LOGIN stmt_block { makeScript(PM_LOG_IN, (List)$3); } | TOK_SCRIPT TOK_LOGOUT stmt_block { makeScript(PM_LOG_OUT, (List)$3); } | TOK_SCRIPT TOK_STATUS stmt_block { makeScript(PM_STATUS_PLUGS, (List)$3); } | TOK_SCRIPT TOK_STATUS_ALL stmt_block { makeScript(PM_STATUS_PLUGS_ALL, (List)$3); } | TOK_SCRIPT TOK_STATUS_TEMP stmt_block { makeScript(PM_STATUS_TEMP, (List)$3); } | TOK_SCRIPT TOK_STATUS_TEMP_ALL stmt_block { makeScript(PM_STATUS_TEMP_ALL, (List)$3); } | TOK_SCRIPT TOK_STATUS_BEACON stmt_block { makeScript(PM_STATUS_BEACON, (List)$3); } | TOK_SCRIPT TOK_STATUS_BEACON_ALL stmt_block { makeScript(PM_STATUS_BEACON_ALL, (List)$3); } | TOK_SCRIPT TOK_BEACON_ON stmt_block { makeScript(PM_BEACON_ON, (List)$3); } | TOK_SCRIPT TOK_BEACON_OFF stmt_block { makeScript(PM_BEACON_OFF, (List)$3); } | TOK_SCRIPT TOK_ON stmt_block { makeScript(PM_POWER_ON, (List)$3); } | TOK_SCRIPT TOK_ON_RANGED stmt_block { makeScript(PM_POWER_ON_RANGED, (List)$3); } | TOK_SCRIPT TOK_ON_ALL stmt_block { makeScript(PM_POWER_ON_ALL, (List)$3); } | TOK_SCRIPT TOK_OFF stmt_block { makeScript(PM_POWER_OFF, (List)$3); } | TOK_SCRIPT TOK_OFF_RANGED stmt_block { makeScript(PM_POWER_OFF_RANGED, (List)$3); } | TOK_SCRIPT TOK_OFF_ALL stmt_block { makeScript(PM_POWER_OFF_ALL, (List)$3); } | TOK_SCRIPT TOK_CYCLE stmt_block { makeScript(PM_POWER_CYCLE, (List)$3); } | TOK_SCRIPT TOK_CYCLE_RANGED stmt_block { makeScript(PM_POWER_CYCLE_RANGED, (List)$3); } | TOK_SCRIPT TOK_CYCLE_ALL stmt_block { makeScript(PM_POWER_CYCLE_ALL, (List)$3); } | TOK_SCRIPT TOK_RESET stmt_block { makeScript(PM_RESET, (List)$3); } | TOK_SCRIPT TOK_RESET_RANGED stmt_block { makeScript(PM_RESET_RANGED, (List)$3); } | TOK_SCRIPT TOK_RESET_ALL stmt_block { makeScript(PM_RESET_ALL, (List)$3); } | TOK_SCRIPT TOK_PING stmt_block { makeScript(PM_PING, (List)$3); } ; stmt_block : TOK_BEGIN stmt_list TOK_END { $$ = $2; } ; stmt_list : stmt_list stmt { list_append((List)$1, $2); $$ = $1; } | stmt { $$ = (char *)list_create((ListDelF)destroyPreStmt); list_append((List)$$, $1); } ; stmt : TOK_EXPECT TOK_STRING_VAL { $$ = (char *)makePreStmt(STMT_EXPECT, $2, NULL, NULL, NULL, NULL, NULL); } | TOK_SEND TOK_STRING_VAL { $$ = (char *)makePreStmt(STMT_SEND, $2, NULL, NULL, NULL, NULL, NULL); } | TOK_DELAY TOK_NUMERIC_VAL { $$ = (char *)makePreStmt(STMT_DELAY, NULL, $2, NULL, NULL, NULL, NULL); } | TOK_SETPLUGSTATE TOK_STRING_VAL regmatch { $$ = (char *)makePreStmt(STMT_SETPLUGSTATE, $2, NULL, NULL, $3, NULL, NULL); } | TOK_SETPLUGSTATE TOK_STRING_VAL regmatch interp_list { $$ = (char *)makePreStmt(STMT_SETPLUGSTATE, $2, NULL, NULL, $3, NULL, (List)$4); } | TOK_SETPLUGSTATE regmatch regmatch { $$ = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, $2, $3, NULL, NULL); } | TOK_SETPLUGSTATE regmatch regmatch interp_list { $$ = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, $2, $3, NULL,(List)$4); } | TOK_SETPLUGSTATE regmatch { $$ = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, NULL, $2, NULL, NULL); } | TOK_SETPLUGSTATE regmatch interp_list { $$ = (char *)makePreStmt(STMT_SETPLUGSTATE, NULL, NULL, NULL,$2,NULL,(List)$3); } | TOK_FOREACHNODE stmt_block { $$ = (char *)makePreStmt(STMT_FOREACHNODE, NULL, NULL, NULL, NULL, (List)$2, NULL); } | TOK_FOREACHPLUG stmt_block { $$ = (char *)makePreStmt(STMT_FOREACHPLUG, NULL, NULL, NULL, NULL, (List)$2, NULL); } | TOK_IFOFF stmt_block { $$ = (char *)makePreStmt(STMT_IFOFF, NULL, NULL, NULL, NULL, (List)$2, NULL); } | TOK_IFON stmt_block { $$ = (char *)makePreStmt(STMT_IFON, NULL, NULL, NULL, NULL, (List)$2, NULL); } ; interp_list : interp_list interp { list_append((List)$1, $2); $$ = $1; } | interp { $$ = (char *)list_create((ListDelF)destroyInterp); list_append((List)$$, $1); } ; interp : TOK_ON TOK_EQUALS TOK_STRING_VAL { $$ = (char *)makeInterp(ST_ON, $3); } | TOK_OFF TOK_EQUALS TOK_STRING_VAL { $$ = (char *)makeInterp(ST_OFF, $3); } ; regmatch : TOK_MATCHPOS TOK_NUMERIC_VAL { $$ = $2; } ; %% void scanner_init(char *filename); void scanner_fini(void); int scanner_line(void); char *scanner_file(void); /* * Entry point into the yacc/lex parser. */ int parse_config_file (char *filename) { extern FILE *yyin; /* part of lexer */ scanner_init(filename); yyin = fopen(filename, "r"); if (!yyin) err_exit(TRUE, "%s", filename); device_specs = list_create((ListDelF) destroySpec); _clear_current_spec(); yyparse(); fclose(yyin); scanner_fini(); list_destroy(device_specs); return 0; } /* makePreStmt(type, str, tv, mp1(plug), mp2(stat/node), prestmts, interps */ static PreStmt *makePreStmt(StmtType type, char *str, char *tvstr, char *mp1str, char *mp2str, List prestmts, List interps) { PreStmt *new; new = (PreStmt *) xmalloc(sizeof(PreStmt)); new->magic = PRESTMT_MAGIC; new->type = type; new->mp1 = mp1str ? _strtolong(mp1str) : -1; new->mp2 = mp2str ? _strtolong(mp2str) : -1; if (str) new->str = xstrdup(str); if (tvstr) _doubletotv(&new->tv, _strtodouble(tvstr)); new->prestmts = prestmts; new->interps = interps; return new; } static void destroyPreStmt(PreStmt *p) { assert(p->magic == PRESTMT_MAGIC); p->magic = 0; if (p->str) xfree(p->str); p->str = NULL; if (p->prestmts) list_destroy(p->prestmts); p->prestmts = NULL; if (p->interps) list_destroy(p->interps); p->interps = NULL; xfree(p); } static void _clear_current_spec(void) { int i; current_spec.name = NULL; current_spec.plugs = NULL; timerclear(¤t_spec.timeout); timerclear(¤t_spec.ping_period); for (i = 0; i < NUM_SCRIPTS; i++) current_spec.prescripts[i] = NULL; } static Spec *_copy_current_spec(void) { Spec *new = (Spec *) xmalloc(sizeof(Spec)); int i; *new = current_spec; for (i = 0; i < NUM_SCRIPTS; i++) new->prescripts[i] = current_spec.prescripts[i]; _clear_current_spec(); return new; } static Spec *makeSpec(char *name) { Spec *spec; current_spec.name = xstrdup(name); /* FIXME: check for manditory scripts here? what are they? */ spec = _copy_current_spec(); assert(device_specs != NULL); list_append(device_specs, spec); return spec; } static void destroySpec(Spec * spec) { int i; if (spec->name) xfree(spec->name); if (spec->plugs) list_destroy(spec->plugs); for (i = 0; i < NUM_SCRIPTS; i++) if (spec->prescripts[i]) list_destroy(spec->prescripts[i]); xfree(spec); } static int matchSpec(Spec * spec, void *key) { return (strcmp(spec->name, (char *) key) == 0); } static Spec *findSpec(char *name) { return list_find_first(device_specs, (ListFindF) matchSpec, name); } static void makeScript(int com, List stmts) { if (current_spec.prescripts[com] != NULL) _errormsg("duplicate script"); current_spec.prescripts[com] = stmts; } static Interp *makeInterp(InterpState state, char *str) { Interp *new = (Interp *)xmalloc(sizeof(Interp)); new->magic = INTERP_MAGIC; new->str = xstrdup(str); new->re = xregex_create(); new->state = state; return new; } static void destroyInterp(Interp *i) { assert(i->magic == INTERP_MAGIC); i->magic = 0; xfree(i->str); xregex_destroy(i->re); xfree(i); } static List copyInterpList(List il) { ListIterator itr; Interp *ip, *icpy; List new = list_create((ListDelF) destroyInterp); if (il != NULL) { itr = list_iterator_create(il); while((ip = list_next(itr))) { assert(ip->magic == INTERP_MAGIC); icpy = makeInterp(ip->state, ip->str); xregex_compile(icpy->re, icpy->str, FALSE); assert(icpy->magic == INTERP_MAGIC); list_append(new, icpy); } list_iterator_destroy(itr); } return new; } /** ** Powerman.conf stuff. **/ static void destroyStmt(Stmt *stmt) { assert(stmt != NULL); switch (stmt->type) { case STMT_SEND: xfree(stmt->u.send.fmt); break; case STMT_EXPECT: xregex_destroy(stmt->u.expect.exp); break; case STMT_DELAY: break; case STMT_SETPLUGSTATE: list_destroy(stmt->u.setplugstate.interps); break; case STMT_FOREACHNODE: case STMT_FOREACHPLUG: case STMT_IFON: case STMT_IFOFF: list_destroy(stmt->u.foreach.stmts); break; default: break; } xfree(stmt); } static Stmt *makeStmt(PreStmt *p) { Stmt *stmt; PreStmt *subp; ListIterator itr; assert(p->magic == PRESTMT_MAGIC); stmt = (Stmt *) xmalloc(sizeof(Stmt)); stmt->type = p->type; switch (p->type) { case STMT_SEND: stmt->u.send.fmt = xstrdup(p->str); break; case STMT_EXPECT: stmt->u.expect.exp = xregex_create(); xregex_compile(stmt->u.expect.exp, p->str, TRUE); break; case STMT_SETPLUGSTATE: stmt->u.setplugstate.stat_mp = p->mp2; if (p->str) stmt->u.setplugstate.plug_name = xstrdup(p->str); else stmt->u.setplugstate.plug_mp = p->mp1; stmt->u.setplugstate.interps = copyInterpList(p->interps); break; case STMT_DELAY: stmt->u.delay.tv = p->tv; break; case STMT_FOREACHNODE: case STMT_FOREACHPLUG: stmt->u.foreach.stmts = list_create((ListDelF) destroyStmt); itr = list_iterator_create(p->prestmts); while((subp = list_next(itr))) { assert(subp->magic == PRESTMT_MAGIC); list_append(stmt->u.foreach.stmts, makeStmt(subp)); } list_iterator_destroy(itr); break; case STMT_IFON: case STMT_IFOFF: stmt->u.ifonoff.stmts = list_create((ListDelF) destroyStmt); itr = list_iterator_create(p->prestmts); while((subp = list_next(itr))) { assert(subp->magic == PRESTMT_MAGIC); list_append(stmt->u.ifonoff.stmts, makeStmt(subp)); } list_iterator_destroy(itr); break; default: break; } return stmt; } static void _parse_hoststr(Device *dev, char *hoststr, char *flagstr) { /* pipe device, e.g. "conman -j baytech0 |&" */ if (strstr(hoststr, "|&") != NULL) { dev->data = pipe_create(hoststr, flagstr); dev->destroy = pipe_destroy; dev->connect = pipe_connect; dev->disconnect = pipe_disconnect; dev->finish_connect = NULL; dev->preprocess = NULL; /* serial device, e.g. "/dev/ttyS0" */ } else if (hoststr[0] == '/') { struct stat sb; if (stat(hoststr, &sb) == -1 || (!(sb.st_mode & S_IFCHR))) _errormsg("serial device not found or not a char special file"); dev->data = serial_create(hoststr, flagstr); dev->destroy = serial_destroy; dev->connect = serial_connect; dev->disconnect = serial_disconnect; dev->finish_connect = NULL; dev->preprocess = NULL; /* tcp device, e.g. "cyclades0:2001" */ } else { char *port = strchr(hoststr, ':'); int n; if (port) { /* host='host:port', flags=NULL */ *port++ = '\0'; } else _errormsg("hostname is missing :port"); n = _strtolong(port); /* verify port number */ if (n < 1 || n > 65535) _errormsg("port number out of range"); dev->data = tcp_create(hoststr, port, flagstr); dev->destroy = tcp_destroy; dev->connect = tcp_connect; dev->disconnect = tcp_disconnect; dev->finish_connect = tcp_finish_connect; dev->preprocess = tcp_preprocess; } } static void makeDevice(char *devstr, char *specstr, char *hoststr, char *flagstr) { ListIterator itr; Device *dev; Spec *spec; int i; /* find that spec */ spec = findSpec(specstr); if ( spec == NULL ) _errormsg("device specification not found"); /* make the Device */ dev = dev_create(devstr); dev->specname = xstrdup(specstr); dev->timeout = spec->timeout; dev->ping_period = spec->ping_period; _parse_hoststr(dev, hoststr, flagstr); /* create plugs (spec->plugs may be NULL) */ dev->plugs = pluglist_create(spec->plugs); /* transfer remaining info from the spec to the device */ for (i = 0; i < NUM_SCRIPTS; i++) { PreStmt *p; if (spec->prescripts[i] == NULL) { dev->scripts[i] = NULL; continue; /* unimplemented script */ } dev->scripts[i] = list_create((ListDelF) destroyStmt); /* copy the list of statements in each script */ itr = list_iterator_create(spec->prescripts[i]); while((p = list_next(itr))) { list_append(dev->scripts[i], makeStmt(p)); } list_iterator_destroy(itr); } dev_add(dev); } static void makeAlias(char *namestr, char *hostsstr) { if (!conf_add_alias(namestr, hostsstr)) _errormsg("bad alias"); } static void makeNode(char *nodestr, char *devstr, char *plugstr) { Device *dev = dev_findbyname(devstr); if (dev == NULL) _errormsg("unknown device"); /* plugstr can be NULL - see comment in pluglist.h */ switch (pluglist_map(dev->plugs, nodestr, plugstr)) { case EPL_DUPNODE: _errormsg("duplicate node"); case EPL_UNKPLUG: _errormsg("unknown plug name"); case EPL_DUPPLUG: _errormsg("plug already assigned"); case EPL_NOPLUGS: _errormsg("more nodes than plugs"); case EPL_NONODES: _errormsg("more plugs than nodes"); default: break; } if (!conf_addnodes(nodestr)) _errormsg("duplicate node name"); } /** ** Utility functions **/ static double _strtodouble(char *str) { char *endptr; double val = strtod(str, &endptr); if (val == 0.0 && endptr == str) _errormsg("error parsing double value"); if ((val == HUGE_VAL || val == -HUGE_VAL) && errno == ERANGE) _errormsg("double value would cause overflow"); return val; } static long _strtolong(char *str) { char *endptr; long val = strtol(str, &endptr, 0); if (val == 0 && endptr == str) _errormsg("error parsing long integer value"); if ((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE) _errormsg("long integer value would cause under/overflow"); return val; } static void _doubletotv(struct timeval *tv, double val) { tv->tv_sec = (val * 10.0)/10; /* crude round-down without -lm */ tv->tv_usec = ((val - tv->tv_sec) * 1000000.0); } static void _errormsg(char *msg) { err_exit(FALSE, "%s: %s::%d", msg, scanner_file(), scanner_line()); } static void _warnmsg(char *msg) { err(FALSE, "warning: %s: %s::%d", msg, scanner_file(), scanner_line()); } void yyerror() { _errormsg("parse error"); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/argv.h0000644000000000000000000000367211113347050013100 0ustar /*****************************************************************************\ * $Id: argv.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_ARGV_H #define PM_ARGV_H /* Create a NULL-terminated argv array suitable for passing to execv() * from 'cmdline' string. Characters in the 'ignore' set are treated as white * space. Caller must free with argv_destroy(). */ char **argv_create(char *cmdline, char *ignore); /* Destroy an argv array created by argv_create. */ void argv_destroy(char **argv); /* Return the number of elements in the argv array (less the NULL terminator). */ int argv_length(char **argv); /* Expand an argv array by one slot and add an entry. */ char **argv_append(char **argv, char *s); #endif /* PM_ARGV_H */ powerman-2.3.5.orig/src/parse_tab.h0000644000000000000000000001121711164745453014112 0ustar /* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { TOK_LOGIN = 258, TOK_LOGOUT = 259, TOK_STATUS = 260, TOK_STATUS_ALL = 261, TOK_STATUS_TEMP = 262, TOK_STATUS_TEMP_ALL = 263, TOK_STATUS_BEACON = 264, TOK_STATUS_BEACON_ALL = 265, TOK_BEACON_ON = 266, TOK_BEACON_OFF = 267, TOK_ON = 268, TOK_ON_RANGED = 269, TOK_ON_ALL = 270, TOK_OFF = 271, TOK_OFF_RANGED = 272, TOK_OFF_ALL = 273, TOK_CYCLE = 274, TOK_CYCLE_RANGED = 275, TOK_CYCLE_ALL = 276, TOK_RESET = 277, TOK_RESET_RANGED = 278, TOK_RESET_ALL = 279, TOK_PING = 280, TOK_SPEC = 281, TOK_EXPECT = 282, TOK_SETPLUGSTATE = 283, TOK_SEND = 284, TOK_DELAY = 285, TOK_FOREACHPLUG = 286, TOK_FOREACHNODE = 287, TOK_IFOFF = 288, TOK_IFON = 289, TOK_OFF_STRING = 290, TOK_ON_STRING = 291, TOK_MAX_PLUG_COUNT = 292, TOK_TIMEOUT = 293, TOK_DEV_TIMEOUT = 294, TOK_PING_PERIOD = 295, TOK_PLUG_NAME = 296, TOK_SCRIPT = 297, TOK_DEVICE = 298, TOK_NODE = 299, TOK_ALIAS = 300, TOK_TCP_WRAPPERS = 301, TOK_LISTEN = 302, TOK_MATCHPOS = 303, TOK_STRING_VAL = 304, TOK_NUMERIC_VAL = 305, TOK_YES = 306, TOK_NO = 307, TOK_BEGIN = 308, TOK_END = 309, TOK_UNRECOGNIZED = 310, TOK_EQUALS = 311 }; #endif /* Tokens. */ #define TOK_LOGIN 258 #define TOK_LOGOUT 259 #define TOK_STATUS 260 #define TOK_STATUS_ALL 261 #define TOK_STATUS_TEMP 262 #define TOK_STATUS_TEMP_ALL 263 #define TOK_STATUS_BEACON 264 #define TOK_STATUS_BEACON_ALL 265 #define TOK_BEACON_ON 266 #define TOK_BEACON_OFF 267 #define TOK_ON 268 #define TOK_ON_RANGED 269 #define TOK_ON_ALL 270 #define TOK_OFF 271 #define TOK_OFF_RANGED 272 #define TOK_OFF_ALL 273 #define TOK_CYCLE 274 #define TOK_CYCLE_RANGED 275 #define TOK_CYCLE_ALL 276 #define TOK_RESET 277 #define TOK_RESET_RANGED 278 #define TOK_RESET_ALL 279 #define TOK_PING 280 #define TOK_SPEC 281 #define TOK_EXPECT 282 #define TOK_SETPLUGSTATE 283 #define TOK_SEND 284 #define TOK_DELAY 285 #define TOK_FOREACHPLUG 286 #define TOK_FOREACHNODE 287 #define TOK_IFOFF 288 #define TOK_IFON 289 #define TOK_OFF_STRING 290 #define TOK_ON_STRING 291 #define TOK_MAX_PLUG_COUNT 292 #define TOK_TIMEOUT 293 #define TOK_DEV_TIMEOUT 294 #define TOK_PING_PERIOD 295 #define TOK_PLUG_NAME 296 #define TOK_SCRIPT 297 #define TOK_DEVICE 298 #define TOK_NODE 299 #define TOK_ALIAS 300 #define TOK_TCP_WRAPPERS 301 #define TOK_LISTEN 302 #define TOK_MATCHPOS 303 #define TOK_STRING_VAL 304 #define TOK_NUMERIC_VAL 305 #define TOK_YES 306 #define TOK_NO 307 #define TOK_BEGIN 308 #define TOK_END 309 #define TOK_UNRECOGNIZED 310 #define TOK_EQUALS 311 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; powerman-2.3.5.orig/src/hostlist.c0000644000000000000000000020654011113347050014004 0ustar /*****************************************************************************\ * $Id: hostlist.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona * UCRL-CODE-2002-040. * * This file is part of SLURM, a resource management program. * For details, see . * * SLURM 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. * * SLURM 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 SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" # if HAVE_STRING_H # include # endif # if HAVE_PTHREAD_H # include # endif #else /* !HAVE_CONFIG_H */ # include # include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include "hostlist.h" /* * lsd_fatal_error : fatal error macro */ #ifdef WITH_LSD_FATAL_ERROR_FUNC # undef lsd_fatal_error extern void lsd_fatal_error(char *file, int line, char *mesg); #else /* !WITH_LSD_FATAL_ERROR_FUNC */ # ifndef lsd_fatal_error # define lsd_fatal_error(file, line, mesg) \ do { \ fprintf(stderr, "ERROR: [%s:%d] %s: %s\n", \ file, line, mesg, strerror(errno)); \ } while (0) # endif /* !lsd_fatal_error */ #endif /* !WITH_LSD_FATAL_ERROR_FUNC */ /* * lsd_nomem_error */ #ifdef WITH_LSD_NOMEM_ERROR_FUNC # undef lsd_nomem_error extern void * lsd_nomem_error(char *file, int line, char *mesg); #else /* !WITH_LSD_NOMEM_ERROR_FUNC */ # ifndef lsd_nomem_error # define lsd_nomem_error(file, line, mesg) (NULL) # endif /* !lsd_nomem_error */ #endif /* !WITH_LSD_NOMEM_ERROR_FUNC */ /* * OOM helper function * Automatically call lsd_nomem_error with appropriate args * and set errno to ENOMEM */ #define out_of_memory(mesg) \ do { \ errno = ENOMEM; \ return(lsd_nomem_error(__FILE__, __LINE__, mesg)); \ } while (0) /* * Some constants and tunables: */ /* number of elements to allocate when extending the hostlist array */ #define HOSTLIST_CHUNK 16 /* max host range: anything larger will be assumed to be an error */ #define MAX_RANGE 16384 /* 16K Hosts */ /* max host suffix value */ #define MAX_HOST_SUFFIX 1<<25 /* max number of ranges that will be processed between brackets */ #define MAX_RANGES 10240 /* 10K Ranges */ /* size of internal hostname buffer (+ some slop), hostnames will probably * be truncated if longer than MAXHOSTNAMELEN */ #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif /* max size of internal hostrange buffer */ #define MAXHOSTRANGELEN 1024 /* ----[ Internal Data Structures ]---- */ /* hostname type: A convenience structure used in parsing single hostnames */ struct hostname_components { char *hostname; /* cache of initialized hostname */ char *prefix; /* hostname prefix */ unsigned long num; /* numeric suffix */ /* string representation of numeric suffix * points into `hostname' */ char *suffix; }; typedef struct hostname_components *hostname_t; /* hostrange type: A single prefix with `hi' and `lo' numeric suffix values */ struct hostrange_components { char *prefix; /* alphanumeric prefix: */ /* beginning (lo) and end (hi) of suffix range */ unsigned long lo, hi; /* width of numeric output format * (pad with zeros up to this width) */ int width; /* If singlehost is 1, `lo' and `hi' are invalid */ unsigned singlehost:1; }; typedef struct hostrange_components *hostrange_t; /* The hostlist type: An array based list of hostrange_t's */ struct hostlist { #ifndef NDEBUG #define HOSTLIST_MAGIC 57005 int magic; #endif #if WITH_PTHREADS pthread_mutex_t mutex; #endif /* WITH_PTHREADS */ /* current number of elements available in array */ int size; /* current number of ranges stored in array */ int nranges; /* current number of hosts stored in hostlist */ int nhosts; /* pointer to hostrange array */ hostrange_t *hr; /* list of iterators */ struct hostlist_iterator *ilist; }; /* a hostset is a wrapper around a hostlist */ struct hostset { hostlist_t hl; }; struct hostlist_iterator { #ifndef NDEBUG int magic; #endif /* hostlist we are traversing */ hostlist_t hl; /* current index of iterator in hl->hr[] */ int idx; /* current hostrange object in list hl, i.e. hl->hr[idx] */ hostrange_t hr; /* current depth we've traversed into range hr */ int depth; /* next ptr for lists of iterators */ struct hostlist_iterator *next; }; /* ---- ---- */ /* ------[ static function prototypes ]------ */ static void _error(char *file, int line, char *mesg, ...); static char * _next_tok(char *, char **); static int _zero_padded(unsigned long, int); static int _width_equiv(unsigned long, int *, unsigned long, int *); static int host_prefix_end(const char *); static hostname_t hostname_create(const char *); static void hostname_destroy(hostname_t); static int hostname_suffix_is_valid(hostname_t); static int hostname_suffix_width(hostname_t); static hostrange_t hostrange_new(void); static hostrange_t hostrange_create_single(const char *); static hostrange_t hostrange_create(char *, unsigned long, unsigned long, int); static unsigned long hostrange_count(hostrange_t); static hostrange_t hostrange_copy(hostrange_t); static void hostrange_destroy(hostrange_t); static hostrange_t hostrange_delete_host(hostrange_t, unsigned long); static int hostrange_cmp(hostrange_t, hostrange_t); static int hostrange_prefix_cmp(hostrange_t, hostrange_t); static int hostrange_within_range(hostrange_t, hostrange_t); static int hostrange_width_combine(hostrange_t, hostrange_t); static int hostrange_empty(hostrange_t); static char * hostrange_pop(hostrange_t); static char * hostrange_shift(hostrange_t); static int hostrange_join(hostrange_t, hostrange_t); static hostrange_t hostrange_intersect(hostrange_t, hostrange_t); static int hostrange_hn_within(hostrange_t, hostname_t); static size_t hostrange_to_string(hostrange_t hr, size_t, char *, char *); static size_t hostrange_numstr(hostrange_t, size_t, char *); static hostlist_t hostlist_new(void); static hostlist_t _hostlist_create_bracketed(const char *, char *, char *); static int hostlist_resize(hostlist_t, size_t); static int hostlist_expand(hostlist_t); static int hostlist_push_range(hostlist_t, hostrange_t); static int hostlist_push_hr(hostlist_t, char *, unsigned long, unsigned long, int); static int hostlist_insert_range(hostlist_t, hostrange_t, int); static void hostlist_delete_range(hostlist_t, int n); static void hostlist_coalesce(hostlist_t hl); static void hostlist_collapse(hostlist_t hl); static hostlist_t _hostlist_create(const char *, char *, char *); static void hostlist_shift_iterators(hostlist_t, int, int, int); static int _attempt_range_join(hostlist_t, int); static int _is_bracket_needed(hostlist_t, int); static hostlist_iterator_t hostlist_iterator_new(void); static void _iterator_advance(hostlist_iterator_t); static void _iterator_advance_range(hostlist_iterator_t); static int hostset_find_host(hostset_t, const char *); /* ------[ macros ]------ */ #ifdef WITH_PTHREADS # define mutex_init(mutex) \ do { \ int e = pthread_mutex_init(mutex, NULL); \ if (e) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "hostlist mutex init:"); \ abort(); \ } \ } while (0) # define mutex_lock(mutex) \ do { \ int e = pthread_mutex_lock(mutex); \ if (e) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "hostlist mutex lock:"); \ abort(); \ } \ } while (0) # define mutex_unlock(mutex) \ do { \ int e = pthread_mutex_unlock(mutex); \ if (e) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "hostlist mutex unlock:"); \ abort(); \ } \ } while (0) # define mutex_destroy(mutex) \ do { \ int e = pthread_mutex_destroy(mutex); \ if (e) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "hostlist mutex destroy:"); \ abort(); \ } \ } while (0) #else /* !WITH_PTHREADS */ # define mutex_init(mutex) # define mutex_lock(mutex) # define mutex_unlock(mutex) # define mutex_destroy(mutex) #endif /* WITH_PTHREADS */ #define LOCK_HOSTLIST(_hl) \ do { \ assert(_hl != NULL); \ mutex_lock(&(_hl)->mutex); \ assert((_hl)->magic == HOSTLIST_MAGIC); \ } while (0) #define UNLOCK_HOSTLIST(_hl) \ do { \ mutex_unlock(&(_hl)->mutex); \ } while (0) #define seterrno_ret(_errno, _rc) \ do { \ errno = _errno; \ return _rc; \ } while (0) /* ------[ Function Definitions ]------ */ /* ----[ general utility functions ]---- */ /* * Varargs capable error reporting via lsd_fatal_error() */ static void _error(char *file, int line, char *msg, ...) { va_list ap; char buf[1024]; int len = 0; va_start(ap, msg); len = vsnprintf(buf, 1024, msg, ap); if ((len < 0) || (len > 1024)) buf[1023] = '\0'; lsd_fatal_error(file, line, buf); va_end(ap); return; } static int _advance_past_brackets (char *tok, char **str) { /* if _single_ opening bracket exists b/w tok and str, push str * past first closing bracket to next seperator */ if ( memchr(tok, '[', *str - tok) != NULL && memchr(tok, ']', *str - tok) == NULL ) { char *q = strchr(*str, ']'); if (q && memchr(*str, '[', q - *str) == NULL) { *str = q + 1; return (1); } } return 0; } /* * Helper function for host list string parsing routines * Returns a pointer to the next token; additionally advance *str * to the next separator. * * next_tok was taken directly from pdsh courtesy of Jim Garlick. * (with modifications to support bracketed hostlists, i.e.: * xxx[xx,xx,xx] is a single token) * */ static char * _next_tok(char *sep, char **str) { char *tok; /* push str past any leading separators */ while (**str != '\0' && strchr(sep, **str) != '\0') (*str)++; if (**str == '\0') return NULL; /* assign token ptr */ tok = *str; /* * Advance str past any separators, but if a separator occurs between * brackets, e.g. foo[0-3,5], then advance str past closing brackets and * try again. */ do { /* push str past token and leave pointing to first separator */ while (**str != '\0' && strchr(sep, **str) == '\0') (*str)++; } while (_advance_past_brackets (tok, str)); /* nullify consecutive separators and push str beyond them */ while (**str != '\0' && strchr(sep, **str) != '\0') *(*str)++ = '\0'; return tok; } /* return the number of zeros needed to pad "num" to "width" */ static int _zero_padded(unsigned long num, int width) { int n = 1; while (num /= 10L) n++; return width > n ? width - n : 0; } /* test whether two format `width' parameters are "equivalent" * The width arguments "wn" and "wm" for integers "n" and "m" * are equivalent if: * * o wn == wm OR * * o applying the same format width (either wn or wm) to both of * 'n' and 'm' will not change the zero padding of *either* 'm' nor 'n'. * * If this function returns 1 (or true), the appropriate width value * (either 'wm' or 'wn') will have been adjusted such that both format * widths are equivalent. */ static int _width_equiv(unsigned long n, int *wn, unsigned long m, int *wm) { int npad, nmpad, mpad, mnpad; if (wn == wm) return 1; npad = _zero_padded(n, *wn); nmpad = _zero_padded(n, *wm); mpad = _zero_padded(m, *wm); mnpad = _zero_padded(m, *wn); if (npad != nmpad && mpad != mnpad) return 0; if (npad != nmpad) { if (mpad == mnpad) { *wm = *wn; return 1; } else return 0; } else { /* mpad != mnpad */ if (npad == nmpad) { *wn = *wm; return 1; } else return 0; } /* not reached */ } /* ----[ hostname_t functions ]---- */ /* * return the location of the last char in the hostname prefix */ static int host_prefix_end(const char *hostname) { int idx = strlen(hostname) - 1; while (idx >= 0 && isdigit((char) hostname[idx])) idx--; return idx; } /* * create a hostname_t object from a string hostname */ static hostname_t hostname_create(const char *hostname) { hostname_t hn = NULL; char *p = '\0'; int idx = 0; assert(hostname != NULL); if (!(hn = (hostname_t) malloc(sizeof(*hn)))) out_of_memory("hostname create"); idx = host_prefix_end(hostname); if (!(hn->hostname = strdup(hostname))) { free(hn); out_of_memory("hostname create"); } hn->num = 0; hn->prefix = NULL; hn->suffix = NULL; if (idx == strlen(hostname) - 1) { if ((hn->prefix = strdup(hostname)) == NULL) { hostname_destroy(hn); out_of_memory("hostname prefix create"); } return hn; } hn->suffix = hn->hostname + idx + 1; hn->num = strtoul(hn->suffix, &p, 10); if ((*p == '\0') && (hn->num <= MAX_HOST_SUFFIX)) { if (!(hn->prefix = malloc((idx + 2) * sizeof(char)))) { hostname_destroy(hn); out_of_memory("hostname prefix create"); } memcpy(hn->prefix, hostname, idx + 1); hn->prefix[idx + 1] = '\0'; } else { if (!(hn->prefix = strdup(hostname))) { hostname_destroy(hn); out_of_memory("hostname prefix create"); } hn->suffix = NULL; } return hn; } /* free a hostname object */ static void hostname_destroy(hostname_t hn) { if (hn == NULL) return; hn->suffix = NULL; if (hn->hostname) free(hn->hostname); if (hn->prefix) free(hn->prefix); free(hn); } /* return true if the hostname has a valid numeric suffix */ static int hostname_suffix_is_valid(hostname_t hn) { return hn->suffix != NULL; } /* return the width (in characters) of the numeric part of the hostname */ static int hostname_suffix_width(hostname_t hn) { assert(hn->suffix != NULL); return (int) strlen(hn->suffix); } /* ----[ hostrange_t functions ]---- */ /* allocate a new hostrange object */ static hostrange_t hostrange_new(void) { hostrange_t new = (hostrange_t) malloc(sizeof(*new)); if (!new) out_of_memory("hostrange create"); return new; } /* Create a hostrange_t containing a single host without a valid suffix * hr->prefix will represent the entire hostname. */ static hostrange_t hostrange_create_single(const char *prefix) { hostrange_t new; assert(prefix != NULL); if ((new = hostrange_new()) == NULL) goto error1; if ((new->prefix = strdup(prefix)) == NULL) goto error2; new->singlehost = 1; new->lo = 0L; new->hi = 0L; new->width = 0; return new; error2: free(new); error1: out_of_memory("hostrange create single"); } /* Create a hostrange object with a prefix, hi, lo, and format width */ static hostrange_t hostrange_create(char *prefix, unsigned long lo, unsigned long hi, int width) { hostrange_t new; assert(prefix != NULL); if ((new = hostrange_new()) == NULL) goto error1; if ((new->prefix = strdup(prefix)) == NULL) goto error2; new->lo = lo; new->hi = hi; new->width = width; new->singlehost = 0; return new; error2: free(new); error1: out_of_memory("hostrange create"); } /* Return the number of hosts stored in the hostrange object */ static unsigned long hostrange_count(hostrange_t hr) { assert(hr != NULL); if (hr->singlehost) return 1; else return hr->hi - hr->lo + 1; } /* Copy a hostrange object */ static hostrange_t hostrange_copy(hostrange_t hr) { assert(hr != NULL); if (hr->singlehost) return hostrange_create_single(hr->prefix); else return hostrange_create(hr->prefix, hr->lo, hr->hi, hr->width); } /* free memory allocated by the hostrange object */ static void hostrange_destroy(hostrange_t hr) { if (hr == NULL) return; if (hr->prefix) free(hr->prefix); free(hr); } /* hostrange_delete_host() deletes a specific host from the range. * If the range is split into two, the greater range is returned, * and `hi' of the lesser range is adjusted accordingly. If the * highest or lowest host is deleted from a range, NULL is returned * and the hostrange hr is adjusted properly. */ static hostrange_t hostrange_delete_host(hostrange_t hr, unsigned long n) { hostrange_t new = NULL; assert(hr != NULL); assert(n >= hr->lo && n <= hr->hi); if (n == hr->lo) hr->lo++; else if (n == hr->hi) hr->hi--; else { if (!(new = hostrange_copy(hr))) out_of_memory("hostrange copy"); hr->hi = n - 1; new->lo = n + 1; } return new; } /* hostrange_cmp() is used to sort hostrange objects. It will * sort based on the following (in order): * o result of strcmp on prefixes * o if widths are compatible, then: * sort based on lowest suffix in range * else * sort based on width */ static int hostrange_cmp(hostrange_t h1, hostrange_t h2) { int retval; assert(h1 != NULL); assert(h2 != NULL); if ((retval = hostrange_prefix_cmp(h1, h2)) == 0) retval = hostrange_width_combine(h1, h2) ? h1->lo - h2->lo : h1->width - h2->width; return retval; } /* compare the prefixes of two hostrange objects. * returns: * < 0 if h1 prefix is less than h2 OR h1 == NULL. * * 0 if h1's prefix and h2's prefix match, * UNLESS, either h1 or h2 (NOT both) do not have a valid suffix. * * > 0 if h1's prefix is greater than h2's OR h2 == NULL. */ static int hostrange_prefix_cmp(hostrange_t h1, hostrange_t h2) { int retval; if (h1 == NULL) return 1; if (h2 == NULL) return -1; retval = strcmp(h1->prefix, h2->prefix); return retval == 0 ? h2->singlehost - h1->singlehost : retval; } /* returns true if h1 and h2 would be included in the same bracketed hostlist. * h1 and h2 will be in the same bracketed list iff: * * 1. h1 and h2 have same prefix * 2. neither h1 nor h2 are singlet hosts (i.e. invalid suffix) * * (XXX: Should incompatible widths be placed in the same bracketed list? * There's no good reason not to, except maybe aesthetics) */ static int hostrange_within_range(hostrange_t h1, hostrange_t h2) { if (hostrange_prefix_cmp(h1, h2) == 0) return h1->singlehost || h2->singlehost ? 0 : 1; else return 0; } /* compare two hostrange objects to determine if they are width * compatible, returns: * 1 if widths can safely be combined * 0 if widths cannot be safely combined */ static int hostrange_width_combine(hostrange_t h0, hostrange_t h1) { assert(h0 != NULL); assert(h1 != NULL); return _width_equiv(h0->lo, &h0->width, h1->lo, &h1->width); } /* Return true if hostrange hr contains no hosts, i.e. hi < lo */ static int hostrange_empty(hostrange_t hr) { assert(hr != NULL); return ((hr->hi < hr->lo) || (hr->hi == (unsigned long) -1)); } /* return the string representation of the last host in hostrange hr * and remove that host from the range (i.e. decrement hi if possible) * * Returns NULL if malloc fails OR there are no more hosts left */ static char *hostrange_pop(hostrange_t hr) { size_t size = 0; char *host = NULL; assert(hr != NULL); if (hr->singlehost) { hr->lo++; /* effectively set count == 0 */ host = strdup(hr->prefix); } else if (hostrange_count(hr) > 0) { size = strlen(hr->prefix) + hr->width + 16; if (!(host = (char *) malloc(size * sizeof(char)))) out_of_memory("hostrange pop"); snprintf(host, size, "%s%0*lu", hr->prefix, hr->width, hr->hi--); } return host; } /* Same as hostrange_pop(), but remove host from start of range */ static char *hostrange_shift(hostrange_t hr) { size_t size = 0; char *host = NULL; assert(hr != NULL); if (hr->singlehost) { hr->lo++; if (!(host = strdup(hr->prefix))) out_of_memory("hostrange shift"); } else if (hostrange_count(hr) > 0) { size = strlen(hr->prefix) + hr->width + 16; if (!(host = (char *) malloc(size * sizeof(char)))) out_of_memory("hostrange shift"); snprintf(host, size, "%s%0*lu", hr->prefix, hr->width, hr->lo++); } return host; } /* join two hostrange objects. * * returns: * * -1 if ranges do not overlap (including incompatible zero padding) * 0 if ranges join perfectly * >0 number of hosts that were duplicated in h1 and h2 * * h2 will be coalesced into h1 if rc >= 0 * * it is assumed that h1->lo <= h2->lo, i.e. hr1 <= hr2 * */ static int hostrange_join(hostrange_t h1, hostrange_t h2) { int duplicated = -1; assert(h1 != NULL); assert(h2 != NULL); assert(hostrange_cmp(h1, h2) <= 0); if (hostrange_prefix_cmp(h1, h2) == 0 && hostrange_width_combine(h1, h2)) { if (h1->singlehost && h2->singlehost) { /* matching singlets */ duplicated = 1; } else if (h1->hi == h2->lo - 1) { /* perfect join */ h1->hi = h2->hi; duplicated = 0; } else if (h1->hi >= h2->lo) { /* some duplication */ if (h1->hi < h2->hi) { duplicated = h1->hi - h2->lo + 1; h1->hi = h2->hi; } else duplicated = hostrange_count(h2); } } return duplicated; } /* hostrange intersect returns the intersection (common hosts) * of hostrange objects h1 and h2. If there is no intersection, * NULL is returned. * * It is assumed that h1 <= h2 (i.e. h1->lo <= h2->lo) */ static hostrange_t hostrange_intersect(hostrange_t h1, hostrange_t h2) { hostrange_t new = NULL; assert(h1 != NULL); assert(h2 != NULL); if (h1->singlehost || h2->singlehost) return NULL; assert(hostrange_cmp(h1, h2) <= 0); if ((hostrange_prefix_cmp(h1, h2) == 0) && (h1->hi > h2->lo) && (hostrange_width_combine(h1, h2))) { if (!(new = hostrange_copy(h1))) return NULL; new->lo = h2->lo; new->hi = h2->hi < h1->hi ? h2->hi : h1->hi; } return new; } /* return 1 if hostname hn is within the hostrange hr * 0 if not. */ static int hostrange_hn_within(hostrange_t hr, hostname_t hn) { int retval = 0; if (hr->singlehost && (strcmp(hn->hostname, hr->prefix) == 0)) return 1; if (strcmp(hr->prefix, hn->prefix) == 0) { if (!hostname_suffix_is_valid(hn)) { if (hr->singlehost) retval = 1; } else if (hn->num <= hr->hi && hn->num >= hr->lo) { int width = hostname_suffix_width(hn); int num = hn->num; retval = _width_equiv(hr->lo, &hr->width, num, &width); } } return retval; } /* copy a string representation of the hostrange hr into buffer buf, * writing at most n chars including NUL termination */ static size_t hostrange_to_string(hostrange_t hr, size_t n, char *buf, char *separator) { unsigned long i; int truncated = 0; int len = 0; char sep = separator == NULL ? ',' : separator[0]; if (n == 0) return 0; if (hr->singlehost) return snprintf(buf, n, "%s", hr->prefix); for (i = hr->lo; i <= hr->hi; i++) { size_t m = (n - len) <= n ? n - len : 0; /* check for < 0 */ int ret = snprintf(buf + len, m, "%s%0*lu", hr->prefix, hr->width, i); if (ret < 0 || ret >= m) { len = n; truncated = 1; break; } len+=ret; buf[len++] = sep; } if (truncated) { buf[n-1] = '\0'; return -1; } else { /* back up over final separator */ buf[--len] = '\0'; return len; } } /* Place the string representation of the numeric part of hostrange into buf * writing at most n chars including NUL termination. */ static size_t hostrange_numstr(hostrange_t hr, size_t n, char *buf) { int len = 0; assert(buf != NULL); if (hr->singlehost || n == 0) return 0; len = snprintf(buf, n, "%0*lu", hr->width, hr->lo); if ((len >= 0) && (len < n) && (hr->lo < hr->hi)) { int len2 = snprintf(buf+len, n-len, "-%0*lu", hr->width, hr->hi); if (len2 < 0) len = -1; else len += len2; } return len; } /* ----[ hostlist functions ]---- */ /* Create a new hostlist object. * Returns an empty hostlist, or NULL if memory allocation fails. */ static hostlist_t hostlist_new(void) { int i; hostlist_t new = (hostlist_t) malloc(sizeof(*new)); if (!new) goto fail1; assert(new->magic = HOSTLIST_MAGIC); mutex_init(&new->mutex); new->hr = (hostrange_t *) malloc(HOSTLIST_CHUNK * sizeof(hostrange_t)); if (!new->hr) goto fail2; /* set entries in hostrange array to NULL */ for (i = 0; i < HOSTLIST_CHUNK; i++) new->hr[i] = NULL; new->size = HOSTLIST_CHUNK; new->nranges = 0; new->nhosts = 0; new->ilist = NULL; return new; fail2: free(new); fail1: out_of_memory("hostlist_create"); } /* Resize the internal array used to store the list of hostrange objects. * * returns 1 for a successful resize, * 0 if call to _realloc fails * * It is assumed that the caller has the hostlist hl locked */ static int hostlist_resize(hostlist_t hl, size_t newsize) { int i; size_t oldsize; assert(hl != NULL); assert(hl->magic == HOSTLIST_MAGIC); oldsize = hl->size; hl->size = newsize; hl->hr = realloc((void *) hl->hr, hl->size*sizeof(hostrange_t)); if (!(hl->hr)) return 0; for (i = oldsize; i < newsize; i++) hl->hr[i] = NULL; return 1; } /* Resize hostlist by one HOSTLIST_CHUNK * Assumes that hostlist hl is locked by caller */ static int hostlist_expand(hostlist_t hl) { if (!hostlist_resize(hl, hl->size + HOSTLIST_CHUNK)) return 0; else return 1; } /* Push a hostrange object onto hostlist hl * Returns the number of hosts successfully pushed onto hl * or -1 if there was an error allocating memory */ static int hostlist_push_range(hostlist_t hl, hostrange_t hr) { hostrange_t tail; int retval; assert(hr != NULL); LOCK_HOSTLIST(hl); tail = (hl->nranges > 0) ? hl->hr[hl->nranges-1] : hl->hr[0]; if (hl->size == hl->nranges && !hostlist_expand(hl)) goto error; if (hl->nranges > 0 && hostrange_prefix_cmp(tail, hr) == 0 && tail->hi == hr->lo - 1 && hostrange_width_combine(tail, hr)) { tail->hi = hr->hi; } else { if ((hl->hr[hl->nranges++] = hostrange_copy(hr)) == NULL) goto error; } retval = hl->nhosts += hostrange_count(hr); UNLOCK_HOSTLIST(hl); return retval; error: UNLOCK_HOSTLIST(hl); return -1; } /* Same as hostlist_push_range() above, but prefix, lo, hi, and width * are passed as args */ static int hostlist_push_hr(hostlist_t hl, char *prefix, unsigned long lo, unsigned long hi, int width) { hostrange_t hr = hostrange_create(prefix, lo, hi, width); int retval = hostlist_push_range(hl, hr); hostrange_destroy(hr); return retval; } /* Insert a range object hr into position n of the hostlist hl * Assumes that hl->mutex is already held by calling process */ static int hostlist_insert_range(hostlist_t hl, hostrange_t hr, int n) { int i; hostrange_t tmp; hostlist_iterator_t hli; assert(hl != NULL); assert(hl->magic == HOSTLIST_MAGIC); assert(hr != NULL); if (n > hl->nranges) return 0; if (hl->size == hl->nranges && !hostlist_expand(hl)) return 0; /* copy new hostrange into slot "n" in array */ tmp = hl->hr[n]; hl->hr[n] = hostrange_copy(hr); /* push remaining hostrange entries up */ for (i = n + 1; i < hl->nranges + 1; i++) { hostrange_t last = hl->hr[i]; hl->hr[i] = tmp; tmp = last; } hl->nranges++; /* adjust hostlist iterators if needed */ for (hli = hl->ilist; hli; hli = hli->next) { if (hli->idx >= n) hli->hr = hli->hl->hr[++hli->idx]; } return 1; } /* Delete the range at position n in the range array * Assumes the hostlist lock is already held. */ static void hostlist_delete_range(hostlist_t hl, int n) { int i; hostrange_t old; assert(hl != NULL); assert(hl->magic == HOSTLIST_MAGIC); assert(n < hl->nranges && n >= 0); old = hl->hr[n]; for (i = n; i < hl->nranges - 1; i++) hl->hr[i] = hl->hr[i + 1]; hl->nranges--; hl->hr[hl->nranges] = NULL; hostlist_shift_iterators(hl, n, 0, 1); /* XXX caller responsible for adjusting nhosts */ /* hl->nhosts -= hostrange_count(old) */ hostrange_destroy(old); } #if WANT_RECKLESS_HOSTRANGE_EXPANSION /* The reckless hostrange expansion function. * See comment in hostlist.h:hostlist_create() for more info on * the different choices for hostlist notation. */ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) { char *str, *orig; char *tok, *cur; int high, low, fmt = 0; char prefix[256] = ""; int pos = 0; int error = 0; char range_op = r_op[0];/* XXX support > 1 char range ops in future? */ hostlist_t new = hostlist_new(); orig = str = strdup(hostlist); /* return an empty list if an empty string was passed in */ if (str == NULL || strlen(str) == 0) goto done; /* Use hostlist_create_bracketed if we see "[" */ if (strchr(str, '[') != NULL) return _hostlist_create_bracketed(hostlist, sep, r_op); while ((tok = _next_tok(sep, &str)) != NULL) { /* save the current string for error messages */ cur = tok; high = low = 0; /* find end of alpha part * do this by finding last occurence of range_op in str */ pos = strlen(tok) - 1; if (strstr(tok, r_op) != '\0') { while (pos >= 0 && (char) tok[pos] != range_op) pos--; } /* now back up past any digits */ while (pos >= 0 && isdigit((char) tok[--pos])) {;} /* Check for valid x-y range (x must be a digit) * Reset pos if the range is not valid */ if (!isdigit((char) tok[++pos])) pos = strlen(tok) - 1; /* create prefix string * if prefix will be zero length, but prefix already exists * use the previous prefix and fmt */ if ((pos > 0) || (prefix[0] == '\0')) { memcpy(prefix, tok, (size_t) pos * sizeof(char)); prefix[pos] = '\0'; /* push pointer past prefix */ tok += pos; /* count number of digits for ouput fmt */ for (fmt = 0; isdigit(tok[fmt]); ++fmt) {;} if (fmt == 0) error = 1; } else tok += pos; /* get lower bound */ low = strtoul(tok, (char **) &tok, 10); if (*tok == range_op) { /* now get range upper bound */ /* push pointer past range op */ ++tok; /* find length of alpha part */ for (pos = 0; tok[pos] && !isdigit(tok[pos]); ++pos) {;} /* alpha part must match prefix or error * this could mean we've got something like "rtr1-a2" * so just record an error */ if (pos > 0) { if (pos != strlen(prefix) || strncmp(prefix, tok, pos) != 0) error = 1; } if (*tok != '\0') tok += pos; /* make sure we have digits to the end */ for (pos = 0; tok[pos] && isdigit((char) tok[pos]); ++pos) {;} if (pos > 0) { /* we have digits to process */ high = strtoul(tok, (char **) &tok, 10); } else { /* bad boy, no digits */ error = 1; } if ((low > high) || (high - low > MAX_RANGE)) error = 1; } else { /* single value */ high = 0; /* special case, ugh. */ } /* error if: * 1. we are not at end of string * 2. upper bound equals lower bound */ if (*tok != '\0' || high == low) error = 1; if (error) { /* assume this is not a range on any error */ hostlist_push_host(new, cur); } else { if (high < low) high = low; hostlist_push_hr(new, prefix, low, high, fmt); } error = 0; } done: free(orig); return new; } #else /* !WANT_RECKLESS_HOSTRANGE_EXPANSION */ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op) { return _hostlist_create_bracketed(hostlist, sep, r_op); } #endif /* WANT_RECKLESS_HOSTRANGE_EXPANSION */ struct _range { unsigned long lo, hi; int width; }; /* Grab a single range from str * returns 1 if str contained a valid number or range, * 0 if conversion of str to a range failed. */ static int _parse_single_range(const char *str, struct _range *range) { char *p, *q; char *orig = strdup(str); if (!orig) seterrno_ret(ENOMEM, 0); if ((p = strchr(str, '-'))) { *p++ = '\0'; if (*p == '-') /* do NOT allow negative numbers */ goto error; } range->lo = strtoul(str, &q, 10); if (q == str) goto error; range->hi = (p && *p) ? strtoul(p, &q, 10) : range->lo; if (q == p || *q != '\0') goto error; if (range->lo > range->hi) goto error; if (range->hi - range->lo + 1 > MAX_RANGE ) { _error(__FILE__, __LINE__, "Too many hosts in range `%s'", orig); free(orig); seterrno_ret(ERANGE, 0); } free(orig); range->width = strlen(str); return 1; error: _error(__FILE__, __LINE__, "Invalid range: `%s'", orig); free(orig); seterrno_ret(EINVAL, 0); } /* * Convert 'str' containing comma separated digits and ranges into an array * of struct _range types (max 'len' elements). * * Return number of ranges created, or -1 on error. */ static int _parse_range_list(char *str, struct _range *ranges, int len) { char *p; int count = 0; while (str) { if (count == len) return -1; if ((p = strchr(str, ','))) *p++ = '\0'; if (!_parse_single_range(str, &ranges[count++])) return -1; str = p; } return count; } static void _push_range_list(hostlist_t hl, char *pfx, struct _range *rng, int n) { int i; for (i = 0; i < n; i++) { hostlist_push_hr(hl, pfx, rng->lo, rng->hi, rng->width); rng++; } } static void _push_range_list_with_suffix(hostlist_t hl, char *pfx, char *sfx, struct _range *rng, int n) { int i; unsigned long j; for (i = 0; i < n; i++) { for (j = rng->lo; j <= rng->hi; j++) { char host[4096]; hostrange_t hr; snprintf (host, 4096, "%s%0*lu%s", pfx, rng->width, j, sfx); hr = hostrange_create_single (host); hostlist_push_range (hl, hr); /* * hr is copied in hostlist_push_range. Need to free here. */ hostrange_destroy (hr); } rng++; } } /* * Create a hostlist from a string with brackets '[' ']' to aid * detection of ranges and compressed lists */ static hostlist_t _hostlist_create_bracketed(const char *hostlist, char *sep, char *r_op) { hostlist_t new = hostlist_new(); struct _range ranges[MAX_RANGES]; int nr, err; char *p, *tok, *str, *orig; char cur_tok[1024]; if (hostlist == NULL) return new; if (!(orig = str = strdup(hostlist))) { hostlist_destroy(new); return NULL; } while ((tok = _next_tok(sep, &str)) != NULL) { strncpy(cur_tok, tok, 1024); if ((p = strchr(tok, '[')) != NULL) { char *q, *prefix = tok; *p++ = '\0'; if ((q = strchr(p, ']'))) { *q = '\0'; nr = _parse_range_list(p, ranges, MAX_RANGES); if (nr < 0) goto error; if (*(++q) != '\0') _push_range_list_with_suffix (new, prefix, q, ranges, nr); else _push_range_list(new, prefix, ranges, nr); } else hostlist_push_host(new, cur_tok); } else hostlist_push_host(new, cur_tok); } free(orig); return new; error: err = errno; hostlist_destroy(new); free(orig); seterrno_ret(err, NULL); } hostlist_t hostlist_create(const char *str) { return _hostlist_create(str, "\t, ", "-"); } hostlist_t hostlist_copy(const hostlist_t hl) { int i; hostlist_t new; if (hl == NULL) return NULL; LOCK_HOSTLIST(hl); if (!(new = hostlist_new())) goto done; new->nranges = hl->nranges; new->nhosts = hl->nhosts; if (new->nranges > new->size) hostlist_resize(new, new->nranges); for (i = 0; i < hl->nranges; i++) new->hr[i] = hostrange_copy(hl->hr[i]); done: UNLOCK_HOSTLIST(hl); return new; } void hostlist_destroy(hostlist_t hl) { int i; if (hl == NULL) return; LOCK_HOSTLIST(hl); while (hl->ilist) { mutex_unlock(&hl->mutex); hostlist_iterator_destroy(hl->ilist); mutex_lock(&hl->mutex); } for (i = 0; i < hl->nranges; i++) hostrange_destroy(hl->hr[i]); free(hl->hr); assert(hl->magic = 0x1); UNLOCK_HOSTLIST(hl); mutex_destroy(&hl->mutex); free(hl); } int hostlist_push(hostlist_t hl, const char *hosts) { hostlist_t new; int retval; if (hosts == NULL) return 0; new = hostlist_create(hosts); if (!new) return 0; mutex_lock(&new->mutex); retval = new->nhosts; mutex_unlock(&new->mutex); hostlist_push_list(hl, new); hostlist_destroy(new); return retval; } int hostlist_push_host(hostlist_t hl, const char *str) { hostrange_t hr; hostname_t hn; if (str == NULL) return 0; hn = hostname_create(str); if (hostname_suffix_is_valid(hn)) { hr = hostrange_create(hn->prefix, hn->num, hn->num, hostname_suffix_width(hn)); } else hr = hostrange_create_single(str); hostlist_push_range(hl, hr); hostrange_destroy(hr); hostname_destroy(hn); return 1; } int hostlist_push_list(hostlist_t h1, hostlist_t h2) { int i, n = 0; if (h2 == NULL) return 0; LOCK_HOSTLIST(h2); for (i = 0; i < h2->nranges; i++) n += hostlist_push_range(h1, h2->hr[i]); UNLOCK_HOSTLIST(h2); return n; } char *hostlist_pop(hostlist_t hl) { char *host = NULL; LOCK_HOSTLIST(hl); if (hl->nhosts > 0) { hostrange_t hr = hl->hr[hl->nranges - 1]; host = hostrange_pop(hr); hl->nhosts--; if (hostrange_empty(hr)) { hostrange_destroy(hl->hr[--hl->nranges]); hl->hr[hl->nranges] = NULL; } } UNLOCK_HOSTLIST(hl); return host; } /* find all iterators affected by a shift (or deletion) at * hl->hr[idx], depth, with the deletion of n ranges */ static void hostlist_shift_iterators(hostlist_t hl, int idx, int depth, int n) { hostlist_iterator_t i; for (i = hl->ilist; i; i = i->next) { if (n == 0) { if (i->idx == idx && i->depth >= depth) i->depth = i->depth > -1 ? i->depth - 1 : -1; } else { if (i->idx >= idx) { if ((i->idx -= n) >= 0) i->hr = i->hl->hr[i->idx]; else hostlist_iterator_reset(i); } } } } char *hostlist_shift(hostlist_t hl) { char *host = NULL; LOCK_HOSTLIST(hl); if (hl->nhosts > 0) { hostrange_t hr = hl->hr[0]; host = hostrange_shift(hr); hl->nhosts--; if (hostrange_empty(hr)) { hostlist_delete_range(hl, 0); /* hl->nranges--; */ } else hostlist_shift_iterators(hl, 0, 0, 0); } UNLOCK_HOSTLIST(hl); return host; } char *hostlist_pop_range(hostlist_t hl) { int i; char buf[MAXHOSTRANGELEN + 1]; hostlist_t hltmp; hostrange_t tail; LOCK_HOSTLIST(hl); if (hl->nranges < 1 || !(hltmp = hostlist_new())) { UNLOCK_HOSTLIST(hl); return NULL; } i = hl->nranges - 2; tail = hl->hr[hl->nranges - 1]; while (i >= 0 && hostrange_within_range(tail, hl->hr[i])) i--; for (i++; i < hl->nranges; i++) { hostlist_push_range(hltmp, hl->hr[i]); hostrange_destroy(hl->hr[i]); hl->hr[i] = NULL; } hl->nhosts -= hltmp->nhosts; hl->nranges -= hltmp->nranges; UNLOCK_HOSTLIST(hl); hostlist_ranged_string(hltmp, MAXHOSTRANGELEN, buf); hostlist_destroy(hltmp); return strdup(buf); } char *hostlist_shift_range(hostlist_t hl) { int i; char buf[1024]; hostlist_t hltmp = hostlist_new(); if (!hltmp) return NULL; LOCK_HOSTLIST(hl); if (hl->nranges == 0) { hostlist_destroy(hltmp); UNLOCK_HOSTLIST(hl); return NULL; } i = 0; do { hostlist_push_range(hltmp, hl->hr[i]); hostrange_destroy(hl->hr[i]); } while ( (++i < hl->nranges) && hostrange_within_range(hltmp->hr[0], hl->hr[i]) ); hostlist_shift_iterators(hl, i, 0, hltmp->nranges); /* shift rest of ranges back in hl */ for (; i < hl->nranges; i++) { hl->hr[i - hltmp->nranges] = hl->hr[i]; hl->hr[i] = NULL; } hl->nhosts -= hltmp->nhosts; hl->nranges -= hltmp->nranges; UNLOCK_HOSTLIST(hl); hostlist_ranged_string(hltmp, 1024, buf); hostlist_destroy(hltmp); return strdup(buf); } /* XXX: Note: efficiency improvements needed */ int hostlist_delete(hostlist_t hl, const char *hosts) { int n = 0; char *hostname = NULL; hostlist_t hltmp; if (!(hltmp = hostlist_create(hosts))) seterrno_ret(EINVAL, 0); while ((hostname = hostlist_pop(hltmp)) != NULL) { n += hostlist_delete_host(hl, hostname); free(hostname); } hostlist_destroy(hltmp); return n; } /* XXX watch out! poor implementation follows! (fix it at some point) */ int hostlist_delete_host(hostlist_t hl, const char *hostname) { int n = hostlist_find(hl, hostname); if (n >= 0) hostlist_delete_nth(hl, n); return n >= 0 ? 1 : 0; } static char * _hostrange_string(hostrange_t hr, int depth) { char buf[MAXHOSTNAMELEN + 16]; int len = snprintf(buf, MAXHOSTNAMELEN + 15, "%s", hr->prefix); if (!hr->singlehost) snprintf(buf+len, MAXHOSTNAMELEN+15 - len, "%0*lu", hr->width, hr->lo + depth); return strdup(buf); } char * hostlist_nth(hostlist_t hl, int n) { char *host = NULL; int i, count; LOCK_HOSTLIST(hl); count = 0; for (i = 0; i < hl->nranges; i++) { int num_in_range = hostrange_count(hl->hr[i]); if (n <= (num_in_range - 1 + count)) { host = _hostrange_string(hl->hr[i], n - count); break; } else count += num_in_range; } UNLOCK_HOSTLIST(hl); return host; } int hostlist_delete_nth(hostlist_t hl, int n) { int i, count; LOCK_HOSTLIST(hl); assert(n >= 0 && n <= hl->nhosts); count = 0; for (i = 0; i < hl->nranges; i++) { int num_in_range = hostrange_count(hl->hr[i]); hostrange_t hr = hl->hr[i]; if (n <= (num_in_range - 1 + count)) { unsigned long num = hr->lo + n - count; hostrange_t new; if (hr->singlehost) { /* this wasn't a range */ hostlist_delete_range(hl, i); } else if ((new = hostrange_delete_host(hr, num))) { hostlist_insert_range(hl, new, i + 1); hostrange_destroy(new); } else if (hostrange_empty(hr)) hostlist_delete_range(hl, i); goto done; } else count += num_in_range; } done: UNLOCK_HOSTLIST(hl); hl->nhosts--; return 1; } int hostlist_count(hostlist_t hl) { int retval; LOCK_HOSTLIST(hl); retval = hl->nhosts; UNLOCK_HOSTLIST(hl); return retval; } int hostlist_find(hostlist_t hl, const char *hostname) { int i, count, ret = -1; hostname_t hn; if (!hostname) return -1; hn = hostname_create(hostname); LOCK_HOSTLIST(hl); for (i = 0, count = 0; i < hl->nranges; i++) { if (hostrange_hn_within(hl->hr[i], hn)) { if (hostname_suffix_is_valid(hn) && !hl->hr[i]->singlehost) ret = count + hn->num - hl->hr[i]->lo; else ret = count; goto done; } else count += hostrange_count(hl->hr[i]); } done: UNLOCK_HOSTLIST(hl); hostname_destroy(hn); return ret; } /* hostrange compare with void * arguments to allow use with * libc qsort() */ int _cmp(const void *hr1, const void *hr2) { hostrange_t *h1 = (hostrange_t *) hr1; hostrange_t *h2 = (hostrange_t *) hr2; return hostrange_cmp((hostrange_t) * h1, (hostrange_t) * h2); } void hostlist_sort(hostlist_t hl) { hostlist_iterator_t i; LOCK_HOSTLIST(hl); if (hl->nranges <= 1) { UNLOCK_HOSTLIST(hl); return; } qsort(hl->hr, hl->nranges, sizeof(hostrange_t), &_cmp); /* reset all iterators */ for (i = hl->ilist; i; i = i->next) hostlist_iterator_reset(i); UNLOCK_HOSTLIST(hl); hostlist_coalesce(hl); } /* search through hostlist for ranges that can be collapsed * does =not= delete any hosts */ static void hostlist_collapse(hostlist_t hl) { int i; LOCK_HOSTLIST(hl); for (i = hl->nranges - 1; i > 0; i--) { hostrange_t hprev = hl->hr[i - 1]; hostrange_t hnext = hl->hr[i]; if (hostrange_prefix_cmp(hprev, hnext) == 0 && hprev->hi == hnext->lo - 1 && hostrange_width_combine(hprev, hnext)) { hprev->hi = hnext->hi; hostlist_delete_range(hl, i); } } UNLOCK_HOSTLIST(hl); } /* search through hostlist (hl) for intersecting ranges * split up duplicates and coalesce ranges where possible */ static void hostlist_coalesce(hostlist_t hl) { int i, j; hostrange_t new; LOCK_HOSTLIST(hl); for (i = hl->nranges - 1; i > 0; i--) { new = hostrange_intersect(hl->hr[i - 1], hl->hr[i]); if (new) { hostrange_t hprev = hl->hr[i - 1]; hostrange_t hnext = hl->hr[i]; j = i; if (new->hi < hprev->hi) hnext->hi = hprev->hi; hprev->hi = new->lo; hnext->lo = new->hi; if (hostrange_empty(hprev)) hostlist_delete_range(hl, i); while (new->lo <= new->hi) { hostrange_t hr = hostrange_create( new->prefix, new->lo, new->lo, new->width ); if (new->lo > hprev->hi) hostlist_insert_range(hl, hr, j++); if (new->lo < hnext->lo) hostlist_insert_range(hl, hr, j++); hostrange_destroy(hr); new->lo++; } i = hl->nranges; hostrange_destroy(new); } } UNLOCK_HOSTLIST(hl); hostlist_collapse(hl); } /* attempt to join ranges at loc and loc-1 in a hostlist */ /* delete duplicates, return the number of hosts deleted */ /* assumes that the hostlist hl has been locked by caller */ /* returns -1 if no range join occurred */ static int _attempt_range_join(hostlist_t hl, int loc) { int ndup; assert(hl != NULL); assert(hl->magic == HOSTLIST_MAGIC); assert(loc > 0); assert(loc < hl->nranges); ndup = hostrange_join(hl->hr[loc - 1], hl->hr[loc]); if (ndup >= 0) { hostlist_delete_range(hl, loc); hl->nhosts -= ndup; } return ndup; } void hostlist_uniq(hostlist_t hl) { int i = 1; hostlist_iterator_t hli; LOCK_HOSTLIST(hl); if (hl->nranges <= 1) { UNLOCK_HOSTLIST(hl); return; } qsort(hl->hr, hl->nranges, sizeof(hostrange_t), &_cmp); while (i < hl->nranges) { if (_attempt_range_join(hl, i) < 0) /* No range join occurred */ i++; } /* reset all iterators */ for (hli = hl->ilist; hli; hli = hli->next) hostlist_iterator_reset(hli); UNLOCK_HOSTLIST(hl); } ssize_t hostlist_deranged_string(hostlist_t hl, size_t n, char *buf) { int i; int len = 0; int truncated = 0; LOCK_HOSTLIST(hl); for (i = 0; i < hl->nranges; i++) { size_t m = (n - len) <= n ? n - len : 0; int ret = hostrange_to_string(hl->hr[i], m, buf + len, ","); if (ret < 0 || ret > m) { len = n; truncated = 1; break; } len+=ret; buf[len++] = ','; } UNLOCK_HOSTLIST(hl); buf[len > 0 ? --len : 0] = '\0'; if (len == n) truncated = 1; return truncated ? -1 : len; } /* return true if a bracket is needed for the range at i in hostlist hl */ static int _is_bracket_needed(hostlist_t hl, int i) { hostrange_t h1 = hl->hr[i]; hostrange_t h2 = i < hl->nranges - 1 ? hl->hr[i + 1] : NULL; return hostrange_count(h1) > 1 || hostrange_within_range(h1, h2); } /* write the next bracketed hostlist, i.e. prefix[n-m,k,...] * into buf, writing at most n chars including the terminating '\0' * * leaves start pointing to one past last range object in bracketed list, * and returns the number of bytes written into buf. * * Assumes hostlist is locked. */ static int _get_bracketed_list(hostlist_t hl, int *start, const size_t n, char *buf) { hostrange_t *hr = hl->hr; int i = *start; int m, len = 0; int bracket_needed = _is_bracket_needed(hl, i); len = snprintf(buf, n, "%s", hr[i]->prefix); if ((len < 0) || (len > n)) return n; /* truncated, buffer filled */ if (bracket_needed && len < n && len >= 0) buf[len++] = '['; do { m = (n - len) <= n ? n - len : 0; len += hostrange_numstr(hr[i], m, buf + len); if (len >= n) break; if (bracket_needed) /* Only need commas inside brackets */ buf[len++] = ','; } while (++i < hl->nranges && hostrange_within_range(hr[i], hr[i-1])); if (bracket_needed && len < n && len > 0) { /* Add trailing bracket (change trailing "," from above to "]" */ buf[len - 1] = ']'; /* NUL terminate for safety, but do not add terminator to len */ buf[len] = '\0'; } else if (len >= n) { if (n > 0) buf[n-1] = '\0'; } else { /* If len is > 0, NUL terminate (but do not add to len) */ buf[len > 0 ? len : 0] = '\0'; } *start = i; return len; } ssize_t hostlist_ranged_string(hostlist_t hl, size_t n, char *buf) { int i = 0; int len = 0; int truncated = 0; LOCK_HOSTLIST(hl); while (i < hl->nranges && len < n) { len += _get_bracketed_list(hl, &i, n - len, buf + len); if ((len > 0) && (len < n) && (i < hl->nranges)) buf[len++] = ','; } UNLOCK_HOSTLIST(hl); /* NUL terminate */ if (len >= n) { truncated = 1; if (n > 0) buf[n-1] = '\0'; } else buf[len > 0 ? len : 0] = '\0'; return truncated ? -1 : len; } /* ----[ hostlist iterator functions ]---- */ static hostlist_iterator_t hostlist_iterator_new(void) { hostlist_iterator_t i = (hostlist_iterator_t) malloc(sizeof(*i)); if (!i) return NULL; i->hl = NULL; i->hr = NULL; i->idx = 0; i->depth = -1; i->next = i; assert(i->magic = HOSTLIST_MAGIC); return i; } hostlist_iterator_t hostlist_iterator_create(hostlist_t hl) { hostlist_iterator_t i; if (!(i = hostlist_iterator_new())) out_of_memory("hostlist_iterator_create"); LOCK_HOSTLIST(hl); i->hl = hl; i->hr = hl->hr[0]; i->next = hl->ilist; hl->ilist = i; UNLOCK_HOSTLIST(hl); return i; } hostlist_iterator_t hostset_iterator_create(hostset_t set) { return hostlist_iterator_create(set->hl); } void hostlist_iterator_reset(hostlist_iterator_t i) { assert(i != NULL); assert(i->magic == HOSTLIST_MAGIC); i->idx = 0; i->hr = i->hl->hr[0]; i->depth = -1; return; } void hostlist_iterator_destroy(hostlist_iterator_t i) { hostlist_iterator_t *pi; if (i == NULL) return; assert(i != NULL); assert(i->magic == HOSTLIST_MAGIC); LOCK_HOSTLIST(i->hl); for (pi = &i->hl->ilist; *pi; pi = &(*pi)->next) { assert((*pi)->magic == HOSTLIST_MAGIC); if (*pi == i) { *pi = (*pi)->next; break; } } UNLOCK_HOSTLIST(i->hl); assert(i->magic = 0x1); free(i); } static void _iterator_advance(hostlist_iterator_t i) { assert(i != NULL); assert(i->magic == HOSTLIST_MAGIC); if (i->idx > i->hl->nranges - 1) return; if (++(i->depth) > (i->hr->hi - i->hr->lo)) { i->depth = 0; i->hr = i->hl->hr[++i->idx]; } } /* advance iterator to end of current range (meaning within "[" "]") * i.e. advance iterator past all range objects that could be represented * in on bracketed hostlist. */ static void _iterator_advance_range(hostlist_iterator_t i) { int nr, j; hostrange_t *hr; assert(i != NULL); assert(i->magic == HOSTLIST_MAGIC); nr = i->hl->nranges; hr = i->hl->hr; j = i->idx; if (++i->depth > 0) { while (++j < nr && hostrange_within_range(i->hr, hr[j])) {;} i->idx = j; i->hr = i->hl->hr[i->idx]; i->depth = 0; } } char *hostlist_next(hostlist_iterator_t i) { char *buf = NULL; char suffix[16]; int len = 0; assert(i != NULL); assert(i->magic == HOSTLIST_MAGIC); LOCK_HOSTLIST(i->hl); _iterator_advance(i); if (i->idx > i->hl->nranges - 1) { UNLOCK_HOSTLIST(i->hl); return NULL; } suffix[0] = '\0'; if (!i->hr->singlehost) snprintf (suffix, 15, "%0*lu", i->hr->width, i->hr->lo + i->depth); len = strlen (i->hr->prefix) + strlen (suffix) + 1; if (!(buf = malloc (len))) out_of_memory("hostlist_next"); buf[0] = '\0'; strcat (buf, i->hr->prefix); strcat (buf, suffix); UNLOCK_HOSTLIST(i->hl); return (buf); } char *hostlist_next_range(hostlist_iterator_t i) { char buf[MAXHOSTRANGELEN + 1]; int j; assert(i != NULL); assert(i->magic == HOSTLIST_MAGIC); LOCK_HOSTLIST(i->hl); _iterator_advance_range(i); if (i->idx > i->hl->nranges - 1) { UNLOCK_HOSTLIST(i->hl); return NULL; } j = i->idx; _get_bracketed_list(i->hl, &j, MAXHOSTRANGELEN, buf); UNLOCK_HOSTLIST(i->hl); return strdup(buf); } int hostlist_remove(hostlist_iterator_t i) { hostrange_t new; assert(i != NULL); assert(i->magic == HOSTLIST_MAGIC); LOCK_HOSTLIST(i->hl); new = hostrange_delete_host(i->hr, i->hr->lo + i->depth); if (new) { hostlist_insert_range(i->hl, new, i->idx + 1); hostrange_destroy(new); i->hr = i->hl->hr[++i->idx]; i->depth = -1; } else if (hostrange_empty(i->hr)) { hostlist_delete_range(i->hl, i->idx); } else i->depth--; i->hl->nhosts--; UNLOCK_HOSTLIST(i->hl); return 1; } /* ----[ hostset functions ]---- */ hostset_t hostset_create(const char *hostlist) { hostset_t new; if (!(new = (hostset_t) malloc(sizeof(*new)))) goto error1; if (!(new->hl = hostlist_create(hostlist))) goto error2; hostlist_uniq(new->hl); return new; error2: free(new); error1: return NULL; } hostset_t hostset_copy(const hostset_t set) { hostset_t new; if (!(new = (hostset_t) malloc(sizeof(*new)))) goto error1; if (!(new->hl = hostlist_copy(set->hl))) goto error2; return new; error2: free(new); error1: return NULL; } void hostset_destroy(hostset_t set) { if (set == NULL) return; hostlist_destroy(set->hl); free(set); } /* inserts a single range object into a hostset * Assumes that the set->hl lock is already held * Updates hl->nhosts */ static int hostset_insert_range(hostset_t set, hostrange_t hr) { int i = 0; int inserted = 0; int nhosts = 0; int ndups = 0; hostlist_t hl; hl = set->hl; if (hl->size == hl->nranges && !hostlist_expand(hl)) return 0; nhosts = hostrange_count(hr); for (i = 0; i < hl->nranges; i++) { if (hostrange_cmp(hr, hl->hr[i]) <= 0) { if ((ndups = hostrange_join(hr, hl->hr[i])) >= 0) hostlist_delete_range(hl, i); else if (ndups < 0) ndups = 0; hostlist_insert_range(hl, hr, i); /* now attempt to join hr[i] and hr[i-1] */ if (i > 0) { int m; if ((m = _attempt_range_join(hl, i)) > 0) ndups += m; } hl->nhosts += nhosts - ndups; inserted = 1; break; } } if (inserted == 0) { hl->hr[hl->nranges++] = hostrange_copy(hr); hl->nhosts += nhosts; if (hl->nranges > 1) { if ((ndups = _attempt_range_join(hl, hl->nranges - 1)) <= 0) ndups = 0; } } /* * Return the number of unique hosts inserted */ return nhosts - ndups; } int hostset_insert(hostset_t set, const char *hosts) { int i, n = 0; hostlist_t hl = hostlist_create(hosts); if (!hl) return 0; hostlist_uniq(hl); LOCK_HOSTLIST(set->hl); for (i = 0; i < hl->nranges; i++) n += hostset_insert_range(set, hl->hr[i]); UNLOCK_HOSTLIST(set->hl); hostlist_destroy(hl); return n; } /* linear search through N ranges for hostname "host" * */ static int hostset_find_host(hostset_t set, const char *host) { int i; int retval = 0; hostname_t hn; LOCK_HOSTLIST(set->hl); hn = hostname_create(host); for (i = 0; i < set->hl->nranges; i++) { if (hostrange_hn_within(set->hl->hr[i], hn)) { retval = 1; goto done; } } done: UNLOCK_HOSTLIST(set->hl); hostname_destroy(hn); return retval; } int hostset_within(hostset_t set, const char *hosts) { int nhosts, nfound; hostlist_t hl; char *hostname; assert(set->hl->magic == HOSTLIST_MAGIC); if (!(hl = hostlist_create(hosts))) return (0); nhosts = hostlist_count(hl); nfound = 0; while ((hostname = hostlist_pop(hl)) != NULL) { nfound += hostset_find_host(set, hostname); free(hostname); } hostlist_destroy(hl); return (nhosts == nfound); } int hostset_delete(hostset_t set, const char *hosts) { return hostlist_delete(set->hl, hosts); } int hostset_delete_host(hostset_t set, const char *hostname) { return hostlist_delete_host(set->hl, hostname); } char *hostset_shift(hostset_t set) { return hostlist_shift(set->hl); } char *hostset_pop(hostset_t set) { return hostlist_pop(set->hl); } char *hostset_shift_range(hostset_t set) { return hostlist_shift_range(set->hl); } char *hostset_pop_range(hostset_t set) { return hostlist_pop_range(set->hl); } int hostset_count(hostset_t set) { return hostlist_count(set->hl); } ssize_t hostset_ranged_string(hostset_t set, size_t n, char *buf) { return hostlist_ranged_string(set->hl, n, buf); } ssize_t hostset_deranged_string(hostset_t set, size_t n, char *buf) { return hostlist_deranged_string(set->hl, n, buf); } #if TEST_MAIN int hostlist_nranges(hostlist_t hl) { return hl->nranges; } int hostset_nranges(hostset_t set) { return set->hl->nranges; } /* test iterator functionality on the list of hosts represented * by list */ int iterator_test(char *list) { int j; char buf[1024]; hostlist_t hl = hostlist_create(list); hostset_t set = hostset_create(list); hostlist_iterator_t i = hostlist_iterator_create(hl); hostlist_iterator_t seti = hostset_iterator_create(set); hostlist_iterator_t i2 = hostlist_iterator_create(hl); char *host; hostlist_ranged_string(hl, 1024, buf); printf("iterator_test: hl = `%s' passed in `%s'\n", buf, list); host = hostlist_next(i); printf("first host in list hl = `%s'\n", host); free(host); /* forge ahead three hosts with i2 */ for (j = 0; j < 4; j++) { host = hostlist_next(i2); free(host); } host = hostlist_shift(hl); printf("result of shift(hl) = `%s'\n", host); free(host); host = hostlist_next(i); printf("next host in list hl = `%s'\n", host); free(host); host = hostlist_next(i2); printf("next host for i2 = `%s'\n", host); free(host); hostlist_iterator_destroy(i); hostlist_destroy(hl); hostset_destroy(set); return 1; } int main(int ac, char **av) { char buf[1024000]; int i; char *str; hostlist_t hl1, hl2, hl3; hostset_t set, set1; hostlist_iterator_t iter, iter2; if (!(hl1 = hostlist_create(ac > 1 ? av[1] : NULL))) perror("hostlist_create"); if (!(set = hostset_create(ac > 1 ? av[1] : NULL))) perror("hostlist_create"); hl3 = hostlist_create("f[0-5]"); hostlist_delete(hl3, "f[1-3]"); hostlist_ranged_string(hl3, 102400, buf); printf("after delete = `%s'\n", buf); hostlist_destroy(hl3); for (i = 2; i < ac; i++) { hostlist_push(hl1, av[i]); hostset_insert(set, av[i]); } hostlist_ranged_string(hl1, 102400, buf); printf("ranged = `%s'\n", buf); iterator_test(buf); hostlist_deranged_string(hl1, 10240, buf); printf("deranged = `%s'\n", buf); hostset_ranged_string(set, 1024, buf); printf("hostset = `%s'\n", buf); hostlist_sort(hl1); hostlist_ranged_string(hl1, 1024, buf); printf("sorted = `%s'\n", buf); hostlist_uniq(hl1); hostlist_ranged_string(hl1, 1024, buf); printf("uniqed = `%s'\n", buf); hl2 = hostlist_copy(hl1); printf("pop_range: "); while ((str = hostlist_pop_range(hl2))) { printf("`%s' ", str); free(str); } hostlist_destroy(hl2); printf("\n"); hl2 = hostlist_copy(hl1); printf("shift_range: "); while ((str = hostlist_shift_range(hl2))) { printf("`%s' ", str); free(str); } hostlist_destroy(hl2); printf("\n"); iter = hostset_iterator_create(set); iter2 = hostset_iterator_create(set); hostlist_iterator_destroy(iter2); printf("next: "); while ((str = hostlist_next(iter))) { printf("`%s' ", str); free(str); } printf("\n"); hostlist_iterator_reset(iter); printf("next_range: "); while ((str = hostlist_next_range(iter))) { printf("`%s' ", str); free(str); } printf("\n"); printf("nranges = %d\n", hostset_nranges(set)); hostset_ranged_string(set, 1024, buf); printf("set = %s\n", buf); hostset_destroy(set); hostlist_destroy(hl1); return 0; } #endif /* TEST_MAIN */ /* * vi: tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/device_serial.h0000644000000000000000000000320311113347050014725 0ustar /*****************************************************************************\ * $Id: device_serial.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_DEVICE_SERIAL_H #define PM_DEVICE_SERIAL_H bool serial_connect(Device * dev); void serial_disconnect(Device * dev); void *serial_create(char *special, char *flags); void serial_destroy(void *data); #endif /* PM_DEVICE_SERIAL_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xpty.h0000644000000000000000000000320211113347050013132 0ustar /*****************************************************************************\ * $Id: xpty.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_XPTY_H #define PM_XPTY_H /* FIXME: these have nothing to do with ptys per se */ void xcfmakeraw(int fd); void nonblock_set(int fd); void nonblock_clr(int fd); pid_t xforkpty(int *amaster, char *name, int len); #endif /* PM_XPTY_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/httppower.c0000644000000000000000000001326311113347050014165 0ustar /*****************************************************************************\ * $Id: httppower.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2007-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #if HAVE_CURL #include #else #error httppower needs curl support! #endif #include #include #include #include "xtypes.h" #include "xmalloc.h" #include "error.h" #include "argv.h" static char *url = NULL; static char *userpwd = NULL; static char errbuf[CURL_ERROR_SIZE]; #define OPTIONS "u:" static struct option longopts[] = { {"url", required_argument, 0, 'u' }, {0,0,0,0}, }; void help(void) { printf("Valid commands are:\n"); printf(" auth user:passwd\n"); printf(" seturl url\n"); printf(" get [url]\n"); printf(" post [url] key=val[&key=val]...\n"); } char * _make_url(char *str) { char *myurl = NULL; if (str && url) { myurl = xmalloc(strlen(url) + strlen(str) + 2); sprintf(myurl, "%s/%s", url, str); } else if (str && !url) { myurl = xstrdup(str); } else if (!str && url) { myurl = xstrdup(url); } return myurl; } void post(CURL *h, char **av) { char *myurl = _make_url(av[0]); char *postdata = av[1] ? xstrdup(av[1]) : NULL; if (postdata && myurl) { curl_easy_setopt(h, CURLOPT_URL, myurl); curl_easy_setopt(h, CURLOPT_POSTFIELDS, postdata); if (curl_easy_perform(h) != 0) printf("Error: %s\n", errbuf); curl_easy_setopt(h, CURLOPT_URL, ""); curl_easy_setopt(h, CURLOPT_POSTFIELDS, ""); } else printf("Nothing to post!\n"); if (myurl) xfree(myurl); if (postdata) xfree(postdata); } void get(CURL *h, char **av) { char *myurl = _make_url(av[0]); if (myurl) { curl_easy_setopt(h, CURLOPT_URL, myurl); if (curl_easy_perform(h) != 0) printf("Error: %s\n", errbuf); curl_easy_setopt(h, CURLOPT_URL, ""); } else printf("Nothing to get!\n"); if (myurl) xfree(myurl); } void seturl(CURL *h, char **av) { if (av[0] == NULL) { printf("Usage: seturl http://...\n"); return; } if (url) xfree(url); url = xstrdup(av[0]); } void auth(CURL *h, char **av) { if (av[0] == NULL) { printf("Usage: auth user:passwd\n"); return; } if (userpwd) xfree(userpwd); userpwd = xstrdup(av[0]); curl_easy_setopt(h, CURLOPT_USERPWD, userpwd); curl_easy_setopt(h, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); } int docmd(CURL *h, char **av) { int rc = 0; if (av[0] != NULL) { if (strcmp(av[0], "help") == 0) help(); else if (strcmp(av[0], "quit") == 0) rc = 1; else if (strcmp(av[0], "auth") == 0) auth(h, av + 1); else if (strcmp(av[0], "seturl") == 0) seturl(h, av + 1); else if (strcmp(av[0], "get") == 0) get(h, av + 1); else if (strcmp(av[0], "post") == 0) post(h, av + 1); else printf("type \"help\" for a list of commands\n"); } return rc; } void shell(CURL *h) { char buf[128]; char **av; int rc = 0; while (rc == 0) { printf("httppower> "); fflush(stdout); if (fgets(buf, sizeof(buf), stdin)) { av = argv_create(buf, ""); rc = docmd(h, av); argv_destroy(av); } else rc = 1; } } void usage(void) { fprintf(stderr, "Usage: httppower [--url URL]\n"); exit(1); } int main(int argc, char *argv[]) { CURL *h; int c; err_init(basename(argv[0])); while ((c = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != EOF) { switch (c) { case 'u': /* --url */ url = xstrdup(optarg); break; default: usage(); break; } } if (optind < argc) usage(); if (curl_global_init(CURL_GLOBAL_ALL) != 0) err_exit(FALSE, "curl_global_init failed"); if ((h = curl_easy_init()) == NULL) err_exit(FALSE, "curl_easy_init failed"); curl_easy_setopt(h, CURLOPT_TIMEOUT, 5); curl_easy_setopt(h, CURLOPT_ERRORBUFFER, errbuf); curl_easy_setopt(h, CURLOPT_FAILONERROR, 1); shell(h); curl_easy_cleanup(h); if (userpwd) xfree(userpwd); if (url) xfree(url); exit(0); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xtypes.h0000644000000000000000000000276711113347050013501 0ustar /*****************************************************************************\ * $Id: xtypes.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_XTYPES_H #define PM_XTYPES_H #ifdef FALSE #undef FALSE #endif #ifdef TRUE #undef TRUE #endif typedef enum { FALSE = 0, TRUE = 1 } bool; #endif powerman-2.3.5.orig/src/parse_lex.c0000644000000000000000000015457711164745453014150 0ustar /* A lexical scanner generated by flex*/ /* Scanner skeleton version: * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* Some routines like yy_flex_realloc() are emitted as static but are not called by all lexers. This generates warnings in some compilers, notably GCC. Arrange to suppress these. */ #ifdef __GNUC__ #define YY_MAY_BE_UNUSED __attribute__((unused)) #else #define YY_MAY_BE_UNUSED #endif /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 71 #define YY_END_OF_BUFFER 72 static yyconst short int yy_accept[274] = { 0, 0, 0, 67, 67, 0, 0, 72, 70, 2, 3, 6, 70, 5, 70, 4, 63, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 61, 62, 69, 67, 68, 19, 16, 7, 71, 2, 0, 1, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 67, 19, 18, 18, 8, 9, 10, 11, 12, 13, 14, 15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 58, 0, 0, 0, 49, 0, 0, 0, 31, 0, 0, 0, 0, 0, 17, 65, 0, 43, 32, 0, 0, 0, 29, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 56, 25, 0, 0, 20, 34, 0, 0, 39, 0, 0, 0, 0, 64, 0, 0, 35, 0, 0, 0, 0, 0, 0, 66, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 45, 0, 0, 0, 0, 38, 0, 57, 48, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 41, 23, 0, 0, 0, 36, 0, 0, 0, 0, 27, 28, 0, 0, 0, 0, 50, 21, 44, 47, 26, 0, 0, 0, 24, 52, 0, 0, 0, 0, 51, 0, 53, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 6, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 12, 1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1, 1, 22, 23, 24, 25, 26, 1, 27, 28, 29, 30, 31, 32, 33, 34, 1, 35, 1, 36, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[37] = { 0, 1, 2, 3, 1, 4, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst short int yy_base[280] = { 0, 0, 0, 35, 37, 38, 39, 305, 306, 43, 306, 306, 301, 306, 294, 43, 306, 280, 284, 266, 282, 265, 272, 30, 32, 271, 37, 37, 278, 45, 48, 277, 306, 306, 0, 291, 306, 0, 306, 306, 66, 62, 289, 306, 282, 281, 59, 268, 275, 272, 34, 260, 258, 259, 268, 254, 262, 264, 261, 266, 253, 246, 247, 247, 48, 256, 259, 245, 247, 241, 0, 266, 0, 306, 258, 306, 306, 306, 306, 306, 306, 306, 306, 257, 252, 249, 241, 249, 240, 243, 242, 52, 236, 228, 57, 239, 243, 60, 235, 234, 235, 230, 234, 223, 233, 218, 214, 228, 306, 235, 215, 217, 224, 206, 224, 223, 224, 218, 306, 205, 217, 209, 202, 306, 72, 209, 217, 203, 226, 198, 200, 306, 203, 203, 193, 195, 196, 306, 306, 196, 207, 306, 201, 188, 201, 306, 199, 190, 306, 184, 190, 198, 188, 185, 191, 79, 195, 177, 175, 186, 175, 189, 171, 188, 73, 306, 306, 179, 181, 306, 306, 175, 172, 306, 176, 167, 180, 75, 306, 173, 170, 178, 163, 159, 162, 164, 172, 65, 306, 306, 165, 166, 161, 158, 158, 166, 150, 162, 91, 150, 306, 74, 153, 150, 148, 150, 154, 154, 144, 151, 145, 142, 136, 151, 141, 145, 144, 143, 141, 306, 306, 139, 141, 126, 139, 306, 138, 306, 306, 134, 139, 122, 128, 136, 125, 120, 306, 129, 128, 125, 306, 306, 126, 106, 113, 306, 104, 92, 89, 100, 306, 306, 99, 97, 88, 87, 99, 306, 306, 306, 306, 86, 85, 95, 306, 95, 84, 88, 74, 72, 306, 24, 306, 306, 120, 124, 128, 132, 136, 138 } ; static yyconst short int yy_def[280] = { 0, 273, 1, 274, 274, 275, 275, 273, 273, 273, 273, 273, 276, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 277, 273, 273, 278, 273, 273, 279, 273, 276, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 277, 273, 278, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 0, 273, 273, 273, 273, 273, 273 } ; static yyconst short int yy_nxt[343] = { 0, 8, 9, 10, 9, 11, 12, 13, 14, 15, 16, 8, 8, 17, 18, 19, 20, 21, 22, 8, 8, 23, 24, 8, 25, 26, 27, 28, 29, 30, 8, 8, 8, 8, 31, 32, 33, 35, 36, 35, 36, 38, 38, 39, 39, 41, 272, 41, 53, 40, 40, 45, 46, 55, 54, 58, 87, 56, 60, 61, 63, 59, 64, 67, 41, 88, 41, 45, 46, 68, 117, 65, 102, 125, 66, 74, 118, 103, 121, 75, 76, 155, 122, 77, 78, 150, 185, 126, 194, 204, 79, 205, 218, 80, 271, 81, 270, 82, 219, 151, 186, 269, 195, 176, 214, 215, 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 216, 34, 34, 34, 34, 37, 37, 37, 37, 42, 42, 42, 42, 70, 254, 253, 70, 72, 72, 73, 73, 73, 73, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 217, 213, 212, 211, 210, 209, 208, 207, 206, 203, 202, 201, 200, 199, 198, 197, 196, 193, 192, 191, 190, 189, 188, 187, 184, 183, 182, 181, 180, 179, 178, 177, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 124, 123, 120, 119, 116, 115, 114, 113, 112, 111, 110, 83, 109, 71, 108, 107, 106, 105, 104, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 86, 85, 84, 83, 44, 43, 71, 69, 62, 57, 52, 51, 50, 49, 48, 47, 44, 43, 273, 7, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273 } ; static yyconst short int yy_chk[343] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 5, 6, 5, 6, 9, 271, 9, 23, 5, 6, 15, 15, 24, 23, 26, 50, 24, 27, 27, 29, 26, 29, 30, 41, 50, 41, 46, 46, 30, 91, 29, 64, 97, 29, 40, 91, 64, 94, 40, 40, 155, 94, 40, 40, 124, 164, 97, 177, 187, 40, 187, 201, 40, 269, 40, 268, 40, 201, 124, 164, 267, 177, 155, 198, 198, 266, 265, 263, 262, 261, 256, 255, 254, 253, 252, 249, 248, 247, 246, 198, 274, 274, 274, 274, 275, 275, 275, 275, 276, 276, 276, 276, 277, 244, 243, 277, 278, 278, 279, 279, 279, 279, 242, 239, 238, 237, 235, 234, 233, 232, 231, 230, 229, 226, 224, 223, 222, 221, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 199, 197, 196, 195, 194, 193, 192, 191, 190, 186, 185, 184, 183, 182, 181, 180, 179, 176, 175, 174, 172, 171, 168, 167, 163, 162, 161, 160, 159, 158, 157, 156, 154, 153, 152, 151, 150, 149, 147, 146, 144, 143, 142, 140, 139, 136, 135, 134, 133, 132, 130, 129, 128, 127, 126, 125, 122, 121, 120, 119, 117, 116, 115, 114, 113, 112, 111, 110, 109, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 96, 95, 93, 92, 90, 89, 88, 87, 86, 85, 84, 83, 74, 71, 69, 68, 67, 66, 65, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 49, 48, 47, 45, 44, 42, 35, 31, 28, 25, 22, 21, 20, 19, 18, 17, 14, 12, 7, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "parse_lex.l" #define INITIAL 0 /*****************************************************************************\ * $Id: parse_lex.c 1125 2009-04-01 20:14:35Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton (uselton2@llnl.gov> * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #define lex_incl 1 #define lex_str 2 #line 30 "parse_lex.l" #if HAVE_CONFIG_H #include "config.h" #endif /* N.B. must define YYSTYPE before including parse_tab.h or type will be int. */ #define YYSTYPE char * #include #include #include #include "hostlist.h" #include "parse_tab.h" #include "xtypes.h" #include "list.h" #include "xmalloc.h" #include "error.h" #include "parse_util.h" extern void yyerror(); #define MAX_INCLUDE_DEPTH 10 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; static int linenum[MAX_INCLUDE_DEPTH]; static char *filename[MAX_INCLUDE_DEPTH]; static int include_stack_ptr = 0; static char string_buf[8192]; static char *string_buf_ptr; static List line_ptrs; /* Lex Options */ #define YY_NO_UNPUT 1 #line 594 "parse_lex.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; #line 62 "parse_lex.l" /* yyin gets initialized in parse.y */ #line 752 "parse_lex.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 274 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 306 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 68 "parse_lex.l" { linenum[include_stack_ptr]++; } YY_BREAK case 2: YY_RULE_SETUP #line 72 "parse_lex.l" { /* Eat up white space */ } YY_BREAK case 3: YY_RULE_SETUP #line 76 "parse_lex.l" { linenum[include_stack_ptr]++; } YY_BREAK case 4: YY_RULE_SETUP #line 80 "parse_lex.l" { yylval = yytext; return TOK_NUMERIC_VAL; } YY_BREAK case 5: YY_RULE_SETUP #line 85 "parse_lex.l" { return TOK_MATCHPOS; } YY_BREAK case 6: YY_RULE_SETUP #line 89 "parse_lex.l" { string_buf_ptr = string_buf; BEGIN(lex_str); } YY_BREAK case 7: YY_RULE_SETUP #line 95 "parse_lex.l" { /* end of string */ int len; BEGIN(INITIAL); *string_buf_ptr = '\0'; len = strlen(string_buf); yylval = xmalloc(len + 1); list_append(line_ptrs, yylval); strncpy(yylval, string_buf, len); yylval[len] = '\0'; return TOK_STRING_VAL; } YY_BREAK case 8: YY_RULE_SETUP #line 108 "parse_lex.l" { *string_buf_ptr++ = '\a'; } YY_BREAK case 9: YY_RULE_SETUP #line 111 "parse_lex.l" { *string_buf_ptr++ = '\b'; } YY_BREAK case 10: YY_RULE_SETUP #line 114 "parse_lex.l" { *string_buf_ptr++ = '\e'; } YY_BREAK case 11: YY_RULE_SETUP #line 117 "parse_lex.l" { *string_buf_ptr++ = '\f'; } YY_BREAK case 12: YY_RULE_SETUP #line 120 "parse_lex.l" { *string_buf_ptr++ = '\n'; } YY_BREAK case 13: YY_RULE_SETUP #line 123 "parse_lex.l" { *string_buf_ptr++ = '\r'; } YY_BREAK case 14: YY_RULE_SETUP #line 126 "parse_lex.l" { *string_buf_ptr++ = '\t'; } YY_BREAK case 15: YY_RULE_SETUP #line 129 "parse_lex.l" { *string_buf_ptr++ = '\v'; } YY_BREAK case 16: YY_RULE_SETUP #line 132 "parse_lex.l" { yyerror(); } YY_BREAK case 17: YY_RULE_SETUP #line 135 "parse_lex.l" { *string_buf_ptr++ = strtol(&yytext[1], NULL, 8); } YY_BREAK case 18: YY_RULE_SETUP #line 138 "parse_lex.l" { *string_buf_ptr++ = yytext[1]; } YY_BREAK case 19: YY_RULE_SETUP #line 141 "parse_lex.l" { char *yptr = yytext; while ( *yptr ) *string_buf_ptr++ = *yptr++; } YY_BREAK case 20: YY_RULE_SETUP #line 149 "parse_lex.l" return TOK_LISTEN; YY_BREAK case 21: YY_RULE_SETUP #line 150 "parse_lex.l" return TOK_TCP_WRAPPERS; YY_BREAK case 22: YY_RULE_SETUP #line 151 "parse_lex.l" return TOK_DEV_TIMEOUT; YY_BREAK case 23: YY_RULE_SETUP #line 152 "parse_lex.l" return TOK_PING_PERIOD; YY_BREAK case 24: YY_RULE_SETUP #line 153 "parse_lex.l" return TOK_SPEC; YY_BREAK case 25: YY_RULE_SETUP #line 154 "parse_lex.l" return TOK_EXPECT; YY_BREAK case 26: YY_RULE_SETUP #line 155 "parse_lex.l" return TOK_SETPLUGSTATE; YY_BREAK case 27: YY_RULE_SETUP #line 156 "parse_lex.l" return TOK_FOREACHNODE; YY_BREAK case 28: YY_RULE_SETUP #line 157 "parse_lex.l" return TOK_FOREACHPLUG; YY_BREAK case 29: YY_RULE_SETUP #line 158 "parse_lex.l" return TOK_IFOFF; YY_BREAK case 30: YY_RULE_SETUP #line 159 "parse_lex.l" return TOK_IFON; YY_BREAK case 31: YY_RULE_SETUP #line 160 "parse_lex.l" return TOK_SEND; YY_BREAK case 32: YY_RULE_SETUP #line 161 "parse_lex.l" return TOK_DELAY; YY_BREAK case 33: YY_RULE_SETUP #line 162 "parse_lex.l" return TOK_LOGIN; YY_BREAK case 34: YY_RULE_SETUP #line 163 "parse_lex.l" return TOK_LOGOUT; YY_BREAK case 35: YY_RULE_SETUP #line 164 "parse_lex.l" return TOK_STATUS; YY_BREAK case 36: YY_RULE_SETUP #line 165 "parse_lex.l" return TOK_STATUS_ALL; YY_BREAK case 37: YY_RULE_SETUP #line 166 "parse_lex.l" return TOK_ON; YY_BREAK case 38: YY_RULE_SETUP #line 167 "parse_lex.l" return TOK_ON_RANGED; YY_BREAK case 39: YY_RULE_SETUP #line 168 "parse_lex.l" return TOK_ON_ALL; YY_BREAK case 40: YY_RULE_SETUP #line 169 "parse_lex.l" return TOK_OFF; YY_BREAK case 41: YY_RULE_SETUP #line 170 "parse_lex.l" return TOK_OFF_RANGED; YY_BREAK case 42: YY_RULE_SETUP #line 171 "parse_lex.l" return TOK_OFF_ALL; YY_BREAK case 43: YY_RULE_SETUP #line 172 "parse_lex.l" return TOK_CYCLE; YY_BREAK case 44: YY_RULE_SETUP #line 173 "parse_lex.l" return TOK_CYCLE_RANGED; YY_BREAK case 45: YY_RULE_SETUP #line 174 "parse_lex.l" return TOK_CYCLE_ALL; YY_BREAK case 46: YY_RULE_SETUP #line 175 "parse_lex.l" return TOK_RESET; YY_BREAK case 47: YY_RULE_SETUP #line 176 "parse_lex.l" return TOK_RESET_RANGED; YY_BREAK case 48: YY_RULE_SETUP #line 177 "parse_lex.l" return TOK_RESET_ALL; YY_BREAK case 49: YY_RULE_SETUP #line 178 "parse_lex.l" return TOK_PING; YY_BREAK case 50: YY_RULE_SETUP #line 179 "parse_lex.l" return TOK_STATUS_TEMP; YY_BREAK case 51: YY_RULE_SETUP #line 180 "parse_lex.l" return TOK_STATUS_TEMP_ALL; YY_BREAK case 52: YY_RULE_SETUP #line 181 "parse_lex.l" return TOK_STATUS_BEACON; YY_BREAK case 53: YY_RULE_SETUP #line 182 "parse_lex.l" return TOK_STATUS_BEACON_ALL; YY_BREAK case 54: YY_RULE_SETUP #line 183 "parse_lex.l" return TOK_BEACON_ON; YY_BREAK case 55: YY_RULE_SETUP #line 184 "parse_lex.l" return TOK_BEACON_OFF; YY_BREAK case 56: YY_RULE_SETUP #line 185 "parse_lex.l" return TOK_DEVICE; YY_BREAK case 57: YY_RULE_SETUP #line 186 "parse_lex.l" return TOK_PLUG_NAME; YY_BREAK case 58: YY_RULE_SETUP #line 187 "parse_lex.l" return TOK_NODE; YY_BREAK case 59: YY_RULE_SETUP #line 188 "parse_lex.l" return TOK_YES; YY_BREAK case 60: YY_RULE_SETUP #line 189 "parse_lex.l" return TOK_NO; YY_BREAK case 61: YY_RULE_SETUP #line 190 "parse_lex.l" return TOK_BEGIN; YY_BREAK case 62: YY_RULE_SETUP #line 191 "parse_lex.l" return TOK_END; YY_BREAK case 63: YY_RULE_SETUP #line 192 "parse_lex.l" return TOK_EQUALS; YY_BREAK case 64: YY_RULE_SETUP #line 193 "parse_lex.l" return TOK_SCRIPT; YY_BREAK case 65: YY_RULE_SETUP #line 194 "parse_lex.l" return TOK_ALIAS; YY_BREAK case 66: YY_RULE_SETUP #line 196 "parse_lex.l" BEGIN(lex_incl); YY_BREAK case 67: YY_RULE_SETUP #line 198 "parse_lex.l" { /* eat white space */ } YY_BREAK case 68: YY_RULE_SETUP #line 202 "parse_lex.l" { linenum[include_stack_ptr]++; } YY_BREAK case 69: YY_RULE_SETUP #line 206 "parse_lex.l" { /* got include file name */ int len; len = strlen(yytext); yytext[len - 1] = '\0'; if ( include_stack_ptr >= MAX_INCLUDE_DEPTH - 1 ) err_exit(FALSE, "Includes nested too deeply" ); include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; yyin = fopen( yytext + 1, "r" ); if ( yyin == NULL ) err_exit(TRUE, "%s", yytext + 1); filename[include_stack_ptr] = xstrdup(yytext + 1); yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ) ); BEGIN(INITIAL); } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(lex_incl): case YY_STATE_EOF(lex_str): #line 227 "parse_lex.l" { if (include_stack_ptr == 0) { yyterminate(); } else { /* do I need an fclose(yyin); here? */ yy_delete_buffer( YY_CURRENT_BUFFER ); yy_switch_to_buffer( include_stack[--include_stack_ptr] ); } } YY_BREAK case 70: YY_RULE_SETUP #line 237 "parse_lex.l" { return TOK_UNRECOGNIZED; } YY_BREAK case 71: YY_RULE_SETUP #line 241 "parse_lex.l" ECHO; YY_BREAK #line 1284 "parse_lex.c" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 274 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 274 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 273); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #endif /* YY_NO_INPUT */ #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 241 "parse_lex.l" /* provide yywrap() to avoid need to link to -lfl */ int yywrap() { return 1; } int scanner_line(void) { return linenum[include_stack_ptr]; } void scanner_line_destroy(char *ptr) { xfree(ptr); } char * scanner_file(void) { return filename[include_stack_ptr]; } void scanner_init(char *filename0) { int i; for (i = 0; i < MAX_INCLUDE_DEPTH; i++) { linenum[i] = 1; filename[i] = NULL; } filename[0] = xstrdup(filename0); line_ptrs = list_create((ListDelF)scanner_line_destroy); } void scanner_fini(void) { int i; for (i = 0; i < MAX_INCLUDE_DEPTH; i++) { if (filename[i] != NULL) xfree(filename[i]); } list_destroy(line_ptrs); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/arglist.c0000644000000000000000000001077311113347050013601 0ustar /*****************************************************************************\ * $Id: arglist.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* Args used to be stored in a List, but gprof showed that very large * configurations spent a lot of time doing linear search of arg list for * each arg->state update. The List was traded for a hash, but as we still * want to iterate through args in the client in order, we keep the hostlist * representation of the nodes in the ArgList, and use it to implement an * 'iterator' interface. */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "list.h" #include "xmalloc.h" #include "hostlist.h" #include "hash.h" #include "arglist.h" struct arglist_iterator { hostlist_iterator_t itr; ArgList arglist; }; struct arglist { hash_t args; hostlist_t hl; int refcount; /* free when refcount == 0 */ }; static void _destroy_arg(Arg * arg) { assert(arg != NULL); assert(arg->node != NULL); xfree(arg->node); if (arg->val) xfree(arg->val); xfree(arg); } static Arg *_create_arg(char *node) { Arg *arg = (Arg *) xmalloc(sizeof(Arg)); arg->node = xstrdup(node); arg->state = ST_UNKNOWN; arg->val = NULL; return arg; } ArgList arglist_create(hostlist_t hl) { ArgList new = (ArgList) xmalloc(sizeof(struct arglist)); hostlist_iterator_t itr; char *node; int hash_size; new->refcount = 1; hash_size = hostlist_count(hl); /* reasonable? */ new->args = hash_create(hash_size, (hash_key_f)hash_key_string, (hash_cmp_f)strcmp, (hash_del_f)_destroy_arg); if ((itr = hostlist_iterator_create(hl)) == NULL) { arglist_unlink(new); return NULL; } while ((node = hostlist_next(itr)) != NULL) { Arg *arg = _create_arg(node); hash_insert(new->args, arg->node, arg); free(node); /* hostlist_next strdups returned string */ } hostlist_iterator_destroy(itr); new->hl = hostlist_copy(hl); return new; } void arglist_unlink(ArgList arglist) { if (--arglist->refcount == 0) { hash_destroy(arglist->args); hostlist_destroy(arglist->hl); xfree(arglist); } } ArgList arglist_link(ArgList arglist) { arglist->refcount++; return arglist; } Arg *arglist_find(ArgList arglist, char *node) { Arg *arg = NULL; if (node != NULL) arg = hash_find(arglist->args, node); return arg; } ArgListIterator arglist_iterator_create(ArgList arglist) { ArgListIterator itr = (ArgListIterator)xmalloc(sizeof(struct arglist_iterator)); itr->arglist = arglist; itr->itr = hostlist_iterator_create(arglist->hl); return itr; } void arglist_iterator_destroy(ArgListIterator itr) { hostlist_iterator_destroy(itr->itr); xfree(itr); } Arg *arglist_next(ArgListIterator itr) { Arg *arg = NULL; char *node; node = hostlist_next(itr->itr); if (node != NULL) { arg = hash_find(itr->arglist->args, node); free(node); /* hostlist_next strdups returned string */ } return arg; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/client.c0000644000000000000000000010443711172212766013425 0ustar /*****************************************************************************\ * $Id: client.c 1127 2009-04-17 23:51:18Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* This is the component of the server that deals with clients. * The client itself is contained in powerman.c. */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #if HAVE_TCP_WRAPPERS #include #endif #include #include #include "xtypes.h" #include "xmalloc.h" #include "xpoll.h" #include "xregex.h" #include "hostlist.h" #include "list.h" #include "parse_util.h" #include "client.h" #include "cbuf.h" #include "error.h" #include "client_proto.h" #include "debug.h" #include "pluglist.h" #include "hprintf.h" #include "arglist.h" #include "device_private.h" #include "xpty.h" #include "powerman.h" #ifndef HAVE_SOCKLEN_T typedef int socklen_t; /* socklen_t is uint32_t in Posix.1g */ #endif /* !HAVE_SOCKLEN_T */ #define LISTEN_BACKLOG 5 #define MIN_CLIENT_BUF 1024 #define MAX_CLIENT_BUF 1024*1024 typedef struct { int com; /* script index */ hostlist_t hl; /* target nodes */ int pending; /* count of pending device actions */ bool error; /* cumulative error flag for actions */ ArgList arglist; /* argument for query commands */ } Command; #define CLI_MAGIC 0xdadadada typedef struct { int magic; int fd; /* file desriptor for the socket */ int ofd; /* separate output file descriptor (if used) */ char *ip; /* IP address of the client's host */ unsigned short int port; /* Port of client connection */ char *host; /* host name of client host */ cbuf_t to; /* out buffer */ cbuf_t from; /* in buffer */ Command *cmd; /* command (there can be only one) */ int client_id; /* client identifier */ bool telemetry; /* client wants telemetry debugging info */ bool exprange; /* client wants host ranges expanded */ bool client_quit; /* set true after client quit command */ } Client; /* prototypes for internal functions */ static Command *_create_command(Client * c, int com, char *arg1); static void _destroy_command(Command * cmd); static int _match_client(Client * c, void *key); static Client *_find_client(int client_id); static hostlist_t _hostlist_create_validated(Client * c, char *str); static void _client_query_nodes_reply(Client * c); static void _client_query_device_reply(Client * c, char *arg); static void _client_query_status_reply(Client * c, bool error); static void _client_query_status_reply_nointerp(Client * c, bool error); static void _handle_read(Client * c); static void _handle_write(Client * c); static void _handle_input(Client *c); static char *_strip_whitespace(char *str); static void _parse_input(Client * c, char *input); static void _destroy_client(Client * c); static void _create_client_socket(int fd); static void _create_client_stdio(void); static void _act_finish(int client_id, ActError acterr, const char *fmt, ...); static void _telemetry_printf(int client_id, const char *fmt, ...); #if HAVE_TCP_WRAPPERS /* tcp wrappers support */ extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, char *client_user); int allow_severity = LOG_INFO; /* logging level for accepted reqs */ int deny_severity = LOG_WARNING;/* logging level for rejected reqs */ #endif static int *listen_fds; /* powermand listen sockets */ static int listen_fds_len = 0; /* count of above sockets */ static List cli_clients = NULL; /* list of clients */ static bool one_client = FALSE; /* terminate after first client */ static bool server_done = FALSE;/* true when stdio client exits */ static int cli_id_seq = 1; /* range 1...INT_MAX */ #define _next_cli_id() \ (cli_id_seq < INT_MAX ? cli_id_seq++ : (cli_id_seq = 1, INT_MAX)) #define _internal_error_response(c) \ _client_printf(c, CP_ERR_INTERNAL, __FILE__, __LINE__) /* * printf-like function which writes to the output cbuf. */ static void _client_printf(Client *c, const char *fmt, ...) { char *str = NULL; int written, dropped; va_list ap; va_start(ap, fmt); str = hvsprintf(fmt, ap); va_end(ap); /* Write to the client buffer */ written = cbuf_write(c->to, str, strlen(str), &dropped); if (written < 0) err(TRUE, "_client_printf: cbuf_write returned %d", written); else if (dropped > 0) err(FALSE, "_client_printf: cbuf_write dropped %d chars", dropped); /* Free the tmp string */ xfree(str); } /* * Initialize module. */ void cli_init(void) { /* create cli_clients list */ cli_clients = list_create((ListDelF) _destroy_client); } /* * Finalize module. */ void cli_fini(void) { /* destroy clients */ list_destroy(cli_clients); } /* * Build a hostlist_t from a string, validating each node name against * powerman configuration. If any bogus nodes are found, issue error * response to client and return NULL. */ static hostlist_t _hostlist_create_validated(Client * c, char *str) { hostlist_t hl = NULL; hostlist_t badhl = NULL; hostlist_iterator_t itr = NULL; char *host; bool valid = TRUE; if ((hl = hostlist_create(str)) == NULL) { /* Note: report detailed error since 'str' comes from the user */ if (errno == ERANGE || errno == EINVAL) _client_printf(c, CP_ERR_HOSTLIST, "invalid range"); else _internal_error_response(c); return NULL; } conf_exp_aliases(hl); if ((badhl = hostlist_create(NULL)) == NULL) { /* Note: other hostlist failures not user-induced so OK to be vague */ _internal_error_response(c); return NULL; } if ((itr = hostlist_iterator_create(hl)) == NULL) { _internal_error_response(c); hostlist_destroy(hl); return NULL; } while ((host = hostlist_next(itr)) != NULL) { if (!conf_node_exists(host)) { valid = FALSE; hostlist_push_host(badhl, host); } free(host); /* hostlist_next strdups returned string */ } if (!valid) { char hosts[CP_LINEMAX]; if (hostlist_ranged_string(badhl, sizeof(hosts), hosts) == -1) _client_printf(c, CP_ERR_NOSUCHNODES, str); else _client_printf(c, CP_ERR_NOSUCHNODES, hosts); hostlist_iterator_destroy(itr); hostlist_destroy(hl); hostlist_destroy(badhl); return NULL; } hostlist_iterator_destroy(itr); hostlist_destroy(badhl); return hl; } /* * Reply to client request for list of nodes in powerman configuration. */ static void _client_query_nodes_reply(Client * c) { hostlist_t nodes = conf_getnodes(); hostlist_sort(nodes); if (c->exprange) { hostlist_iterator_t itr; char *node; if ((itr = hostlist_iterator_create(nodes)) == NULL) { _internal_error_response(c); return; } while ((node = hostlist_next(itr))) { _client_printf(c, CP_INFO_XNODES, node); free(node); /* hostlist_next strdups returned string */ } hostlist_iterator_destroy(itr); } else { char hosts[CP_LINEMAX]; if (hostlist_ranged_string(nodes, sizeof(hosts), hosts) == -1) { _internal_error_response(c); return; } _client_printf(c, CP_INFO_NODES, hosts); } _client_printf(c, CP_RSP_QRY_COMPLETE); } /* * Helper for _client_query_device_reply() . * Create a hostlist string for the nodes attached to the specified device. * Return TRUE if str contains a valid hostlist string. */ static bool _make_pluglist(Device * dev, char *str, int len) { hostlist_t hl = hostlist_create(NULL); PlugListIterator itr; bool res = FALSE; Plug *plug; if (hl != NULL) { itr = pluglist_iterator_create(dev->plugs); while ((plug = pluglist_next(itr))) { assert(plug->name != NULL); hostlist_push(hl, plug->node); } pluglist_iterator_destroy(itr); hostlist_sort(hl); if (hostlist_ranged_string(hl, len, str) != -1) res = TRUE; hostlist_destroy(hl); } return res; } /* * Helper for _client_query_device_reply. * Return TRUE if hostlist string in 'arg' matches any plugs on device. */ static bool _device_matches_targets(Device *dev, char *arg) { hostlist_t targ = hostlist_create(arg); PlugListIterator itr; Plug *plug; bool res = FALSE; if (targ != NULL) { itr = pluglist_iterator_create(dev->plugs); while ((plug = pluglist_next(itr))) { if (hostlist_find(targ, plug->node) != -1) { res = TRUE; break; } } pluglist_iterator_destroy(itr); hostlist_destroy(targ); } return res; } /* * Reply to client request for list of devices in powerman configuration. */ static void _client_query_device_reply(Client * c, char *arg) { List devs = dev_getdevices(); Device *dev; ListIterator itr; if (devs) { itr = list_iterator_create(devs); while ((dev = list_next(itr))) { char nodelist[CP_LINEMAX]; int con = dev->stat_successful_connects; if (arg && !_device_matches_targets(dev, arg)) continue; if (_make_pluglist(dev, nodelist, sizeof(nodelist))) { _client_printf(c, CP_INFO_DEVICE, dev->name, dev->connect_state == DEV_CONNECTED ? "connected" : dev->connect_state == DEV_CONNECTING ? "connecting" : "disconnected", con > 0 ? con - 1 : 0, dev->stat_successful_actions, dev->specname, nodelist); } } list_iterator_destroy(itr); } _client_printf(c, CP_RSP_QRY_COMPLETE); } /* * Reply to client request for plug/soft status. */ static void _client_query_status_reply(Client * c, bool error) { Arg *arg; ArgListIterator itr; assert(c->cmd != NULL); if (c->exprange) { itr = arglist_iterator_create(c->cmd->arglist); while ((arg = arglist_next(itr))) { _client_printf(c, CP_INFO_XSTATUS, arg->node, arg->state == ST_ON ? "on" : arg->state == ST_OFF ? "off" : "unknown"); } arglist_iterator_destroy(itr); } else { char on[CP_LINEMAX], off[CP_LINEMAX], unknown[CP_LINEMAX]; hostlist_t hl_on, hl_off, hl_unknown; int n = 0; hl_on = hostlist_create(NULL); hl_off = hostlist_create(NULL); hl_unknown = hostlist_create(NULL); itr = arglist_iterator_create(c->cmd->arglist); while ((arg = arglist_next(itr))) { switch (arg->state) { case ST_UNKNOWN: hostlist_push(hl_unknown, arg->node); break; case ST_ON: hostlist_push(hl_on, arg->node); break; case ST_OFF: hostlist_push(hl_off, arg->node); break; } } arglist_iterator_destroy(itr); hostlist_sort(hl_unknown); hostlist_sort(hl_on); hostlist_sort(hl_off); n |= hostlist_ranged_string(hl_unknown, CP_LINEMAX, unknown); n |= hostlist_ranged_string(hl_on, CP_LINEMAX, on); n |= hostlist_ranged_string(hl_off, CP_LINEMAX, off); hostlist_destroy(hl_unknown); hostlist_destroy(hl_on); hostlist_destroy(hl_off); if (n == -1) { _internal_error_response(c); return; } _client_printf(c, CP_INFO_STATUS, on, off, unknown); } if (error) _client_printf(c, CP_ERR_QRY_COMPLETE); else _client_printf(c, CP_RSP_QRY_COMPLETE); } /* * Reply to client request for temperature/beacon status. */ static void _client_query_status_reply_nointerp(Client * c, bool error) { Arg *arg; ArgListIterator itr; hostlist_t hl = hostlist_create(NULL); char tmpstr[CP_LINEMAX]; int n; assert(c->cmd != NULL); itr = arglist_iterator_create(c->cmd->arglist); while ((arg = arglist_next(itr))) { _client_printf(c, CP_INFO_XSTATUS, arg->node, arg->val); if (!arg->val) hostlist_push(hl, arg->node); } arglist_iterator_destroy(itr); if (!hostlist_is_empty(hl)) { hostlist_sort(hl); n = hostlist_ranged_string(hl, sizeof(tmpstr), tmpstr); if (n == -1) { _internal_error_response(c); /* truncation */ goto done; } _client_printf(c, CP_INFO_XSTATUS, tmpstr, "unknown"); } if (error) _client_printf(c, CP_ERR_QRY_COMPLETE); else _client_printf(c, CP_RSP_QRY_COMPLETE); done: hostlist_destroy(hl); } /* * Create Command. * On error, return an error to the client and NULL to the caller. */ static Command *_create_command(Client * c, int com, char *arg1) { Command *cmd = (Command *) xmalloc(sizeof(Command)); cmd->com = com; cmd->error = FALSE; cmd->pending = 0; cmd->hl = NULL; cmd->arglist = NULL; if (arg1) { /* Note: this can send CP_ERR_HOSTLIST to client */ cmd->hl = _hostlist_create_validated(c, arg1); if (cmd->hl == NULL) { _destroy_command(cmd); cmd = NULL; } } else cmd->hl = hostlist_copy(conf_getnodes()); if (cmd && !dev_check_actions(cmd->com, cmd->hl)) { _destroy_command(cmd); _client_printf(c, CP_ERR_UNIMPL); cmd = NULL; } /* NOTE 1: cmd->arglist has a reference count and can persist after we * unlink from it in _destroy_command(). If client goes away prematurely, * actions that write to arglist will still have valid pointers. * NOTE 2: we create arglist for all actions, rather than just query * actions, because we want to allow 'setplugstate' in any context. */ if (cmd) { cmd->arglist = arglist_create(cmd->hl); if (cmd->arglist == NULL) { _destroy_command(cmd); _internal_error_response(c); cmd = NULL; } } return cmd; } /* * Destroy a Command. */ static void _destroy_command(Command * cmd) { if (cmd->hl) hostlist_destroy(cmd->hl); if (cmd->arglist) arglist_unlink(cmd->arglist); xfree(cmd); } /* helper for _parse_input that deletes leading & trailing whitespace */ static char *_strip_whitespace(char *str) { char *head = str; char *tail = str + strlen(str) - 1; while (*head && isspace(*head)) head++; while (tail > head && isspace(*tail)) *tail-- = '\0'; return head; } /* * Parse a line of input and create a Command (and enqueue device actions) * if needed. */ static void _parse_input(Client * c, char *input) { char *str = _strip_whitespace(input); char arg1[CP_LINEMAX]; Command *cmd = NULL; memset(arg1, 0, CP_LINEMAX); /* NOTE: sscanf is safe because 'str' is guaranteed to be < CP_LINEMAX */ if (strlen(str) >= CP_LINEMAX) { _client_printf(c, CP_ERR_TOOLONG); /* error: too long */ } else if (c->cmd != NULL) { _client_printf(c, CP_ERR_CLIBUSY); /* error: busy */ return; /* no prompt */ } else if (!strncasecmp(str, CP_HELP, strlen(CP_HELP))) { _client_printf(c, CP_INFO_HELP); /* help */ _client_printf(c, CP_RSP_QRY_COMPLETE); } else if (!strncasecmp(str, CP_NODES, strlen(CP_NODES))) { _client_query_nodes_reply(c); /* nodes */ } else if (!strncasecmp(str, CP_TELEMETRY, strlen(CP_TELEMETRY))) { c->telemetry = !c->telemetry; /* telemetry */ _client_printf(c, CP_RSP_TELEMETRY, c->telemetry ? "ON" : "OFF"); } else if (!strncasecmp(str, CP_EXPRANGE, strlen(CP_EXPRANGE))) { c->exprange = !c->exprange; /* exprange */ _client_printf(c, CP_RSP_EXPRANGE, c->exprange ? "ON" : "OFF"); } else if (!strncasecmp(str, CP_QUIT, strlen(CP_QUIT))) { c->client_quit = TRUE; _client_printf(c, CP_RSP_QUIT); /* quit */ _handle_write(c); } else if (sscanf(str, CP_ON, arg1) == 1) { /* on hostlist */ cmd = _create_command(c, PM_POWER_ON, arg1); } else if (sscanf(str, CP_OFF, arg1) == 1) { /* off hostlist */ cmd = _create_command(c, PM_POWER_OFF, arg1); } else if (sscanf(str, CP_CYCLE, arg1) == 1) { /* cycle hostlist */ cmd = _create_command(c, PM_POWER_CYCLE, arg1); } else if (sscanf(str, CP_RESET, arg1) == 1) { /* reset hostlist */ cmd = _create_command(c, PM_RESET, arg1); } else if (sscanf(str, CP_BEACON_ON, arg1) == 1) { /* beacon_on hostlist */ cmd = _create_command(c, PM_BEACON_ON, arg1); } else if (sscanf(str, CP_BEACON_OFF, arg1) == 1) { /* beacon_off hostlist*/ cmd = _create_command(c, PM_BEACON_OFF, arg1); } else if (sscanf(str, CP_STATUS, arg1) == 1) { /* status [hostlist] */ cmd = _create_command(c, PM_STATUS_PLUGS, arg1); } else if (!strncasecmp(str, CP_STATUS_ALL, strlen(CP_STATUS_ALL))) { cmd = _create_command(c, PM_STATUS_PLUGS, NULL); } else if (sscanf(str, CP_TEMP, arg1) == 1) { /* temp [hostlist] */ cmd = _create_command(c, PM_STATUS_TEMP, arg1); } else if (!strncasecmp(str, CP_TEMP_ALL, strlen(CP_TEMP_ALL))) { cmd = _create_command(c, PM_STATUS_TEMP, NULL); } else if (sscanf(str, CP_BEACON, arg1) == 1) { /* beacon [hostlist] */ cmd = _create_command(c, PM_STATUS_BEACON, arg1); } else if (!strncasecmp(str, CP_BEACON_ALL, strlen(CP_BEACON_ALL))) { cmd = _create_command(c, PM_STATUS_BEACON, NULL); } else if (sscanf(str, CP_DEVICE, arg1) == 1) { /* device [hostlist] */ _client_query_device_reply(c, arg1); } else if (!strncasecmp(str, CP_DEVICE_ALL, strlen(CP_DEVICE_ALL))) { _client_query_device_reply(c, NULL); } else { /* error: unknown */ _client_printf(c, CP_ERR_UNKNOWN); } /* enqueue device actions and tie up the client if necessary */ if (cmd) { assert(cmd->hl != NULL); dbg(DBG_CLIENT, "_parse_input: enqueuing actions"); cmd->pending = dev_enqueue_actions(cmd->com, cmd->hl, _act_finish, c->telemetry ? _telemetry_printf : NULL, c->client_id, cmd->arglist); if (cmd->pending == 0) { _client_printf(c, CP_ERR_UNIMPL); _destroy_command(cmd); cmd = NULL; } assert(c->cmd == NULL); c->cmd = cmd; } /* reissue prompt if we didn't queue up any device actions */ if (cmd == NULL && !c->client_quit) _client_printf(c, CP_PROMPT); } /* * Callback for device debugging printfs (sent to client if --telemetry) */ static void _telemetry_printf(int client_id, const char *fmt, ...) { va_list ap; Client *c; char *str; if ((c = _find_client(client_id))) { va_start(ap, fmt); str = hvsprintf(fmt, ap); va_end(ap); _client_printf(c, CP_INFO_TELEMETRY, str); xfree(str); } } /* * Callback for device action completion. */ static void _act_finish(int client_id, ActError acterr, const char *fmt, ...) { va_list ap; Client *c; char *str; /* if client has gone away do nothing */ if (!(c = _find_client(client_id))) return; assert(c->magic == CLI_MAGIC); assert(c->cmd != NULL); /* handle errors immediately */ if (acterr != ACT_ESUCCESS) { va_start(ap, fmt); str = hvsprintf(fmt, ap); va_end(ap); _client_printf(c, CP_INFO_ACTERROR, str); xfree(str); c->cmd->error = TRUE; /* when done say "completed with errors" */ } /* all actions have called back - return response to client */ if (--c->cmd->pending == 0) { switch (c->cmd->com) { case PM_STATUS_PLUGS: /* status */ case PM_STATUS_BEACON: /* beacon */ _client_query_status_reply(c, c->cmd->error); break; case PM_STATUS_TEMP: /* temp */ _client_query_status_reply_nointerp(c, c->cmd->error); break; case PM_POWER_ON: /* on */ case PM_POWER_OFF: /* off */ case PM_BEACON_ON: /* flash */ case PM_BEACON_OFF: /* unflash */ case PM_POWER_CYCLE: /* cycle */ case PM_RESET: /* reset */ if (c->cmd->error) _client_printf(c, CP_ERR_COM_COMPLETE); else _client_printf(c, CP_RSP_COM_COMPLETE); break; default: assert(FALSE); _internal_error_response(c); break; } /* clean up and re-prompt */ _destroy_command(c->cmd); c->cmd = NULL; _client_printf(c, CP_PROMPT); } } /* * Destroy a client. */ static void _destroy_client(Client *c) { assert(c->magic == CLI_MAGIC); if (c->fd != NO_FD) { dbg(DBG_CLIENT, "_destroy_client: closing fd %d", c->fd); if (close(c->fd) < 0) err(TRUE, "close fd %d", c->fd); c->fd = NO_FD; } if (c->ofd != NO_FD) { dbg(DBG_CLIENT, "_destroy_client: closing fd %d", c->ofd); if (close(c->ofd) < 0) err(TRUE, "close fd %d", c->ofd); c->ofd = NO_FD; } if (c->to) cbuf_destroy(c->to); if (c->from) cbuf_destroy(c->from); if (c->cmd) _destroy_command(c->cmd); if (c->ip) xfree(c->ip); if (c->host) xfree(c->host); xfree(c); if (one_client) server_done = TRUE; } /* helper for _find_client */ static int _match_client(Client *c, void *key) { return (c->client_id == *(int *) key); } /* * Test if a client still exists (by sequence). */ static Client *_find_client(int seq) { return list_find_first(cli_clients, (ListFindF) _match_client, &seq); } /* * Begin listening for clients on configured listen addresses. * This function leaves listen_fds[] (of size listen_fds_len) initialized * with each element either NO_FD or an open fd we are listening on. */ static void _listen_client(void) { int fd, error, i, opt, count; struct addrinfo hints, *res, *r; char *addr, *host, *port; char *what = "nothing"; int saved_errno = 0; List addrs; ListIterator itr; i = 0; count = 0; saved_errno = 0; addrs = conf_get_listen(); itr = list_iterator_create(addrs); while ((addr = list_next(itr))) { host = addr; if (!(port = strchr(addr, ':'))) err_exit(FALSE, "error parsing listen address: %s", addr); *port++ = '\0'; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; /* N.B.: host=NULL, ai_hints=AI_PASSIVE says "any interface", * while host="0.0.0.0" is IPv4-specific INADDR_ANY. */ if ((error = getaddrinfo(host, port, &hints, &res))) err_exit(FALSE, "getaddrinfo: %s", gai_strerror(error)); if (res == NULL) err_exit(FALSE, "listen address has no addrinfo: %s", addr); /* allocate the listen_fds array */ for (r = res; r != NULL; r = r->ai_next) listen_fds_len++; if (listen_fds == NULL) listen_fds = (int *)xmalloc(sizeof(int) * listen_fds_len); else listen_fds = (int *)xrealloc((char *)listen_fds, sizeof(int) * listen_fds_len); /* bind sockets to addresses */ for (r = res; r != NULL; r = r->ai_next, i++) { assert(i < listen_fds_len); listen_fds[i] = NO_FD; if ((fd = socket(r->ai_family, r->ai_socktype, 0)) < 0) { saved_errno = errno; what = "socket"; continue; } opt = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) { saved_errno = errno; what = "setsockopt"; close(fd); continue; } nonblock_set(fd); if (bind(fd, r->ai_addr, r->ai_addrlen) < 0) { saved_errno = errno; what = "bind"; close(fd); continue; } if (listen(fd, LISTEN_BACKLOG) < 0) { saved_errno = errno; what = "listen"; close(fd); continue; } listen_fds[i] = fd; count++; } freeaddrinfo(res); } list_iterator_destroy(itr); /* FIXME: dodgy error handling here: As we go through the loop(s) we may * encounter errors that are interesting, however we only display the * most recent one, and then only if no bindable addresses were found. */ if (count == 0) { errno = saved_errno; err_exit(TRUE, "%s", what); } dbg(DBG_CLIENT, "listening on %d sockets", count); } static void _create_client_socket(int fd) { Client *c; struct sockaddr_storage addr; socklen_t addr_size = sizeof(addr); char hbuf[64], pbuf[6]; int error; /* create client data structure */ c = (Client *) xmalloc(sizeof(Client)); c->magic = CLI_MAGIC; c->to = NULL; c->from = NULL; c->cmd = NULL; c->client_id = _next_cli_id(); c->telemetry = FALSE; c->exprange = FALSE; c->ofd = NO_FD; c->client_quit = FALSE; c->fd = accept(fd, (struct sockaddr *)&addr, &addr_size); if (c->fd < 0){ /* client died after it initiated connect and before we could accept * Ref. Stevens, UNP p424 */ if (errno == EWOULDBLOCK || errno == ECONNABORTED || errno == EPROTO || errno == EINTR) { _destroy_client(c); err(TRUE, "_create_client: accept"); return; } err_exit(TRUE, "accept"); } if ((error = getnameinfo((struct sockaddr *)&addr, addr_size, hbuf, sizeof(hbuf), pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV))) { _destroy_client(c); err(TRUE, "_create_client: getnameinfo: %s", gai_strerror(error)); return; } c->ip = xstrdup(hbuf); c->port = strtoul(pbuf, NULL, 10); if ((error = getnameinfo((struct sockaddr *)&addr, addr_size, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD))) err(FALSE, "_create_client: getnameinfo: %s", gai_strerror(error)); else c->host = xstrdup(hbuf); #if HAVE_TCP_WRAPPERS /* get authorization from tcp wrappers */ if (conf_get_use_tcp_wrappers()) { if (!hosts_ctl(DAEMON_NAME, c->host ? c->host : STRING_UNKNOWN, c->ip, STRING_UNKNOWN)) { err(FALSE, "_create_client: tcp wrappers denies %s:%d", c->host ? c->host : c->ip, c->port); _destroy_client(c); return; } } #endif /* create I/O buffers */ c->to = cbuf_create(MIN_CLIENT_BUF, MAX_CLIENT_BUF); c->from = cbuf_create(MIN_CLIENT_BUF, MAX_CLIENT_BUF); nonblock_set(c->fd); /* append to the list of clients */ list_append(cli_clients, c); dbg(DBG_CLIENT, "connect %s:%d fd %d", c->host ? c->host : c->ip, c->port, c->fd); /* prompt the client */ _client_printf(c, CP_VERSION, META_VERSION); _client_printf(c, CP_PROMPT); } static void _create_client_stdio(void) { Client *c; /* create client data structure */ c = (Client *) xmalloc(sizeof(Client)); c->magic = CLI_MAGIC; c->cmd = NULL; c->client_id = _next_cli_id(); c->telemetry = FALSE; c->exprange = FALSE; c->client_quit = FALSE; c->fd = STDIN_FILENO; c->ofd = STDOUT_FILENO; c->host = xstrdup("localhost"); c->ip = xstrdup("127.0.0.1"); /* XXX lies */ c->port = 0; c->to = cbuf_create(MIN_CLIENT_BUF, MAX_CLIENT_BUF); c->from = cbuf_create(MIN_CLIENT_BUF, MAX_CLIENT_BUF); nonblock_set(c->fd); nonblock_set(c->ofd); /* append to the list of clients */ list_append(cli_clients, c); /* prompt the client */ _client_printf(c, CP_VERSION, META_VERSION); _client_printf(c, CP_PROMPT); } /* * select(2) read handler for the client */ static void _handle_read(Client * c) { int n; int dropped; assert(c->magic == CLI_MAGIC); n = cbuf_write_from_fd(c->from, c->fd, -1, &dropped); if (n < 0) { c->client_quit = TRUE; err(TRUE, "client read error"); return; } if (n == 0) { c->client_quit = TRUE; err(FALSE, "client read returned EOF"); return; } if (dropped != 0) err(FALSE, "dropped %d bytes of client input", dropped); } /* * select(2) write handler for the client */ static void _handle_write(Client * c) { int n; int ofd = c->ofd != NO_FD ? c->ofd : c->fd; assert(c->magic == CLI_MAGIC); if (c->client_quit) nonblock_clr(ofd); n = cbuf_read_to_fd(c->to, ofd, -1); if (n < 0) { err(TRUE, "write error on client"); c->client_quit = TRUE; } } static void _handle_input(Client *c) { char buf[MAX_CLIENT_BUF]; int len; while ((len = cbuf_read_line(c->from, buf, sizeof(buf), 1)) > 0) _parse_input(c, buf); if (len < 0) err(TRUE, "client cbuf_read_line returned %d", len); } /* * Prep rset/wset/maxfd for the main poll call. */ void cli_pre_poll(xpollfd_t pfd) { ListIterator itr; Client *client; int i; for (i = 0; i < listen_fds_len; i++) { if (listen_fds[i] != NO_FD) assert(listen_fds[i] >= 0); xpollfd_set(pfd, listen_fds[i], XPOLLIN); } itr = list_iterator_create(cli_clients); while ((client = list_next(itr))) { if (client->fd < 0) continue; /* always set read set bits so select will unblock if the * connection is dropped. */ xpollfd_set(pfd, client->fd, XPOLLIN); /* need to be in the write set if we are sending anything */ if (!cbuf_is_empty(client->to)) { if (client->ofd != NO_FD) xpollfd_set(pfd, client->ofd, XPOLLOUT); else xpollfd_set(pfd, client->fd, XPOLLOUT); } } list_iterator_destroy(itr); } /* * Handle any client activity (new connection or read/write). */ void cli_post_poll(xpollfd_t pfd) { ListIterator itr; Client *c; int i; for (i = 0; i < listen_fds_len; i++) { if (listen_fds[i] != NO_FD) if ((xpollfd_revents(pfd, listen_fds[i]) & XPOLLIN)) _create_client_socket(listen_fds[i]); } itr = list_iterator_create(cli_clients); while ((c = list_next(itr))) { if (c->fd != NO_FD) { short flags = xpollfd_revents(pfd, c->fd); if (flags & XPOLLERR) err(FALSE, "client poll: error"); if (flags & XPOLLHUP) err(FALSE, "client poll: hangup"); if (flags & XPOLLNVAL) err(FALSE, "client poll: fd not open"); if (flags & (XPOLLERR | XPOLLHUP | XPOLLNVAL)) goto client_dead; if ((flags & XPOLLIN)) _handle_read(c); if ((flags & XPOLLOUT)) _handle_write(c); } if (c->ofd != NO_FD) { short flags = xpollfd_revents(pfd, c->ofd); if (flags & XPOLLERR) err(FALSE, "client poll: error"); if (flags & XPOLLHUP) err(FALSE, "client poll: hangup"); if (flags & XPOLLNVAL) err(FALSE, "client poll: fd not open"); if (flags & (XPOLLERR | XPOLLHUP | XPOLLNVAL)) goto client_dead; if (c->fd == NO_FD) goto client_dead; if ((flags & XPOLLOUT)) _handle_write(c); } _handle_input(c); if (c->client_quit) goto client_dead; continue; client_dead: list_delete(itr); } list_iterator_destroy(itr); } /* hook so daemonization function can avoid closing our fd */ void cli_listen_fds(int **fdsp, int *lenp) { *fdsp = listen_fds; *lenp = listen_fds_len; } bool cli_server_done(void) { return server_done; } void cli_start(bool use_stdio, bool oc) { if (use_stdio) _create_client_stdio(); else _listen_client(); one_client = oc; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/list.c0000644000000000000000000005110511113347050013101 0ustar /***************************************************************************** * $Id: list.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * * LSD-Tools 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. * * LSD-Tools 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 LSD-Tools; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ***************************************************************************** * Refer to "list.h" for documentation on public functions. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef WITH_PTHREADS # include #endif /* WITH_PTHREADS */ #include #include #include #include #include "list.h" /********************* * lsd_fatal_error * *********************/ #ifdef WITH_LSD_FATAL_ERROR_FUNC # undef lsd_fatal_error extern void lsd_fatal_error(char *file, int line, char *mesg); #else /* !WITH_LSD_FATAL_ERROR_FUNC */ # ifndef lsd_fatal_error # include # include # include # define lsd_fatal_error(file, line, mesg) \ do { \ fprintf(stderr, "ERROR: [%s:%d] %s: %s\n", \ file, line, mesg, strerror(errno)); \ } while (0) # endif /* !lsd_fatal_error */ #endif /* !WITH_LSD_FATAL_ERROR_FUNC */ /********************* * lsd_nomem_error * *********************/ #ifdef WITH_LSD_NOMEM_ERROR_FUNC # undef lsd_nomem_error extern void * lsd_nomem_error(char *file, int line, char *mesg); #else /* !WITH_LSD_NOMEM_ERROR_FUNC */ # ifndef lsd_nomem_error # define lsd_nomem_error(file, line, mesg) (NULL) # endif /* !lsd_nomem_error */ #endif /* !WITH_LSD_NOMEM_ERROR_FUNC */ /*************** * Constants * ***************/ #define LIST_ALLOC 32 #define LIST_MAGIC 0xDEADBEEF /**************** * Data Types * ****************/ struct listNode { void *data; /* node's data */ struct listNode *next; /* next node in list */ }; struct listIterator { struct list *list; /* the list being iterated */ struct listNode *pos; /* the next node to be iterated */ struct listNode **prev; /* addr of 'next' ptr to prv It node */ struct listIterator *iNext; /* iterator chain for list_destroy() */ #ifndef NDEBUG unsigned int magic; /* sentinel for asserting validity */ #endif /* !NDEBUG */ }; struct list { struct listNode *head; /* head of the list */ struct listNode **tail; /* addr of last node's 'next' ptr */ struct listIterator *iNext; /* iterator chain for list_destroy() */ ListDelF fDel; /* function to delete node data */ int count; /* number of nodes in list */ #ifdef WITH_PTHREADS pthread_mutex_t mutex; /* mutex to protect access to list */ #endif /* WITH_PTHREADS */ #ifndef NDEBUG unsigned int magic; /* sentinel for asserting validity */ #endif /* !NDEBUG */ }; typedef struct listNode * ListNode; /**************** * Prototypes * ****************/ static void * list_node_create (List l, ListNode *pp, void *x); static void * list_node_destroy (List l, ListNode *pp); static List list_alloc (void); static void list_free (List l); static ListNode list_node_alloc (void); static void list_node_free (ListNode p); static ListIterator list_iterator_alloc (void); static void list_iterator_free (ListIterator i); static void * list_alloc_aux (int size, void *pfreelist); static void list_free_aux (void *x, void *pfreelist); /*************** * Variables * ***************/ static List list_free_lists = NULL; static ListNode list_free_nodes = NULL; static ListIterator list_free_iterators = NULL; #ifdef WITH_PTHREADS static pthread_mutex_t list_free_lock = PTHREAD_MUTEX_INITIALIZER; #endif /* WITH_PTHREADS */ /************ * Macros * ************/ #ifdef WITH_PTHREADS # define list_mutex_init(mutex) \ do { \ int e = pthread_mutex_init(mutex, NULL); \ if (e != 0) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "list mutex init"); \ abort(); \ } \ } while (0) # define list_mutex_lock(mutex) \ do { \ int e = pthread_mutex_lock(mutex); \ if (e != 0) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "list mutex lock"); \ abort(); \ } \ } while (0) # define list_mutex_unlock(mutex) \ do { \ int e = pthread_mutex_unlock(mutex); \ if (e != 0) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "list mutex unlock"); \ abort(); \ } \ } while (0) # define list_mutex_destroy(mutex) \ do { \ int e = pthread_mutex_destroy(mutex); \ if (e != 0) { \ errno = e; \ lsd_fatal_error(__FILE__, __LINE__, "list mutex destroy"); \ abort(); \ } \ } while (0) # ifndef NDEBUG static int list_mutex_is_locked (pthread_mutex_t *mutex); # endif /* !NDEBUG */ #else /* !WITH_PTHREADS */ # define list_mutex_init(mutex) # define list_mutex_lock(mutex) # define list_mutex_unlock(mutex) # define list_mutex_destroy(mutex) # define list_mutex_is_locked(mutex) (1) #endif /* !WITH_PTHREADS */ /*************** * Functions * ***************/ List list_create (ListDelF f) { List l; if (!(l = list_alloc())) return(lsd_nomem_error(__FILE__, __LINE__, "list create")); l->head = NULL; l->tail = &l->head; l->iNext = NULL; l->fDel = f; l->count = 0; list_mutex_init(&l->mutex); assert(l->magic = LIST_MAGIC); /* set magic via assert abuse */ return(l); } void list_destroy (List l) { ListIterator i, iTmp; ListNode p, pTmp; assert(l != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); i = l->iNext; while (i) { assert(i->magic == LIST_MAGIC); iTmp = i->iNext; assert(i->magic = ~LIST_MAGIC); /* clear magic via assert abuse */ list_iterator_free(i); i = iTmp; } p = l->head; while (p) { pTmp = p->next; if (p->data && l->fDel) l->fDel(p->data); list_node_free(p); p = pTmp; } assert(l->magic = ~LIST_MAGIC); /* clear magic via assert abuse */ list_mutex_unlock(&l->mutex); list_mutex_destroy(&l->mutex); list_free(l); return; } int list_is_empty (List l) { int n; assert(l != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); n = l->count; list_mutex_unlock(&l->mutex); return(n == 0); } int list_count (List l) { int n; assert(l != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); n = l->count; list_mutex_unlock(&l->mutex); return(n); } void * list_append (List l, void *x) { void *v; assert(l != NULL); assert(x != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); v = list_node_create(l, l->tail, x); list_mutex_unlock(&l->mutex); return(v); } void * list_prepend (List l, void *x) { void *v; assert(l != NULL); assert(x != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); v = list_node_create(l, &l->head, x); list_mutex_unlock(&l->mutex); return(v); } void * list_find_first (List l, ListFindF f, void *key) { ListNode p; void *v = NULL; assert(l != NULL); assert(f != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); for (p=l->head; p; p=p->next) { if (f(p->data, key)) { v = p->data; break; } } list_mutex_unlock(&l->mutex); return(v); } int list_delete_all (List l, ListFindF f, void *key) { ListNode *pp; void *v; int n = 0; assert(l != NULL); assert(f != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); pp = &l->head; while (*pp) { if (f((*pp)->data, key)) { if ((v = list_node_destroy(l, pp))) { if (l->fDel) l->fDel(v); n++; } } else { pp = &(*pp)->next; } } list_mutex_unlock(&l->mutex); return(n); } int list_for_each (List l, ListForF f, void *arg) { ListNode p; int n = 0; assert(l != NULL); assert(f != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); for (p=l->head; p; p=p->next) { n++; if (f(p->data, arg) < 0) { n = -n; break; } } list_mutex_unlock(&l->mutex); return(n); } void list_sort (List l, ListCmpF f) { /* Note: Time complexity O(n^2). */ ListNode *pp, *ppPrev, *ppPos, pTmp; ListIterator i; assert(l != NULL); assert(f != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); if (l->count > 1) { ppPrev = &l->head; pp = &(*ppPrev)->next; while (*pp) { if (f((*pp)->data, (*ppPrev)->data) < 0) { ppPos = &l->head; while (f((*pp)->data, (*ppPos)->data) >= 0) ppPos = &(*ppPos)->next; pTmp = (*pp)->next; (*pp)->next = *ppPos; *ppPos = *pp; *pp = pTmp; if (ppPrev == ppPos) ppPrev = &(*ppPrev)->next; } else { ppPrev = pp; pp = &(*pp)->next; } } l->tail = pp; for (i=l->iNext; i; i=i->iNext) { assert(i->magic == LIST_MAGIC); i->pos = i->list->head; i->prev = &i->list->head; } } list_mutex_unlock(&l->mutex); return; } void * list_push (List l, void *x) { void *v; assert(l != NULL); assert(x != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); v = list_node_create(l, &l->head, x); list_mutex_unlock(&l->mutex); return(v); } void * list_pop (List l) { void *v; assert(l != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); v = list_node_destroy(l, &l->head); list_mutex_unlock(&l->mutex); return(v); } void * list_peek (List l) { void *v; assert(l != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); v = (l->head) ? l->head->data : NULL; list_mutex_unlock(&l->mutex); return(v); } void * list_enqueue (List l, void *x) { void *v; assert(l != NULL); assert(x != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); v = list_node_create(l, l->tail, x); list_mutex_unlock(&l->mutex); return(v); } void * list_dequeue (List l) { void *v; assert(l != NULL); list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); v = list_node_destroy(l, &l->head); list_mutex_unlock(&l->mutex); return(v); } ListIterator list_iterator_create (List l) { ListIterator i; assert(l != NULL); if (!(i = list_iterator_alloc())) return(lsd_nomem_error(__FILE__, __LINE__, "list iterator create")); i->list = l; list_mutex_lock(&l->mutex); assert(l->magic == LIST_MAGIC); i->pos = l->head; i->prev = &l->head; i->iNext = l->iNext; l->iNext = i; assert(i->magic = LIST_MAGIC); /* set magic via assert abuse */ list_mutex_unlock(&l->mutex); return(i); } void list_iterator_reset (ListIterator i) { assert(i != NULL); assert(i->magic == LIST_MAGIC); list_mutex_lock(&i->list->mutex); assert(i->list->magic == LIST_MAGIC); i->pos = i->list->head; i->prev = &i->list->head; list_mutex_unlock(&i->list->mutex); return; } void list_iterator_destroy (ListIterator i) { ListIterator *pi; assert(i != NULL); assert(i->magic == LIST_MAGIC); list_mutex_lock(&i->list->mutex); assert(i->list->magic == LIST_MAGIC); for (pi=&i->list->iNext; *pi; pi=&(*pi)->iNext) { assert((*pi)->magic == LIST_MAGIC); if (*pi == i) { *pi = (*pi)->iNext; break; } } list_mutex_unlock(&i->list->mutex); assert(i->magic = ~LIST_MAGIC); /* clear magic via assert abuse */ list_iterator_free(i); return; } void * list_next (ListIterator i) { ListNode p; assert(i != NULL); assert(i->magic == LIST_MAGIC); list_mutex_lock(&i->list->mutex); assert(i->list->magic == LIST_MAGIC); if ((p = i->pos)) i->pos = p->next; if (*i->prev != p) i->prev = &(*i->prev)->next; list_mutex_unlock(&i->list->mutex); return(p ? p->data : NULL); } void * list_insert (ListIterator i, void *x) { void *v; assert(i != NULL); assert(x != NULL); assert(i->magic == LIST_MAGIC); list_mutex_lock(&i->list->mutex); assert(i->list->magic == LIST_MAGIC); v = list_node_create(i->list, i->prev, x); list_mutex_unlock(&i->list->mutex); return(v); } void * list_find (ListIterator i, ListFindF f, void *key) { void *v; assert(i != NULL); assert(f != NULL); assert(i->magic == LIST_MAGIC); while ((v=list_next(i)) && !f(v,key)) {;} return(v); } void * list_remove (ListIterator i) { void *v = NULL; assert(i != NULL); assert(i->magic == LIST_MAGIC); list_mutex_lock(&i->list->mutex); assert(i->list->magic == LIST_MAGIC); if (*i->prev != i->pos) v = list_node_destroy(i->list, i->prev); list_mutex_unlock(&i->list->mutex); return(v); } int list_delete (ListIterator i) { void *v; assert(i != NULL); assert(i->magic == LIST_MAGIC); if ((v = list_remove(i))) { if (i->list->fDel) i->list->fDel(v); return(1); } return(0); } static void * list_node_create (List l, ListNode *pp, void *x) { /* Inserts data pointed to by [x] into list [l] after [pp], * the address of the previous node's "next" ptr. * Returns a ptr to data [x], or NULL if insertion fails. * This routine assumes the list is already locked upon entry. */ ListNode p; ListIterator i; assert(l != NULL); assert(l->magic == LIST_MAGIC); assert(list_mutex_is_locked(&l->mutex)); assert(pp != NULL); assert(x != NULL); if (!(p = list_node_alloc())) return(lsd_nomem_error(__FILE__, __LINE__, "list node create")); p->data = x; if (!(p->next = *pp)) l->tail = &p->next; *pp = p; l->count++; for (i=l->iNext; i; i=i->iNext) { assert(i->magic == LIST_MAGIC); if (i->prev == pp) i->prev = &p->next; else if (i->pos == p->next) i->pos = p; assert((i->pos == *i->prev) || (i->pos == (*i->prev)->next)); } return(x); } static void * list_node_destroy (List l, ListNode *pp) { /* Removes the node pointed to by [*pp] from from list [l], * where [pp] is the address of the previous node's "next" ptr. * Returns the data ptr associated with list item being removed, * or NULL if [*pp] points to the NULL element. * This routine assumes the list is already locked upon entry. */ void *v; ListNode p; ListIterator i; assert(l != NULL); assert(l->magic == LIST_MAGIC); assert(list_mutex_is_locked(&l->mutex)); assert(pp != NULL); if (!(p = *pp)) return(NULL); v = p->data; if (!(*pp = p->next)) l->tail = pp; l->count--; for (i=l->iNext; i; i=i->iNext) { assert(i->magic == LIST_MAGIC); if (i->pos == p) i->pos = p->next, i->prev = pp; else if (i->prev == &p->next) i->prev = pp; assert((i->pos == *i->prev) || (i->pos == (*i->prev)->next)); } list_node_free(p); return(v); } static List list_alloc (void) { return(list_alloc_aux(sizeof(struct list), &list_free_lists)); } static void list_free (List l) { list_free_aux(l, &list_free_lists); return; } static ListNode list_node_alloc (void) { return(list_alloc_aux(sizeof(struct listNode), &list_free_nodes)); } static void list_node_free (ListNode p) { list_free_aux(p, &list_free_nodes); return; } static ListIterator list_iterator_alloc (void) { return(list_alloc_aux(sizeof(struct listIterator), &list_free_iterators)); } static void list_iterator_free (ListIterator i) { list_free_aux(i, &list_free_iterators); return; } static void * list_alloc_aux (int size, void *pfreelist) { /* Allocates an object of [size] bytes from the freelist [*pfreelist]. * Memory is added to the freelist in chunks of size LIST_ALLOC. * Returns a ptr to the object, or NULL if the memory request fails. */ void **px; void **pfree = pfreelist; void **plast; assert(sizeof(char) == 1); assert(size >= sizeof(void *)); assert(pfreelist != NULL); assert(LIST_ALLOC > 0); list_mutex_lock(&list_free_lock); if (!*pfree) { if ((*pfree = malloc(LIST_ALLOC * size))) { px = *pfree; plast = (void **) ((char *) *pfree + ((LIST_ALLOC - 1) * size)); while (px < plast) *px = (char *) px + size, px = *px; *plast = NULL; } } if ((px = *pfree)) *pfree = *px; else errno = ENOMEM; list_mutex_unlock(&list_free_lock); return(px); } static void list_free_aux (void *x, void *pfreelist) { /* Frees the object [x], returning it to the freelist [*pfreelist]. */ void **px = x; void **pfree = pfreelist; assert(x != NULL); assert(pfreelist != NULL); list_mutex_lock(&list_free_lock); *px = *pfree; *pfree = px; list_mutex_unlock(&list_free_lock); return; } #ifndef NDEBUG #ifdef WITH_PTHREADS static int list_mutex_is_locked (pthread_mutex_t *mutex) { /* Returns true if the mutex is locked; o/w, returns false. */ int rc; assert(mutex != NULL); rc = pthread_mutex_trylock(mutex); return(rc == EBUSY ? 1 : 0); } #endif /* WITH_PTHREADS */ #endif /* !NDEBUG */ powerman-2.3.5.orig/src/parse_util.c0000644000000000000000000001754011164745453014321 0ustar /*****************************************************************************\ * $Id: parse_util.c 1125 2009-04-01 20:14:35Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include "list.h" #include "hostlist.h" #include "xtypes.h" #include "error.h" #include "parse_util.h" #include "xmalloc.h" #include "xpoll.h" #include "pluglist.h" #include "client.h" #include "powerman.h" typedef struct { char *name; hostlist_t hl; } alias_t; static bool conf_use_tcp_wrap = FALSE; static List conf_listen = NULL; /* list of host:port strings */ static hostlist_t conf_nodes = NULL; static List conf_aliases = NULL; /* list of alias_t's */ static bool _validate_config(void); static void _alias_destroy(alias_t *a); extern int parse_config_file(char *filename); /* yacc/lex parser */ /* * initialize module * parse the named config file - on error, exit with a message to stderr */ void conf_init(char *filename) { struct stat stbuf; bool valid; conf_listen = list_create((ListDelF) xfree); conf_nodes = hostlist_create(NULL); conf_aliases = list_create((ListDelF) _alias_destroy); /* validate config file */ if (stat(filename, &stbuf) < 0) err_exit(TRUE, "%s", filename); if ((stbuf.st_mode & S_IFMT) != S_IFREG) err_exit(FALSE, "%s is not a regular file\n", filename); /* * Call yacc parser against config file. The parser calls support * functions below and builds 'dev_devices' (devices.c), * 'conf_cluster', 'conf_specs' (config.c), and various other * conf_* attributes (config.c). */ parse_config_file(filename); valid = _validate_config(); if (!valid) exit(1); } /* finalize module */ void conf_fini(void) { if (conf_nodes != NULL) hostlist_destroy(conf_nodes); } /* * Check the config file and exit with error if any problems are found. */ static bool _validate_config(void) { ListIterator itr; bool valid = TRUE; alias_t *a; /* make sure aliases do not point to bogus node names */ itr = list_iterator_create(conf_aliases); while ((a = list_next(itr)) != NULL) { hostlist_iterator_t hitr = hostlist_iterator_create(a->hl); char *host; if (hitr == NULL) err_exit(FALSE, "hostlist_iterator_create failed"); while ((host = hostlist_next(hitr)) != NULL) { if (!conf_node_exists(host)) { err(FALSE, "alias '%s' references nonexistant node '%s'", a->name, host); valid = FALSE; free(host); break; } else free(host); } hostlist_iterator_destroy(hitr); } list_iterator_destroy(itr); /* make sure there is at least one node defined */ if (hostlist_is_empty(conf_nodes)) { err(FALSE, "no nodes are defined"); valid = FALSE; } /* if no listen ports, add the default */ if (list_count(conf_listen) == 0) { char *s = xmalloc(strlen(DFLT_HOSTNAME) + strlen(DFLT_PORT) + 2); sprintf(s, "%s:%s", DFLT_HOSTNAME, DFLT_PORT); list_append(conf_listen, s); } return valid; } /* * Node conf_nodes list. */ bool conf_node_exists(char *node) { int res; res = hostlist_find(conf_nodes, node); return (res == -1 ? FALSE : TRUE); } bool conf_addnodes(char *nodelist) { hostlist_t hl = hostlist_create(nodelist); hostlist_iterator_t itr = hostlist_iterator_create(hl); char *node; int res = TRUE; while ((node = hostlist_next(itr))) { if (conf_node_exists(node)) { free(node); res = FALSE; break; } else { hostlist_push(conf_nodes, node); free(node); } } hostlist_iterator_destroy(itr); hostlist_destroy(hl); return res; } hostlist_t conf_getnodes(void) { return conf_nodes; } /* * Accessor functions for misc. configurable values. */ bool conf_get_use_tcp_wrappers(void) { return conf_use_tcp_wrap; } void conf_set_use_tcp_wrappers(bool val) { #if ! HAVE_TCP_WRAPPERS if (val == TRUE) err_exit(FALSE, "powerman was not built with tcp_wrapper support"); #endif conf_use_tcp_wrap = val; } List conf_get_listen(void) { return conf_listen; } void conf_add_listen(char *hostport) { list_append(conf_listen, xstrdup(hostport)); } /* * Manage a list of nodename aliases. */ static int _alias_match(alias_t *a, char *name) { return (strcmp(a->name, name) == 0); } /* Expand any aliases present in hostlist. * N.B. Aliases cannot contain other aliases. */ void conf_exp_aliases(hostlist_t hl) { hostlist_iterator_t itr = NULL; hostlist_t newhosts = hostlist_create(NULL); char *host; /* Put the expansion of any aliases in the hostlist into 'newhosts', * deleting the original reference from the hostlist. */ if (newhosts == NULL) err_exit(FALSE, "hostlist_create failed"); if ((itr = hostlist_iterator_create(hl)) == NULL) err_exit(FALSE, "hostlist_iterator_create failed"); while ((host = hostlist_next(itr)) != NULL) { alias_t *a; a = list_find_first(conf_aliases, (ListFindF) _alias_match, host); if (a) { hostlist_delete_host(hl, host); hostlist_push_list(newhosts, a->hl); hostlist_iterator_reset(itr); /* not sure of itr position after insertion/deletion so reset */ } free(host); } hostlist_iterator_destroy(itr); /* dump the contents of 'newhosts' into the hostlist */ hostlist_push_list(hl, newhosts); hostlist_destroy(newhosts); } static void _alias_destroy(alias_t *a) { if (a->name) xfree(a->name); if (a->hl) hostlist_destroy(a->hl); xfree(a); } static alias_t *_alias_create(char *name, char *hosts) { alias_t *a = NULL; if (!list_find_first(conf_aliases, (ListFindF) _alias_match, name)) { a = (alias_t *)xmalloc(sizeof(alias_t)); a->name= xstrdup(name); a->hl = hostlist_create(hosts); if (a->hl == NULL) { _alias_destroy(a); a = NULL; } } return a; } /* * Called from the parser. */ bool conf_add_alias(char *name, char *hosts) { alias_t *a; if ((a = _alias_create(name, hosts))) { list_push(conf_aliases, a); return TRUE; } return FALSE; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/hostlist.h0000644000000000000000000002731111113347050014006 0ustar /*****************************************************************************\ * $Id: hostlist.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona * UCRL-CODE-2002-040. * * This file is part of SLURM, a resource management program. * For details, see . * * SLURM 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. * * SLURM 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 SLURM; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef _HOSTLIST_H #define _HOSTLIST_H #include /* Notes: * * If WITH_LSD_FATAL_ERROR_FUNC is defined, the linker will expect to * find and external lsd_fatal_error(file,line,mesg) function. By default, * lsd_fatal_error(file,line,mesg) is a macro definition that outputs an * error message to stderr. This macro may be redefined to invoke another * routine instead. e.g.: * * #define lsd_fatal_error(file,line,mesg) \ * error("%s:%s %s\n",file,line,mesg); * * If WITH_LSD_NOMEM_ERROR_FUNC is defined, the linker will expect to * find an external lsd_nomem_error(file,line,mesg) function. By default, * lsd_nomem_error(file,line,mesg) is a macro definition that returns NULL. * This macro may be redefined to invoke another routine instead. * * If WITH_PTHREADS is defined, these routines will be thread-safe. * */ /* The hostlist opaque data type * * A hostlist is a list of hostnames optimized for a prefixXXXX style * naming convention, where XXXX is a decimal, numeric suffix. */ typedef struct hostlist * hostlist_t; /* A hostset is a special case of a hostlist. It: * * 1. never contains duplicates * 2. is always sorted * (Note: sort occurs first on alphanumeric prefix -- where prefix * matches, numeric suffixes will be sorted *by value*) */ typedef struct hostset * hostset_t; /* The hostlist iterator type (may be used with a hostset as well) * used for non-destructive access to hostlist members. * */ typedef struct hostlist_iterator * hostlist_iterator_t; /* ----[ hostlist_t functions: ]---- */ /* ----[ hostlist creation and destruction ]---- */ /* * hostlist_create(): * * Create a new hostlist from a string representation. * * The string representation (str) may contain one or more hostnames or * bracketed hostlists separated by either `,' or whitespace. A bracketed * hostlist is denoted by a common prefix followed by a list of numeric * ranges contained within brackets: e.g. "tux[0-5,12,20-25]" * * Note: if this module is compiled with WANT_RECKLESS_HOSTRANGE_EXPANSION * defined, a much more loose interpretation of host ranges is used. * Reckless hostrange expansion allows all of the following (in addition to * bracketed hostlists): * * o tux0-5,tux12,tux20-25 * o tux0-tux5,tux12,tux20-tux25 * o tux0-5,12,20-25 * * If str is NULL, and empty hostlist is created and returned. * * If the create fails, hostlist_create() returns NULL. * * The returned hostlist must be freed with hostlist_destroy() * */ hostlist_t hostlist_create(const char *hostlist); /* hostlist_copy(): * * Allocate a copy of a hostlist object. Returned hostlist must be freed * with hostlist_destroy. */ hostlist_t hostlist_copy(const hostlist_t hl); /* hostlist_destroy(): * * Destroy a hostlist object. Frees all memory allocated to the hostlist. */ void hostlist_destroy(hostlist_t hl); /* ----[ hostlist list operations ]---- */ /* hostlist_push(): * * push a string representation of hostnames onto a hostlist. * * The hosts argument may take the same form as in hostlist_create() * * Returns the number of hostnames inserted into the list, * or 0 on failure. */ int hostlist_push(hostlist_t hl, const char *hosts); /* hostlist_push_host(): * * Push a single host onto the hostlist hl. * This function is more efficient than hostlist_push() for a single * hostname, since the argument does not need to be checked for ranges. * * return value is 1 for success, 0 for failure. */ int hostlist_push_host(hostlist_t hl, const char *host); /* hostlist_push_list(): * * Push a hostlist (hl2) onto another list (hl1) * * Returns 1 for success, 0 for failure. * */ int hostlist_push_list(hostlist_t hl1, hostlist_t hl2); /* hostlist_pop(): * * Returns the string representation of the last host pushed onto the list * or NULL if hostlist is empty or there was an error allocating memory. * The host is removed from the hostlist. * * Note: Caller is responsible for freeing the returned memory. */ char * hostlist_pop(hostlist_t hl); char * hostlist_nth(hostlist_t hl, int n); /* hostlist_shift(): * * Returns the string representation of the first host in the hostlist * or NULL if the hostlist is empty or there was an error allocating memory. * The host is removed from the hostlist. * * Note: Caller is responsible for freeing the returned memory. */ char * hostlist_shift(hostlist_t hl); /* hostlist_pop_range(): * * Pop the last bracketed list of hosts of the hostlist hl. * Returns the string representation in bracketed list form. * All hosts associated with the returned list are removed * from hl. * * Caller is responsible for freeing returned memory */ char * hostlist_pop_range(hostlist_t hl); /* hostlist_shift_range(): * * Shift the first bracketed hostlist (improperly: range) off the * hostlist hl. Returns the string representation in bracketed list * form. All hosts associated with the list are removed from the * hostlist. * * Caller is responsible for freeing returned memory. */ char * hostlist_shift_range(hostlist_t hl); /* hostlist_find(): * * Searches hostlist hl for the first host matching hostname * and returns position in list if found. * * Returns -1 if host is not found. * */ int hostlist_find(hostlist_t hl, const char *hostname); /* hostlist_delete(): * * Deletes all hosts in the list represented by `hosts' * * Returns the number of hosts successfully deleted */ int hostlist_delete(hostlist_t hl, const char *hosts); /* hostlist_delete_host(): * * Deletes the first host that matches `hostname' from the hostlist hl. * Note: "hostname" argument cannot contain a range of hosts * (see hostlist_delete() for this functionality.) * * Returns 1 if successful, 0 if hostname is not found in list. */ int hostlist_delete_host(hostlist_t hl, const char *hostname); /* hostlist_delete_nth(): * * Deletes the host from position n in the hostlist. * * Returns 1 if successful 0 on error. * */ int hostlist_delete_nth(hostlist_t hl, int n); /* hostlist_count(): * * Return the number of hosts in hostlist hl. */ int hostlist_count(hostlist_t hl); /* hostlist_is_empty(): return true if hostlist is empty. */ #define hostlist_is_empty(__hl) ( hostlist_count(__hl) == 0 ) /* ----[ Other hostlist operations ]---- */ /* hostlist_sort(): * * Sort the hostlist hl. * */ void hostlist_sort(hostlist_t hl); /* hostlist_uniq(): * * Sort the hostlist hl and remove duplicate entries. * */ void hostlist_uniq(hostlist_t hl); /* ----[ hostlist print functions ]---- */ /* hostlist_ranged_string(): * * Write the string representation of the hostlist hl into buf, * writing at most n chars. Returns the number of bytes written, * or -1 if truncation occurred. * * The result will be NULL terminated. * * hostlist_ranged_string() will write a bracketed hostlist representation * where possible. */ ssize_t hostlist_ranged_string(hostlist_t hl, size_t n, char *buf); ssize_t hostset_ranged_string(hostset_t hs, size_t n, char *buf); /* hostlist_deranged_string(): * * Writes the string representation of the hostlist hl into buf, * writing at most n chars. Returns the number of bytes written, * or -1 if truncation occurred. * * hostlist_deranged_string() will not attempt to write a bracketed * hostlist representation. Every hostname will be explicitly written. */ ssize_t hostlist_deranged_string(hostlist_t hl, size_t n, char *buf); ssize_t hostset_deranged_string(hostset_t hs, size_t n, char *buf); /* ----[ hostlist utility functions ]---- */ /* hostlist_nranges(): * * Return the number of ranges currently held in hostlist hl. */ int hostlist_nranges(hostlist_t hl); /* ----[ hostlist iterator functions ]---- */ /* hostlist_iterator_create(): * * Creates and returns a hostlist iterator used for non destructive * access to a hostlist or hostset. Returns NULL on failure. */ hostlist_iterator_t hostlist_iterator_create(hostlist_t hl); /* hostset_iterator_create(): * * Same as hostlist_iterator_create(), but creates a hostlist_iterator * from a hostset. */ hostlist_iterator_t hostset_iterator_create(hostset_t set); /* hostlist_iterator_destroy(): * * Destroys a hostlist iterator. */ void hostlist_iterator_destroy(hostlist_iterator_t i); /* hostlist_iterator_reset(): * * Reset an iterator to the beginning of the list. */ void hostlist_iterator_reset(hostlist_iterator_t i); /* hostlist_next(): * * Returns a pointer to the next hostname on the hostlist * or NULL at the end of the list * * The caller is responsible for freeing the returned memory. */ char * hostlist_next(hostlist_iterator_t i); /* hostlist_next_range(): * * Returns the next bracketed hostlist or NULL if the iterator i is * at the end of the list. * * The caller is responsible for freeing the returned memory. * */ char * hostlist_next_range(hostlist_iterator_t i); /* hostlist_remove(): * Removes the last host returned by hostlist iterator i * * Returns 1 for success, 0 for failure. */ int hostlist_remove(hostlist_iterator_t i); /* ----[ hostset operations ]---- */ /* hostset_create(): * * Create a new hostset object from a string representation of a list of * hosts. See hostlist_create() for valid hostlist forms. */ hostset_t hostset_create(const char *hostlist); /* hostset_copy(): * * Copy a hostset object. Returned set must be freed with hostset_destroy(). */ hostset_t hostset_copy(hostset_t set); /* hostset_destroy(): */ void hostset_destroy(hostset_t set); /* hostset_insert(): * Add a host or list of hosts into hostset "set." * * Returns number of hosts successfully added to "set" * (insertion of a duplicate is not considered successful) */ int hostset_insert(hostset_t set, const char *hosts); /* hostset_delete(): * Delete a host or list of hosts from hostset "set." * Returns number of hosts deleted from set. */ int hostset_delete(hostset_t set, const char *hosts); /* hostset_within(): * Return 1 if all hosts specified by "hosts" are within the hostset "set" * Retrun 0 if every host in "hosts" is not in the hostset "set" */ int hostset_within(hostset_t set, const char *hosts); /* hostset_shift(): * hostset equivalent to hostlist_shift() */ char * hostset_shift(hostset_t set); /* hostset_shift_range(): * hostset eqivalent to hostlist_shift_range() */ char * hostset_shift_range(hostset_t set); /* hostset_count(): * Count the number of hosts currently in hostset */ int hostset_count(hostset_t set); #endif /* !_HOSTLIST_H */ powerman-2.3.5.orig/src/daemon.c0000644000000000000000000000654011115264426013403 0ustar /*****************************************************************************\ * $Id: daemon.c 1100 2008-12-02 16:57:58Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "xtypes.h" #include "xsignal.h" #include "error.h" #include "daemon.h" static int in_fdlist(int fd, int *fds, int len) { while (--len >= 0) if (fds[len] == fd) return 1; return 0; } void daemon_init(int *skipfds, int skipfdslen, char *rundir, char *pidfile, char *logname) { int i; FILE *fp; switch (fork()) { case -1: err_exit(TRUE, "fork"); case 0: /* child */ break; default: /* parent */ exit(0); } /* 1st child continues */ /* become session leader */ if (setsid() < 0) err_exit(TRUE, "setsid"); xsignal(SIGHUP, SIG_IGN); switch(fork()) { case -1: err_exit(TRUE, "fork"); case 0: /* child */ break; default: /* parent */ exit(0); } /* 2nd child continues */ /* change working directory */ if (chdir(rundir) < 0) err_exit(TRUE, "chdir %s", rundir); /* clear our file mode creation mask */ umask(0022); /* craete pidfile */ (void)unlink(pidfile); if (!(fp = fopen(pidfile, "w"))) err_exit(TRUE, "fopen %s", pidfile); if (fprintf(fp, "%d\n", (int)getpid()) == EOF) { (void)unlink(pidfile); err_exit(TRUE, "fwrite %s", pidfile); } if (fclose(fp) == EOF) { (void)unlink(pidfile); err_exit(TRUE, "fclose %s", pidfile); } /* close fd's */ for (i = 0; i < 256; i++) { if (!in_fdlist(i, skipfds, skipfdslen)) close(i); /* ignore errors */ } /* Init syslog */ openlog(logname, LOG_NDELAY | LOG_PID, LOG_DAEMON); syslog(LOG_NOTICE, "started"); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/cbuf.c0000644000000000000000000013702711113347050013055 0ustar /***************************************************************************** * $Id: cbuf.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2002-2005 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * * LSD-Tools 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. * * LSD-Tools 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 LSD-Tools; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ***************************************************************************** * Refer to "cbuf.h" for documentation on public functions. *****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef WITH_PTHREADS # include #endif /* WITH_PTHREADS */ #include #include #include #include #include #include "cbuf.h" /***************************************************************************** * lsd_fatal_error *****************************************************************************/ #ifdef WITH_LSD_FATAL_ERROR_FUNC # undef lsd_fatal_error extern void lsd_fatal_error (char *file, int line, char *mesg); #else /* !WITH_LSD_FATAL_ERROR_FUNC */ # ifndef lsd_fatal_error # include # include # include # define lsd_fatal_error(file, line, mesg) \ do { \ fprintf (stderr, "ERROR: [%s:%d] %s: %s\n", \ file, line, mesg, strerror (errno)); \ } while (0) # endif /* !lsd_fatal_error */ #endif /* !WITH_LSD_FATAL_ERROR_FUNC */ /***************************************************************************** * lsd_nomem_error *****************************************************************************/ #ifdef WITH_LSD_NOMEM_ERROR_FUNC # undef lsd_nomem_error extern void * lsd_nomem_error (char *file, int line, char *mesg); #else /* !WITH_LSD_NOMEM_ERROR_FUNC */ # ifndef lsd_nomem_error # define lsd_nomem_error(file, line, mesg) (NULL) # endif /* !lsd_nomem_error */ #endif /* !WITH_LSD_NOMEM_ERROR_FUNC */ /***************************************************************************** * Constants *****************************************************************************/ #define CBUF_CHUNK 1000 #define CBUF_MAGIC 0xDEADBEEF #define CBUF_MAGIC_LEN (sizeof (unsigned long)) /***************************************************************************** * Data Types *****************************************************************************/ struct cbuf { #ifndef NDEBUG unsigned long magic; /* cookie for asserting validity */ #endif /* !NDEBUG */ #ifdef WITH_PTHREADS pthread_mutex_t mutex; /* mutex to protect access to cbuf */ #endif /* WITH_PTHREADS */ int alloc; /* num bytes malloc'd/realloc'd */ int minsize; /* min bytes of data to allocate */ int maxsize; /* max bytes of data to allocate */ int size; /* num bytes of data allocated */ int used; /* num bytes of unread data */ cbuf_overwrite_t overwrite; /* overwrite option behavior */ int got_wrap; /* true if data has wrapped */ int i_in; /* index to where data is written in */ int i_out; /* index to where data is read out */ int i_rep; /* index to where data is replayable */ unsigned char *data; /* ptr to circular buffer of data */ }; typedef int (*cbuf_iof) (void *cbuf_data, void *arg, int len); /***************************************************************************** * Prototypes *****************************************************************************/ static int cbuf_find_replay_line (cbuf_t cb, int chars, int *nlines, int *nl); static int cbuf_find_unread_line (cbuf_t cb, int chars, int *nlines); static int cbuf_get_fd (void *dstbuf, int *psrcfd, int len); static int cbuf_get_mem (void *dstbuf, unsigned char **psrcbuf, int len); static int cbuf_put_fd (void *srcbuf, int *pdstfd, int len); static int cbuf_put_mem (void *srcbuf, unsigned char **pdstbuf, int len); static int cbuf_copier (cbuf_t src, cbuf_t dst, int len, int *ndropped); static int cbuf_dropper (cbuf_t cb, int len); static int cbuf_reader (cbuf_t src, int len, cbuf_iof putf, void *dst); static int cbuf_replayer (cbuf_t src, int len, cbuf_iof putf, void *dst); static int cbuf_writer (cbuf_t dst, int len, cbuf_iof getf, void *src, int *ndropped); static int cbuf_grow (cbuf_t cb, int n); static int cbuf_shrink (cbuf_t cb); #ifndef NDEBUG static int cbuf_is_valid (cbuf_t cb); #endif /* !NDEBUG */ /***************************************************************************** * Macros *****************************************************************************/ #ifndef MAX # define MAX(x,y) (((x) >= (y)) ? (x) : (y)) #endif /* !MAX */ #ifndef MIN # define MIN(x,y) (((x) <= (y)) ? (x) : (y)) #endif /* !MIN */ #ifdef WITH_PTHREADS # define cbuf_mutex_init(cb) \ do { \ int e = pthread_mutex_init (&cb->mutex, NULL); \ if (e) { \ errno = e; \ lsd_fatal_error (__FILE__, __LINE__, "cbuf mutex init"); \ abort (); \ } \ } while (0) # define cbuf_mutex_lock(cb) \ do { \ int e = pthread_mutex_lock (&cb->mutex); \ if (e) { \ errno = e; \ lsd_fatal_error (__FILE__, __LINE__, "cbuf mutex lock"); \ abort (); \ } \ } while (0) # define cbuf_mutex_unlock(cb) \ do { \ int e = pthread_mutex_unlock (&cb->mutex); \ if (e) { \ errno = e; \ lsd_fatal_error (__FILE__, __LINE__, "cbuf mutex unlock"); \ abort (); \ } \ } while (0) # define cbuf_mutex_destroy(cb) \ do { \ int e = pthread_mutex_destroy (&cb->mutex); \ if (e) { \ errno = e; \ lsd_fatal_error (__FILE__, __LINE__, "cbuf mutex destroy"); \ abort (); \ } \ } while (0) # ifndef NDEBUG static int cbuf_mutex_is_locked (cbuf_t cb); # endif /* !NDEBUG */ #else /* !WITH_PTHREADS */ # define cbuf_mutex_init(cb) # define cbuf_mutex_lock(cb) # define cbuf_mutex_unlock(cb) # define cbuf_mutex_destroy(cb) # define cbuf_mutex_is_locked(cb) (1) #endif /* !WITH_PTHREADS */ /***************************************************************************** * Functions *****************************************************************************/ cbuf_t cbuf_create (int minsize, int maxsize) { cbuf_t cb; if (minsize <= 0) { errno = EINVAL; return (NULL); } if (!(cb = malloc (sizeof (struct cbuf)))) { errno = ENOMEM; return (lsd_nomem_error (__FILE__, __LINE__, "cbuf struct")); } /* Circular buffer is empty when (i_in == i_out), * so reserve 1 byte for this sentinel. */ cb->alloc = minsize + 1; #ifndef NDEBUG /* Reserve space for the magic cookies used to protect the * cbuf data[] array from underflow and overflow. */ cb->alloc += 2 * CBUF_MAGIC_LEN; #endif /* !NDEBUG */ if (!(cb->data = malloc (cb->alloc))) { free (cb); errno = ENOMEM; return (lsd_nomem_error (__FILE__, __LINE__, "cbuf data")); } cbuf_mutex_init (cb); cb->minsize = minsize; cb->maxsize = (maxsize > minsize) ? maxsize : minsize; cb->size = minsize; cb->used = 0; cb->overwrite = CBUF_WRAP_MANY; cb->got_wrap = 0; cb->i_in = cb->i_out = cb->i_rep = 0; #ifndef NDEBUG /* C is for cookie, that's good enough for me, yeah! * The magic cookies are only defined during DEBUG code. * The first "magic" cookie is at the top of the structure. * Magic cookies are also placed at the top & bottom of the * cbuf data[] array to catch buffer underflow & overflow errors. */ cb->data += CBUF_MAGIC_LEN; /* jump forward past underflow magic */ cb->magic = CBUF_MAGIC; /* * Must use memcpy since overflow cookie may not be word-aligned. */ memcpy (cb->data - CBUF_MAGIC_LEN, (void *) &cb->magic, CBUF_MAGIC_LEN); memcpy (cb->data + cb->size + 1, (void *) &cb->magic, CBUF_MAGIC_LEN); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); cbuf_mutex_unlock (cb); #endif /* !NDEBUG */ return (cb); } void cbuf_destroy (cbuf_t cb) { assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); #ifndef NDEBUG /* The moon sometimes looks like a C, but you can't eat that. * Munch the magic cookies before freeing memory. */ cb->magic = ~CBUF_MAGIC; /* the anti-cookie! */ memcpy (cb->data - CBUF_MAGIC_LEN, (void *) &cb->magic, CBUF_MAGIC_LEN); memcpy (cb->data + cb->size + 1, (void *) &cb->magic, CBUF_MAGIC_LEN); cb->data -= CBUF_MAGIC_LEN; /* jump back to what malloc returned */ #endif /* !NDEBUG */ free (cb->data); cbuf_mutex_unlock (cb); cbuf_mutex_destroy (cb); free (cb); return; } void cbuf_flush (cbuf_t cb) { assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); /* * FIXME: Shrink buffer back to minimum size. */ cb->used = 0; cb->got_wrap = 0; cb->i_in = cb->i_out = cb->i_rep = 0; assert (cbuf_is_valid (cb)); cbuf_mutex_unlock (cb); return; } int cbuf_size (cbuf_t cb) { int size; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); size = cb->maxsize; cbuf_mutex_unlock (cb); return (size); } int cbuf_free (cbuf_t cb) { int nfree; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); nfree = cb->maxsize - cb->used; cbuf_mutex_unlock (cb); return (nfree); } int cbuf_used (cbuf_t cb) { int used; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); used = cb->used; cbuf_mutex_unlock (cb); return (used); } int cbuf_lines_used (cbuf_t cb) { int lines = -1; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); cbuf_find_unread_line (cb, cb->size, &lines); cbuf_mutex_unlock (cb); return (lines); } int cbuf_reused (cbuf_t cb) { /* If (O > R) * n = O - R * else * n = (O - 0) + ((S+1) - R). * (S+1) is used since data[] contains 'size' bytes + a 1-byte sentinel. */ int reused; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); reused = (cb->i_out - cb->i_rep + (cb->size + 1)) % (cb->size + 1); cbuf_mutex_unlock (cb); return (reused); } int cbuf_lines_reused (cbuf_t cb) { int lines = -1; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); cbuf_find_replay_line (cb, cb->size, &lines, NULL); cbuf_mutex_unlock (cb); return (lines); } int cbuf_is_empty (cbuf_t cb) { int used; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); used = cb->used; cbuf_mutex_unlock (cb); return (used == 0); } int cbuf_opt_get (cbuf_t cb, cbuf_opt_t name, int *value) { int rc = 0; assert (cb != NULL); if (value == NULL) { errno = EINVAL; return (-1); } cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); if (name == CBUF_OPT_OVERWRITE) { *value = cb->overwrite; } else { errno = EINVAL; rc = -1; } cbuf_mutex_unlock (cb); return (rc); } int cbuf_opt_set (cbuf_t cb, cbuf_opt_t name, int value) { int rc = 0; assert (cb != NULL); cbuf_mutex_lock (cb); assert (cbuf_is_valid (cb)); if (name == CBUF_OPT_OVERWRITE) { if ( (value == CBUF_NO_DROP) || (value == CBUF_WRAP_ONCE) || (value == CBUF_WRAP_MANY) ) { cb->overwrite = value; } else { errno = EINVAL; rc = -1; } } else { errno = EINVAL; rc = -1; } assert (cbuf_is_valid (cb)); cbuf_mutex_unlock (cb); return (rc); } int cbuf_drop (cbuf_t src, int len) { assert (src != NULL); if (len < -1) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); if (len == -1) { len = src->used; } else { len = MIN (len, src->used); } if (len > 0) { cbuf_dropper (src, len); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (len); } int cbuf_peek (cbuf_t src, void *dstbuf, int len) { int n; assert (src != NULL); if ((dstbuf == NULL) || (len < 0)) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_reader (src, len, (cbuf_iof) cbuf_put_mem, &dstbuf); assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_read (cbuf_t src, void *dstbuf, int len) { int n; assert (src != NULL); if ((dstbuf == NULL) || (len < 0)) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_reader (src, len, (cbuf_iof) cbuf_put_mem, &dstbuf); if (n > 0) { cbuf_dropper (src, n); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_replay (cbuf_t src, void *dstbuf, int len) { int n; assert (src != NULL); if ((dstbuf == NULL) || (len < 0)) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_replayer (src, len, (cbuf_iof) cbuf_put_mem, &dstbuf); assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_rewind (cbuf_t src, int len) { int reused; assert (src != NULL); if (len < -1) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); reused = (src->i_out - src->i_rep + (src->size + 1)) % (src->size + 1); if (len == -1) { len = reused; } else { len = MIN (len, reused); } if (len > 0) { src->used += len; src->i_out = (src->i_out - len + (src->size + 1)) % (src->size + 1); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (len); } int cbuf_write (cbuf_t dst, void *srcbuf, int len, int *ndropped) { int n; assert (dst != NULL); if (ndropped) { *ndropped = 0; } if ((srcbuf == NULL) || (len < 0)) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } cbuf_mutex_lock (dst); assert (cbuf_is_valid (dst)); n = cbuf_writer (dst, len, (cbuf_iof) cbuf_get_mem, &srcbuf, ndropped); assert (cbuf_is_valid (dst)); cbuf_mutex_unlock (dst); return (n); } int cbuf_drop_line (cbuf_t src, int len, int lines) { int n; assert (src != NULL); if ((len < 0) || (lines < -1)) { errno = EINVAL; return (-1); } if (lines == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_find_unread_line (src, len, &lines); if (n > 0) { cbuf_dropper (src, n); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_peek_line (cbuf_t src, char *dstbuf, int len, int lines) { int n, m, l; char *pdst; assert (src != NULL); if ((dstbuf == NULL) || (len < 0) || (lines < -1)) { errno = EINVAL; return (-1); } if (lines == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_find_unread_line (src, len - 1, &lines); if (n > 0) { if (len > 0) { m = MIN (n, len - 1); if (m > 0) { pdst = dstbuf; l = cbuf_reader (src, m, (cbuf_iof) cbuf_put_mem, &pdst); assert (l == m); } assert (m < len); dstbuf[m] = '\0'; } } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_read_line (cbuf_t src, char *dstbuf, int len, int lines) { int n, m, l; char *pdst; assert (src != NULL); if ((dstbuf == NULL) || (len < 0) || (lines < -1)) { errno = EINVAL; return (-1); } if (lines == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_find_unread_line (src, len - 1, &lines); if (n > 0) { if (len > 0) { m = MIN (n, len - 1); if (m > 0) { pdst = dstbuf; l = cbuf_reader (src, m, (cbuf_iof) cbuf_put_mem, &pdst); assert (l == m); } assert (m < len); dstbuf[m] = '\0'; } cbuf_dropper (src, n); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_replay_line (cbuf_t src, char *dstbuf, int len, int lines) { int n, m, l; int nl; char *pdst; assert (src != NULL); if ((dstbuf == NULL) || (len < 0) || (lines < -1)) { errno = EINVAL; return (-1); } if (lines == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_find_replay_line (src, len - 1, &lines, &nl); if (n > 0) { if (len > 0) { assert ((nl == 0) || (nl == 1)); m = MIN (n, len - 1 - nl); m = MAX (m, 0); if (m > 0) { pdst = dstbuf; l = cbuf_replayer (src, m, (cbuf_iof) cbuf_put_mem, &pdst); assert (l == m); } /* Append newline if needed and space allows. */ if ((nl) && (len > 1)) { dstbuf[m++] = '\n'; } assert (m < len); dstbuf[m] = '\0'; n += nl; } } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_rewind_line (cbuf_t src, int len, int lines) { int n; assert (src != NULL); if ((len < 0) || (lines < -1)) { errno = EINVAL; return (-1); } if (lines == 0) { return (0); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); n = cbuf_find_replay_line (src, len, &lines, NULL); if (n > 0) { src->used += n; src->i_out = (src->i_out - n + (src->size + 1)) % (src->size + 1); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_write_line (cbuf_t dst, char *srcbuf, int *ndropped) { int len; int nfree, ncopy, n; int ndrop = 0, d; char *psrc = srcbuf; char *newline = "\n"; assert (dst != NULL); if (ndropped) { *ndropped = 0; } if (srcbuf == NULL) { errno = EINVAL; return (-1); } /* Compute number of bytes to effectively copy to dst cbuf. * Reserve space for the trailing newline if needed. */ len = ncopy = strlen (srcbuf); if ((len == 0) || (srcbuf[len - 1] != '\n')) { len++; } cbuf_mutex_lock (dst); assert (cbuf_is_valid (dst)); /* * Attempt to grow dst cbuf if necessary. */ nfree = dst->size - dst->used; if ((len > nfree) && (dst->size < dst->maxsize)) { nfree += cbuf_grow (dst, len - nfree); } /* Determine if src will fit (or be made to fit) in dst cbuf. */ if (dst->overwrite == CBUF_NO_DROP) { if (len > dst->size - dst->used) { errno = ENOSPC; len = -1; /* cannot return while mutex locked */ } } else if (dst->overwrite == CBUF_WRAP_ONCE) { if (len > dst->size) { errno = ENOSPC; len = -1; /* cannot return while mutex locked */ } } if (len > 0) { /* * Discard data that won't fit in dst cbuf. */ if (len > dst->size) { ndrop += len - dst->size; ncopy -= ndrop; psrc += ndrop; } /* Copy data from src string to dst cbuf. */ if (ncopy > 0) { n = cbuf_writer (dst, ncopy, (cbuf_iof) cbuf_get_mem, &psrc, &d); assert (n == ncopy); ndrop += d; } /* Append newline if needed. */ if (srcbuf[len - 1] != '\n') { n = cbuf_writer (dst, 1, (cbuf_iof) cbuf_get_mem, &newline, &d); assert (n == 1); ndrop += d; } } assert (cbuf_is_valid (dst)); cbuf_mutex_unlock (dst); if (ndropped) { *ndropped = ndrop; } return (len); } int cbuf_peek_to_fd (cbuf_t src, int dstfd, int len) { int n = 0; assert (src != NULL); if ((dstfd < 0) || (len < -1)) { errno = EINVAL; return (-1); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); if (len == -1) { len = src->used; } if (len > 0) { n = cbuf_reader (src, len, (cbuf_iof) cbuf_put_fd, &dstfd); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_read_to_fd (cbuf_t src, int dstfd, int len) { int n = 0; assert (src != NULL); if ((dstfd < 0) || (len < -1)) { errno = EINVAL; return (-1); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); if (len == -1) { len = src->used; } if (len > 0) { n = cbuf_reader (src, len, (cbuf_iof) cbuf_put_fd, &dstfd); if (n > 0) { cbuf_dropper (src, n); } } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_replay_to_fd (cbuf_t src, int dstfd, int len) { int n = 0; assert (src != NULL); if ((dstfd < 0) || (len < -1)) { errno = EINVAL; return (-1); } cbuf_mutex_lock (src); assert (cbuf_is_valid (src)); if (len == -1) { len = src->size - src->used; } if (len > 0) { n = cbuf_replayer (src, len, (cbuf_iof) cbuf_put_fd, &dstfd); } assert (cbuf_is_valid (src)); cbuf_mutex_unlock (src); return (n); } int cbuf_write_from_fd (cbuf_t dst, int srcfd, int len, int *ndropped) { int n = 0; assert (dst != NULL); if (ndropped) { *ndropped = 0; } if ((srcfd < 0) || (len < -1)) { errno = EINVAL; return (-1); } cbuf_mutex_lock (dst); assert (cbuf_is_valid (dst)); if (len == -1) { /* * Try to use all of the free buffer space available for writing. * If it is all in use, try to grab another chunk. */ len = dst->size - dst->used; if (len == 0) { len = CBUF_CHUNK; } } if (len > 0) { n = cbuf_writer (dst, len, (cbuf_iof) cbuf_get_fd, &srcfd, ndropped); } assert (cbuf_is_valid (dst)); cbuf_mutex_unlock (dst); return (n); } int cbuf_copy (cbuf_t src, cbuf_t dst, int len, int *ndropped) { int n = 0; assert (src != NULL); assert (dst != NULL); if (ndropped) { *ndropped = 0; } if (src == dst) { errno = EINVAL; return (-1); } if (len < -1) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } /* Lock cbufs in order of lowest memory address to prevent deadlock. */ if (src < dst) { cbuf_mutex_lock (src); cbuf_mutex_lock (dst); } else { cbuf_mutex_lock (dst); cbuf_mutex_lock (src); } assert (cbuf_is_valid (src)); assert (cbuf_is_valid (dst)); if (len == -1) { len = src->used; } if (len > 0) { n = cbuf_copier (src, dst, len, ndropped); } assert (cbuf_is_valid (src)); assert (cbuf_is_valid (dst)); cbuf_mutex_unlock (src); cbuf_mutex_unlock (dst); return (n); } int cbuf_move (cbuf_t src, cbuf_t dst, int len, int *ndropped) { int n = 0; assert (src != NULL); assert (dst != NULL); if (ndropped) { *ndropped = 0; } if (src == dst) { errno = EINVAL; return (-1); } if (len < -1) { errno = EINVAL; return (-1); } if (len == 0) { return (0); } /* Lock cbufs in order of lowest memory address to prevent deadlock. */ if (src < dst) { cbuf_mutex_lock (src); cbuf_mutex_lock (dst); } else { cbuf_mutex_lock (dst); cbuf_mutex_lock (src); } assert (cbuf_is_valid (src)); assert (cbuf_is_valid (dst)); if (len == -1) { len = src->used; } if (len > 0) { n = cbuf_copier (src, dst, len, ndropped); if (n > 0) { cbuf_dropper (src, n); } } assert (cbuf_is_valid (src)); assert (cbuf_is_valid (dst)); cbuf_mutex_unlock (src); cbuf_mutex_unlock (dst); return (n); } static int cbuf_find_replay_line (cbuf_t cb, int chars, int *nlines, int *nl) { /* Finds the specified number of lines from the replay region of the buffer. * If ([nlines] > 0), returns the number of bytes comprising the line count, * or 0 if this number of lines is not available (ie, all or none). * If ([nlines] == -1), returns the number of bytes comprising the maximum * line count bounded by the number of characters specified by [chars]. * Only complete lines (ie, those terminated by a newline) are counted, * with once exception: the most recent line of replay data is treated * as a complete line regardless of the presence of a terminating newline. * Sets the value-result parameter [nlines] to the number of lines found. * Sets [nl] to '1' if a newline is required to terminate the replay data. */ int i, n, m, l; int lines; assert (cb != NULL); assert (nlines != NULL); assert (*nlines >= -1); assert (cbuf_mutex_is_locked (cb)); n = m = l = 0; lines = *nlines; *nlines = 0; if (nl) { *nl = 0; /* init in case of early return */ } if ((lines == 0) || ((lines <= -1) && (chars <= 0))) { return (0); } if (cb->i_out == cb->i_rep) { return (0); /* no replay data available */ } if (lines > 0) { chars = -1; /* chars parm not used if lines > 0 */ } else { ++chars; /* incr to allow for preceding '\n' */ } /* Since the most recent line of replay data is considered implicitly * terminated, decrement the char count to account for the newline * if one is not present, or increment the line count if one is. * Note: cb->data[(O - 1 + (S+1)) % (S+1)] is the last replayable char. */ if (cb->data[(cb->i_out + cb->size) % (cb->size + 1)] != '\n') { if (nl) { *nl = 1; } --chars; } else { if (lines > 0) { ++lines; } --l; } i = cb->i_out; while (i != cb->i_rep) { i = (i + cb->size) % (cb->size + 1); /* (i - 1 + (S+1)) % (S+1) */ ++n; if (chars > 0) { --chars; } /* Complete lines are identified by a preceding newline. */ if (cb->data[i] == '\n') { if (lines > 0) { --lines; } m = n - 1; /* do not include preceding '\n' */ ++l; } if ((chars == 0) || (lines == 0)) { break; } } /* But the first line written in does not need a preceding newline. */ if ((!cb->got_wrap) && ((chars > 0) || (lines > 0))) { if (lines > 0) { --lines; } m = n; ++l; } if (lines > 0) { return (0); /* all or none, and not enough found */ } *nlines = l; return (m); } static int cbuf_find_unread_line (cbuf_t cb, int chars, int *nlines) { /* Finds the specified number of lines from the unread region of the buffer. * If ([nlines] > 0), returns the number of bytes comprising the line count, * or 0 if this number of lines is not available (ie, all or none). * If ([nlines] == -1), returns the number of bytes comprising the maximum * line count bounded by the number of characters specified by [chars]. * Only complete lines (ie, those terminated by a newline) are counted. * Sets the value-result parameter [nlines] to the number of lines found. */ int i, n, m, l; int lines; assert (cb != NULL); assert (nlines != NULL); assert (*nlines >= -1); assert (cbuf_mutex_is_locked (cb)); n = m = l = 0; lines = *nlines; *nlines = 0; if ((lines == 0) || ((lines <= -1) && (chars <= 0))) { return (0); } if (cb->used == 0) { return (0); /* no unread data available */ } if (lines > 0) { chars = -1; /* chars parm not used if lines > 0 */ } i = cb->i_out; while (i != cb->i_in) { ++n; if (chars > 0) { --chars; } if (cb->data[i] == '\n') { if (lines > 0) { --lines; } m = n; ++l; } if ((chars == 0) || (lines == 0)) { break; } i = (i + 1) % (cb->size + 1); } if (lines > 0) { return (0); /* all or none, and not enough found */ } *nlines = l; return (m); } static int cbuf_get_fd (void *dstbuf, int *psrcfd, int len) { /* Copies data from the file referenced by the file descriptor * pointed at by [psrcfd] into cbuf's [dstbuf]. * Returns the number of bytes read from the fd, 0 on EOF, or -1 on error. */ int n; assert (dstbuf != NULL); assert (psrcfd != NULL); assert (*psrcfd >= 0); assert (len > 0); do { n = read (*psrcfd, dstbuf, len); } while ((n < 0) && (errno == EINTR)); return (n); } static int cbuf_get_mem (void *dstbuf, unsigned char **psrcbuf, int len) { /* Copies data from the buffer pointed at by [psrcbuf] into cbuf's [dstbuf]. * Returns the number of bytes copied. */ assert (dstbuf != NULL); assert (psrcbuf != NULL); assert (*psrcbuf != NULL); assert (len > 0); memcpy (dstbuf, *psrcbuf, len); *psrcbuf += len; return (len); } static int cbuf_put_fd (void *srcbuf, int *pdstfd, int len) { /* Copies data from cbuf's [srcbuf] into the file referenced * by the file descriptor pointed at by [pdstfd]. * Returns the number of bytes written to the fd, or -1 on error. */ int n; assert (srcbuf != NULL); assert (pdstfd != NULL); assert (*pdstfd >= 0); assert (len > 0); do { n = write (*pdstfd, srcbuf, len); } while ((n < 0) && (errno == EINTR)); return (n); } static int cbuf_put_mem (void *srcbuf, unsigned char **pdstbuf, int len) { /* Copies data from cbuf's [srcbuf] into the buffer pointed at by [pdstbuf]. * Returns the number of bytes copied. */ assert (srcbuf != NULL); assert (pdstbuf != NULL); assert (*pdstbuf != NULL); assert (len > 0); memcpy (*pdstbuf, srcbuf, len); *pdstbuf += len; return (len); } static int cbuf_copier (cbuf_t src, cbuf_t dst, int len, int *ndropped) { /* Copies up to [len] bytes from the [src] cbuf into the [dst] cbuf. * Returns the number of bytes copied, or -1 on error (with errno set). * Sets [ndropped] (if not NULL) to the number of [dst] bytes overwritten. */ int ncopy, nfree, nleft, nrepl, n; int i_src, i_dst; assert (src != NULL); assert (dst != NULL); assert (len > 0); assert (cbuf_mutex_is_locked (src)); assert (cbuf_mutex_is_locked (dst)); /* Bound len by the number of bytes available. */ len = MIN (len, src->used); if (len == 0) { return (0); } /* Attempt to grow dst cbuf if necessary. */ nfree = dst->size - dst->used; if ((len > nfree) && (dst->size < dst->maxsize)) { nfree += cbuf_grow (dst, len - nfree); } /* Compute number of bytes to effectively copy to dst cbuf. */ if (dst->overwrite == CBUF_NO_DROP) { len = MIN (len, dst->size - dst->used); if (len == 0) { errno = ENOSPC; return (-1); } } else if (dst->overwrite == CBUF_WRAP_ONCE) { len = MIN (len, dst->size); } /* Compute number of bytes that will be overwritten in dst cbuf. */ if (ndropped) { *ndropped = MAX (0, len - dst->size + dst->used); } /* Compute number of bytes to physically copy to dst cbuf. This prevents * copying data that will overwritten if the cbuf wraps multiple times. */ ncopy = len; i_src = src->i_out; i_dst = dst->i_in; if (ncopy > dst->size) { n = ncopy - dst->size; i_src = (i_src + n) % (src->size + 1); ncopy -= n; } /* Copy data from src cbuf to dst cbuf. */ nleft = ncopy; while (nleft > 0) { n = MIN (((src->size + 1) - i_src), ((dst->size + 1) - i_dst)); n = MIN (n, nleft); memcpy (&dst->data[i_dst], &src->data[i_src], n); i_src = (i_src + n) % (src->size + 1); i_dst = (i_dst + n) % (dst->size + 1); nleft -= n; } /* Update dst cbuf metadata. */ if (ncopy > 0) { nrepl = (dst->i_out - dst->i_rep + (dst->size + 1)) % (dst->size + 1); dst->used = MIN (dst->used + ncopy, dst->size); assert (i_dst == (dst->i_in + ncopy) % (dst->size + 1)); dst->i_in = i_dst; if (ncopy > nfree - nrepl) { dst->got_wrap = 1; dst->i_rep = (dst->i_in + 1) % (dst->size + 1); } if (ncopy > nfree) { dst->i_out = dst->i_rep; } } return (len); } static int cbuf_dropper (cbuf_t cb, int len) { /* Discards exactly [len] bytes of unread data from [cb]. * Returns the number of bytes dropped. */ assert (cb != NULL); assert (len > 0); assert (len <= cb->used); assert (cbuf_mutex_is_locked (cb)); cb->used -= len; cb->i_out = (cb->i_out + len) % (cb->size + 1); /* Attempt to shrink cbuf if possible. */ if ((cb->size - cb->used > CBUF_CHUNK) && (cb->size > cb->minsize)) { cbuf_shrink (cb); } /* Don't call me clumsy, don't call me a fool. * When things fall down on me, I'm following the rule. */ return (len); } static int cbuf_reader (cbuf_t src, int len, cbuf_iof putf, void *dst) { /* Reads up to [len] bytes from [src] into the object pointed at by [dst]. * The I/O function [putf] specifies how data is written into [dst]. * Returns the number of bytes read, or -1 on error (with errno set). * Note that [dst] is a value-result parameter and will be "moved forward" * by the number of bytes written into it. */ int nleft, n, m; int i_src; assert (src != NULL); assert (len > 0); assert (putf != NULL); assert (dst != NULL); assert (cbuf_mutex_is_locked (src)); /* Bound len by the number of bytes available. */ len = MIN (len, src->used); if (len == 0) { return (0); } /* Copy data from src cbuf to dst obj. Do the cbuf hokey-pokey and * wrap-around the buffer at most once. Break out if putf() returns * either an ERR or a short count. */ i_src = src->i_out; nleft = len; m = 0; while (nleft > 0) { n = MIN (nleft, (src->size + 1) - i_src); m = putf (&src->data[i_src], dst, n); if (m > 0) { nleft -= m; i_src = (i_src + m) % (src->size + 1); } if (n != m) { break; /* got ERR or "short" putf() */ } } /* Compute number of bytes written to dst obj. */ n = len - nleft; assert ((n >= 0) && (n <= len)); /* * If no data has been written, return the ERR reported by putf(). */ if (n == 0) { return (m); } return (n); } static int cbuf_replayer (cbuf_t src, int len, cbuf_iof putf, void *dst) { /* Replays up to [len] bytes from [src] into the object pointed at by [dst]. * The I/O function [putf] specifies how data is written into [dst]. * Returns the number of bytes replayed, or -1 on error (with errno set). * Note that [dst] is a value-result parameter and will be "moved forward" * by the number of bytes written into it. */ int nleft, n, m; int i_src; assert (src != NULL); assert (len > 0); assert (putf != NULL); assert (dst != NULL); assert (cbuf_mutex_is_locked (src)); /* Bound len by the number of bytes available. */ n = (src->i_out - src->i_rep + (src->size + 1)) % (src->size + 1); len = MIN (len, n); if (len == 0) { return (0); } /* Copy data from src cbuf to dst obj. Do the cbuf hokey-pokey and * wrap-around the buffer at most once. Break out if putf() returns * either an ERR or a short count. */ i_src = (src->i_out - len + (src->size + 1)) % (src->size + 1); nleft = len; m = 0; while (nleft > 0) { n = MIN (nleft, (src->size + 1) - i_src); m = putf (&src->data[i_src], dst, n); if (m > 0) { nleft -= m; i_src = (i_src + m) % (src->size + 1); } if (n != m) { break; /* got ERR or "short" putf() */ } } /* Compute number of bytes written to dst obj. */ n = len - nleft; assert ((n >= 0) && (n <= len)); /* * If no data has been written, return the ERR reported by putf(). */ if (n == 0) { return (m); } return (n); } static int cbuf_writer (cbuf_t dst, int len, cbuf_iof getf, void *src, int *ndropped) { /* Writes up to [len] bytes from the object pointed at by [src] into [dst]. * The I/O function [getf] specifies how data is read from [src]. * Returns the number of bytes written, or -1 on error (with errno set). * Sets [ndropped] (if not NULL) to the number of [dst] bytes overwritten. * Note that [src] is a value-result parameter and will be "moved forward" * by the number of bytes read from it. */ int nfree, nleft, nrepl, n, m; int i_dst; assert (dst != NULL); assert (len > 0); assert (getf != NULL); assert (src != NULL); assert (cbuf_mutex_is_locked (dst)); /* Attempt to grow dst cbuf if necessary. */ nfree = dst->size - dst->used; if ((len > nfree) && (dst->size < dst->maxsize)) { nfree += cbuf_grow (dst, len - nfree); } /* Compute number of bytes to write to dst cbuf. */ if (dst->overwrite == CBUF_NO_DROP) { len = MIN (len, dst->size - dst->used); if (len == 0) { errno = ENOSPC; return (-1); } } else if (dst->overwrite == CBUF_WRAP_ONCE) { len = MIN (len, dst->size); } /* Copy data from src obj to dst cbuf. Do the cbuf hokey-pokey and * wrap-around the buffer as needed. Break out if getf() returns * either an EOF/ERR or a short count. */ i_dst = dst->i_in; nleft = len; m = 0; while (nleft > 0) { n = MIN (nleft, (dst->size + 1) - i_dst); m = getf (&dst->data[i_dst], src, n); if (m > 0) { nleft -= m; i_dst = (i_dst + m) % (dst->size + 1); } if (n != m) { break; /* got EOF/ERR or "short" getf() */ } } /* Compute number of bytes written to dst cbuf. */ n = len - nleft; assert ((n >= 0) && (n <= len)); /* * If no data has been written, return the EOF/ERR reported by getf(). */ if (n == 0) { return (m); } /* Update dst cbuf metadata. */ if (n > 0) { nrepl = (dst->i_out - dst->i_rep + (dst->size + 1)) % (dst->size + 1); dst->used = MIN (dst->used + n, dst->size); assert (i_dst == (dst->i_in + n) % (dst->size + 1)); dst->i_in = i_dst; if (n > nfree - nrepl) { dst->got_wrap = 1; dst->i_rep = (dst->i_in + 1) % (dst->size + 1); } if (n > nfree) { dst->i_out = dst->i_rep; } } if (ndropped) { *ndropped = MAX (0, n - nfree); } return (n); } static int cbuf_grow (cbuf_t cb, int n) { /* Attempts to grow the circular buffer [cb] by at least [n] bytes. * Returns the number of bytes by which the buffer has grown (which may be * less-than, equal-to, or greater-than the number of bytes requested). */ unsigned char *data; int size_old, size_meta; int m; assert (cb != NULL); assert (n > 0); assert (cbuf_mutex_is_locked (cb)); if (cb->size == cb->maxsize) { return (0); } size_old = cb->size; size_meta = cb->alloc - cb->size; /* size of sentinel & magic cookies */ assert (size_meta > 0); /* Attempt to grow data buffer by multiples of the chunk-size. */ m = cb->alloc + n; m = m + (CBUF_CHUNK - (m % CBUF_CHUNK)); m = MIN (m, (cb->maxsize + size_meta)); assert (m > cb->alloc); data = cb->data; #ifndef NDEBUG data -= CBUF_MAGIC_LEN; /* jump back to what malloc returned */ #endif /* !NDEBUG */ if (!(data = realloc (data, m))) { /* * XXX: Set flag or somesuch to prevent regrowing when out of memory? */ return (0); /* unable to grow data buffer */ } cb->data = data; cb->alloc = m; cb->size = m - size_meta; #ifndef NDEBUG /* A round cookie with one bite out of it looks like a C. * The underflow cookie will have been copied by realloc() if needed. * But the overflow cookie must be rebaked. * Must use memcpy since overflow cookie may not be word-aligned. */ cb->data += CBUF_MAGIC_LEN; /* jump forward past underflow magic */ memcpy (cb->data + cb->size + 1, (void *) &cb->magic, CBUF_MAGIC_LEN); #endif /* !NDEBUG */ /* The memory containing replay and unread data must be contiguous modulo * the buffer size. Additional memory must be inserted between where * new data is written in (i_in) and where replay data starts (i_rep). * If replay data wraps-around the old buffer, move it to the new end * of the buffer so it wraps-around in the same manner. */ if (cb->i_rep > cb->i_in) { n = (size_old + 1) - cb->i_rep; m = (cb->size + 1) - n; memmove (cb->data + m, cb->data + cb->i_rep, n); if (cb->i_out >= cb->i_rep) { cb->i_out += m - cb->i_rep; } cb->i_rep = m; } assert (cbuf_is_valid (cb)); return (cb->size - size_old); } static int cbuf_shrink (cbuf_t cb) { /* XXX: DOCUMENT ME. */ assert (cb != NULL); assert (cbuf_mutex_is_locked (cb)); assert (cbuf_is_valid (cb)); if (cb->size == cb->minsize) { return (0); } if (cb->size - cb->used <= CBUF_CHUNK) { return (0); } /* FIXME: NOT IMPLEMENTED. */ assert (cbuf_is_valid (cb)); return (0); } #ifndef NDEBUG #ifdef WITH_PTHREADS static int cbuf_mutex_is_locked (cbuf_t cb) { /* Returns true if the mutex is locked; o/w, returns false. */ int rc; assert (cb != NULL); rc = pthread_mutex_trylock (&cb->mutex); return (rc == EBUSY ? 1 : 0); } #endif /* WITH_PTHREADS */ #endif /* !NDEBUG */ #ifndef NDEBUG static int cbuf_is_valid (cbuf_t cb) { /* Validates the data structure. All invariants should be tested here. * Returns true if everything is valid; o/w, aborts due to assertion failure. */ int nfree; assert (cb != NULL); assert (cbuf_mutex_is_locked (cb)); assert (cb->data != NULL); assert (cb->magic == CBUF_MAGIC); /* * Must use memcmp since overflow cookie may not be word-aligned. */ assert (memcmp (cb->data - CBUF_MAGIC_LEN, (void *) &cb->magic, CBUF_MAGIC_LEN) == 0); assert (memcmp (cb->data + cb->size + 1, (void *) &cb->magic, CBUF_MAGIC_LEN) == 0); assert (cb->alloc > 0); assert (cb->alloc > cb->size); assert (cb->size > 0); assert (cb->size >= cb->minsize); assert (cb->size <= cb->maxsize); assert (cb->minsize > 0); assert (cb->maxsize > 0); assert (cb->used >= 0); assert (cb->used <= cb->size); assert (cb->overwrite == CBUF_NO_DROP || cb->overwrite == CBUF_WRAP_ONCE || cb->overwrite == CBUF_WRAP_MANY); assert (cb->got_wrap || !cb->i_rep);/* i_rep = 0 if data has not wrapped */ assert (cb->i_in >= 0); assert (cb->i_in <= cb->size); assert (cb->i_out >= 0); assert (cb->i_out <= cb->size); assert (cb->i_rep >= 0); assert (cb->i_rep <= cb->size); if (cb->i_in >= cb->i_out) { assert ((cb->i_rep > cb->i_in) || (cb->i_rep <= cb->i_out)); } else /* if (cb->in < cb->i_out) */ { assert ((cb->i_rep > cb->i_in) && (cb->i_rep <= cb->i_out)); } nfree = (cb->i_out - cb->i_in - 1 + (cb->size + 1)) % (cb->size + 1); assert (cb->size - cb->used == nfree); return (1); } #endif /* !NDEBUG */ powerman-2.3.5.orig/src/device_serial.c0000644000000000000000000001655711113347050014740 0ustar /*****************************************************************************\ * $Id: device_serial.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* * Implement connect/disconnect device methods for serial devices. */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "xtypes.h" #include "cbuf.h" #include "hostlist.h" #include "list.h" #include "parse_util.h" #include "xpoll.h" #include "xmalloc.h" #include "pluglist.h" #include "arglist.h" #include "xregex.h" #include "device_private.h" #include "device_serial.h" #include "error.h" #include "debug.h" #include "xpty.h" typedef struct { char *special; char *flags; } SerialDev; typedef struct { int baud; speed_t bconst; } baudmap_t; static baudmap_t baudmap[] = { {300, B300}, {1200, B1200}, {2400, B2400}, {4800, B4800}, {9600, B9600}, {19200, B19200}, {38400, B38400}, #ifdef B57600 {57600, B57600}, #endif #ifdef B115200 {115200,B115200}, #endif #ifdef B230400 {230400,B230400}, #endif #ifdef B460800 {460800,B460800}, #endif }; void *serial_create(char *special, char *flags) { SerialDev *ser = (SerialDev *)xmalloc(sizeof(SerialDev)); ser->special = xstrdup(special); ser->flags = xstrdup(flags); return (void *)ser; } void serial_destroy(void *data) { SerialDev *ser = (SerialDev *)data; if (ser->special) xfree(ser->special); if (ser->flags) xfree(ser->flags); xfree(ser); } /* Set up serial port: 0 on success, <0 on error */ static int _serial_setup(char *devname, int fd, int baud, int databits, char parity, int stopbits) { int res; struct termios tio; int i; res = tcgetattr(fd, &tio); if (res < 0) { err(TRUE, "%s: error getting serial attributes", devname); return -1; } res = -1; for (i = 0; i < sizeof(baudmap)/sizeof(baudmap_t); i++) { if (baudmap[i].baud == baud) { if ((res = cfsetispeed(&tio, baudmap[i].bconst)) == 0) res = cfsetospeed(&tio, baudmap[i].bconst); break; } } if (res < 0) { err(FALSE, "%s: error setting baud rate to %d", devname, baud); return -1; } switch (databits) { case 7: tio.c_cflag &= ~CSIZE; tio.c_cflag |= CS7; break; case 8: tio.c_cflag &= ~CSIZE; tio.c_cflag |= CS8; break; default: err(FALSE, "%s: error setting data bits to %d", devname, databits); return -1; } switch (stopbits) { case 1: tio.c_cflag &= ~CSTOPB; break; case 2: tio.c_cflag |= CSTOPB; break; default: err(FALSE, "%s: error setting stop bits to %d", devname, stopbits); return -1; } switch (parity) { case 'n': case 'N': tio.c_cflag &= ~PARENB; break; case 'e': case 'E': tio.c_cflag |= PARENB; tio.c_cflag &= ~PARODD; break; case 'o': case 'O': tio.c_cflag |= PARENB; tio.c_cflag |= PARODD; break; default: err(FALSE, "%s: error setting parity to %c", devname, parity); return -1; } tio.c_oflag &= ~OPOST; /* turn off post-processing of output */ tio.c_iflag = tio.c_lflag = 0; if (tcsetattr(fd, TCSANOW, &tio) < 0) { err(TRUE, "%s: error setting serial attributes", devname); return -1; } return 0; } /* * Open the special file associated with this device. */ bool serial_connect(Device * dev) { SerialDev *ser; int baud = 9600, databits = 8, stopbits = 1; char parity = 'N'; int res; int n; assert(dev->magic == DEV_MAGIC); assert(dev->connect_state == DEV_NOT_CONNECTED); assert(dev->fd == NO_FD); ser = (SerialDev *)dev->data; dev->fd = open(ser->special, O_RDWR | O_NONBLOCK | O_NOCTTY); if (dev->fd < 0) { err(TRUE, "_serial_connect(%s): open %s", dev->name, ser->special); goto out; } if (!isatty(dev->fd)) { err(FALSE, "_serial_connect(%s): not a tty", dev->name); goto out; } /* [lifted from conman] According to the UNIX Programming FAQ v1.37 * * (Section 3.6: How to Handle a Serial Port or Modem), * systems seem to differ as to whether a nonblocking * open on a tty will affect subsequent read()s. * Play it safe and be explicit! */ nonblock_set(dev->fd); /* Conman takes an fcntl F_WRLCK on serial devices. * Powerman should respect conman's locks and vice-versa. */ if (lockf(dev->fd, F_TLOCK, 0) < 0) { err(TRUE, "_serial_connect(%s): could not lock device\n", dev->name); goto out; } /* parse the serial flags and set up port accordingly */ n = sscanf(ser->flags, "%d,%d%c%d", &baud, &databits, &parity, &stopbits); assert(n >= 0 && n <= 4); /* 0-4 matches OK (defaults if no match) */ res = _serial_setup(dev->name, dev->fd, baud, databits, parity, stopbits); if (res < 0) goto out; dev->connect_state = DEV_CONNECTED; dev->stat_successful_connects++; err(FALSE, "_serial_connect(%s): opened", dev->name); return TRUE; out: if (dev->fd >= 0) { if (close(dev->fd) < 0) err(TRUE, "_serial_connect(%s): close", dev->name); dev->fd = NO_FD; } return FALSE; } /* * Close the special file associated with this device. */ void serial_disconnect(Device * dev) { assert(dev->connect_state == DEV_CONNECTED); dbg(DBG_DEVICE, "_serial_disconnect: %s on fd %d", dev->name, dev->fd); /* close device if open */ if (dev->fd >= 0) { if (close(dev->fd) < 0) err(TRUE, "_serial_disconnect(%s): close", dev->name); dev->fd = NO_FD; } err(FALSE, "_serial_disconnect(%s): closed", dev->name); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/cbuf.h0000644000000000000000000003221311113347050013051 0ustar /***************************************************************************** * $Id: cbuf.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2002-2005 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * * LSD-Tools 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. * * LSD-Tools 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 LSD-Tools; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ #ifndef LSD_CBUF_H #define LSD_CBUF_H /***************************************************************************** * Notes *****************************************************************************/ /* * Cbuf is a circular-buffer capable of dynamically resizing itself. * Unread data in the buffer will be overwritten once the cbuf has * reached its maximum size or is unable to allocate additional memory. * * The CBUF_OPT_OVERWRITE option specifies how unread cbuf data will * be overwritten. If set to CBUF_NO_DROP, unread data will never be * overwritten; writes into the cbuf will return -1 with ENOSPC. If set * to CBUF_WRAP_ONCE, a single write operation will wrap-around the buffer * at most once, and up to cbuf_used() bytes of data may be overwritten. * If set to CBUF_WRAP_MANY, a single write operation will wrap-around the * buffer as many times as needed in order to write all of the data. * * If NDEBUG is not defined, internal debug code will be enabled. This is * intended for development use only and production code should define NDEBUG. * * If WITH_LSD_FATAL_ERROR_FUNC is defined, the linker will expect to * find an external lsd_fatal_error(file,line,mesg) function. By default, * lsd_fatal_error(file,line,mesg) is a macro definition that outputs an * error message to stderr. This macro may be redefined to invoke another * routine instead. * * If WITH_LSD_NOMEM_ERROR_FUNC is defined, the linker will expect to * find an external lsd_nomem_error(file,line,mesg) function. By default, * lsd_nomem_error(file,line,mesg) is a macro definition that returns NULL. * This macro may be redefined to invoke another routine instead. * * If WITH_PTHREADS is defined, these routines will be thread-safe. */ /***************************************************************************** * Data Types *****************************************************************************/ typedef struct cbuf * cbuf_t; /* circular-buffer opaque data type */ typedef enum { /* cbuf option names */ CBUF_OPT_OVERWRITE } cbuf_opt_t; typedef enum { /* CBUF_OPT_OVERWRITE values: */ CBUF_NO_DROP, /* -never drop data, ENOSPC if full */ CBUF_WRAP_ONCE, /* -drop data, wrapping at most once */ CBUF_WRAP_MANY /* -drop data, wrapping as needed */ } cbuf_overwrite_t; /***************************************************************************** * Functions *****************************************************************************/ cbuf_t cbuf_create (int minsize, int maxsize); /* * Creates and returns a new circular buffer, or lsd_nomem_error() on failure. * The buffer is initially allocated to hold [minsize] bytes of data, * but can attempt to grow up to [maxsize] bytes before overwriting data. * Set minsize = maxsize to prevent cbuf from dynamically resizing itself. * The default overwrite option behavior is CBUF_WRAP_MANY. * Abandoning a cbuf without calling cbuf_destroy() will cause a memory leak. */ void cbuf_destroy (cbuf_t cb); /* * Destroys the circular buffer [cb]. */ void cbuf_flush (cbuf_t cb); /* * Flushes all data (including replay data) in [cb]. */ int cbuf_size (cbuf_t cb); /* * Returns the maximum size of the buffer allocated to [cb] * (ie, the number of bytes it can currently hold). */ int cbuf_free (cbuf_t cb); /* * Returns the number of bytes in [cb] available for writing before unread * data is overwritten (assuming the cbuf can resize itself if needed). */ int cbuf_used (cbuf_t cb); /* * Returns the number of bytes in [cb] available for reading. */ int cbuf_lines_used (cbuf_t cb); /* * Returns the number of lines in [cb] available for reading. */ int cbuf_reused (cbuf_t cb); /* * Returns the number of bytes in [cb] available for replaying/rewinding. */ int cbuf_lines_reused (cbuf_t cb); /* * Returns the number of lines in [cb] available for replaying/rewinding. */ int cbuf_is_empty (cbuf_t cb); /* * Returns non-zero if [cb] is empty; o/w, returns zero. */ int cbuf_opt_get (cbuf_t cb, cbuf_opt_t name, int *value); /* * Gets the [name] option for [cb] and sets [value] to the result. * Returns 0 on success, or -1 on error (with errno set). */ int cbuf_opt_set (cbuf_t cb, cbuf_opt_t name, int value); /* * Sets the [name] option for [cb] to [value]. * Returns 0 on success, or -1 on error (with errno set). */ int cbuf_drop (cbuf_t src, int len); /* * Discards up to [len] bytes of unread data from [src]; * if [len] is -1, all unread data will be dropped. * Dropped data is still available via the replay buffer. * Returns the number of bytes dropped, or -1 on error (with errno set). */ int cbuf_peek (cbuf_t src, void *dstbuf, int len); /* * Reads up to [len] bytes of data from the [src] cbuf into [dstbuf], * but does not consume the data read from the cbuf. * The "peek" can be committed to the cbuf via a call to cbuf_drop(), * but the peek+drop combination is not atomic. * Returns the number of bytes read, or -1 on error (with errno set). */ int cbuf_read (cbuf_t src, void *dstbuf, int len); /* * Reads up to [len] bytes of data from the [src] cbuf into [dstbuf]. * Returns the number of bytes read, or -1 on error (with errno set). */ int cbuf_replay (cbuf_t src, void *dstbuf, int len); /* * Replays up to [len] bytes of previously read data from the [src] cbuf * into [dstbuf]. * Returns the number of bytes replayed, or -1 on error (with errno set). */ int cbuf_rewind (cbuf_t src, int len); /* * Rewinds [src] by up to [len] bytes, placing previously read data back in * the unread data buffer; if [len] is -1, all replay data will be rewound. * Returns the number of bytes rewound, or -1 on error (with errno set). */ int cbuf_write (cbuf_t dst, void *srcbuf, int len, int *ndropped); /* * Writes up to [len] bytes of data from [srcbuf] into the [dst] cbuf * according to dst's CBUF_OPT_OVERWRITE behavior. * Returns the number of bytes written, or -1 on error (with errno set). * Sets [ndropped] (if not NULL) to the number of bytes overwritten. */ int cbuf_drop_line (cbuf_t src, int len, int lines); /* * Discards the specified [lines] of data from [src]. If [lines] is -1, * discards the maximum number of lines comprised of up to [len] characters. * Dropped data is still available via the replay buffer. * Returns the number of bytes dropped, or -1 on error (with errno set). * Returns 0 if the number of lines is not available (ie, all or none). */ int cbuf_peek_line (cbuf_t src, char *dstbuf, int len, int lines); /* * Reads the specified [lines] of data from the [src] cbuf into [dstbuf], * but does not consume the data read from the cbuf. If [lines] is -1, * reads the maximum number of lines that [dstbuf] can hold. The buffer * will be NUL-terminated and contain at most ([len] - 1) characters. * The "peek" can be committed to the cbuf via a call to cbuf_drop(), * but the peek+drop combination is not atomic. * Returns strlen of the line(s) on success; truncation occurred if >= [len]. * Returns 0 if the number of lines is not available (ie, all or none). * Returns -1 on error (with errno set). */ int cbuf_read_line (cbuf_t src, char *dstbuf, int len, int lines); /* * Reads the specified [lines] of data from the [src] cbuf into [dstbuf]. * If [lines] is -1, reads the maximum number of lines that [dstbuf] * can hold. The buffer will be NUL-terminated and contain at most * ([len] - 1) characters. * Returns strlen of the line(s) on success; truncation occurred if >= [len], * in which case excess line data is discarded. Returns 0 if the number * of lines is not available (ie, all or none), in which case no data is * consumed. Returns -1 on error (with errno set). */ int cbuf_replay_line (cbuf_t src, char *dstbuf, int len, int lines); /* * Replays the specified [lines] of data from the [src] cbuf into [dstbuf]. * If [lines] is -1, replays the maximum number of lines that [dstbuf] * can hold. A newline will be appended to [dstbuf] if the last (ie, most * recently read) line does not contain a trailing newline. The buffer * will be NUL-terminated and contain at most ([len] - 1) characters. * Returns strlen of the line(s) on success; truncation occurred if >= [len]. * Returns 0 if the number of lines is not available (ie, all or none). * Returns -1 on error (with errno set). */ int cbuf_rewind_line (cbuf_t src, int len, int lines); /* * Rewinds [src] by the specified [lines] of data, placing previously read * data back in the unread data buffer. If [lines] is -1, rewinds the * maximum number of lines comprised of up to [len] characters. * Returns the number of bytes rewound, or -1 on error (with errno set). * Returns 0 if the number of lines is not available (ie, all or none). */ int cbuf_write_line (cbuf_t dst, char *srcbuf, int *ndropped); /* * Writes the entire NUL-terminated [srcbuf] string into the [dst] cbuf * according to dst's CBUF_OPT_OVERWRITE behavior. A newline will be * appended to the cbuf if [srcbuf] does not contain a trailing newline. * Returns the number of bytes written, or -1 or error (with errno set). * Sets [ndropped] (if not NULL) to the number of bytes overwritten. */ int cbuf_peek_to_fd (cbuf_t src, int dstfd, int len); /* * Reads up to [len] bytes of data from the [src] cbuf into the file * referenced by the [dstfd] file descriptor, but does not consume the * data read from the cbuf. If [len] is -1, it will be set to the number * of [src] bytes available for reading. * The "peek" can be committed to the cbuf via a call to cbuf_drop(), * but the peek+drop combination is not atomic. * Returns the number of bytes read, or -1 on error (with errno set). */ int cbuf_read_to_fd (cbuf_t src, int dstfd, int len); /* * Reads up to [len] bytes of data from the [src] cbuf into the file * referenced by the [dstfd] file descriptor. If [len] is -1, it will * be set to the number of [src] bytes available for reading. * Returns the number of bytes read, or -1 on error (with errno set). */ int cbuf_replay_to_fd (cbuf_t src, int dstfd, int len); /* * Replays up to [len] bytes of previously read data from the [src] cbuf into * the file referenced by the [dstfd] file descriptor. If [len] is -1, it * will be set to the maximum number of [src] bytes available for replay. * Returns the number of bytes replayed, or -1 on error (with errno set). */ int cbuf_write_from_fd (cbuf_t dst, int srcfd, int len, int *ndropped); /* * Writes up to [len] bytes of data from the file referenced by the * [srcfd] file descriptor into the [dst] cbuf according to dst's * CBUF_OPT_OVERWRITE behavior. If [len] is -1, it will be set to * an appropriate chunk size. * Returns the number of bytes written, 0 on EOF, or -1 on error (with errno). * Sets [ndropped] (if not NULL) to the number of bytes overwritten. */ int cbuf_copy (cbuf_t src, cbuf_t dst, int len, int *ndropped); /* * Copies up to [len] bytes of data from the [src] cbuf into the [dst] cbuf * according to dst's CBUF_OPT_OVERWRITE behavior. If [len] is -1, * it will be set to the number of [src] bytes available for reading. * Returns the number of bytes copied, or -1 on error (with errno set). * Sets [ndropped] (if not NULL) to the number of [dst] bytes overwritten. */ int cbuf_move (cbuf_t src, cbuf_t dst, int len, int *ndropped); /* * Moves up to [len] bytes of data from the [src] cbuf into the [dst] cbuf * according to dst's CBUF_OPT_OVERWRITE behavior. If [len] is -1, * it will be set to the number of [src] bytes available for reading. * Returns the number of bytes moved, or -1 on error (with errno set). * Sets [ndropped] (if not NULL) to the number of [dst] bytes overwritten. */ #endif /* !LSD_CBUF_H */ powerman-2.3.5.orig/src/xread.c0000644000000000000000000000574611113347050013243 0ustar /*****************************************************************************\ * $Id: xread.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "xread.h" #include "xtypes.h" #include "error.h" int xread(int fd, char *p, int max) { int n; do { n = read(fd, p, max); } while (n < 0 && errno == EINTR); if (n < 0 && errno != EWOULDBLOCK && errno != ECONNRESET) err_exit(TRUE, "read"); return n; } int xwrite(int fd, char *p, int max) { int n; do { n = write(fd, p, max); } while (n < 0 && errno == EINTR); if (n < 0 && errno != EAGAIN && errno != ECONNRESET && errno != EPIPE) err_exit(TRUE, "write"); return n; } void xwrite_all(int fd, char *p, int count) { int n; int done = 0; while (done < count) { n = xwrite(fd, p + done, count - done); if (n < 0) err_exit(TRUE, "write"); done += n; } } void xread_all(int fd, char *p, int count) { int n; int done = 0; while (done < count) { n = xread(fd, p + done, count - done); if (n < 0) err_exit(TRUE, "read"); if (n == 0) err_exit(FALSE, "EOF on read"); done += n; } } static void _zap_trailing_whitespace(char *s) { char *p = s + strlen(s) - 1; while (p >= s && isspace(*p)) *p-- = '\0'; } char *xreadline(char *prompt, char *buf, int buflen) { printf("%s", prompt); fflush(stdout); if (fgets(buf, buflen, stdin) == NULL) return NULL; _zap_trailing_whitespace(buf); return buf; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/powerman.c0000644000000000000000000004620611164745453014003 0ustar /*****************************************************************************\ * $Id: powerman.c 1125 2009-04-01 20:14:35Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #if HAVE_GETOPT_H #include #endif #if HAVE_GENDERS_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "powerman.h" #include "xmalloc.h" #include "xtypes.h" #include "xread.h" #include "error.h" #include "hostlist.h" #include "client_proto.h" #include "debug.h" #include "argv.h" #include "xpty.h" #include "hprintf.h" #include "argv.h" #include "list.h" #define CMD_MAGIC 0x5565aafd typedef struct { int magic; char *fmt; char **argv; char *sendstr; } cmd_t; #if WITH_GENDERS static void _push_genders_hosts(hostlist_t targets, char *s); #endif static int _connect_to_server_tcp(char *host, char *port); static int _connect_to_server_pipe(char *server_path, char *config_path, bool short_circuit_delays); static void _usage(void); static void _license(void); static void _version(void); static void _getline(int fd, char *str, int len); static int _process_line(int fd); static void _expect(int fd, char *str); static int _process_response(int fd); static void _process_version(int fd); static void _cmd_create(List cl, char *fmt, char *arg, bool prepend); static void _cmd_destroy(cmd_t *cp); static void _cmd_append(cmd_t *cp, char *arg); static void _cmd_prepare(cmd_t *cp, bool genders); static int _cmd_execute(cmd_t *cp, int fd); static void _cmd_print(cmd_t *cp); static char *prog; #define OPTIONS "0:1:c:r:f:u:B:blQ:qP:tD:dTxgh:S:C:YVLZI" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { {"on", required_argument, 0, '1'}, {"off", required_argument, 0, '0'}, {"cycle", required_argument, 0, 'c'}, {"reset", required_argument, 0, 'r'}, {"flash", required_argument, 0, 'f'}, {"unflash", required_argument, 0, 'u'}, {"beacon", required_argument, 0, 'B'}, {"beacon-all", no_argument, 0, 'b'}, {"list", no_argument, 0, 'l'}, {"query", required_argument, 0, 'Q'}, {"query-all", no_argument, 0, 'q'}, {"temp", required_argument, 0, 'P'}, {"temp-all", no_argument, 0, 't'}, {"device", required_argument, 0, 'D'}, {"device-all", no_argument, 0, 'd'}, {"telemetry", no_argument, 0, 'T'}, {"exprange", no_argument, 0, 'x'}, {"genders", no_argument, 0, 'g'}, {"server-host", required_argument, 0, 'h'}, {"server-path", required_argument, 0, 'S'}, {"config-path", required_argument, 0, 'C'}, {"short-circuit-delays", no_argument, 0, 'Y'}, {"version", no_argument, 0, 'V'}, {"license", no_argument, 0, 'L'}, {"dump-cmds", no_argument, 0, 'Z'}, {"ignore-errs", no_argument, 0, 'I'}, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char **argv) { int c; int res = 0; int server_fd; char *p, *port = DFLT_PORT; char *host = DFLT_HOSTNAME; bool genders = FALSE; bool dumpcmds = FALSE; bool ignore_errs = FALSE; char *server_path = NULL; char *config_path = NULL; List commands; /* list-o-cmd_t's */ ListIterator itr; cmd_t *cp; bool short_circuit_delays = FALSE; prog = basename(argv[0]); err_init(prog); commands = list_create((ListDelF)_cmd_destroy); /* Parse options. */ opterr = 0; while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case '1': /* --on */ _cmd_create(commands, CP_ON, optarg, FALSE); break; case '0': /* --off */ _cmd_create(commands, CP_OFF, optarg, FALSE); break; case 'c': /* --cycle */ _cmd_create(commands, CP_CYCLE, optarg, FALSE); break; case 'r': /* --reset */ _cmd_create(commands, CP_RESET, optarg, FALSE); break; case 'l': /* --list */ _cmd_create(commands, CP_NODES, NULL, FALSE); break; case 'Q': /* --query */ _cmd_create(commands, CP_STATUS, optarg, FALSE); break; case 'q': /* --query-all */ _cmd_create(commands, CP_STATUS_ALL, NULL, FALSE); break; case 'f': /* --flash */ _cmd_create(commands, CP_BEACON_ON, optarg, FALSE); break; case 'u': /* --unflash */ _cmd_create(commands, CP_BEACON_OFF, optarg, FALSE); break; case 'B': /* --beacon */ _cmd_create(commands, CP_BEACON, optarg, FALSE); break; case 'b': /* --beacon-all */; _cmd_create(commands, CP_BEACON_ALL, NULL, FALSE); break; case 'P': /* --temp */ _cmd_create(commands, CP_TEMP, optarg, FALSE); break; case 't': /* --temp-all */ _cmd_create(commands, CP_TEMP_ALL, NULL, FALSE); break; case 'D': /* --device */ _cmd_create(commands, CP_DEVICE, optarg, FALSE); break; case 'd': /* --device-all */ _cmd_create(commands, CP_DEVICE_ALL, NULL, FALSE); break; case 'Y': /* --short-circuit-delays */ short_circuit_delays = TRUE; break; case 'h': /* --server-host host[:port] */ if ((p = strchr(optarg, ':'))) { *p++ = '\0'; port = p; } host = optarg; break; case 'L': /* --license */ _license(); /*NOTREACHED*/ break; case 'V': /* --version */ _version(); /*NOTREACHED*/ break; case 'T': /* --telemetry */ _cmd_create(commands, CP_TELEMETRY, NULL, TRUE); break; case 'x': /* --exprange */ _cmd_create(commands, CP_EXPRANGE, NULL, TRUE); break; case 'g': /* --genders */ #if WITH_GENDERS genders = TRUE; #else err_exit(FALSE, "not configured with genders support"); #endif break; case 'S': /* --server-path */ server_path = optarg; break; case 'C': /* --config-path */ config_path = optarg; break; case 'Z': /* --dump-cmds */ dumpcmds = TRUE; break; case 'I': /* --ignore-errs */ ignore_errs = TRUE; break; default: _usage(); /*NOTREACHED*/ break; } } if (list_is_empty(commands)) _usage(); if (short_circuit_delays && !server_path) _usage(); /* For backwards compat with powerman 2.0 and earlier, * additional arguments are more targets for last command. */ if (optind < argc) { cmd_t *last = NULL; itr = list_iterator_create(commands); while ((cp = list_next(itr))) last = cp; list_iterator_destroy(itr); if (last == NULL) _usage(); while (optind < argc) { _cmd_append(last, argv[optind]); optind++; } } /* Prepare commands for processing. */ itr = list_iterator_create(commands); while ((cp = list_next(itr))) _cmd_prepare(cp, genders); list_iterator_destroy(itr); /* Dump commands and exit if requested. */ if (dumpcmds) { itr = list_iterator_create(commands); while ((cp = list_next(itr))) _cmd_print(cp); list_iterator_destroy(itr); exit(0); } /* Establish connection to server and start protocol. */ if (server_path) server_fd = _connect_to_server_pipe(server_path, config_path, short_circuit_delays); else server_fd = _connect_to_server_tcp(host, port); _process_version(server_fd); _expect(server_fd, CP_PROMPT); /* Execute the commands. */ itr = list_iterator_create(commands); while ((cp = list_next(itr))) { res = _cmd_execute(cp, server_fd); if (ignore_errs) res = 0; if (res != 0) break; } list_iterator_destroy(itr); list_destroy(commands); /* Disconnect from server. */ hfdprintf(server_fd, "%s%s", CP_QUIT, CP_EOL); _expect(server_fd, CP_RSP_QUIT); exit(res); } /* Display powerman usage and exit. */ static void _usage(void) { printf("Usage: %s [action] [targets]\n", prog); printf("-1,--on targets Power on targets\n"); printf("-0,--off targets Power off targets\n"); printf("-c,--cycle targets Power cycle targets\n"); printf("-q,--query-all Query power state of all targets\n"); printf("-Q,--query targets Query power state of specific targets\n"); exit(1); } /* Display powerman license and exit. */ static void _license(void) { printf( "Copyright (C) 2001-2008 The Regents of the University of California.\n" "Produced at Lawrence Livermore National Laboratory.\n" "Written by Andrew Uselton .\n" "http://www.llnl.gov/linux/powerman/\n" "UCRL-CODE-2002-008\n\n" "PowerMan is free software; you can redistribute it and/or modify it\n" "under the terms of the GNU General Public License as published by\n" "the Free Software Foundation.\n"); exit(1); } /* Display powerman version and exit. */ static void _version(void) { printf("%s\n", META_VERSION); exit(1); } #if WITH_GENDERS static void _push_genders_hosts(hostlist_t targets, char *s) { genders_t g; char **nodes; int len, n, i; if (strlen(s) == 0) return; if (!(g = genders_handle_create())) err_exit(FALSE, "genders_handle_create failed"); if (genders_load_data(g, NULL) < 0) err_exit(FALSE, "genders_load_data: %s", genders_errormsg(g)); if ((len = genders_nodelist_create(g, &nodes)) < 0) err_exit(FALSE, "genders_nodelist_create: %s", genders_errormsg(g)); if ((n = genders_query(g, nodes, len, s)) < 0) err_exit(FALSE, "genders_query: %s", genders_errormsg(g)); genders_handle_destroy(g); if (n == 0) err_exit(FALSE, "genders expression did not match any nodes"); for (i = 0; i < n; i++) { if (!hostlist_push(targets, nodes[i])) err_exit(FALSE, "hostlist error"); } } #endif static void _cmd_create(List cl, char *fmt, char *arg, bool prepend) { cmd_t *cp = (cmd_t *)xmalloc(sizeof(cmd_t)); cp->magic = CMD_MAGIC; cp->fmt = fmt; cp->argv = NULL; cp->sendstr = NULL; if (arg) cp->argv = argv_create(arg, ""); if (prepend) list_prepend(cl, cp); else list_append(cl, cp); } static void _cmd_destroy(cmd_t *cp) { assert(cp->magic == CMD_MAGIC); cp->magic = 0; if (cp->sendstr) xfree(cp->sendstr); if (cp->argv) argv_destroy(cp->argv); xfree(cp); } static void _cmd_append(cmd_t *cp, char *arg) { assert(cp->magic == CMD_MAGIC); if (cp->argv == NULL) { if (!strcmp(cp->fmt, CP_STATUS_ALL)) { cp->fmt = CP_STATUS; cp->argv = argv_create(arg, ""); } else if (!strcmp(cp->fmt, CP_BEACON_ALL)) { cp->fmt = CP_BEACON; cp->argv = argv_create(arg, ""); } else if (!strcmp(cp->fmt, CP_DEVICE_ALL)) { cp->fmt = CP_DEVICE; cp->argv = argv_create(arg, ""); } else if (!strcmp(cp->fmt, CP_TEMP_ALL)) { cp->fmt = CP_TEMP; cp->argv = argv_create(arg, ""); } else err_exit(FALSE, "option takes no arguments"); } else cp->argv = argv_append(cp->argv, arg); } static void _cmd_prepare(cmd_t *cp, bool genders) { char tmpstr[CP_LINEMAX]; hostlist_t hl; int i; assert(cp->magic == CMD_MAGIC); assert(cp->sendstr == NULL); tmpstr[0] = '\0'; if (cp->argv) { hl = hostlist_create(NULL); for (i = 0; i < argv_length(cp->argv); i++) { if (genders) { #if WITH_GENDERS _push_genders_hosts(hl, cp->argv[i]); #endif } else { if (hostlist_push(hl, cp->argv[i]) == 0) err_exit(FALSE, "hostlist error"); } } if (hostlist_ranged_string(hl, sizeof(tmpstr), tmpstr) == -1) err_exit(FALSE, "hostlist error"); hostlist_destroy(hl); } cp->sendstr = hsprintf(cp->fmt, tmpstr); } static int _cmd_execute(cmd_t *cp, int fd) { int res; assert(cp->magic == CMD_MAGIC); assert(cp->sendstr != NULL); hfdprintf(fd, "%s%s", cp->sendstr, CP_EOL); res = _process_response(fd); _expect(fd, CP_PROMPT); return res; } static void _cmd_print(cmd_t *cp) { assert(cp->magic == CMD_MAGIC); assert(cp->sendstr != NULL); printf("%s%s", cp->sendstr, CP_EOL); } static int _connect_to_server_pipe(char *server_path, char *config_path, bool short_circuit_delays) { int saved_stderr; char cmd[128]; char **argv; pid_t pid; int fd; saved_stderr = dup(STDERR_FILENO); if (saved_stderr < 0) err_exit(TRUE, "dup stderr"); snprintf(cmd, sizeof(cmd), "powermand -sf -c %s", config_path); argv = argv_create(cmd, ""); if (short_circuit_delays) argv = argv_append(argv, "-Y"); pid = xforkpty(&fd, NULL, 0); switch (pid) { case -1: err_exit(TRUE, "forkpty error"); case 0: /* child */ if (dup2(saved_stderr, STDERR_FILENO) < 0) err_exit(TRUE, "dup2 stderr"); close(saved_stderr); xcfmakeraw(STDIN_FILENO); execv(server_path, argv); err_exit(TRUE, "exec %s", server_path); default: /* parent */ close(saved_stderr); break; } argv_destroy(argv); return fd; } static int _connect_to_server_tcp(char *host, char *port) { int error, fd = -1; struct addrinfo hints, *res, *r; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if ((error = getaddrinfo(host, port, &hints, &res)) != 0) err_exit(FALSE, "getaddrinfo %s:%s: %s", host, port, gai_strerror(error)); if (res == NULL) err_exit(FALSE, "no addresses for server %s:%s", host, port); for (r = res; r != NULL; r = r->ai_next) { if ((fd = socket(r->ai_family, r->ai_socktype, 0)) < 0) continue; if (connect(fd, r->ai_addr, r->ai_addrlen) < 0) { close(fd); continue; } break; /* success! */ } if (r == NULL) err_exit(FALSE, "could not connect to address %s:%s", host, port); freeaddrinfo(res); return fd; } /* Return true if response should be suppressed. */ static bool _supress(int num) { if (strtol(CP_RSP_QRY_COMPLETE, NULL, 10) == num) return TRUE; if (strtol(CP_RSP_TELEMETRY, NULL, 10) == num) return TRUE; if (strtol(CP_RSP_EXPRANGE, NULL, 10) == num) return TRUE; return FALSE; } /* Read a line of data terminated with \r\n or just \n. */ static void _getline(int fd, char *buf, int size) { while (size > 1) { /* leave room for terminating null */ if (xread(fd, buf, 1) <= 0) err_exit(TRUE, "lost connection with server"); if (*buf == '\r') continue; if (*buf == '\n') break; size--; buf++; } *buf = '\0'; } /* Get a line from the socket and display on stdout. * Return the numerical portion of the repsonse. */ static int _process_line(int fd) { char buf[CP_LINEMAX]; long int num; _getline(fd, buf, CP_LINEMAX); num = strtol(buf, NULL, 10); if (num == LONG_MIN || num == LONG_MAX) num = -1; if (strlen(buf) > 4) { if (!_supress(num)) printf("%s\n", buf + 4); } else err_exit(FALSE, "unexpected response from server"); return num; } /* Read version and warn if it doesn't match the client's. */ static void _process_version(int fd) { char buf[CP_LINEMAX], vers[CP_LINEMAX]; _getline(fd, buf, CP_LINEMAX); if (sscanf(buf, CP_VERSION, vers) != 1) err_exit(FALSE, "unexpected response from server"); if (strcmp(vers, META_VERSION) != 0) err(FALSE, "warning: server version (%s) != client (%s)", vers, META_VERSION); } static int _process_response(int fd) { int num; do { num = _process_line(fd); } while (!CP_IS_ALLDONE(num)); return (CP_IS_FAILURE(num) ? num : 0); } /* Read strlen(str) bytes from file descriptor and exit if * it doesn't match 'str'. */ static void _expect(int fd, char *str) { char buf[CP_LINEMAX]; int len = strlen(str); char *p = buf; int res; assert(len < sizeof(buf)); do { res = xread(fd, p, len); if (res < 0) err_exit(TRUE, "lost connection with server"); p += res; *p = '\0'; len -= res; } while (strcmp(str, buf) != 0 && len > 0); /* Shouldn't happen. We are not handling the general case of the server * returning the wrong response. Read() loop above may hang in that case. */ if (strcmp(str, buf) != 0) err_exit(FALSE, "unexpected response from server"); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/hash.c0000644000000000000000000002665211113347050013062 0ustar /***************************************************************************** * $Id: hash.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * * LSD-Tools 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. * * LSD-Tools 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 LSD-Tools; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ***************************************************************************** * Refer to "hash.h" for documentation on public functions. *****************************************************************************/ #if HAVE_CONFIG_H # include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #if WITH_PTHREADS #include "thread.h" #else # define lsd_mutex_init(mutex) # define lsd_mutex_lock(mutex) # define lsd_mutex_unlock(mutex) # define lsd_mutex_destroy(mutex) # define lsd_mutex_is_locked(mutex) (1) #endif #include "hash.h" /***************************************************************************** * Constants *****************************************************************************/ #define HASH_ALLOC 256 #define HASH_DEF_SIZE 1213 #define HASH_MAGIC 0xDEADBEEF /***************************************************************************** * Data Types *****************************************************************************/ struct hash_node { struct hash_node *next; /* next node in list */ void *data; /* ptr to hashed item */ const void *hkey; /* ptr to hashed item's key */ }; struct hash { int count; /* number of items in hash table */ int size; /* num slots allocated in hash table */ struct hash_node **table; /* hash table array of node ptrs */ hash_cmp_f cmp_f; /* key comparison function */ hash_del_f del_f; /* item deletion function */ hash_key_f key_f; /* key hash function */ #if WITH_PTHREADS pthread_mutex_t mutex; /* mutex to protect access to hash */ #endif /* WITH_PTHREADS */ #ifndef NDEBUG unsigned int magic; /* sentinel for asserting validity */ #endif /* NDEBUG */ }; /***************************************************************************** * Prototypes *****************************************************************************/ static struct hash_node * hash_node_alloc (void); static void hash_node_free (struct hash_node *node); /***************************************************************************** * Variables *****************************************************************************/ static struct hash_node *hash_free_list = NULL; #if WITH_PTHREADS static pthread_mutex_t hash_free_lock = PTHREAD_MUTEX_INITIALIZER; #endif /* WITH_PTHREADS */ /***************************************************************************** * Macros *****************************************************************************/ #ifdef WITH_LSD_FATAL_ERROR_FUNC # undef lsd_fatal_error extern void lsd_fatal_error (char *file, int line, char *mesg); #else /* !WITH_LSD_FATAL_ERROR_FUNC */ # ifndef lsd_fatal_error # define lsd_fatal_error(file, line, mesg) (abort ()) # endif /* !lsd_fatal_error */ #endif /* !WITH_LSD_FATAL_ERROR_FUNC */ #ifdef WITH_LSD_NOMEM_ERROR_FUNC # undef lsd_nomem_error extern void * lsd_nomem_error (char *file, int line, char *mesg); #else /* !WITH_LSD_NOMEM_ERROR_FUNC */ # ifndef lsd_nomem_error # define lsd_nomem_error(file, line, mesg) (NULL) # endif /* !lsd_nomem_error */ #endif /* !WITH_LSD_NOMEM_ERROR_FUNC */ /***************************************************************************** * Functions *****************************************************************************/ hash_t hash_create (int size, hash_key_f key_f, hash_cmp_f cmp_f, hash_del_f del_f) { hash_t h; if (!cmp_f || !key_f) { errno = EINVAL; return (NULL); } if (size <= 0) { size = HASH_DEF_SIZE; } if (!(h = malloc (sizeof (*h)))) { return (lsd_nomem_error (__FILE__, __LINE__, "hash_create")); } if (!(h->table = calloc (size, sizeof (struct hash_node *)))) { free (h); return (lsd_nomem_error (__FILE__, __LINE__, "hash_create")); } h->count = 0; h->size = size; h->cmp_f = cmp_f; h->del_f = del_f; h->key_f = key_f; lsd_mutex_init (&h->mutex); assert (h->magic = HASH_MAGIC); /* set magic via assert abuse */ return (h); } void hash_destroy (hash_t h) { int i; struct hash_node *p, *q; assert (h != NULL); lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); for (i = 0; i < h->size; i++) { for (p = h->table[i]; p != NULL; p = q) { q = p->next; if (h->del_f) h->del_f (p->data); hash_node_free (p); } } assert (h->magic = ~HASH_MAGIC); /* clear magic via assert abuse */ lsd_mutex_unlock (&h->mutex); lsd_mutex_destroy (&h->mutex); free (h->table); free (h); return; } int hash_is_empty (hash_t h) { int n; assert (h != NULL); lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); n = h->count; lsd_mutex_unlock (&h->mutex); return (n == 0); } int hash_count (hash_t h) { int n; assert (h != NULL); lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); n = h->count; lsd_mutex_unlock (&h->mutex); return (n); } void * hash_find (hash_t h, const void *key) { unsigned int slot; struct hash_node *p; void *data = NULL; assert (h != NULL); if (!key) { errno = EINVAL; return (NULL); } errno = 0; lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); slot = h->key_f (key) % h->size; for (p = h->table[slot]; p != NULL; p = p->next) { if (!h->cmp_f (p->hkey, key)) { data = p->data; break; } } lsd_mutex_unlock (&h->mutex); return (data); } void * hash_insert (hash_t h, const void *key, void *data) { struct hash_node *p; unsigned int slot; assert (h != NULL); if (!key || !data) { errno = EINVAL; return (NULL); } lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); slot = h->key_f (key) % h->size; for (p = h->table[slot]; p != NULL; p = p->next) { if (!h->cmp_f (p->hkey, key)) { errno = EEXIST; data = NULL; goto end; } } if (!(p = hash_node_alloc())) { data = lsd_nomem_error (__FILE__, __LINE__, "hash_insert"); goto end; } p->hkey = key; p->data = data; p->next = h->table[slot]; h->table[slot] = p; h->count++; end: lsd_mutex_unlock (&h->mutex); return (data); } void * hash_remove (hash_t h, const void *key) { struct hash_node **pp; struct hash_node *p; unsigned int slot; void *data = NULL; assert (h != NULL); if (!key) { errno = EINVAL; return (NULL); } errno = 0; lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); slot = h->key_f (key) % h->size; for (pp = &(h->table[slot]); (p = *pp) != NULL; pp = &((*pp)->next)) { if (!h->cmp_f (p->hkey, key)) { data = p->data; *pp = p->next; hash_node_free (p); h->count--; break; } } lsd_mutex_unlock (&h->mutex); return (data); } int hash_delete_if (hash_t h, hash_arg_f arg_f, void *arg) { int i; struct hash_node **pp; struct hash_node *p; int n = 0; assert (h != NULL); if (!arg_f) { errno = EINVAL; return (-1); } lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); for (i = 0; i < h->size; i++) { pp = &(h->table[i]); while ((p = *pp) != NULL) { if (arg_f (p->data, arg) > 0) { if (h->del_f) h->del_f (p->data); *pp = p->next; hash_node_free (p); h->count--; n++; } else { pp = &(p->next); } } } lsd_mutex_unlock (&h->mutex); return (n); } int hash_for_each (hash_t h, hash_arg_f arg_f, void *arg) { int i; struct hash_node *p; int n = 0; assert (h != NULL); if (!arg_f) { errno = EINVAL; return (-1); } lsd_mutex_lock (&h->mutex); assert (h->magic == HASH_MAGIC); for (i = 0; i < h->size; i++) { for (p = h->table[i]; p != NULL; p = p->next) { if (arg_f (p->data, arg) > 0) { n++; } } } lsd_mutex_unlock (&h->mutex); return (n); } /***************************************************************************** * Hash Functions *****************************************************************************/ unsigned int hash_key_string (const char *str) { unsigned char *p; unsigned int hval = 0; const unsigned int multiplier = 31; for (p = (unsigned char *) str; *p != '\0'; p++) { hval += (multiplier * hval) + *p; } return (hval); } /***************************************************************************** * Internal Functions *****************************************************************************/ static struct hash_node * hash_node_alloc (void) { /* Allocates a hash node from the freelist. * Memory is allocated in chunks of HASH_ALLOC. * Returns a ptr to the object, or NULL if memory allocation fails. */ int i; struct hash_node *p = NULL; assert (HASH_ALLOC > 0); lsd_mutex_lock (&hash_free_lock); if (!hash_free_list) { if ((hash_free_list = malloc (HASH_ALLOC * sizeof (*p)))) { for (i = 0; i < HASH_ALLOC - 1; i++) hash_free_list[i].next = &hash_free_list[i+1]; hash_free_list[i].next = NULL; } } if (hash_free_list) { p = hash_free_list; hash_free_list = p->next; } else { errno = ENOMEM; } lsd_mutex_unlock (&hash_free_lock); return (p); } static void hash_node_free (struct hash_node *node) { /* De-allocates the object [node], returning it to the freelist. */ assert (node != NULL); memset (node, 0, sizeof (*node)); lsd_mutex_lock (&hash_free_lock); node->next = hash_free_list; hash_free_list = node; lsd_mutex_unlock (&hash_free_lock); return; } powerman-2.3.5.orig/src/xread.h0000644000000000000000000000420711113347050013237 0ustar /*****************************************************************************\ * $Id: xread.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_XREAD_H #define PM_XREAD_H /* Read function that handles EINTR internally and terminates on all * other errors except EWOULDBLOCK and ECONNRESET. */ int xread(int fd, char *p, int max); /* Write function that handles EINTR internally and terminates on all * other errors except EPIPE, EWOULDBLOCK, and ECONNRESET. */ int xwrite(int fd, char *p, int max); /* Wrapper for xread that reads exactly count bytes or dies trying */ void xread_all(int fd, char *p, int count); /* Wrapper for xwrite that writes exactly count bytes or dies trying. */ void xwrite_all(int fd, char *p, int count); /* Read a line of input, strip whitespace off the end, and return it. */ char *xreadline(char *prompt, char *buf, int buflen); #endif /* PM_XREAD_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/device_private.h0000644000000000000000000001430111113347050015121 0ustar /*****************************************************************************\ * $Id: device_private.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_DEVICE_PRIVATE_H #define PM_DEVICE_PRIVATE_H #define NO_FD (-1) /* Indices into script array */ #define PM_LOG_IN 0 #define PM_LOG_OUT 1 #define PM_STATUS_PLUGS 2 #define PM_STATUS_PLUGS_ALL 3 /*4*/ /*5*/ #define PM_PING 6 #define PM_POWER_ON 7 #define PM_POWER_ON_RANGED 8 #define PM_POWER_ON_ALL 9 #define PM_POWER_OFF 10 #define PM_POWER_OFF_RANGED 11 #define PM_POWER_OFF_ALL 12 #define PM_POWER_CYCLE 13 #define PM_POWER_CYCLE_RANGED 14 #define PM_POWER_CYCLE_ALL 15 #define PM_RESET 16 #define PM_RESET_RANGED 17 #define PM_RESET_ALL 18 #define PM_STATUS_TEMP 19 #define PM_STATUS_TEMP_ALL 20 #define PM_STATUS_BEACON 21 #define PM_STATUS_BEACON_ALL 22 #define PM_BEACON_ON 23 #define PM_BEACON_OFF 24 #define PM_RESOLVE 25 #define NUM_SCRIPTS 26 /* count of scripts above */ #define MAX_MATCH_POS 20 #define INTERP_MAGIC 0x13434550 typedef struct { int magic; InterpState state; char *str; xregex_t re; } Interp; /* * A Script is a list of Stmts. */ typedef enum { STMT_SEND, STMT_EXPECT, STMT_SETPLUGSTATE, STMT_DELAY, STMT_FOREACHPLUG, STMT_FOREACHNODE, STMT_IFOFF, STMT_IFON, } StmtType; typedef struct { StmtType type; union { struct { /* SEND */ char *fmt; /* printf(fmt, ...) style format string */ } send; struct { /* EXPECT */ xregex_t exp; /* compiled regex */ } expect; struct { /* SETPLUGSTATE (regexs refer to prev expect) */ char *plug_name; /* plug name if literally specified */ int plug_mp; /* regex subexp match pos of plug name if not */ int stat_mp; /* regex subexp match pos of plug status */ List interps; /* list of possible interpretations */ } setplugstate; struct { /* DELAY */ struct timeval tv; /* delay at this point in the script */ } delay; struct { /* FOREACHPLUG | FOREACHNODE */ List stmts; /* list of statements to exec in a loop */ } foreach; struct { /* IFON | IFOFF */ List stmts; /* list of statements to exec conditionally */ } ifonoff; } u; } Stmt; typedef List Script; /* * Device */ typedef enum { DEV_NOT_CONNECTED, DEV_CONNECTING, DEV_CONNECTED } ConnectState; #define DEV_MAGIC 0xbeefb111 typedef struct _device { int magic; char *name; /* name of device */ char *specname; /* name of specification, e.g. "icebox3" */ ConnectState connect_state; /* is device connected/open? */ bool logged_in; /* TRUE if login script has run successfully */ xregex_match_t xmatch; /* cache regex matches for future $N ref */ int fd; /* socket, serial device, or pty */ List acts; /* queue of Actions */ struct timeval timeout; /* configurable device timeout */ cbuf_t to; /* buffer -> device */ cbuf_t from; /* buffer <- device */ PlugList plugs; /* list of Plugs (node name <-> plug name) */ Script scripts[NUM_SCRIPTS]; /* array of scripts */ struct timeval last_retry; /* time of last reconnect retry */ int retry_count; /* number of retries attempted */ struct timeval last_ping; /* time of last ping (if any) */ struct timeval ping_period; /* configurable ping period (0.0 = none) */ int stat_successful_connects; int stat_successful_actions; /* network (e.g. tcp/serial)-specific methods */ bool (*connect)(struct _device *dev); bool (*finish_connect)(struct _device *dev); void (*preprocess)(struct _device *dev); void (*disconnect)(struct _device *dev); void (*destroy)(void *data); void *data; } Device; typedef enum { ACT_ESUCCESS, ACT_EEXPFAIL, ACT_EABORT, ACT_ECONNECTTIMEOUT, ACT_ELOGINTIMEOUT } ActError; typedef void (*ActionCB) (int client_id, ActError acterr, const char *fmt, ...); typedef void (*VerbosePrintf) (int client_id, const char *fmt, ...); #define MIN_DEV_BUF 1024 #define MAX_DEV_BUF 1024*64 void dev_add(Device * dev); int dev_enqueue_actions(int com, hostlist_t hl, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist); bool dev_check_actions(int com, hostlist_t hl); Device *dev_create(const char *name); void dev_destroy(Device * dev); Device *dev_findbyname(char *name); List dev_getdevices(void); #endif /* PM_DEVICE_PRIVATE_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/hprintf.c0000644000000000000000000000513611113347050013603 0ustar /*****************************************************************************\ * $Id: hprintf.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "xmalloc.h" #include "hprintf.h" #include "xread.h" #define CHUNKSIZE 80 char *hvsprintf(const char *fmt, va_list ap) { int len, size = 0; char *str = NULL; do { va_list vacpy; str = (size == 0) ? xmalloc(CHUNKSIZE) : xrealloc(str, size+CHUNKSIZE); size += CHUNKSIZE; va_copy(vacpy, ap); len = vsnprintf(str, size, fmt, vacpy); /* always null terminates */ va_end(vacpy); } while (len == -1 || len >= size); assert(len == strlen(str)); return str; } char *hsprintf(const char *fmt, ...) { char *str; va_list ap; va_start(ap, fmt); str = hvsprintf(fmt, ap); va_end(ap); return str; } int hfdprintf(int fd, const char *format, ...) { char *str, *p; va_list ap; int n, rc; va_start(ap, format); str = hvsprintf(format, ap); va_end(ap); p = str; n = strlen(p); rc = 0; do { rc = xwrite(fd, str, n); if (rc < 0) return rc; n -= rc; p += rc; } while (n > 0); xfree(str); return n; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/parse_util.h0000644000000000000000000000355011164745453014322 0ustar /*****************************************************************************\ * $Id: parse_util.h 1125 2009-04-01 20:14:35Z garlick $ ***************************************************************************** * Copyright (C) 2001-2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_PARSE_UTIL_H #define PM_PARSE_UTIL_H void conf_init(char *filename); void conf_fini(void); bool conf_addnodes(char *nodelist); bool conf_node_exists(char *node); hostlist_t conf_getnodes(void); bool conf_get_use_tcp_wrappers(void); void conf_set_use_tcp_wrappers(bool val); List conf_get_listen(void); void conf_add_listen(char *hostport); void conf_exp_aliases(hostlist_t hl); bool conf_add_alias(char *name, char *hosts); #endif /* PM_PARSE_UTIL_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/hprintf.h0000644000000000000000000000355311113347050013611 0ustar /*****************************************************************************\ * $Id: hprintf.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_HPRINTF_H #define PM_HPRINTF_H /* A vsprintf-like function that allocates the string on the heap and ensures * that no truncation occurs. The caller must Free() the resulting string. */ char *hvsprintf(const char *fmt, va_list ap); /* An sprintf-like function that allocates the string on the heap. * The caller must Free() the resulting string. */ char *hsprintf(const char *fmt, ...); int hfdprintf(int fd, const char *format, ...); #endif /* PM_HPRINTF_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/device_pipe.h0000644000000000000000000000316311113347050014410 0ustar /*****************************************************************************\ * $Id: device_pipe.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_DEVICE_PIPE_H #define PM_DEVICE_PIPE_H bool pipe_connect(Device * dev); void pipe_disconnect(Device * dev); void *pipe_create(char *cmdline, char *flags); void pipe_destroy(void *data); #endif /* PM_DEVICE_PIPE_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/device_tcp.h0000644000000000000000000000327711113347050014247 0ustar /*****************************************************************************\ * $Id: device_tcp.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_DEVICE_TCP_H #define PM_DEVICE_TCP_H bool tcp_finish_connect(Device * dev); bool tcp_connect(Device * dev); void tcp_disconnect(Device * dev); void tcp_preprocess(Device * dev); void *tcp_create(char *host, char *port, char *flags); void tcp_destroy(void *data); #endif /* PM_DEVICE_TCP_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/hash.h0000644000000000000000000001552211113347050013061 0ustar /***************************************************************************** * $Id: hash.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * * LSD-Tools 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. * * LSD-Tools 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 LSD-Tools; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ #ifndef LSD_HASH_H #define LSD_HASH_H /***************************************************************************** * Notes *****************************************************************************/ /* * If an item's key is modified after insertion, the hash will be unable to * locate it if the new key should hash to a different slot in the table. * * If NDEBUG is not defined, internal debug code will be enabled; this is * intended for development use only. Production code should define NDEBUG. * * If WITH_LSD_FATAL_ERROR_FUNC is defined, the linker will expect to * find an external lsd_fatal_error(file,line,mesg) function. By default, * lsd_fatal_error(file,line,mesg) is a macro definition that aborts. * This macro may be redefined to invoke another routine instead. * * If WITH_LSD_NOMEM_ERROR_FUNC is defined, the linker will expect to * find an external lsd_nomem_error(file,line,mesg) function. By default, * lsd_nomem_error(file,line,mesg) is a macro definition that returns NULL. * This macro may be redefined to invoke another routine instead. * * If WITH_PTHREADS is defined, these routines will be thread-safe. */ /***************************************************************************** * Data Types *****************************************************************************/ typedef struct hash * hash_t; /* * Hash table opaque data type. */ typedef unsigned int (*hash_key_f) (const void *key); /* * Function prototype for the hash function responsible for converting * the data's [key] into an unsigned integer hash value. */ typedef int (*hash_cmp_f) (const void *key1, const void *key2); /* * Function prototype for comparing two keys. * Returns zero if both keys are equal; o/w, returns nonzero. */ typedef void (*hash_del_f) (void *data); /* * Function prototype for de-allocating a data item stored within a hash. * This function is responsible for freeing all memory associated with * the [data] item, including any subordinate items. */ typedef int (*hash_arg_f) (void *data, void *arg); /* * Function prototype for operating on each element in the hash table. * The function will be invoked once for each [data] item in the hash, * with [arg] being passed in as an argument. */ /***************************************************************************** * Functions *****************************************************************************/ hash_t hash_create (int size, hash_key_f key_f, hash_cmp_f cmp_f, hash_del_f del_f); /* * Creates and returns a new hash table on success. * Returns lsd_nomem_error() with errno=ENOMEM if memory allocation fails. * Returns NULL with errno=EINVAL if [keyf] or [cmpf] is not specified. * The [size] is the number of slots in the table; a larger table requires * more memory, but generally provide quicker access times. If set <= 0, * the default size is used. * The [keyf] function converts a key into a hash value. * The [cmpf] function determines whether two keys are equal. * The [delf] function de-allocates memory used by items in the hash; * if set to NULL, memory associated with these items will not be freed * when the hash is destroyed. */ void hash_destroy (hash_t h); /* * Destroys hash table [h]. If a deletion function was specified when the * hash was created, it will be called for each item contained within. * Abadoning a hash without calling hash_destroy() will cause a memory leak. */ int hash_is_empty (hash_t h); /* * Returns non-zero if hash table [h] is empty; o/w, returns zero. */ int hash_count (hash_t h); /* * Returns the number of items in hash table [h]. */ void * hash_find (hash_t h, const void *key); /* * Searches for the item corresponding to [key] in hash table [h]. * Returns a ptr to the found item's data on success. * Returns NULL with errno=0 if no matching item is found. * Returns NULL with errno=EINVAL if [key] is not specified. */ void * hash_insert (hash_t h, const void *key, void *data); /* * Inserts [data] with the corresponding [key] into hash table [h]; * note that it is permissible for [key] to be set equal to [data]. * Returns a ptr to the inserted item's data on success. * Returns NULL with errno=EEXIST if [key] already exists in the hash. * Returns NULL with errno=EINVAL if [key] or [data] is not specified. * Returns lsd_nomem_error() with errno=ENOMEM if memory allocation fails. */ void * hash_remove (hash_t h, const void *key); /* * Removes the item corresponding to [key] from hash table [h]. * Returns a ptr to the removed item's data on success. * Returns NULL with errno=0 if no matching item is found. * Returns NULL with errno=EINVAL if [key] is not specified. */ int hash_delete_if (hash_t h, hash_arg_f argf, void *arg); /* * Conditionally deletes (and de-allocates) items from hash table [h]. * The [argf] function is invoked once for each item in the hash, with * [arg] being passed in as an argument. Items for which [argf] returns * greater-than-zero are deleted. * Returns the number of items deleted. * Returns -1 with errno=EINVAL if [argf] is not specified. */ int hash_for_each (hash_t h, hash_arg_f argf, void *arg); /* * Invokes the [argf] function once for each item in hash table [h], * with [arg] being passed in as an argument. * Returns the number of items for which [argf] returns greater-than-zero. * Returns -1 with errno=EINVAL if [argf] is not specified. */ unsigned int hash_key_string (const char *str); /* * A hash_key_f function that hashes the string [str]. */ #endif /* !LSD_HASH_H */ powerman-2.3.5.orig/src/xpoll.h0000644000000000000000000000370511113347050013274 0ustar /*****************************************************************************\ * $Id: xpoll.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_XPOLL_H #define PM_XPOLL_H typedef struct xpollfd *xpollfd_t; int xpoll(xpollfd_t pfd, struct timeval *timeout); xpollfd_t xpollfd_create(void); void xpollfd_destroy(xpollfd_t pfd); void xpollfd_zero(xpollfd_t pfd); void xpollfd_set(xpollfd_t pfd, int fd, short events); short xpollfd_revents(xpollfd_t pfd, int fd); char *xpollfd_str(xpollfd_t pfd, char *str, int len); #define XPOLLIN 1 #define XPOLLOUT 2 #define XPOLLHUP 4 #define XPOLLERR 8 #define XPOLLNVAL 16 #endif /* PM_XPOLL_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xsignal.h0000644000000000000000000000304511113347050013600 0ustar /*****************************************************************************\ * $Id: xsignal.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_XSIGNAL_H #define PM_XSIGNAL_H typedef void xsigfunc_t(int); xsigfunc_t *xsignal(int signo, xsigfunc_t * func); #endif /* PM_XSIGNAL_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/Makefile.am0000644000000000000000000000323011115104225014007 0ustar ##***************************************************************************** ## $Id: Makefile.am,v 1.72 2005/08/25 22:04:32 achu Exp $ ##***************************************************************************** ## Process this file with automake to produce Makefile.in. ##***************************************************************************** AM_CFLAGS = @GCCWARN@ if WITH_HTTPPOWER HTTPPOWER = httppower endif bin_PROGRAMS = powerman pm sbin_PROGRAMS = powermand plmpower $(HTTPPOWER) noinst_HEADERS = \ arglist.h \ argv.h \ cbuf.h \ client.h \ client_proto.h \ daemon.h \ debug.h \ device.h \ device_pipe.h \ device_private.h \ device_serial.h \ device_tcp.h \ error.h \ hash.h \ hostlist.h \ hprintf.h \ list.h \ parse_util.h \ pluglist.h \ powerman.h \ xread.h \ xpoll.h \ xmalloc.h \ xregex.h \ xtime.h \ xtypes.h \ xpty.h \ xsignal.h COMMON_SOURCE = \ debug.c \ error.c \ hostlist.c \ list.c \ hprintf.c \ argv.c \ xread.c \ xpoll.c \ xmalloc.c \ xregex.c \ xpty.c \ xsignal.c powerman_SOURCES = powerman.c $(COMMON_SOURCE) powerman_LDADD = $(LIBGENDERS) $(LIBFORKPTY) if WITH_HTTPPOWER httppower_SOURCES = httppower.c $(COMMON_SOURCE) httppower_LDADD = $(LIBCURL) $(LIBFORKPTY) endif plmpower_SOURCES = plmpower.c $(COMMON_SOURCE) plmpower_LDADD = $(LIBFORKPTY) powermand_SOURCES = \ powermand.c \ arglist.c \ cbuf.c \ client.c \ daemon.c \ device.c \ device_pipe.c \ device_serial.c \ device_tcp.c \ hash.c \ parse_lex.l \ parse_tab.y \ parse_util.c \ pluglist.c \ $(COMMON_SOURCE) powermand_LDADD = $(LIBWRAP) $(LIBFORKPTY) AM_YFLAGS = -d pm_SOURCES = pm: powerman $(LN_S) powerman pm powerman-2.3.5.orig/src/powerman.h0000644000000000000000000000311011164745453013773 0ustar /*****************************************************************************\ * $Id: powerman.h 1125 2009-04-01 20:14:35Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_POWERMAN_H #define PM_POWERMAN_H #define DAEMON_NAME "powermand" #define DFLT_PORT "10101" #define DFLT_HOSTNAME "127.0.0.1" #endif /* PM_POWERMAN_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/device_tcp.c0000644000000000000000000003351311113347050014236 0ustar /*****************************************************************************\ * $Id: device_tcp.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * Modularlization and telnet engine added by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* * Implement connect/disconnect/preprocess methods for tcp/telnet devices. * * NOTE: we always do telnet when we are doing tcp. If there ever is a telnet * device that requires some proactive option negotiation, or a non-telnet * device that manages to confuse the telnet state machine, we could easily * implement a 'notelnet' flag. Right now it seems innocuous to leave the * telnet machine running. */ #if HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include #include #include #include #define TELOPTS #define TELCMDS #include #include #include "list.h" #include "hostlist.h" #include "cbuf.h" #include "xtypes.h" #include "parse_util.h" #include "xmalloc.h" #include "xpoll.h" #include "pluglist.h" #include "arglist.h" #include "xregex.h" #include "device_private.h" #include "error.h" #include "debug.h" #include "device_tcp.h" #include "xpty.h" #ifndef HAVE_SOCKLEN_T typedef int socklen_t; /* socklen_t is uint32_t in Posix.1g */ #endif /* !HAVE_SOCKLEN_T */ typedef enum { TELNET_NONE, TELNET_CMD, TELNET_OPT } TelnetState; typedef struct { char *host; char *port; TelnetState tstate; /* state of telnet processing */ unsigned char tcmd; /* buffered telnet command */ bool quiet; /* don't report idle timeout messages */ struct addrinfo *addrs; struct addrinfo *cur; } TcpDev; static void _telnet_init(Device *dev); static void _telnet_preprocess(Device * dev); static void _parse_options(TcpDev *tcp, char *flags) { char *tmp = xstrdup(flags); char *opt = strtok(tmp, ","); while (opt) { if (strcmp(opt, "quiet") == 0) tcp->quiet = TRUE; else err_exit(FALSE, "bad device option: %s\n", opt); opt = strtok(NULL, ","); } xfree(tmp); } void *tcp_create(char *host, char *port, char *flags) { TcpDev *tcp = (TcpDev *)xmalloc(sizeof(TcpDev)); struct addrinfo hints; int error; tcp->host = xstrdup(host); tcp->port = xstrdup(port); tcp->tstate = TELNET_NONE; tcp->tcmd = 0; tcp->quiet = FALSE; if (flags) _parse_options(tcp, flags); /* Store a list of possible addresses/families to connect to * in the tcp->addrs linked list. */ memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if ((error = getaddrinfo(tcp->host, tcp->port, &hints, &tcp->addrs)) != 0) err_exit(FALSE, "getaddrinfo %s:%s: %s", tcp->host, tcp->port, gai_strerror(error)); if (tcp->addrs == NULL) err_exit(FALSE, "no addresses for server %s:%s", tcp->host, tcp->port); tcp->cur = tcp->addrs; return (void *)tcp; } void tcp_destroy(void *data) { TcpDev *tcp = (TcpDev *)data; if (tcp->host) xfree(tcp->host); if (tcp->port) xfree(tcp->port); if (tcp->addrs) freeaddrinfo(tcp->addrs); xfree(tcp); } /* After a successful connect, perform some management on * the connection. Returns TRUE on success, FALSE on error. */ static bool tcp_finish_connect_one(Device *dev) { int rc; int error = 0; socklen_t len = sizeof(error); rc = getsockopt(dev->fd, SOL_SOCKET, SO_ERROR, &error, &len); /* * If an error occurred, Berkeley-derived implementations * return 0 with the pending error in 'error'. But Solaris * returns -1 with the pending error in 'errno'. -dun */ if (rc < 0) error = errno; if (! error) { dev->connect_state = DEV_CONNECTED; dev->stat_successful_connects++; _telnet_init(dev); return TRUE; } return FALSE; } /* Obtain a socket for the specified address and attempt to connect it. * Return TRUE on completion or connection in progress, FALSE on error. */ static bool tcp_connect_one(Device *dev, struct addrinfo *addr) { TcpDev *tcp = (TcpDev *)dev->data; int opt; assert(tcp->cur != NULL); if ((dev->fd = socket(addr->ai_family, addr->ai_socktype, 0)) < 0) return FALSE; opt = 1; if (setsockopt(dev->fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) { close(dev->fd); return FALSE; } nonblock_set(dev->fd); if (connect(dev->fd, addr->ai_addr, addr->ai_addrlen) >= 0) return tcp_finish_connect_one(dev); else if (errno == EINPROGRESS) return TRUE; close(dev->fd); return FALSE; } /* * Continue TCP connect when fd unblocks. * Return FALSE on error, which triggers timed retry of tcp_connect(). * Return TRUE if connected or still connecting (on the next address). */ bool tcp_finish_connect(Device * dev) { TcpDev *tcp; assert(dev->magic == DEV_MAGIC); assert(dev->connect_state == DEV_CONNECTING); tcp = (TcpDev *)dev->data; if (!tcp_finish_connect_one(dev)) { tcp->cur = tcp->cur->ai_next; while (tcp->cur && !tcp_connect_one(dev, tcp->cur)) tcp->cur = tcp->cur->ai_next; if (tcp->cur == NULL) dev->connect_state = DEV_NOT_CONNECTED; } switch(dev->connect_state) { case DEV_NOT_CONNECTED: err(FALSE, "tcp_finish_connect(%s): connection refused", dev->name); break; case DEV_CONNECTED: if (!tcp->quiet) err(FALSE, "tcp_finish_connect(%s): connected", dev->name); break; case DEV_CONNECTING: if (!tcp->quiet) err(FALSE, "tcp_finish_connect(%s): connecting", dev->name); break; } return (dev->connect_state != DEV_NOT_CONNECTED); } /* * Initiate a non-blocking TCP connect. tcp_finish_connect() will try to * finish the job when the main poll() loop unblocks again, unless we * finish here. */ bool tcp_connect(Device * dev) { TcpDev *tcp; assert(dev->magic == DEV_MAGIC); assert(dev->connect_state == DEV_NOT_CONNECTED); assert(dev->fd == NO_FD); tcp = (TcpDev *)dev->data; dev->connect_state = DEV_CONNECTING; while (tcp->cur && !tcp_connect_one(dev, tcp->cur)) tcp->cur = tcp->cur->ai_next; if (tcp->cur == NULL) dev->connect_state = DEV_NOT_CONNECTED; switch(dev->connect_state) { case DEV_NOT_CONNECTED: err(FALSE, "tcp_connect(%s): connection refused", dev->name); break; case DEV_CONNECTED: if (!tcp->quiet) err(FALSE, "tcp_connect(%s): connected", dev->name); break; case DEV_CONNECTING: if (!tcp->quiet) err(FALSE, "tcp_connect(%s): connecting", dev->name); break; } return (dev->connect_state == DEV_CONNECTED); } /* * Close the socket associated with this device. */ void tcp_disconnect(Device * dev) { TcpDev *tcp; assert(dev->magic == DEV_MAGIC); assert(dev->connect_state == DEV_CONNECTING || dev->connect_state == DEV_CONNECTED); tcp = (TcpDev *)dev->data; dbg(DBG_DEVICE, "tcp_disconnect: %s on fd %d", dev->name, dev->fd); /* close socket if open */ if (dev->fd >= 0) { if (close(dev->fd) < 0) err(TRUE, "tcp_disconnect: %s close fd %d", dev->name, dev->fd); dev->fd = NO_FD; } if (!tcp->quiet) err(FALSE, "tcp_disconnect(%s): disconnected", dev->name); } void tcp_preprocess(Device *dev) { _telnet_preprocess(dev); } static void _telnet_sendopt(Device *dev, int cmd, int opt) { unsigned char str[] = { IAC, cmd, opt }; int n; dbg(DBG_TELNET, "%s: _telnet_sendopt: %s %s", dev->name, TELCMD_OK(cmd) ? TELCMD(cmd) : "", TELOPT_OK(opt) ? TELOPT(opt) : ""); n = cbuf_write(dev->to, str, 3, NULL); if (n < 3) err((n < 0), "_telnet_sendopt: cbuf_write returned %d", n); } #if 0 static void _telnet_sendcmd(Device *dev, unsigned char cmd) { unsigned char str[] = { IAC, cmd }; int n; dbg(DBG_TELNET, "%s: _telnet_sendcmd: %s", dev->name, TELCMD_OK(cmd) ? TELCMD(cmd) : ""); n = cbuf_write(dev->to, str, 2, NULL); if (n < 2) err((n < 0), "_telnet_sendcmd: cbuf_write returned %d", n); } #endif static void _telnet_recvcmd(Device *dev, int cmd) { dbg(DBG_TELNET, "%s: _telnet_recvcmd: %s", dev->name, TELCMD_OK(cmd) ? TELCMD(cmd) : ""); } static void _telnet_recvopt(Device *dev, int cmd, int opt) { TcpDev *tcp = (TcpDev *)dev->data; dbg(DBG_TELNET, "%s: _telnet_recvopt: %s %s", dev->name, TELCMD_OK(cmd) ? TELCMD(cmd) : "", TELOPT_OK(opt) ? TELOPT(opt) : ""); switch (cmd) { case DO: switch (opt) { case TELOPT_SGA: /* rfc 858 - suppress go ahead*/ case TELOPT_TM: /* rfc 860 - timing mark */ _telnet_sendopt(dev, WILL, opt); break; case TELOPT_TTYPE: /* rfc 1091 - terminal type */ case TELOPT_NAWS: /* rfc 1073 - window size */ /* next three added for gnat powerman/634 - jg */ case TELOPT_NEW_ENVIRON: /* environment variables */ case TELOPT_XDISPLOC: /* X display location */ case TELOPT_TSPEED: /* terminal speed */ /* next two added for newer baytechs - jg */ case TELOPT_ECHO: /* echo */ case TELOPT_LFLOW: /* remote flow control */ /* next one added for cyclades ts - jg */ case TELOPT_BINARY: /* 8-bit data path */ _telnet_sendopt(dev, WONT, opt); break; default: if (!tcp->quiet) err(0, "%s: _telnet_recvopt: ignoring %s %s", dev->name, TELCMD_OK(cmd) ? TELCMD(cmd) : "", TELOPT_OK(opt) ? TELOPT(opt) : ""); break; } break; default: break; } } /* * Called just after a connect so we can perform any option requests. */ static void _telnet_init(Device * dev) { TcpDev *tcp = (TcpDev *)dev->data; tcp->tstate = TELNET_NONE; tcp->tcmd = 0; #if 0 _telnet_sendopt(dev, DONT, TELOPT_NAWS); _telnet_sendopt(dev, DONT, TELOPT_TTYPE); _telnet_sendopt(dev, DONT, TELOPT_ECHO); #endif } /* * Telnet state machine. This is called when new data has arrived in the * input buffer. We get to look first to process any telnet escapes. * Except for a little bit of state stored in the dev->u.tcp union, * we do all the processing now. */ static void _telnet_preprocess(Device * dev) { static unsigned char peek[MAX_DEV_BUF]; static unsigned char device[MAX_DEV_BUF]; TcpDev *tcp = (TcpDev *)dev->data; int len, i, k; len = cbuf_peek(dev->from, peek, MAX_DEV_BUF); for (i = 0, k = 0; i < len; i++) { switch (tcp->tstate) { case TELNET_NONE: if (peek[i] == IAC) tcp->tstate = TELNET_CMD; else device[k++] = peek[i]; break; case TELNET_CMD: switch (peek[i]) { case IAC: /* escaped IAC */ device[k++] = peek[i]; tcp->tstate = TELNET_NONE; break; case DONT: /* option commands - one more byte coming */ case DO: case WILL: case WONT: tcp->tcmd = peek[i]; tcp->tstate = TELNET_OPT; break; default: /* single char commands - process immediately */ _telnet_recvcmd(dev, peek[i]); tcp->tstate = TELNET_NONE; break; } break; case TELNET_OPT: /* option char - process stored command */ _telnet_recvopt(dev, tcp->tcmd, peek[i]); tcp->tstate = TELNET_NONE; break; } } /* rewrite buffers if anything changed */ if (k < len) { int n; n = cbuf_drop(dev->from, len); if (n < len) err((n < 0), "_telnet_preprocess: cbuf_drop returned %d", n); n = cbuf_write(dev->from, device, k, NULL); if (n < k) err((n < 0), "_telnet_preprocess: cbuf_write returned %d", n); } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/list.h0000644000000000000000000002166411113347050013115 0ustar /***************************************************************************** * $Id: list.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Chris Dunlap . * * This file is from LSD-Tools, the LLNL Software Development Toolbox. * * LSD-Tools 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. * * LSD-Tools 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 LSD-Tools; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ #ifndef LSD_LIST_H #define LSD_LIST_H /*********** * Notes * ***********/ /* * If NDEBUG is not defined, internal debug code will be enabled. This is * intended for development use only and production code should define NDEBUG. * * If WITH_LSD_FATAL_ERROR_FUNC is defined, the linker will expect to * find an external lsd_fatal_error(file,line,mesg) function. By default, * lsd_fatal_error(file,line,mesg) is a macro definition that outputs an * error message to stderr. This macro may be redefined to invoke another * routine instead. * * If WITH_LSD_NOMEM_ERROR_FUNC is defined, the linker will expect to * find an external lsd_nomem_error(file,line,mesg) function. By default, * lsd_nomem_error(file,line,mesg) is a macro definition that returns NULL. * This macro may be redefined to invoke another routine instead. * * If WITH_PTHREADS is defined, these routines will be thread-safe. */ /**************** * Data Types * ****************/ typedef struct list * List; /* * List opaque data type. */ typedef struct listIterator * ListIterator; /* * List Iterator opaque data type. */ typedef void (*ListDelF) (void *x); /* * Function prototype to deallocate data stored in a list. * This function is responsible for freeing all memory associated * with an item, including all subordinate items (if applicable). */ typedef int (*ListCmpF) (void *x, void *y); /* * Function prototype for comparing two items in a list. * Returns less-than-zero if (xy). */ typedef int (*ListFindF) (void *x, void *key); /* * Function prototype for matching items in a list. * Returns non-zero if (x==key); o/w returns zero. */ typedef int (*ListForF) (void *x, void *arg); /* * Function prototype for operating on each item in a list. * Returns less-than-zero on error. */ /******************************* * General-Purpose Functions * *******************************/ List list_create (ListDelF f); /* * Creates and returns a new empty list, or lsd_nomem_error() on failure. * The deletion function [f] is used to deallocate memory used by items * in the list; if this is NULL, memory associated with these items * will not be freed when the list is destroyed. * Note: Abandoning a list without calling list_destroy() will result * in a memory leak. */ void list_destroy (List l); /* * Destroys list [l], freeing memory used for list iterators and the * list itself; if a deletion function was specified when the list * was created, it will be called for each item in the list. */ int list_is_empty (List l); /* * Returns non-zero if list [l] is empty; o/w returns zero. */ int list_count (List l); /* * Returns the number of items in list [l]. */ /*************************** * List Access Functions * ***************************/ void * list_append (List l, void *x); /* * Inserts data [x] at the end of list [l]. * Returns the data's ptr, or lsd_nomem_error() if insertion failed. */ void * list_prepend (List l, void *x); /* * Inserts data [x] at the beginning of list [l]. * Returns the data's ptr, or lsd_nomem_error() if insertion failed. */ void * list_find_first (List l, ListFindF f, void *key); /* * Traverses list [l] using [f] to match each item with [key]. * Returns a ptr to the first item for which the function [f] * returns non-zero, or NULL if no such item is found. * Note: This function differs from list_find() in that it does not require * a list iterator; it should only be used when all list items are known * to be unique (according to the function [f]). */ int list_delete_all (List l, ListFindF f, void *key); /* * Traverses list [l] using [f] to match each item with [key]. * Removes all items from the list for which the function [f] returns * non-zero; if a deletion function was specified when the list was * created, it will be called to deallocate each item being removed. * Returns a count of the number of items removed from the list. */ int list_for_each (List l, ListForF f, void *arg); /* * For each item in list [l], invokes the function [f] with [arg]. * Returns a count of the number of items on which [f] was invoked. * If [f] returns <0 for a given item, the iteration is aborted and the * function returns the negative of that item's position in the list. */ void list_sort (List l, ListCmpF f); /* * Sorts list [l] into ascending order according to the function [f]. * Note: Sorting a list resets all iterators associated with the list. * Note: The sort algorithm is stable. */ /**************************** * Stack Access Functions * ****************************/ void * list_push (List l, void *x); /* * Pushes data [x] onto the top of stack [l]. * Returns the data's ptr, or lsd_nomem_error() if insertion failed. */ void * list_pop (List l); /* * Pops the data item at the top of the stack [l]. * Returns the data's ptr, or NULL if the stack is empty. */ void * list_peek (List l); /* * Peeks at the data item at the top of the stack (or head of the queue) [l]. * Returns the data's ptr, or NULL if the stack (or queue) is empty. * Note: The item is not removed from the list. */ /**************************** * Queue Access Functions * ****************************/ void * list_enqueue (List l, void *x); /* * Enqueues data [x] at the tail of queue [l]. * Returns the data's ptr, or lsd_nomem_error() if insertion failed. */ void * list_dequeue (List l); /* * Dequeues the data item at the head of the queue [l]. * Returns the data's ptr, or NULL if the queue is empty. */ /***************************** * List Iterator Functions * *****************************/ ListIterator list_iterator_create (List l); /* * Creates and returns a list iterator for non-destructively traversing * list [l], or lsd_nomem_error() on failure. */ void list_iterator_reset (ListIterator i); /* * Resets the list iterator [i] to start traversal at the beginning * of the list. */ void list_iterator_destroy (ListIterator i); /* * Destroys the list iterator [i]; list iterators not explicitly destroyed * in this manner will be destroyed when the list is deallocated via * list_destroy(). */ void * list_next (ListIterator i); /* * Returns a ptr to the next item's data, * or NULL once the end of the list is reached. * Example: i=list_iterator_create(i); while ((x=list_next(i))) {...} */ void * list_insert (ListIterator i, void *x); /* * Inserts data [x] immediately before the last item returned via list * iterator [i]; once the list iterator reaches the end of the list, * insertion is made at the list's end. * Returns the data's ptr, or lsd_nomem_error() if insertion failed. */ void * list_find (ListIterator i, ListFindF f, void *key); /* * Traverses the list from the point of the list iterator [i] * using [f] to match each item with [key]. * Returns a ptr to the next item for which the function [f] * returns non-zero, or NULL once the end of the list is reached. * Example: i=list_iterator_reset(i); while ((x=list_find(i,f,k))) {...} */ void * list_remove (ListIterator i); /* * Removes from the list the last item returned via list iterator [i] * and returns the data's ptr. * Note: The client is responsible for freeing the returned data. */ int list_delete (ListIterator i); /* * Removes from the list the last item returned via list iterator [i]; * if a deletion function was specified when the list was created, * it will be called to deallocate the item being removed. * Returns a count of the number of items removed from the list * (ie, '1' if the item was removed, and '0' otherwise). */ #endif /* !LSD_LIST_H */ powerman-2.3.5.orig/src/debug.h0000644000000000000000000000441511115264426013232 0ustar /*****************************************************************************\ * $Id: debug.h 1100 2008-12-02 16:57:58Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_DEBUG_H #define PM_DEBUG_H #define DBG_ALWAYS 0x0000 #define DBG_DEVICE 0x0001 #define DBG_POLL 0x0002 #define DBG_CLIENT 0x0004 #define DBG_ACTION 0x0008 #define DBG_MEMORY 0x0010 #define DBG_TELNET 0x0020 #define DBG_NAME_TAB { \ { DBG_DEVICE, "device" }, \ { DBG_POLL, "poll" }, \ { DBG_CLIENT, "client" }, \ { DBG_ACTION, "action" }, \ { DBG_MEMORY, "memory" }, \ { DBG_TELNET, "telnet" }, \ { 0, NULL } \ } void dbg_notty(void); void dbg_setmask(unsigned long mask); void dbg_wrapped(unsigned long channel, const char *fmt, ...); char *dbg_memstr(char *mem, int len); #define dbg(channel, fmt...) dbg_wrapped(channel, fmt) #endif /* PM_DEBUG_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xtime.h0000644000000000000000000000562511113347050013267 0ustar /*****************************************************************************\ * $Id: xtime.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* borrowed from glibc-2.5 */ #ifndef PM_XTIME_H #define PM_XTIME_H #ifndef timeradd # define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) #endif #ifndef timersub # define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif #endif /* PM_XTIME_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/pluglist.c0000644000000000000000000001635311113347050013777 0ustar /*****************************************************************************\ * $Id: pluglist.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "xtypes.h" #include "list.h" #include "xmalloc.h" #include "hostlist.h" #include "pluglist.h" #define PLUGLISTITR_MAGIC 0xfeedfefe #define PLUGLIST_MAGIC 0xfeedb0b struct pluglist_iterator { int magic; ListIterator itr; }; struct pluglist { int magic; List pluglist; bool hardwired; }; static Plug *_create_plug(char *name) { Plug *plug = (Plug *) xmalloc(sizeof(Plug)); assert(name != NULL); plug->name = xstrdup(name); plug->node = NULL; return plug; } static void _destroy_plug(Plug *plug) { assert(plug != NULL); xfree(plug->name); if (plug->node) xfree(plug->node); xfree(plug); } PlugList pluglist_create(List plugnames) { PlugList pl = (PlugList) xmalloc(sizeof(struct pluglist)); pl->magic = PLUGLIST_MAGIC; pl->pluglist = list_create((ListDelF)_destroy_plug); pl->hardwired = FALSE; /* create plug for each element of plugnames list */ if (plugnames) { ListIterator itr; char *name; itr = list_iterator_create(plugnames); while ((name = list_next(itr))) list_append(pl->pluglist, _create_plug(name)); list_iterator_destroy(itr); pl->hardwired = TRUE; } return pl; } void pluglist_destroy(PlugList pl) { assert(pl != NULL); assert(pl->magic == PLUGLIST_MAGIC); pl->magic = 0; list_destroy(pl->pluglist); xfree(pl); } static Plug *_pluglist_find_any(PlugList pl, char *name) { PlugListIterator itr = pluglist_iterator_create(pl); Plug *plug; while ((plug = pluglist_next(itr))) { if (strcmp(plug->name, name) == 0) break; } pluglist_iterator_destroy(itr); return plug; } /* Assign a node name to an existing Plug. * Create Plug if Plug with name doesn't exist and Plugs are not hardwired. */ static pl_err_t _pluglist_map_one(PlugList pl, char *node, char *name) { Plug *plug = _pluglist_find_any(pl, name); pl_err_t res = EPL_SUCCESS; if (plug == NULL) { if (pl->hardwired) { res = EPL_UNKPLUG; goto err; } plug = _create_plug(name); list_push(pl->pluglist, plug); } if (plug->node) { res = EPL_DUPPLUG; goto err; } plug->node = xstrdup(node); err: return res; } /* Assign a node name to the next available plug. */ static pl_err_t _pluglist_map_next(PlugList pl, char *node) { Plug *plug; PlugListIterator pitr; pl_err_t res = EPL_NOPLUGS; pitr = pluglist_iterator_create(pl); while ((plug = pluglist_next(pitr))) { if (plug->node == NULL) { plug->node = xstrdup(node); res = EPL_SUCCESS; break; } } pluglist_iterator_destroy(pitr); return res; } pl_err_t pluglist_map(PlugList pl, char *nodelist, char *pluglist) { pl_err_t res = EPL_SUCCESS; assert(pl != NULL); assert(pl->magic == PLUGLIST_MAGIC); assert(nodelist != NULL); /* If pluglist is omitted we have one of two cases: * 1) hardwired plugs, and we assign node names to existing plugs in order. * 2) no plugs, we create plugs with same names as node names. */ if (pluglist == NULL) { hostlist_t nhl = hostlist_create(nodelist); hostlist_iterator_t nitr = hostlist_iterator_create(nhl); char *node; while ((node = hostlist_next(nitr))) { if (pl->hardwired) res = _pluglist_map_next(pl, node); else res = _pluglist_map_one(pl, node, node); free(node); if (res != EPL_SUCCESS) break; } hostlist_iterator_destroy(nitr); hostlist_destroy(nhl); /* We have a pluglist so we just map plugs to nodes. */ } else { hostlist_t nhl = hostlist_create(nodelist); hostlist_iterator_t nitr = hostlist_iterator_create(nhl); hostlist_t phl = hostlist_create(pluglist); hostlist_iterator_t pitr = hostlist_iterator_create(phl); char *node, *name; while ((node = hostlist_next(nitr))) { name = hostlist_next(pitr); if (name) res = _pluglist_map_one(pl, node, name); else res = EPL_NOPLUGS; free(node); free(name); if (res != EPL_SUCCESS) break; } if (res == EPL_SUCCESS) { char *tmp = hostlist_next(pitr); if (tmp != NULL) res = EPL_NONODES; free(tmp); } hostlist_iterator_destroy(pitr); hostlist_iterator_destroy(nitr); hostlist_destroy(phl); hostlist_destroy(nhl); } return res; } PlugListIterator pluglist_iterator_create(PlugList pl) { PlugListIterator itr = (PlugListIterator)xmalloc(sizeof(struct pluglist_iterator)); itr->magic = PLUGLISTITR_MAGIC; itr->itr = list_iterator_create(pl->pluglist); return itr; } void pluglist_iterator_destroy(PlugListIterator itr) { assert(itr != NULL); assert(itr->magic == PLUGLISTITR_MAGIC); itr->magic = 0; list_iterator_destroy(itr->itr); xfree(itr); } Plug *pluglist_next(PlugListIterator itr) { assert(itr != NULL); assert(itr->magic == PLUGLISTITR_MAGIC); return (Plug *)list_next(itr->itr); } Plug *pluglist_find(PlugList pl, char *name) { Plug *plug; assert(pl != NULL); assert(pl->magic == PLUGLIST_MAGIC); assert(name != NULL); plug = _pluglist_find_any(pl, name); if (plug && plug->node == NULL) plug = NULL; return plug; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/arglist.h0000644000000000000000000000540311113347050013600 0ustar /*****************************************************************************\ * $Id: arglist.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* * The ArgList is used to pass the list of "target nodes" into a device * script, and then to pass the result back to the client. */ #ifndef PM_ARGLIST_H #define PM_ARGLIST_H typedef enum { ST_UNKNOWN, ST_OFF, ST_ON } InterpState; typedef struct { char *node; /* node name (in) */ char *val; /* value as returned by the device (out) */ InterpState state; /* interpreted value, if appropriate (out) */ } Arg; typedef struct arglist_iterator *ArgListIterator; typedef struct arglist *ArgList; /* Create an ArgList with an Arg entry for each node in hl (refcount == 1). */ ArgList arglist_create(hostlist_t hl); /* Do refcount++ in ArgList. */ ArgList arglist_link(ArgList arglist); /* Do refcount-- in ArgList. * If the refcount reaches zero, destroy the Arglist. */ void arglist_unlink(ArgList arglist); /* Search ArgList for an Arg entry that matches node. * Return pointer to Arg on success (points to actual list entry), * or NULL on search failure. */ Arg * arglist_find(ArgList arglist, char *node); /* An iterator interface for ArgLists, similar to the iterators in list.h. */ ArgListIterator arglist_iterator_create(ArgList arglist); void arglist_iterator_destroy(ArgListIterator itr); Arg * arglist_next(ArgListIterator itr); #endif /* PM_ARGLIST_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/client_proto.h0000644000000000000000000001405211113347050014634 0ustar /*****************************************************************************\ * $Id: client_proto.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2002-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_CLIENT_PROTO_H #define PM_CLIENT_PROTO_H /* * Line oriented request/response protocol for powerman daemon. * 1. client connects * 2. server sends version string * 3. server sends prompt * 4. client sends command * 5. server sends response (see note under Responses below) * If not quit, goto 3 */ #define CP_LINEMAX 8192 /* max request/response line length */ #define CP_EOL "\r\n" /* line terminator */ #define CP_PROMPT "powerman> " /* prompt */ #define CP_VERSION "001 %s" CP_EOL /* * Requests */ #define CP_HELP "help" #define CP_QUIT "quit" #define CP_RESET "reset %s" #define CP_CYCLE "cycle %s" #define CP_ON "on %s" #define CP_OFF "off %s" #define CP_NODES "nodes" #define CP_DEVICE "device %s" #define CP_DEVICE_ALL "device" #define CP_STATUS "status %s" #define CP_STATUS_ALL "status" #define CP_TEMP "temp %s" #define CP_TEMP_ALL "temp" #define CP_BEACON "beacon %s" #define CP_BEACON_ALL "beacon" #define CP_BEACON_ON "flash %s" #define CP_BEACON_OFF "unflash %s" #define CP_TELEMETRY "telemetry" #define CP_EXPRANGE "exprange" /* * Responses - * 1XX's are successes (indicates end of response) * 2XX's are failures (indicates end of response) * 3XX's are informational messages (more data coming) * Responses can be multi-line. Client knows response is complete when * it reads a 1XX or 2XX line. */ #define CP_IS_SUCCESS(i) ((i) >= 100 && (i) < 200) #define CP_IS_FAILURE(i) ((i) >= 200 && (i) < 300) #define CP_IS_ALLDONE(i) ((i) >= 100 && (i) < 300) /* success 1xx */ #define CP_RSP_QUIT "101 Goodbye" CP_EOL #define CP_RSP_COM_COMPLETE "102 Command completed successfully" CP_EOL #define CP_RSP_QRY_COMPLETE "103 Query complete" CP_EOL #define CP_RSP_TELEMETRY "104 Telemetry %s" CP_EOL #define CP_RSP_EXPRANGE "105 Hostrange expansion %s" CP_EOL /* failure 2xx */ #define CP_ERR_UNKNOWN "201 Unknown command" CP_EOL #define CP_ERR_PARSE "202 Parse error" CP_EOL #define CP_ERR_TOOLONG "203 Command too long" CP_EOL #define CP_ERR_INTERNAL "204 Internal powermand error: %s::%d" CP_EOL #define CP_ERR_HOSTLIST "205 Hostlist error: %s" CP_EOL #define CP_ERR_CLIBUSY "208 Command in progress" CP_EOL #define CP_ERR_NOSUCHNODES "209 No such nodes: %s" CP_EOL #define CP_ERR_COM_COMPLETE "210 Command completed with errors" CP_EOL #define CP_ERR_QRY_COMPLETE "211 Query completed with errors" CP_EOL #define CP_ERR_UNIMPL "213 Command cannot be handled by power control device(s)" CP_EOL /* informational 3xx */ #define CP_INFO_HELP \ "301 nodes - query node list" CP_EOL \ "301 device [] - query power control device status" CP_EOL \ "301 status [] - query power status" CP_EOL \ "301 on - power on" CP_EOL \ "301 off - power off" CP_EOL \ "301 cycle - power cycle" CP_EOL \ "301 reset - hardware reset (if available)" CP_EOL \ "301 temp [] - query temperature (if available)" CP_EOL \ "301 beacon [] - query beacon status (if available)" CP_EOL \ "301 flash - set beacon to ON (if available)" CP_EOL \ "301 unflash - set beacon to OFF (if available)" CP_EOL \ "301 telemetry - toggle telemetry display" CP_EOL \ "301 exprange - toggle host range expansion" CP_EOL \ "301 help - display help" CP_EOL \ "301 quit - logout" CP_EOL #define CP_INFO_STATUS \ "302 on: %s" CP_EOL \ "302 off: %s" CP_EOL \ "302 unknown: %s" CP_EOL #define CP_INFO_XSTATUS "303 %s: %s" CP_EOL #define CP_INFO_DEVICE \ "304 %s: state=%s reconnects=%-3.3d actions=%-3.3d type=%s hosts=%s" CP_EOL #define CP_INFO_TELEMETRY "305 %s" CP_EOL #define CP_INFO_NODES "306 %s" CP_EOL #define CP_INFO_XNODES "307 %s" CP_EOL #define CP_INFO_ACTERROR "308 %s" CP_EOL #endif /* PM_CLIENT_PROTO_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/argv.c0000644000000000000000000000664211113347050013073 0ustar /*****************************************************************************\ * $Id: argv.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2003-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "xmalloc.h" #include "argv.h" /* make a copy of the first word in str and advance str past it */ static char *_nextargv(char **strp, char *ignore) { char *str = *strp; char *word; int len; char *cpy = NULL; while (*str && (isspace(*str) || strchr(ignore, *str))) str++; word = str; while (*str && !(isspace(*str) || strchr(ignore, *str))) str++; len = str - word; if (len > 0) { cpy = (char *)xmalloc(len + 1); memcpy(cpy, word, len); cpy[len] = '\0'; } *strp = str; return cpy; } /* return number of space seperated words in str */ static int _sizeargv(char *str, char *ignore) { int count = 0; do { while (*str && (isspace(*str) || strchr(ignore, *str))) str++; if (*str) count++; while (*str && !(isspace(*str) || strchr(ignore, *str))) str++; } while (*str); return count; } int argv_length(char **argv) { int i = 0; while (argv[i] != NULL) i++; return i; } char **argv_append(char **argv, char *s) { int argc = argv_length(argv) + 1; argv = (char **)xrealloc((char *)argv, sizeof(char *) * (argc + 1)); argv[argc - 1] = xstrdup(s); argv[argc] = NULL; return argv; } /* Create a null-terminated argv array given a command line. * Characters in the 'ignore' set are treated like white space. */ char **argv_create(char *cmdline, char *ignore) { int argc = _sizeargv(cmdline, ignore); char **argv = (char **)xmalloc(sizeof(char *) * (argc + 1)); int i; for (i = 0; i < argc; i++) { argv[i] = _nextargv(&cmdline, ignore); assert(argv[i] != NULL); } argv[i] = NULL; return argv; } /* Destroy a null-terminated argv array. */ void argv_destroy(char **argv) { int i; for (i = 0; argv[i] != NULL; i++) xfree((void *)argv[i]); xfree((void *)argv); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xregex.h0000644000000000000000000000640311113347050013436 0ustar /*****************************************************************************\ * $Id: xregex.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_XREGEX_H #define PM_XREGEX_H /* A compiled regex. */ typedef struct xregex_struct *xregex_t; /* A container for regexec subexpression match results. */ typedef struct xregex_match_struct *xregex_match_t; /* Create/destroy a regex object. */ xregex_t xregex_create(void); void xregex_destroy(xregex_t x); /* Compile a regex defined by 's' into a regex object created with * xregex_create(). 's' may contain the strings "\n" or "\r" in expanded * form and they will be converted into 0xa and 0xd respectively. * If 'withsub' is TRUE, the regex will support subexpression matches. * Program terminates with detailed message on compilation error. */ void xregex_compile(xregex_t x, const char *s, bool withsub); /* Execute a compiled regex against the provided string 's'. * If xm is non-NULL, place match info there. * Returns TRUE on a match. */ bool xregex_exec(xregex_t x, const char *s, xregex_match_t xm); /* Create/destroy/recycle a match result object. * The maximum number of matches is specified at creation in 'nmatch'. * Allow one match for main expression, and an additional match for * each subexpression. */ xregex_match_t xregex_match_create(int nmatch); void xregex_match_destroy(xregex_match_t xm); void xregex_match_recycle(xregex_match_t xm); /* Retrieve a copy of the main/subexpression match specified by 'index', * or NULL if no match. The caller must free result with xfree(). * Index 0 is for the main expression, other indices are for subexpressions. * This function must be called only after xregex_exec(). */ char *xregex_match_sub_strdup(xregex_match_t xm, int index); /* Similar to xregex_match_sub_strdup(xm, 0) but includes unmatched * leading text. Caller must free result with xfree(). */ char *xregex_match_strdup(xregex_match_t xm); /* Strlen of above. */ int xregex_match_strlen(xregex_match_t xm); #endif /* PM_XREGEX_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/powermand.c0000644000000000000000000001557411115264426014143 0ustar /*****************************************************************************\ * $Id: powermand.c 1100 2008-12-02 16:57:58Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include "xtypes.h" #include "list.h" #include "hostlist.h" #include "parse_util.h" #include "xmalloc.h" #include "xpoll.h" #include "xsignal.h" #include "pluglist.h" #include "device.h" #include "daemon.h" #include "client.h" #include "error.h" #include "debug.h" #include "hprintf.h" #include "powerman.h" /* prototypes */ static void _usage(char *prog); static void _version(void); static void _noop_handler(int signum); static void _exit_handler(int signum); static void _select_loop(void); #define OPTIONS "c:fhd:VsY1" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { {"conf", required_argument, 0, 'c'}, {"foreground", no_argument, 0, 'f'}, {"help", no_argument, 0, 'h'}, {"debug", required_argument, 0, 'd'}, {"version", no_argument, 0, 'V'}, {"stdio", no_argument, 0, 's'}, {"short-circuit-delay", no_argument, 0, 'Y'}, {"one-client", no_argument, 0, '1'}, {0, 0, 0, 0} }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char **argv) { int c; char *config_filename = NULL; bool daemonize = TRUE; bool use_stdio = FALSE; bool short_circuit_delay = FALSE; bool one_client = FALSE; /* parse command line options */ err_init(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'Y': /* --short-circuit-delay */ short_circuit_delay = TRUE; break; case 'c': /* --conf */ if (!config_filename) config_filename = xstrdup(optarg); break; case 'f': /* --foreground */ daemonize = FALSE; break; case 'd': /* --debug */ { unsigned long val = strtol(optarg, NULL, 0); if ((val == LONG_MAX || val == LONG_MIN) && errno == ERANGE) err_exit(TRUE, "strtol on debug mask"); dbg_setmask(val); } break; case 'V': /* --version */ _version(); /*NOTREACHED*/ break; case 's': /* --stdio */ use_stdio = TRUE; one_client = TRUE; break; case '1': /* --one-client */ one_client = TRUE; break; case 'h': /* --help */ default: _usage(argv[0]); /*NOTREACHED*/ break; } } if (use_stdio && daemonize) err_exit(FALSE, "--stdio should only be used with --foreground"); if (!config_filename) config_filename = hsprintf("%s/%s/%s", X_SYSCONFDIR, "powerman", "powerman.conf"); dev_init(short_circuit_delay); cli_init(); conf_init(config_filename); xfree(config_filename); xsignal(SIGHUP, _noop_handler); xsignal(SIGTERM, _exit_handler); xsignal(SIGINT, _exit_handler); xsignal(SIGPIPE, SIG_IGN); cli_start(use_stdio, one_client); if (daemonize) { char *rundir = hsprintf("%s/run/powerman", X_LOCALSTATEDIR); char *pidfile = hsprintf("%s/powermand.pid", rundir); int *fds, len; cli_listen_fds(&fds, &len); daemon_init(fds, len, rundir, pidfile, DAEMON_NAME); xfree(rundir); xfree(pidfile); err_notty(); dbg_notty(); } /* We now have a socket at listener fd running in listen mode */ /* and a file descriptor for communicating with each device */ _select_loop(); return 0; } static void _usage(char *prog) { printf("Usage: %s [OPTIONS]\n", prog); printf(" -c --conf Specify config file path\n"); printf(" -d --debug Set debug mask [0]\n"); printf(" -f --foreground Don't daemonize\n"); printf(" -V --version Report powerman version\n"); printf(" -s --stdio Talk to client on stdin/stdout\n"); printf(" -1 --one-client Terminate when client disconnects\n"); exit(0); } static void _version(void) { printf("%s\n", VERSION); exit(0); } static void _select_loop(void) { struct timeval tmout; xpollfd_t pfd = xpollfd_create(); timerclear(&tmout); /* start non-blocking connections to all the devices - finish them inside * the poll loop. */ dev_initial_connect(); while (1) { int n; xpollfd_zero(pfd); cli_pre_poll(pfd); dev_pre_poll(pfd); n = xpoll(pfd, timerisset(&tmout) ? &tmout : NULL); timerclear(&tmout); /* * Process activity on client and device fd's. * If a device requires a timeout, for example to reconnect or * to process a scripted delay, tmout is updated. */ cli_post_poll(pfd); dev_post_poll(pfd, &tmout); if (cli_server_done()) break; } xpollfd_destroy(pfd); } static void _noop_handler(int signum) { /* do nothing */ } static void _exit_handler(int signum) { cli_fini(); dev_fini(); conf_fini(); err_exit(FALSE, "exiting on signal %d", signum); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/debug.c0000644000000000000000000000767411113347050013230 0ustar /*****************************************************************************\ * $Id: debug.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include "xtypes.h" #include "xmalloc.h" #include "debug.h" #define DBG_BUFLEN 1024 static unsigned long dbg_channel_mask = 0; static bool dbg_ttyvalid = TRUE; void dbg_notty(void) { dbg_ttyvalid = FALSE; } void dbg_setmask(unsigned long mask) { dbg_channel_mask = mask; } static char *_channel_name(unsigned long channel) { static struct { unsigned long chan; char *desc; } tab[] = DBG_NAME_TAB; int i = 0; while (tab[i].chan != 0) { if (tab[i].chan == channel) break; i++; } return (tab[i].chan == 0 ? "" : tab[i].desc); } static char *_time(void) { time_t now = time(NULL); char *str = ctime(&now); str[strlen(str) - 1] = '\0'; /* lose trailing \n */ return str; } /* * Report message on stdout/syslog if dbg_channel_mask permits. */ void dbg_wrapped(unsigned long channel, const char *fmt, ...) { va_list ap; if ((channel & dbg_channel_mask) == channel) { char buf[DBG_BUFLEN]; va_start(ap, fmt); vsnprintf(buf, DBG_BUFLEN, fmt, ap); /* overflow ignored on purpose */ va_end(ap); if (dbg_ttyvalid) fprintf(stderr, "%s %s: %s\n", _time(), _channel_name(channel), buf); else syslog(LOG_DEBUG, "%s: %s", _channel_name(channel), buf); } } /* * Convert memory to string, turning non-printable character into "C" * representation. * mem (IN) target memory * len (IN) number of characters to convert * RETURN string (caller must free) */ char *dbg_memstr(char *mem, int len) { int i, j; int strsize = len * 4; /* worst case */ char *str = xmalloc(strsize + 1); for (i = j = 0; i < len; i++) { switch (mem[i]) { case '\r': strcpy(&str[j], "\\r"); j += 2; break; case '\n': strcpy(&str[j], "\\n"); j += 2; break; case '\t': strcpy(&str[j], "\\t"); j += 2; break; default: if (isprint(mem[i])) str[j++] = mem[i]; else { sprintf(&str[j], "\\%.3o", mem[i]); j += 4; } break; } assert(j <= strsize || i == len); } str[j] = '\0'; return str; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/device.h0000644000000000000000000000321011113347050013364 0ustar /*****************************************************************************\ * $Id: device.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_DEVICE_H #define PM_DEVICE_H void dev_init(bool short_circuit_delay); void dev_fini(void); void dev_initial_connect(void); void dev_pre_poll(xpollfd_t pfd); void dev_post_poll(xpollfd_t pfd, struct timeval *tv); #endif /* PM_DEVICE_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/pluglist.h0000644000000000000000000000627311113347050014004 0ustar /*****************************************************************************\ * $Id: pluglist.h 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_PLUGLIST_H #define PM_PLUGLIST_H /* * Pluglists are used to map node names to plug names within a given device * context. */ typedef struct { char *name; /* how the plug is known to the device */ char *node; /* node name */ } Plug; typedef struct pluglist_iterator *PlugListIterator; typedef struct pluglist *PlugList; typedef enum { EPL_SUCCESS, EPL_DUPNODE, EPL_UNKPLUG, EPL_DUPPLUG, EPL_NOPLUGS, EPL_NONODES } pl_err_t; /* Create a PlugList. plugnames may be NULL (indicating plug creation is * deferred until pluglist_map() time), or a hardwired list of plug names. * ('hardwired' means the list of plugnames is fixed at creation time). */ PlugList pluglist_create(List plugnames); /* Destroy a PlugList and its Plugs */ void pluglist_destroy(PlugList pl); /* Assign node names to plugs. nodelist and pluglist are strings in compressed * hostlist format (the degenerate case of which is a single name). pluglist * can be NULL, indicating * - if hardwired plugs, available plugs should be assigned to nodes in order * - else (not hardwired), assume plug names are the same as node names. */ pl_err_t pluglist_map(PlugList pl, char *nodelist, char *pluglist); /* Search PlugList for a Plug with matching plug name. Return pointer to Plug * on success (points to actual list entry), or NULL on search failure. * Only plugs with non-NULL node fields are returned. */ Plug * pluglist_find(PlugList pl, char *name); /* An iterator interface for PlugLists, similar to the iterators in list.h. */ PlugListIterator pluglist_iterator_create(PlugList pl); void pluglist_iterator_destroy(PlugListIterator itr); Plug * pluglist_next(PlugListIterator itr); #endif /* PM_PLUGLIST_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xpoll.c0000644000000000000000000001641611113347050013272 0ustar /*****************************************************************************\ * $Id: xpoll.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif /* Force select() on darwin as poll() can't be used on devices (e.g. ptys) * FIXME: This should be a configure-time test. */ #if defined(__APPLE__) && defined(HAVE_POLL) #undef HAVE_POLL #endif #include #include #include #include #include #if HAVE_POLL_H #include #endif #if HAVE_SYS_SELECT_H #include #endif #include #include "xtime.h" #include "xtypes.h" #include "xmalloc.h" #include "error.h" #include "xpoll.h" #ifndef MAX #define MAX(x, y) (((x) > (y))? (x) : (y)) #endif #define XPOLLFD_ALLOC_CHUNK 16 #define XPOLLFD_MAGIC 0x56452334 struct xpollfd { int magic; #if HAVE_POLL unsigned int nfds; unsigned int ufds_size; struct pollfd *ufds; #else /* select */ int maxfd; fd_set rset; fd_set wset; #endif }; #if HAVE_POLL static short xflag2flag(short x) { short f = 0; if ((x & XPOLLIN)) f |= POLLIN; if ((x & XPOLLOUT)) f |= POLLOUT; if ((x & XPOLLHUP)) f |= POLLHUP; if ((x & XPOLLERR)) f |= POLLERR; if ((x & XPOLLNVAL)) f |= POLLNVAL; return f; } static short flag2xflag(short f) { short x = 0; if ((f & POLLIN)) x |= XPOLLIN; if ((f & POLLOUT)) x |= XPOLLOUT; if ((f & POLLHUP)) x |= XPOLLHUP; if ((f & POLLERR)) x |= XPOLLERR; if ((f & POLLNVAL)) x |= XPOLLNVAL; return x; } #endif /* a null tv means no timeout (could block forever) */ int xpoll(xpollfd_t pfd, struct timeval *tv) { struct timeval tv_cpy, *tvp = NULL; struct timeval start, end, delta; int n; if (tv) { tv_cpy = *tv; if (gettimeofday(&start, NULL) < 0) err_exit(TRUE, "gettimeofday"); tvp = &tv_cpy; } /* repeat poll if interrupted */ do { #if HAVE_POLL int tv_msec = -1; if (tvp) tv_msec = tvp->tv_sec * 1000 + tvp->tv_usec / 1000; n = poll(pfd->ufds, pfd->nfds, tv_msec); #else n = select(pfd->maxfd + 1, &pfd->rset, &pfd->wset, NULL, tvp); #endif if (n < 0 && errno != EINTR) err_exit(TRUE, "select/poll"); if (n < 0 && tv != NULL) { if (gettimeofday(&end, NULL) < 0) err_exit(TRUE, "gettimeofday"); timersub(&end, &start, &delta); /* delta = end - start */ timersub(tv, &delta, tvp); /* *tvp = tv - delta */ } } while (n < 0); return n; } #if HAVE_POLL static void _grow_pollfd(xpollfd_t pfd, int n) { assert(pfd->magic == XPOLLFD_MAGIC); while (pfd->ufds_size < n) { pfd->ufds_size += XPOLLFD_ALLOC_CHUNK; pfd->ufds = (struct pollfd *)xrealloc((char *)pfd->ufds, sizeof(struct pollfd) * pfd->ufds_size); } } #endif xpollfd_t xpollfd_create(void) { xpollfd_t pfd = (xpollfd_t)xmalloc(sizeof(struct xpollfd)); pfd->magic = XPOLLFD_MAGIC; #if HAVE_POLL pfd->ufds_size += XPOLLFD_ALLOC_CHUNK; pfd->ufds = (struct pollfd *)xmalloc(sizeof(struct pollfd)*pfd->ufds_size); pfd->nfds = 0; #else pfd->maxfd = 0; FD_ZERO(&pfd->rset); FD_ZERO(&pfd->wset); #endif return pfd; } void xpollfd_destroy(xpollfd_t pfd) { assert(pfd->magic == XPOLLFD_MAGIC); pfd->magic = 0; #if HAVE_POLL if (pfd->ufds != NULL) xfree(pfd->ufds); #endif xfree(pfd); } void xpollfd_zero(xpollfd_t pfd) { assert(pfd->magic == XPOLLFD_MAGIC); #if HAVE_POLL pfd->nfds = 0; /*memset(pfd->ufds, 0, sizeof(struct pollfd) * pfd->ufds_size);*/ #else FD_ZERO(&pfd->rset); FD_ZERO(&pfd->wset); pfd->maxfd = 0; #endif } void xpollfd_set(xpollfd_t pfd, int fd, short events) { #if HAVE_POLL int i; assert(pfd->magic == XPOLLFD_MAGIC); for (i = 0; i < pfd->nfds; i++) { if (pfd->ufds[i].fd == fd) { pfd->ufds[i].events |= xflag2flag(events); break; } } if (i == pfd->nfds) { /* not found */ _grow_pollfd(pfd, ++pfd->nfds); pfd->ufds[i].fd = fd; pfd->ufds[i].events = xflag2flag(events); } #else assert(pfd->magic == XPOLLFD_MAGIC); assert(fd < FD_SETSIZE); if (events & XPOLLIN) FD_SET(fd, &pfd->rset); if (events & XPOLLOUT) FD_SET(fd, &pfd->wset); pfd->maxfd = MAX(pfd->maxfd, fd); #endif } char * xpollfd_str(xpollfd_t pfd, char *str, int len) { int i; #if HAVE_POLL int maxfd = -1; #endif assert(pfd->magic == XPOLLFD_MAGIC); #if HAVE_POLL memset(str, '.', len); for (i = 0; i < pfd->nfds; i++) { int fd = pfd->ufds[i].fd; short revents = pfd->ufds[i].revents; if (fd < len - 1) { if (revents) { if (revents & (POLLNVAL | POLLERR | POLLHUP)) str[fd] = 'E'; else if (revents & POLLIN) str[fd] = 'I'; else if (revents & POLLOUT) str[fd] = 'O'; } if (fd > maxfd) maxfd = fd; } } assert(maxfd + 1 < len); str[maxfd + 1] = '\0'; #else for (i = 0; i <= pfd->maxfd; i++) { if (FD_ISSET(i, &pfd->rset)) str[i] = 'I'; else if (FD_ISSET(i, &pfd->wset)) str[i] = 'O'; else str[i] = '.'; } assert(i < len); str[i] = '\0'; #endif return str; } short xpollfd_revents(xpollfd_t pfd, int fd) { short flags = 0; #if HAVE_POLL int i; assert(pfd->magic == XPOLLFD_MAGIC); for (i = 0; i < pfd->nfds; i++) { if (pfd->ufds[i].fd == fd) { flags = flag2xflag(pfd->ufds[i].revents); break; } } #else assert(pfd->magic == XPOLLFD_MAGIC); if (FD_ISSET(fd, &pfd->rset)) flags |= XPOLLIN; if (FD_ISSET(fd, &pfd->wset)) flags |= XPOLLOUT; #endif return flags; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/plmpower.c0000644000000000000000000005243611113347050014003 0ustar /*****************************************************************************\ * $Id: plmpower.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2007-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* plmpower.c - control Insteon/X10 devices via SmartLabs PLM 2412S */ /* References: * For PLM bits, see "Insteon Modem Developer's Guide", * http://www.smarthome.com/manuals/2412sdevguide.pdf * For general Insteon protocol, see "Insteon: The Details" * http://www.insteon.net/pdf/insteondetails.pdf * For Insteon commands, see "EZBridge Reference Manual", Appendix B. * http://www.simplehomenet.com/Downloads/EZBridge%20Manual.pdf * Also: "Quick Reference Guide for Smarthome Device Manager for INSTEON" * http://www.insteon.net/sdk/files/dm/docs/ */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "xtypes.h" #include "xmalloc.h" #include "error.h" #include "argv.h" #include "xread.h" #include "xtime.h" #include "xpoll.h" /* PLM commands */ #define IM_RECV_STD 0x50 /* plm -> host */ #define IM_RECV_EXT 0x51 #define IM_RECV_X10 0x52 #define IM_RECV_ALL_LINK_COMPLETE 0x53 #define IM_RECV_BUTTON 0x54 #define IM_RECV_RESET 0x55 #define IM_RECV_ALL_LINK_FAIL 0x56 #define IM_RECV_ALL_LINK_REC 0x57 #define IM_RECV_ALL_LINK_STAT 0x58 #define IM_GET_INFO 0x60 /* host -> plm */ #define IM_SEND_ALL_LINK 0x61 #define IM_SEND 0x62 #define IM_SEND_X10 0x63 #define IM_START_ALL_LINK 0x64 #define IM_CANCEL_ALL_LINK 0x65 #define IM_SET_HOST_CATEGORY 0x66 #define IM_RESET 0x67 #define IM_SET_ACK 0x68 #define IM_GET_FIRST_ALL_LINK_REC 0x69 #define IM_GET_NEXT_ALL_LINK_REC 0x6A #define IM_CONFIG_SET 0x6B #define IM_GET_SENDER_ALL_LINK_REC 0x6C #define IM_LED_ON 0x6D #define IM_LED_OFF 0x6E #define IM_MANAGE_ALL_LINK_REC 0x6F #define IM_SET_NACK 0x70 #define IM_SET_ACK2 0x71 #define IM_RF_SLEEP 0x72 #define IM_CONFIG_GET 0x73 /* PLM control bytes */ #define IM_STX 0x02 #define IM_ACK 0x06 #define IM_NAK 0x15 /* PLM config bits */ #define IM_CONFIG_BUTLINK_DISABLE 0x80 #define IM_CONFIG_MONITOR_MODE 0x40 #define IM_CONFIG_AUTOLED_DISABLE 0x20 #define IM_CONFIG_DEADMAN_DISABLE 0x10 #define IM_MAX_RECVLEN 28 /* response to send extended msg */ /* Insteon commands (incomplete) */ #define CMD_GRP_ASSIGN 0x01 #define CMD_GRP_DELETE 0x02 #define CMD_PING 0x10 #define CMD_ON 0x11 #define CMD_ON_FAST 0x12 #define CMD_OFF 0x13 #define CMD_OFF_FAST 0x14 #define CMD_BRIGHT 0x15 #define CMD_DIM 0x16 #define CMD_MAN_START 0x17 #define CMD_MAN_STOP 0x18 #define CMD_STATUS 0x19 /* X10 commands */ #define X10_ALL_UNITS_OFF 0x0 #define X10_ALL_LIGHTS_ON 0x1 #define X10_ON 0x2 #define X10_OFF 0x3 #define X10_DIM 0x4 #define X10_BRIGHT 0x5 #define X10_ALL_LIGHTS_OFF 0x6 #define X10_EXT_CODE 0x7 #define X10_HAIL_REQ 0x8 #define X10_HAIL_ACK 0x9 #define X10_PRESET_DIM 0xa #define X10_PRESET_DIM2 0xb #define X10_EXT_DATA 0xc #define X10_STATUS_ON 0xd #define X10_STATUS_OFF 0xe #define X10_STATUS_REQ 0xf /* X10 encoding of housecode A-P and device code 1-16 */ static const int x10_enc[] = { 0x6, 0xe, 0x2, 0xa, 0x1, 0x9, 0x5, 0xd, 0x7, 0xf, 0x3, 0xb, 0x0, 0x8, 0x4, 0xc }; typedef struct { char h; char m; char l; } insaddr_t; typedef struct { char house; char unit; } x10addr_t; static void usage(void); static int open_serial(char *dev); static void shell(int fd); static void docmd(int fd, char **av, int *quitp); static void help(void); static void plm_reset(int fd); static void plm_info(int fd); static void plm_on(int fd, char *addrstr); static void plm_off(int fd, char *addrstr); static void plm_status(int fd, char *addrstr); static void plm_ping(int fd, char *addrstr); static int str2insaddr(char *s, insaddr_t *ip); static char *insaddr2str(insaddr_t *ip); static int str2x10addr(char *s, x10addr_t *xp); static int wait_until_ready(int fd, int timeout_msec); static int plm_recv(int fd, char cmd, char *recv, int recvlen); static void plm_docmd(int fd, char *send, int sendlen, char *recv, int recvlen); static void plm_send_insteon(int fd, insaddr_t *ip, char cmd1, char cmd2); static int plm_recv_insteon(int fd, insaddr_t *ip, char *cmd1, char *cmd2, int timeout_msec); static void plm_send_x10(int fd, x10addr_t *xp, char cmd); static int testmode = 0; static char test_plug = 0; static unsigned long x10_attempts = 3; static int insteon_tmout = 1000; /* (msec) */ #define OPTIONS "d:Tx:t:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static struct option longopts[] = { { "device", required_argument, 0, 'd' }, { "testmode", no_argument, 0, 'T' }, { "x10-attempts", required_argument, 0, 'x' }, { "timeout", required_argument, 0, 't' }, {0,0,0,0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { char *device = NULL; int c; int fd = -1; err_init(basename(argv[0])); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != EOF) { switch (c) { case 'd': /* --device */ device = optarg; break; case 'T': /* --testmode */ testmode = 1; break; case 't': /* --timeout */ insteon_tmout = strtoul(optarg, NULL, 10); if (insteon_tmout < 1) err_exit(FALSE, "timeout must be >= 1 msec"); break; case 'x': /* --x10-attempts */ x10_attempts = strtoul(optarg, NULL, 10); if (x10_attempts < 1) err_exit(FALSE, "X10 attempts must be >= 1"); break; default: usage(); break; } } if (optind < argc) usage(); if (!testmode) { if (device == NULL) usage(); fd = open_serial(device); } shell(fd); if (close(fd) < 0) err_exit(TRUE, "error closing %s", device); exit(0); } static void usage(void) { fprintf(stderr, "Usage: plmpower -d device \n"); exit(1); } /* Open the PLM's serial device [dev], lock it in a manner consistent * with powerman and conman, set baud rate, line discipline, etc, * and return file descriptor. */ static int open_serial(char *dev) { struct termios tio; int fd; fd = open(dev, O_RDWR | O_NOCTTY); if (fd < 0) err_exit(TRUE, "could not open %s", dev); if (lockf(fd, F_TLOCK, 0) < 0) err_exit(TRUE, "could not lock %s", dev); tcgetattr(fd, &tio); tio.c_cflag = B19200 | CS8 | CLOCAL | CREAD; tio.c_iflag = IGNBRK | IGNPAR; tio.c_oflag = ONLRET; tio.c_lflag = 0; tio.c_cc[VMIN] = 1; tio.c_cc[VTIME] = 1; tcsetattr(fd, TCSANOW, &tio); return fd; } /* Prompt the user and parse the command line into an argv array which * is passed to docmd() for execution against PLM on [fd]. Returns when * the user wants to quit. */ static void shell(int fd) { char buf[128]; char **av; int quit = 0; while (!quit) { printf("plmpower> "); fflush(stdout); if (fgets(buf, sizeof(buf), stdin)) { av = argv_create(buf, ""); docmd(fd, av, &quit); argv_destroy(av); } else quit = 1; } } /* Parse argv array [av] and execute any commands against PLM on [fd]. * If the user wants to quit, set [*quitp] to 1. */ static void docmd(int fd, char **av, int *quitp) { if (av[0] != NULL) { if (strcmp(av[0], "help") == 0) { help(); } else if (strcmp(av[0], "quit") == 0) { *quitp = 1; } else if (strcmp(av[0], "info") == 0) { if (testmode) printf("Unavailable in test mode\n"); else plm_info(fd); } else if (strcmp(av[0], "reset") == 0) { if (testmode) printf("Unavailable in test mode\n"); else plm_reset(fd); } else if (strcmp(av[0], "on") == 0) { if (argv_length(av) != 2) printf("Usage: on addr\n"); else plm_on(fd, av[1]); } else if (strcmp(av[0], "off") == 0) { if (argv_length(av) != 2) printf("Usage: off addr\n"); else plm_off(fd, av[1]); } else if (strcmp(av[0], "status") == 0) { if (argv_length(av) != 2) printf("Usage: status addr\n"); else plm_status(fd, av[1]); } else if (strcmp(av[0], "ping") == 0) { if (testmode) printf("Unavailable in test mode\n"); else if (argv_length(av) != 2) printf("Usage: ping addr\n"); else plm_ping(fd, av[1]); } else printf("type \"help\" for a list of commands\n"); } } /* Summarize interactive "shell" commands. */ static void help(void) { printf("Valid commands are:\n"); printf(" info get PLM info\n"); printf(" reset reset the PLM (clears all-link db)\n"); printf(" on addr turn on device\n"); printf(" off addr turn on device\n"); printf(" status addr query status of device\n"); printf(" ping addr time round trip request/response to device\n"); printf("Where addr is Insteon (e.g. 1A.2B.3C) or X10 (e.g. G12)\n"); } /* Send the ON command to [addrstr], either X10 or Insteon, via PLM on [fd]. * If Insteon, retry the command until a response is received. * If X10, send it x10_attempts times whether we need to or not. */ static void plm_on(int fd, char *addrstr) { insaddr_t i; x10addr_t x; char cmd2; if (str2insaddr(addrstr, &i)) { if (testmode) { test_plug = 1; } else { do { plm_send_insteon(fd, &i, CMD_ON_FAST, 0xff); } while (!plm_recv_insteon(fd, &i, NULL, &cmd2, insteon_tmout)); if (cmd2 == 0) err_exit(FALSE, "on command failed"); } } else if (str2x10addr(addrstr, &x)) { if (!testmode) plm_send_x10(fd, &x, X10_ON); } else err(FALSE, "could not parse address"); } /* Send the OFF command to [addrstr], either X10 or Insteon, via PLM on [fd]. * If Insteon, retry the command until a response is received. * If X10, send it x10_attempts times whether we need to or not. */ static void plm_off(int fd, char *addrstr) { insaddr_t i; x10addr_t x; char cmd2; if (str2insaddr(addrstr, &i)) { if (testmode) { test_plug = 0; } else { do { plm_send_insteon(fd, &i, CMD_OFF_FAST, 0); } while (!plm_recv_insteon(fd, &i, NULL, &cmd2, insteon_tmout)); if (cmd2 != 0) err_exit(FALSE, "off command failed"); } } else if (str2x10addr(addrstr, &x)) { if (!testmode) plm_send_x10(fd, &x, X10_OFF); } else err(FALSE, "could not parse address"); } /* Send the Insteon STATUS command to [addrstr] via PLM on [fd] and print * the result on stdout. Retry the command until a response is received. * X10 addresses are accepted here, but we always report status as "unknown". */ static void plm_status(int fd, char *addrstr) { insaddr_t i; x10addr_t x; char cmd2; if (str2insaddr(addrstr, &i)) { if (testmode) { cmd2 = test_plug; } else { do { plm_send_insteon(fd, &i, CMD_STATUS, 0); } while (!plm_recv_insteon(fd, &i, NULL, &cmd2, insteon_tmout)); } printf("%s: %.2hhX\n", addrstr, cmd2); } else if (str2x10addr(addrstr, &x)) printf("%s: unknown\n", addrstr); else err(FALSE, "could not parse address"); } /* Send the Insteon PING command to [addrstr] via PLM on [fd] * and print the round-trip time and number of retries on stdout. * Retry the command until a response is received. */ static void plm_ping(int fd, char *addrstr) { insaddr_t i; x10addr_t x; struct timeval t1, t2, delta; int tries = 0; /* FIXME: make this work more like ping(8). */ if (str2insaddr(addrstr, &i)) { if (gettimeofday(&t1, NULL) < 0) err_exit(TRUE, "gettimeofday"); do { tries++; plm_send_insteon(fd, &i, CMD_PING, 0); } while (!plm_recv_insteon(fd, &i, NULL, NULL, insteon_tmout)); if (gettimeofday(&t2, NULL) < 0) err_exit(TRUE, "gettimeofday"); timersub(&t2, &t1, &delta); printf("PING from %s: retries=%d time=%.2lf ms\n", addrstr, tries - 1, (double)delta.tv_usec / 1000.0 + (double)delta.tv_sec * 1000.0); } else if (str2x10addr(addrstr, &x)) err(FALSE, "ping is only for Insteon devices"); else err(FALSE, "could not parse address"); } /* Convert a string [s] to Insteon address [ip]. * Return 1 on success, 0 on failure. */ static int str2insaddr(char *s, insaddr_t *ip) { if (sscanf(s, "%2hhx.%2hhx.%2hhx", &ip->h, &ip->m, &ip->l) != 3) return 0; return 1; } /* Convert an Insteon address [ip] to string [returned]. * Returns pointer to static data overwritten on each call. */ static char * insaddr2str(insaddr_t *ip) { static char s[64]; snprintf(s, sizeof(s), "%.2hhX.%.2hhX.%.2hhX", ip->h, ip->m, ip->l); return s; } /* Convert a string [s] to X10 address [xp]. * Return 1 on success, 0 on failure. */ static int str2x10addr(char *s, x10addr_t *xp) { unsigned long i; if (isupper(s[0])) s[0] = tolower(s[0]); if (!islower(s[0]) || s[0] > 'p') return 0; xp->house = x10_enc[s[0] - 'a']; i = strtoul(&s[1], NULL, 10) - 1; if (i >= sizeof(x10_enc)/sizeof(int)) return 0; xp->unit = x10_enc[i]; return 1; } /* Wait until PLM on [fd] has data ready for reading or [timeout_msec] expires. * Return value is 1 on data ready, 0 on timeout. */ static int wait_until_ready(int fd, int timeout_msec) { struct timeval tv = { timeout_msec / 1000, (timeout_msec % 1000) * 1000 }; xpollfd_t pfd = xpollfd_create(); int res = 1; xpollfd_set(pfd, fd, XPOLLIN); if (xpoll(pfd, &tv) == 0) res = 0; xpollfd_destroy(pfd); return res; } /* Receive a command or a response from the PLM on [fd] and return it * in [recv] of length [recvlen]. If the a command is received which does * not match [cmd], silently discard it. If a NAK is received instead of STX * indicating the PLM was busy when the last command was sent, return 1, * otherwise return 0. */ static int plm_recv(int fd, char cmd, char *recv, int recvlen) { char b[IM_MAX_RECVLEN]; retry: xread_all(fd, &b[0], 1); if (b[0] == IM_NAK) return 1; else if (b[0] != IM_STX) err_exit(FALSE, "expected IM_STX or IM_NAK, got %.2hhX", b[0]); xread_all(fd, &b[1], 1); if (b[1] != cmd) { switch (b[1]) { case IM_RECV_STD: xread_all(fd, &b[2], 9); break; case IM_RECV_EXT: xread_all(fd, &b[2], 23); break; case IM_RECV_X10: xread_all(fd, &b[2], 2); break; case IM_RECV_ALL_LINK_COMPLETE: xread_all(fd, &b[2], 8); break; case IM_RECV_BUTTON: xread_all(fd, &b[2], 1); break; case IM_RECV_RESET: break; case IM_RECV_ALL_LINK_FAIL: xread_all(fd, &b[2], 5); break; case IM_RECV_ALL_LINK_REC: xread_all(fd, &b[2], 8); break; case IM_RECV_ALL_LINK_STAT: xread_all(fd, &b[2], 1); break; default: err_exit(FALSE, "unexpected command: %.2hhX", b[1]); break; } goto retry; } xread_all(fd, &b[2], recvlen - 2); memcpy(recv, b, recvlen); return 0; } /* Send a command [send] of length [sendlen] to PLM on [fd], then * read the response into [recv] of length [recvlen]. If a NAK is * received, retry the command until it is ACKed. */ static void plm_docmd(int fd, char *send, int sendlen, char *recv, int recvlen) { int nak; do { xwrite_all(fd, send, sendlen); nak = plm_recv(fd, send[1], recv, recvlen); if (!nak && recv[recvlen - 1] == IM_NAK) nak = 1; /* FIXME: retry appropriate here or is command broken? */ if (nak) usleep(1000*100); /* wait 100ms for PLM to become ready */ } while (nak); } /* Send IM_RESET to the PLM on [fd]. */ static void plm_reset(int fd) { char send[2] = { IM_STX, IM_RESET }; char recv[3]; plm_docmd(fd, send, sizeof(send), recv, sizeof(recv)); printf("PLM reset complete\n"); } /* Send IM_GET_INFO to the PLM on [fd] and print the response on stdout. */ static void plm_info(int fd) { insaddr_t i; char send[2] = { IM_STX, IM_GET_INFO }; char recv[9]; plm_docmd(fd, send, sizeof(send), recv, sizeof(recv)); i.h = recv[2]; i.m = recv[3]; i.l = recv[4]; printf("id=%s dev=%.2hhX.%.2hhX vers=%hhd\n", insaddr2str(&i), recv[5], recv[6], recv[7]); } /* Send an Insteon command described by [cmd1] and [cmd2] to address [ip] * using PLM on [fd]. The command will be retried until accepted by the PLM. */ static void plm_send_insteon(int fd, insaddr_t *ip, char cmd1, char cmd2) { char send[8] = { IM_STX, IM_SEND, ip->h, ip->m, ip->l, 3, cmd1, cmd2 }; char recv[9]; plm_docmd(fd, send, sizeof(send), recv, sizeof(recv)); } /* Receive an Insteon command from address [i] into [cmd1] and [cmd2] * via PLM on [fd]. If more than [timeout_msec] milliseconds elapses, * give up and return 0, else return 1. */ static int plm_recv_insteon(int fd, insaddr_t *ip, char *cmd1, char *cmd2, int timeout_msec) { char recv[11]; int nak; do { /* FIXME: timeout is restarted if an unsolicited command is received */ if (!wait_until_ready(fd, timeout_msec)) return 0; nak = plm_recv(fd, IM_RECV_STD, recv, sizeof(recv)); if (nak) err_exit(FALSE, "unexpected NAK while waiting for Insteon packet"); } while (ip->h != recv[2] || ip->m != recv[3] || ip->l != recv[4]); if (cmd1) *cmd1 = recv[9]; if (cmd2) *cmd2 = recv[10]; return 1; } /* Send an X10 command [cmd] to address [xp] via PLM on [fd]. * Repeat the command x10_attempts times for good measure because we will * get no acknowledgement from the device. */ static void plm_send_x10(int fd, x10addr_t *xp, char cmd) { char senda[4] = { IM_STX, IM_SEND_X10, (xp->house << 4) | xp->unit, 0 }; char sendb[4] = { IM_STX, IM_SEND_X10, (xp->house << 4) | cmd, 0x80 }; char recv[5]; int i; for (i = 0; i < x10_attempts; i++) { plm_docmd(fd, senda, sizeof(senda), recv, sizeof(recv)); plm_docmd(fd, sendb, sizeof(sendb), recv, sizeof(recv)); } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/daemon.h0000644000000000000000000000307611115264426013411 0ustar /*****************************************************************************\ * $Id: daemon.h 1100 2008-12-02 16:57:58Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifndef PM_DAEMON_H #define PM_DAEMON_H void daemon_init(int *skipfds, int skipfdslen, char *rundir, char *pidfile, char *logname); #endif /* PM_DAEMON_H */ /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/device.c0000644000000000000000000013322311113347050013367 0ustar /*****************************************************************************\ * $Id: device.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* Primary entry points to this module are: * * initialization - dev_init() and dev_fini() are called from powermand. * dev_initial_connect(), called one time only after dev_init(), begins * connection establishment to all devices. * * parser - at config file parse time, each device is instantiated by * the dev_create() function, which puts the device on the local 'dev_devices' * list. * * client - calls dev_enqueue_actions() to cause one type of script to * run across possibly multiple devices. This function returns an "action * count", and each time an action completes, a callback is made to the client * which decrements its count. When the count reaches zero, the client knows * this module is all done operating on its behalf and can respond to the * user. * * select - the select/poll loop calls the dev_pre_poll() and dev_post_poll() * functions, the former to make a list of file descriptors which when ready * should unblock select/poll; the latter to move data between device cbufs * and the device file descriptors, to manage timeouts, and to move * device scripts along when new state develops (e.g. data in cbufs). * * FIXME: the Device type is not externally opaque as it ought to be: * - parser creates Device with dev_create() but then initializes lots * of Device fields based on parsed device specification * - client pulls out plug names & stats for --device response */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "list.h" #include "hostlist.h" #include "cbuf.h" #include "xtypes.h" #include "parse_util.h" #include "xpoll.h" #include "xmalloc.h" #include "xregex.h" #include "pluglist.h" #include "device.h" #include "arglist.h" #include "device_private.h" #include "error.h" #include "debug.h" #include "client_proto.h" #include "hprintf.h" #include "xtime.h" /* ExecCtx's are the state for the execution of a block of statements. * They are stacked on the Action (new ExecCtx pushed when executing an * inner block). */ typedef struct { List plugs; /* name(s) used for send "%s" (NULL=all) */ List block; /* List of stmts */ ListIterator stmtitr; /* next stmt in block */ Stmt *cur; /* current stmt */ PlugListIterator plugitr; /* used by foreach */ bool processing; /* flag used by stmts, ifon/ifoff */ } ExecCtx; /* Actions are queued on a device and executed one at a time. Each action * represents a request to run a particular script on a device, for a set of * plugs. Actions can be enqueued by the client or internally (e.g. login). */ #define ACT_MAGIC 0xb00bb000 #define MAX_LEVELS 2 typedef struct { int magic; int com; /* one of the PM_* above */ List exec; /* stack of ExecCtxs (outer block is first) */ ActionCB complete_fun; /* callback for action completion */ VerbosePrintf vpf_fun; /* callback for device telemetry */ int client_id; /* client id so completion can find client */ ActError errnum; /* errno for action */ struct timeval time_stamp; /* time stamp for timeouts */ struct timeval delay_start; /* time stamp for delay completion */ ArgList arglist; /* argument for query actions (list of Arg's) */ } Action; static bool _process_stmt(Device *dev, Action *act, ExecCtx *e, struct timeval *timeout); static bool _process_ifonoff(Device *dev, Action *act, ExecCtx *e); static bool _process_foreach(Device *dev, Action *act, ExecCtx *e); static bool _process_setplugstate(Device * dev, Action *act, ExecCtx *e); static bool _process_expect(Device * dev, Action *act, ExecCtx *e); static bool _process_send(Device * dev, Action *act, ExecCtx *e); static bool _process_delay(Device * dev, Action *act, ExecCtx *e, struct timeval *timeout); static int _match_name(Device * dev, void *key); static bool _handle_read(Device * dev); static bool _handle_write(Device * dev); static void _process_action(Device * dev, struct timeval *timeout); static bool _timeout(struct timeval *timestamp, struct timeval *timeout, struct timeval *timeleft); static int _get_all_script(Device * dev, int com); static int _get_ranged_script(Device * dev, int com); static int _enqueue_actions(Device * dev, int com, hostlist_t hl, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist); static Action *_create_action(Device * dev, int com, List plugs, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist); static int _enqueue_targetted_actions(Device * dev, int com, hostlist_t hl, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist); static char *_getregex_buf(cbuf_t b, xregex_t re, xregex_match_t xm); static bool _command_needs_device(Device * dev, hostlist_t hl); static void _enqueue_ping(Device * dev, struct timeval *timeout); static void _enqueue_login(Device *dev); static void _disconnect(Device * dev); static bool _connect(Device * dev); static bool _reconnect(Device * dev, struct timeval *timeout); static bool _time_to_reconnect(Device * dev, struct timeval *timeout); static List dev_devices = NULL; static bool short_circuit_delay = FALSE; static void _dbg_actions(Device * dev) { char tmpstr[1024]; Action *act; ListIterator itr; tmpstr[0] = '\0'; itr = list_iterator_create(dev->acts); while ((act = list_next(itr))) { snprintf(tmpstr + strlen(tmpstr), sizeof(tmpstr) - strlen(tmpstr), "%d,", act->com); } list_iterator_destroy(itr); if (strlen(tmpstr) > 0) tmpstr[strlen(tmpstr) - 1] = '\0'; /* zap trailing comma */ dbg(DBG_ACTION, "%s: %s", dev->name, tmpstr); } static void _memtrans(char *m, int len, char from, char to) { int i; for (i = 0; i < len; i++) { if (m[i] == from) m[i] = to; } } /* * Apply regular expression to the contents of a cbuf_t. * If there is a match, return (and consume) from the beginning * of the buffer to the last character of the match. * NOTE: embedded \0 chars are converted to \377 because libc regex * functions would treat these as string terminators. As a result, * \0 chars cannot be matched explicitly. * b (IN) buffer to apply regex to * re (IN) regular expression * xm (OUT) subexpression matches * RETURN String match (caller must free) or NULL if no match */ static char *_getregex_buf(cbuf_t b, xregex_t re, xregex_match_t xm) { int bytes_peeked, dropped, matchlen; char *str; int maxpeeksize = cbuf_used(b); str = xmalloc(maxpeeksize + 1); bytes_peeked = cbuf_peek(b, str, maxpeeksize); if (bytes_peeked <= 0) { /* FIXME: any -1 handling needed? */ if (bytes_peeked < 0) err(TRUE, "_getregex_buf: cbuf_peek returned %d", bytes_peeked); xfree(str); return NULL; } assert(bytes_peeked <= maxpeeksize); _memtrans(str, bytes_peeked, '\0', '\377'); str[bytes_peeked] = '\0'; if (!xregex_exec(re, str, xm)) { xfree(str); return NULL; } matchlen = xregex_match_strlen(xm); dropped = cbuf_drop(b, matchlen); if (dropped != matchlen) err((dropped < 0), "_getregex_buf: cbuf_drop returned %d", dropped); return str; } static ExecCtx *_create_exec_ctx(Device *dev, List block, List plugs) { ExecCtx *new = (ExecCtx *)xmalloc(sizeof(ExecCtx)); new->stmtitr = list_iterator_create(block); new->cur = list_next(new->stmtitr); new->block = block; new->plugs = plugs; new->plugitr = NULL; new->processing = FALSE; return new; } static void _destroy_exec_ctx(ExecCtx *e) { if (e->stmtitr != NULL) list_iterator_destroy(e->stmtitr); e->stmtitr = NULL; e->cur = NULL; if (e->plugs) list_destroy(e->plugs); e->plugs = NULL; xfree(e); } static void _rewind_action(Action *act) { ExecCtx *e; /* get back to the context for the outer block */ while ((e = list_pop(act->exec))) { if (list_is_empty(act->exec)) { list_push(act->exec, e); break; } _destroy_exec_ctx(e); } /* reset outer block iterator and current pointer */ if (e) { list_iterator_reset(e->stmtitr); e->cur = list_next(e->stmtitr); } } static Action *_create_action(Device * dev, int com, List plugs, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist) { Action *act; ExecCtx *e; dbg(DBG_ACTION, "_create_action: %d", com); act = (Action *) xmalloc(sizeof(Action)); act->magic = ACT_MAGIC; act->com = com; act->complete_fun = complete_fun; act->vpf_fun = vpf_fun; act->client_id = client_id; act->exec = list_create((ListDelF)_destroy_exec_ctx); e = _create_exec_ctx(dev, dev->scripts[act->com], plugs); list_push(act->exec, e); act->errnum = ACT_ESUCCESS; act->arglist = arglist ? arglist_link(arglist) : NULL; timerclear(&act->time_stamp); return act; } static void _destroy_action(Action * act) { assert(act->magic == ACT_MAGIC); act->magic = 0; dbg(DBG_ACTION, "_destroy_action: %d", act->com); if (act->exec) list_destroy(act->exec); act->exec = NULL; if (act->arglist) arglist_unlink(act->arglist); act->arglist = NULL; xfree(act); } /* initialize this module */ void dev_init(bool Sopt) { dev_devices = list_create((ListDelF) dev_destroy); short_circuit_delay = Sopt; } /* tear down this module */ void dev_fini(void) { list_destroy(dev_devices); } /* add a device to the device list (called from config file parser) */ void dev_add(Device * dev) { list_append(dev_devices, dev); } /* * Client needs access to device list to process "devices" query. */ List dev_getdevices(void) { return dev_devices; } /* * Test whether timeout has occurred * time_stamp (IN) * timeout (IN) * timeleft (OUT) if timeout has not occurred, put time left here * RETURN TRUE if (time_stamp + timeout > now) */ static bool _timeout(struct timeval *time_stamp, struct timeval *timeout, struct timeval *timeleft) { struct timeval now; struct timeval limit; bool result = FALSE; /* limit = time_stamp + timeout */ timeradd(time_stamp, timeout, &limit); if (gettimeofday(&now, NULL) < 0) err_exit(TRUE, "gettimeofday"); if (timercmp(&now, &limit, >=)) /* if now >= limit */ result = TRUE; if (result == FALSE) timersub(&limit, &now, timeleft); /* timeleft = limit - now */ else timerclear(timeleft); return result; } /* * If tv is less than timeout, or timeout is zero, set timeout = tv. */ void _update_timeout(struct timeval *timeout, struct timeval *tv) { if (timercmp(tv, timeout, <) || !timerisset(timeout)) *timeout = *tv; } /* * Helper for _reconnect(). * Return TRUE if OK to attempt reconnect. If FALSE, put the time left * in timeout if it is less than timeout or if timeout is zero. */ static bool _time_to_reconnect(Device * dev, struct timeval *timeout) { static int rtab[] = { 1, 2, 4, 8, 15, 30, 60 }; int max_rtab_index = sizeof(rtab) / sizeof(int) - 1; int rix = dev->retry_count - 1; struct timeval timeleft, retry; bool reconnect = TRUE; if (dev->retry_count > 0) { timerclear(&retry); retry.tv_sec = rtab[rix > max_rtab_index ? max_rtab_index : rix]; if (!_timeout(&dev->last_retry, &retry, &timeleft)) reconnect = FALSE; if (timeout && !reconnect) _update_timeout(timeout, &timeleft); } return reconnect; } static bool _connect(Device * dev) { bool connected; assert(dev->connect != NULL); if (gettimeofday(&dev->last_retry, NULL) < 0) err_exit(TRUE, "gettimeofday"); dev->retry_count++; connected = dev->connect(dev); if (connected) _enqueue_login(dev); return connected; } static bool _reconnect(Device *dev, struct timeval *timeout) { bool connected = FALSE; if (dev->connect_state != DEV_NOT_CONNECTED) _disconnect(dev); if (_time_to_reconnect(dev, timeout)) connected = _connect(dev); return connected; } /* helper for dev_check_actions/dev_enqueue_actions */ static bool _command_needs_device(Device * dev, hostlist_t hl) { bool needed = FALSE; PlugListIterator itr; Plug *plug; itr = pluglist_iterator_create(dev->plugs); while ((plug = pluglist_next(itr))) { if (plug->node != NULL && hostlist_find(hl, plug->node) != -1) { needed = TRUE; break; } } pluglist_iterator_destroy(itr); return needed; } /* * Return true if all devices targetted by hostlist implement the * specified action. */ bool dev_check_actions(int com, hostlist_t hl) { Device *dev; ListIterator itr; bool valid = TRUE; assert(hl != NULL); itr = list_iterator_create(dev_devices); while ((dev = list_next(itr))) { if (_command_needs_device(dev, hl)) { if (!dev->scripts[com] && _get_all_script(dev, com) == -1 && _get_ranged_script(dev, com) == -1) { valid = FALSE; break; } } } list_iterator_destroy(itr); return valid; } /* * Translate a command from a client into actions for devices. * Return an action count so the client be notified when all the * actions "check in". */ int dev_enqueue_actions(int com, hostlist_t hl, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist) { Device *dev; ListIterator itr; int total = 0; itr = list_iterator_create(dev_devices); while ((dev = list_next(itr))) { int count; if (!dev->scripts[com] && _get_all_script(dev, com) == -1 && _get_ranged_script(dev, com) == -1) continue; /* unimplemented script */ if (hl && !_command_needs_device(dev, hl)) continue; /* uninvolved device */ count = _enqueue_actions(dev, com, hl, complete_fun, vpf_fun, client_id, arglist); if (count > 0 && dev->connect_state != DEV_CONNECTED) dev->retry_count = 0; /* expedite retries on this device since */ total += count; /* the user is beating on us... */ } list_iterator_destroy(itr); return total; } static int _enqueue_actions(Device * dev, int com, hostlist_t hl, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist) { Action *act; int count = 0; switch (com) { case PM_LOG_IN: /* reset script of preempted action so it starts over */ if (!list_is_empty(dev->acts)) { act = list_peek(dev->acts); _rewind_action(act); dbg(DBG_ACTION, "resetting iterator for non-login action"); } act = _create_action(dev, com, NULL, complete_fun, vpf_fun, client_id, arglist); list_prepend(dev->acts, act); count++; break; case PM_LOG_OUT: case PM_PING: act = _create_action(dev, com, NULL, complete_fun, vpf_fun, client_id, arglist); list_append(dev->acts, act); count++; break; case PM_POWER_ON: case PM_POWER_OFF: case PM_BEACON_ON: case PM_BEACON_OFF: case PM_POWER_CYCLE: case PM_RESET: case PM_STATUS_PLUGS: case PM_STATUS_TEMP: case PM_STATUS_BEACON: count += _enqueue_targetted_actions(dev, com, hl, complete_fun, vpf_fun, client_id, arglist); break; default: assert(FALSE); } return count; } /* return "all" version of script if defined else -1 */ static int _get_all_script(Device * dev, int com) { int new = -1; switch (com) { case PM_POWER_ON: if (dev->scripts[PM_POWER_ON_ALL]) new = PM_POWER_ON_ALL; break; case PM_POWER_OFF: if (dev->scripts[PM_POWER_OFF_ALL]) new = PM_POWER_OFF_ALL; break; case PM_POWER_CYCLE: if (dev->scripts[PM_POWER_CYCLE_ALL]) new = PM_POWER_CYCLE_ALL; break; case PM_RESET: if (dev->scripts[PM_RESET_ALL]) new = PM_RESET_ALL; break; case PM_STATUS_PLUGS: if (dev->scripts[PM_STATUS_PLUGS_ALL]) new = PM_STATUS_PLUGS_ALL; break; case PM_STATUS_TEMP: if (dev->scripts[PM_STATUS_TEMP_ALL]) new = PM_STATUS_TEMP_ALL; break; case PM_STATUS_BEACON: if (dev->scripts[PM_STATUS_BEACON_ALL]) new = PM_STATUS_BEACON_ALL; break; default: break; } return new; } /* return "ranged" version of script if defined else -1 */ static int _get_ranged_script(Device * dev, int com) { int new = -1; switch (com) { case PM_POWER_ON: if (dev->scripts[PM_POWER_ON_RANGED]) new = PM_POWER_ON_RANGED; break; case PM_POWER_OFF: if (dev->scripts[PM_POWER_OFF_RANGED]) new = PM_POWER_OFF_RANGED; break; case PM_POWER_CYCLE: if (dev->scripts[PM_POWER_CYCLE_RANGED]) new = PM_POWER_CYCLE_RANGED; break; case PM_RESET: if (dev->scripts[PM_RESET_RANGED]) new = PM_RESET_RANGED; break; default: break; } return new; } static bool _is_query_action(int com) { switch (com) { case PM_STATUS_PLUGS: case PM_STATUS_PLUGS_ALL: case PM_STATUS_TEMP: case PM_STATUS_TEMP_ALL: case PM_STATUS_BEACON: case PM_STATUS_BEACON_ALL: return TRUE; default: return FALSE; } /*NOTREACHED*/ } static int _enqueue_targetted_actions(Device * dev, int com, hostlist_t hl, ActionCB complete_fun, VerbosePrintf vpf_fun, int client_id, ArgList arglist) { List new_acts = list_create((ListDelF) _destroy_action); bool all = TRUE; Plug *plug; PlugListIterator itr; int count = 0; Action *act; List ranged_plugs = NULL; int used_ranged_plugs = 0; assert(hl != NULL); if (!(ranged_plugs = list_create((ListDelF)NULL))) goto cleanup; itr = pluglist_iterator_create(dev->plugs); while ((plug = pluglist_next(itr))) { /* antisocial to gratuitously turn on/off unused plug */ if (plug->node == NULL) { all = FALSE; continue; } /* check if node name for plug matches the target */ if (hostlist_find(hl, plug->node) == -1) { all = FALSE; continue; } if (!list_append(ranged_plugs, plug)) goto cleanup; /* append action to 'new_acts' */ if (dev->scripts[com] != NULL) { /* maybe we only have _ALL... */ List plugs; if (!(plugs = list_create((ListDelF)NULL))) goto cleanup; if (!list_append(plugs, plug)) { list_destroy(plugs); goto cleanup; } act = _create_action(dev, com, plugs, complete_fun, vpf_fun, client_id, arglist); list_append(new_acts, act); } } pluglist_iterator_destroy(itr); /* Try _all version of script. */ if (all || _is_query_action(com)) { int ncom = _get_all_script(dev, com); if (ncom != -1) { act = _create_action(dev, ncom, NULL, complete_fun, vpf_fun, client_id, arglist); list_append(dev->acts, act); count++; } } /* _all didn't work, try _ranged. */ if (count == 0) { int ncom = _get_ranged_script(dev, com); if (ncom != -1) { act = _create_action(dev, ncom, ranged_plugs, complete_fun, vpf_fun, client_id, arglist); list_append(dev->acts, act); used_ranged_plugs++; count++; } } /* _all and _ranged didn't work, try singlet. */ if (count == 0) { while ((act = list_pop(new_acts))) { list_append(dev->acts, act); count++; } } cleanup: list_destroy(new_acts); if (!used_ranged_plugs) list_destroy(ranged_plugs); return count; } /* Called upon success of connect or finish_connect device methods. */ static void _enqueue_login(Device *dev) { _enqueue_actions(dev, PM_LOG_IN, NULL, NULL, NULL, 0, NULL); } static void _disconnect(Device * dev) { Action *act; assert(dev->disconnect != NULL); dev->disconnect(dev); /* empty buffers */ cbuf_flush(dev->from); cbuf_flush(dev->to); /* update state */ dev->connect_state = DEV_NOT_CONNECTED; dev->logged_in = FALSE; /* delete PM_LOG_IN action queued for this device, if any */ if (((act = list_peek(dev->acts)) != NULL) && act->com == PM_LOG_IN) _destroy_action(list_dequeue(dev->acts)); } static void _act_completion(Action *act, Device *dev) { assert(act->complete_fun != NULL); switch (act->errnum) { case ACT_ECONNECTTIMEOUT: act->complete_fun(act->client_id, act->errnum, "%s: connect timeout", dev->name); break; case ACT_ELOGINTIMEOUT: act->complete_fun(act->client_id, act->errnum, "%s: login timeout", dev->name); break; case ACT_EEXPFAIL: act->complete_fun(act->client_id, act->errnum, "%s: action timed out waiting for expected response", dev->name); break; case ACT_EABORT: act->complete_fun(act->client_id, act->errnum, "%s: action aborted due to previous action timeout", dev->name); break; case ACT_ESUCCESS: act->complete_fun(act->client_id, act->errnum, NULL); break; } } /* * Process the script for the current action for this device. * Update timeout and return if one of the script elements stalls. * Start the next action if we complete this one. */ static void _process_action(Device * dev, struct timeval *timeout) { bool stalled = FALSE; Action *act; while ((act = list_peek(dev->acts)) && !stalled) { struct timeval timeleft; ExecCtx *e = list_peek(act->exec); assert(e != NULL); dbg(DBG_ACTION, "_process_action: processing action %d", act->com); _dbg_actions(dev); /* initialize timeout (action is brand new) */ if (!timerisset(&act->time_stamp)) if (gettimeofday(&act->time_stamp, NULL) < 0) err_exit(TRUE, "gettimeofday"); /* timeout exceeded? */ if (_timeout(&act->time_stamp, &dev->timeout, &timeleft)) { if (!(dev->connect_state == DEV_CONNECTED)) act->errnum = ACT_ECONNECTTIMEOUT; else if (!dev->logged_in) { act->errnum = ACT_ELOGINTIMEOUT; } else act->errnum = ACT_EEXPFAIL; if (act->vpf_fun) { static char mem[MAX_DEV_BUF]; int len = cbuf_peek(dev->from, mem, MAX_DEV_BUF); char *memstr = dbg_memstr(mem, len); if (!(dev->connect_state == DEV_CONNECTED)) act->vpf_fun(act->client_id, "connect(%s): timeout", dev->name); else act->vpf_fun(act->client_id, "recv(%s): '%s'", dev->name, memstr); xfree(memstr); } /* not connected but timeout not yet exceeded */ } else if (!(dev->connect_state == DEV_CONNECTED)) { stalled = TRUE; /* not connnected */ /* connected - process statements */ } else { /* If a statement has an inner block to execute, it pushes a new * ExecCtx onto the action's exec stack and returns. We notice * the top of the exec stack has changed and try to exec the next * stmt (now of the new context) and so on. When the inner block * is done, the stack is popped and the "current" stmt is back to * the one that initiated the inner block. */ do { e = list_peek(act->exec); stalled = !_process_stmt(dev, act, e, timeout); } while (e != list_peek(act->exec)); } /* stalled - update timeout for select */ if (stalled) { _update_timeout(timeout, &timeleft); /* most recently attempted stmt completed successfully */ } else if (act->errnum == ACT_ESUCCESS) { e->cur = list_next(e->stmtitr); /* next stmt this block */ if (!e->cur) { /* ...or new block */ ExecCtx *e2 = list_pop(act->exec); assert(e2 == e); _destroy_exec_ctx(e2); e = list_peek(act->exec); } /* completed action successfully! */ if (e == NULL) { if (act->com == PM_LOG_IN) dev->logged_in = TRUE; if (act->complete_fun) _act_completion(act, dev); _destroy_action(list_dequeue(dev->acts)); dev->stat_successful_actions++; } /* most recently attempted stmt completed with error */ } else { ActError res = act->errnum; /* save for ref after _destroy_action */ if (act->complete_fun) _act_completion(act, dev); _destroy_action(list_dequeue(dev->acts)); /* if one action failed, abort the rest in the device queue * in preparation for reconnect. */ while ((act = list_dequeue(dev->acts)) != NULL) { act->errnum = (res == ACT_EEXPFAIL ? ACT_EABORT : res); if (act->complete_fun) _act_completion(act, dev); _destroy_action(act); } /* reconnect/login if expect timed out */ if ((dev->connect_state == DEV_CONNECTED)) { dbg(DBG_DEVICE, "_process_action: disconnecting due to error"); _reconnect(dev, timeout); break; } } } /* while loop */ } bool _process_stmt(Device *dev, Action *act, ExecCtx *e, struct timeval *timeout) { bool finished = 0; switch (e->cur->type) { case STMT_EXPECT: finished = _process_expect(dev, act, e); break; case STMT_SEND: finished = _process_send(dev, act, e); break; case STMT_SETPLUGSTATE: finished = _process_setplugstate(dev, act, e); break; case STMT_DELAY: finished = _process_delay(dev, act, e, timeout); break; case STMT_FOREACHPLUG: case STMT_FOREACHNODE: finished = _process_foreach(dev, act, e); break; case STMT_IFON: case STMT_IFOFF: finished = _process_ifonoff(dev, act, e); break; } return finished; } static bool _process_foreach(Device *dev, Action *act, ExecCtx *e) { bool finished = TRUE; ExecCtx *new; Plug *plug = NULL; /* we store a plug iterator in the ExecCtx */ if (e->plugitr == NULL) e->plugitr = pluglist_iterator_create(dev->plugs); /* Each time the inner block is executed, its argument will be * a new plug name. Pick that up here. */ if (e->cur->type == STMT_FOREACHPLUG) { plug = pluglist_next(e->plugitr); } else if (e->cur->type == STMT_FOREACHNODE) { do { plug = pluglist_next(e->plugitr); } while (plug && plug->node == NULL); } else { assert(0); } /* plug list not exhausted? start a new execution context for this block */ if (plug != NULL) { List plugs; if (!(plugs = list_create((ListDelF)NULL))) goto cleanup; if (!list_append(plugs, plug)) { list_destroy(plugs); goto cleanup; } new = _create_exec_ctx(dev, e->cur->u.foreach.stmts, plugs); list_push(act->exec, new); } else { pluglist_iterator_destroy(e->plugitr); e->plugitr = NULL; } /* we won't be called again if we don't push a new context */ cleanup: return finished; } static bool _process_ifonoff(Device *dev, Action *act, ExecCtx *e) { bool finished = TRUE; if (e->processing) { /* if returning from subblock, we are done */ e->processing = FALSE; } else { InterpState state = ST_UNKNOWN; bool condition = FALSE; ExecCtx *new; if (e->plugs && list_count(e->plugs) > 0) { Plug *plug = list_peek(e->plugs); Arg *arg = arglist_find(act->arglist, plug->node); if (arg) state = arg->state; } if (e->cur->type == STMT_IFON && state == ST_ON) condition = TRUE; else if (e->cur->type == STMT_IFOFF && state == ST_OFF) condition = TRUE; else if (state == ST_UNKNOWN) { act->errnum = ACT_EEXPFAIL; /* FIXME */ } /* condition met? start a new execution context for this block */ if (condition) { List plugs; ListIterator itr; Plug *plug; e->processing = TRUE; /* achu: previous context's plugs could get destroy, * so must copy plugs to a new list. */ if (!(plugs = list_create((ListDelF)NULL))) goto cleanup; if (!(itr = list_iterator_create(e->plugs))) { list_destroy(plugs); goto cleanup; } while ((plug = list_next(itr))) { if (!list_append(plugs, plug)) { list_destroy(plugs); list_iterator_destroy(itr); goto cleanup; } } new = _create_exec_ctx(dev, e->cur->u.ifonoff.stmts, plugs); list_push(act->exec, new); list_iterator_destroy(itr); } } cleanup: return finished; } static bool _process_setplugstate(Device *dev, Action *act, ExecCtx *e) { bool finished = TRUE; char *plug_name = NULL; /* * Usage: setplugstate [plug] status [interps] * plug can be literal plug name, or regex match, or omitted, * (implying target plug name). */ if (e->cur->u.setplugstate.plug_name) /* literal */ plug_name = xstrdup(e->cur->u.setplugstate.plug_name); if (!plug_name) /* regex match */ plug_name = xregex_match_sub_strdup(dev->xmatch, e->cur->u.setplugstate.plug_mp); if (!plug_name && (e->plugs && list_count(e->plugs) > 0)) { Plug *plug = list_peek(e->plugs); if (plug->name) plug_name = xstrdup(plug->name);/* use action target */ } /* if no plug name, do nothing */ if (plug_name) { char *str = xregex_match_sub_strdup(dev->xmatch, e->cur->u.setplugstate.stat_mp); Plug *plug = pluglist_find(dev->plugs, plug_name); if (str && plug && plug->node) { InterpState state = ST_UNKNOWN; ListIterator itr; Interp *i; Arg *arg; itr = list_iterator_create(e->cur->u.setplugstate.interps); while ((i = list_next(itr))) { if (xregex_exec(i->re, str, NULL)) { state = i->state; break; } } list_iterator_destroy(itr); if ((arg = arglist_find(act->arglist, plug->node))) { arg->state = state; if (arg->val) xfree(arg->val); arg->val = xstrdup(str); } } if (str) xfree(str); /* if no match, do nothing */ xfree(plug_name); } return finished; } /* return TRUE if expect is finished */ static bool _process_expect(Device *dev, Action *act, ExecCtx *e) { bool finished = FALSE; char *str; xregex_match_recycle(dev->xmatch); if ((str = _getregex_buf(dev->from, e->cur->u.expect.exp, dev->xmatch))) { if (act->vpf_fun) { char *matchstr = xregex_match_strdup(dev->xmatch); char *memstr = dbg_memstr(matchstr, strlen(matchstr)); act->vpf_fun(act->client_id, "recv(%s): '%s'", dev->name, memstr); xfree(memstr); xfree(matchstr); } xfree(str); finished = TRUE; } return finished; } static bool _process_send(Device *dev, Action *act, ExecCtx *e) { bool finished = FALSE; /* first time through? */ if (!e->processing) { int dropped = 0; int written; char *str = NULL; if (e->plugs && list_count(e->plugs) > 0) { if (list_count(e->plugs) > 1) { char names[CP_LINEMAX]; ListIterator itr = NULL; hostlist_t hl = NULL; Plug *plug; if (!(hl = hostlist_create(NULL))) { err(TRUE, "_process_send(%s): hostlist_create", dev->name); goto range_cleanup; } if (!(itr = list_iterator_create(e->plugs))) { err(TRUE, "_process_send(%s): list_iterator_create", dev->name); goto range_cleanup; } while ((plug = list_next(itr))) { if (!hostlist_push(hl, plug->name)) { err(TRUE, "_process_send(%s): hostlist_push", dev->name); goto range_cleanup; } } hostlist_sort(hl); if (hostlist_ranged_string(hl, CP_LINEMAX, names) < 0) { err(TRUE, "_process_send(%s): hostlist_ranged_string", dev->name); goto range_cleanup; } str = hsprintf(e->cur->u.send.fmt, names); range_cleanup: if (itr) list_iterator_destroy(itr); if (hl) hostlist_destroy(hl); } else { Plug *plug = list_peek(e->plugs); str = hsprintf(e->cur->u.send.fmt, (plug->name ? plug->name : "[unresolved]")); } } else str = hsprintf(e->cur->u.send.fmt, NULL); if (str) { written = cbuf_write(dev->to, str, strlen(str), &dropped); if (written < 0) err(TRUE, "_process_send(%s): cbuf_write returned %d", dev->name, written); else if (dropped > 0) err(FALSE, "_process_send(%s): buffer overrun, %d dropped", dev->name, dropped); else { char *memstr = dbg_memstr(str, strlen(str)); if (act->vpf_fun) act->vpf_fun(act->client_id, "send(%s): '%s'", dev->name, memstr); xfree(memstr); } assert(written < 0 || (dropped == strlen(str) - written)); } e->processing = TRUE; xfree(str); } if (cbuf_is_empty(dev->to)) { /* finished! */ e->processing = FALSE; finished = TRUE; } return finished; } /* return TRUE if delay is finished */ static bool _process_delay(Device *dev, Action *act, ExecCtx *e, struct timeval *timeout) { bool finished = FALSE; struct timeval delay, timeleft; delay = e->cur->u.delay.tv; /* first time */ if (!e->processing) { if (act->vpf_fun) act->vpf_fun(act->client_id, "delay(%s): %ld.%-6.6ld", dev->name, delay.tv_sec, delay.tv_usec); e->processing = TRUE; if (gettimeofday(&act->delay_start, NULL) < 0) err_exit(TRUE, "gettimeofday"); } /* timeout expired? */ if (short_circuit_delay || _timeout(&act->delay_start, &delay, &timeleft)) { e->processing = FALSE; finished = TRUE; } else _update_timeout(timeout, &timeleft); return finished; } Device *dev_create(const char *name) { Device *dev; int i; dev = (Device *) xmalloc(sizeof(Device)); dev->magic = DEV_MAGIC; dev->name = xstrdup(name); dev->connect_state = DEV_NOT_CONNECTED; dev->fd = NO_FD; dev->acts = list_create((ListDelF) _destroy_action); dev->xmatch = xregex_match_create(MAX_MATCH_POS); dev->data = NULL; timerclear(&dev->timeout); timerclear(&dev->last_retry); timerclear(&dev->last_ping); timerclear(&dev->ping_period); dev->to = cbuf_create(MIN_DEV_BUF, MAX_DEV_BUF); dev->from = cbuf_create(MIN_DEV_BUF, MAX_DEV_BUF); for (i = 0; i < NUM_SCRIPTS; i++) dev->scripts[i] = NULL; dev->plugs = NULL; dev->retry_count = 0; dev->stat_successful_connects = 0; dev->stat_successful_actions = 0; return dev; } /* helper for dev_findbyname */ static int _match_name(Device * dev, void *key) { return (strcmp(dev->name, (char *) key) == 0); } Device *dev_findbyname(char *name) { return list_find_first(dev_devices, (ListFindF) _match_name, name); } void dev_destroy(Device * dev) { int i; assert(dev->magic == DEV_MAGIC); dev->magic = 0; if (dev->connect_state == DEV_CONNECTED) dev->disconnect(dev); xfree(dev->name); xfree(dev->specname); if (dev->data) { assert(dev->destroy != NULL); dev->destroy(dev->data); } list_destroy(dev->acts); if (dev->plugs) pluglist_destroy(dev->plugs); for (i = 0; i < NUM_SCRIPTS; i++) if (dev->scripts[i] != NULL) list_destroy(dev->scripts[i]); cbuf_destroy(dev->to); cbuf_destroy(dev->from); xregex_match_destroy(dev->xmatch); xfree(dev); } static void _enqueue_ping(Device * dev, struct timeval *timeout) { struct timeval timeleft; if (dev->scripts[PM_PING] != NULL && timerisset(&dev->ping_period)) { if (_timeout(&dev->last_ping, &dev->ping_period, &timeleft)) { _enqueue_actions(dev, PM_PING, NULL, NULL, NULL, 0, NULL); if (gettimeofday(&dev->last_ping, NULL) < 0) err_exit(TRUE, "gettimeofday"); dbg(DBG_ACTION, "%s: enqeuuing ping", dev->name); } else _update_timeout(timeout, &timeleft); } } /* * Called prior to the select loop to initiate connects to all devices. */ void dev_initial_connect(void) { Device *dev; ListIterator itr; itr = list_iterator_create(dev_devices); while ((dev = list_next(itr))) { assert(dev->connect_state == DEV_NOT_CONNECTED); _connect(dev); } list_iterator_destroy(itr); } /* * Select says device is ready for reading. */ static bool _handle_read(Device * dev) { int n; int dropped; assert(dev->magic == DEV_MAGIC); n = cbuf_write_from_fd(dev->from, dev->fd, -1, &dropped); if (n < 0) { err(TRUE, "read error on %s", dev->name); goto err; } if (n == 0) { dbg(DBG_DEVICE, "read returned EOF on %s", dev->name); goto err; } if (dropped > 0) err(FALSE, "%s lost %d chars due to buffer wrap", dev->name, dropped); return FALSE; err: return TRUE; } /* * Select says device is ready for writing. */ static bool _handle_write(Device * dev) { int n; assert(dev->magic == DEV_MAGIC); n = cbuf_read_to_fd(dev->to, dev->fd, -1); if (n < 0) { err(TRUE, "write error on %s", dev->name); goto err; } if (n == 0) { err(FALSE, "write sent no data on %s", dev->name); goto err; } return FALSE; err: return TRUE; } /* One of the poll bits is set for the device - handle it! */ static bool _handle_ready_device(Device *dev, short flags) { assert(dev->connect_state != DEV_NOT_CONNECTED); assert(dev->fd != NO_FD); /* error cases (won't get here with select - only poll) */ if (flags & XPOLLHUP) { err(FALSE, "%s: poll: hangup", dev->name); goto ioerr; } if (flags & XPOLLERR) { err(FALSE, "%s: poll: error", dev->name); goto ioerr; } if (flags & XPOLLNVAL) { err(FALSE, "%s: poll: fd not open", dev->name); goto ioerr; } /* ready for writing */ if (flags & XPOLLOUT) { if (dev->connect_state == DEV_CONNECTING) { assert(dev->finish_connect != NULL); if (!dev->finish_connect(dev)) goto ioerr; if (dev->connect_state == DEV_CONNECTED) _enqueue_login(dev); /* enqueue login if connected */ goto success; /* don't want to test read bit */ } else { assert(dev->connect_state == DEV_CONNECTED); if (_handle_write(dev)) goto ioerr; } } /* ready for reading */ if (flags & XPOLLIN) { if (_handle_read(dev)) goto ioerr; if (dev->preprocess != NULL) dev->preprocess(dev); /* preprocess input, e.g. telnet escapes */ } success: return FALSE; ioerr: return TRUE; } /* * Called before poll to ready pfd. */ void dev_pre_poll(xpollfd_t pfd) { Device *dev; ListIterator itr; itr = list_iterator_create(dev_devices); while ((dev = list_next(itr))) { short flags = 0; if (dev->fd < 0) continue; /* always set read set bits so select will unblock if the * connection is dropped. */ flags |= XPOLLIN; /* need to be in the write set if we are sending anything */ if (dev->connect_state == DEV_CONNECTED) { if (!cbuf_is_empty(dev->to)) flags |= XPOLLOUT; } /* descriptor will become writable after a connect */ if (dev->connect_state == DEV_CONNECTING) flags |= XPOLLOUT; xpollfd_set(pfd, dev->fd, flags); } list_iterator_destroy(itr); } /* * Called after select to process ready file descriptors, timeouts, etc. */ void dev_post_poll(xpollfd_t pfd, struct timeval *timeout) { Device *dev; ListIterator itr; itr = list_iterator_create(dev_devices); while ((dev = list_next(itr))) { short flags = dev->fd != NO_FD ? xpollfd_revents(pfd, dev->fd) : 0; bool ioerr = FALSE; /* A device is "ready", e.g. it can be read/written or has an error */ if (flags) ioerr = _handle_ready_device(dev, flags); /* Either initiate reconnect or recalculate timeout (for backoff) * so poll will unblock then. If successful, _reconnect() * will enqueue a login action which will need processing below. */ if (ioerr || dev->connect_state == DEV_NOT_CONNECTED) _reconnect(dev, timeout); /* can update dev->connect_state */ /* If we are periodically "pinging" this device, we may need to * enqueue a ping action, or update the timeout so poll will * unblock when it is time to enqueue one. */ if (dev->connect_state == DEV_CONNECTED) _enqueue_ping(dev, timeout); /* If any actions are enqueued, process them. This is state machine * activity and I/O to/from cbufs, not device I/O. Update timeout so * poll will unblock to handle non-responsive devices, or processing * of scripted delays. Note that we are not necessarily connected * to the device - users may enqueue actions on an unconnected device, * which expedites a reconnect; if the reconnect then times out, * we have to time out the actions (e.g. tell the user). */ _process_action(dev, timeout); } list_iterator_destroy(itr); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/xsignal.c0000644000000000000000000000401311113347050013567 0ustar /*****************************************************************************\ * $Id: xsignal.c 1087 2008-11-26 22:31:04Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #if HAVE_CONFIG_H #include "config.h" #endif #include #include "xtypes.h" #include "error.h" #include "xsignal.h" xsigfunc_t *xsignal(int signo, xsigfunc_t *func) { struct sigaction act, oact; int n; act.sa_handler = func; sigemptyset(&act.sa_mask); act.sa_flags = 0; if (signo == SIGALRM) { #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; /* SunOS 4.x */ #endif } else { #ifdef SA_RESTART act.sa_flags |= SA_RESTART; /* SVR4, 44BSD */ #endif } n = sigaction(signo, &act, &oact); if (n < 0) err_exit(TRUE, "sigaction"); return (oact.sa_handler); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/src/parse_lex.l0000644000000000000000000001552211164745453014143 0ustar /*****************************************************************************\ * $Id: parse.lex 868 2008-05-21 21:17:04Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton (uselton2@llnl.gov> * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ %x lex_incl lex_str %{ #if HAVE_CONFIG_H #include "config.h" #endif /* N.B. must define YYSTYPE before including parse_tab.h or type will be int. */ #define YYSTYPE char * #include #include #include #include "hostlist.h" #include "parse_tab.h" #include "xtypes.h" #include "list.h" #include "xmalloc.h" #include "error.h" #include "parse_util.h" extern void yyerror(); #define MAX_INCLUDE_DEPTH 10 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; static int linenum[MAX_INCLUDE_DEPTH]; static char *filename[MAX_INCLUDE_DEPTH]; static int include_stack_ptr = 0; static char string_buf[8192]; static char *string_buf_ptr; static List line_ptrs; %} /* Lex Options */ %option nounput %% %{ /* yyin gets initialized in parse.y */ %} #[^\n]*\n { linenum[include_stack_ptr]++; } [ \t\r]+ { /* Eat up white space */ } [\n] { linenum[include_stack_ptr]++; } ([0-9]+)|([0-9]+"."[0-9]*)|("."[0-9]+) { yylval = yytext; return TOK_NUMERIC_VAL; } \$ { return TOK_MATCHPOS; } \" { string_buf_ptr = string_buf; BEGIN(lex_str); } { \" { /* end of string */ int len; BEGIN(INITIAL); *string_buf_ptr = '\0'; len = strlen(string_buf); yylval = xmalloc(len + 1); list_append(line_ptrs, yylval); strncpy(yylval, string_buf, len); yylval[len] = '\0'; return TOK_STRING_VAL; } "\\a" { *string_buf_ptr++ = '\a'; } "\\b" { *string_buf_ptr++ = '\b'; } "\\e" { *string_buf_ptr++ = '\e'; } "\\f" { *string_buf_ptr++ = '\f'; } "\\n" { *string_buf_ptr++ = '\n'; } "\\r" { *string_buf_ptr++ = '\r'; } "\\t" { *string_buf_ptr++ = '\t'; } "\\v" { *string_buf_ptr++ = '\v'; } "\n" { yyerror(); } \\[0-9][0-9][0-9] { *string_buf_ptr++ = strtol(&yytext[1], NULL, 8); } \\(.|\n) { *string_buf_ptr++ = yytext[1]; } [^\\\n\"]+ { char *yptr = yytext; while ( *yptr ) *string_buf_ptr++ = *yptr++; } } listen return TOK_LISTEN; tcpwrappers return TOK_TCP_WRAPPERS; timeout return TOK_DEV_TIMEOUT; pingperiod return TOK_PING_PERIOD; specification return TOK_SPEC; expect return TOK_EXPECT; setplugstate return TOK_SETPLUGSTATE; foreachnode return TOK_FOREACHNODE; foreachplug return TOK_FOREACHPLUG; ifoff return TOK_IFOFF; ifon return TOK_IFON; send return TOK_SEND; delay return TOK_DELAY; login return TOK_LOGIN; logout return TOK_LOGOUT; status return TOK_STATUS; status_all return TOK_STATUS_ALL; on return TOK_ON; on_ranged return TOK_ON_RANGED; on_all return TOK_ON_ALL; off return TOK_OFF; off_ranged return TOK_OFF_RANGED; off_all return TOK_OFF_ALL; cycle return TOK_CYCLE; cycle_ranged return TOK_CYCLE_RANGED; cycle_all return TOK_CYCLE_ALL; reset return TOK_RESET; reset_ranged return TOK_RESET_RANGED; reset_all return TOK_RESET_ALL; ping return TOK_PING; status_temp return TOK_STATUS_TEMP; status_temp_all return TOK_STATUS_TEMP_ALL; status_beacon return TOK_STATUS_BEACON; status_beacon_all return TOK_STATUS_BEACON_ALL; beacon_on return TOK_BEACON_ON; beacon_off return TOK_BEACON_OFF; device return TOK_DEVICE; plug[ \t]+name return TOK_PLUG_NAME; node return TOK_NODE; yes return TOK_YES; no return TOK_NO; \{ return TOK_BEGIN; \} return TOK_END; = return TOK_EQUALS; script return TOK_SCRIPT; alias return TOK_ALIAS; include BEGIN(lex_incl); [ \t]* { /* eat white space */ } [\n] { linenum[include_stack_ptr]++; } [^ \t\n]+ { /* got include file name */ int len; len = strlen(yytext); yytext[len - 1] = '\0'; if ( include_stack_ptr >= MAX_INCLUDE_DEPTH - 1 ) err_exit(FALSE, "Includes nested too deeply" ); include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; yyin = fopen( yytext + 1, "r" ); if ( yyin == NULL ) err_exit(TRUE, "%s", yytext + 1); filename[include_stack_ptr] = xstrdup(yytext + 1); yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ) ); BEGIN(INITIAL); } <> { if (include_stack_ptr == 0) { yyterminate(); } else { /* do I need an fclose(yyin); here? */ yy_delete_buffer( YY_CURRENT_BUFFER ); yy_switch_to_buffer( include_stack[--include_stack_ptr] ); } } . { return TOK_UNRECOGNIZED; } %% /* provide yywrap() to avoid need to link to -lfl */ int yywrap() { return 1; } int scanner_line(void) { return linenum[include_stack_ptr]; } void scanner_line_destroy(char *ptr) { xfree(ptr); } char * scanner_file(void) { return filename[include_stack_ptr]; } void scanner_init(char *filename0) { int i; for (i = 0; i < MAX_INCLUDE_DEPTH; i++) { linenum[i] = 1; filename[i] = NULL; } filename[0] = xstrdup(filename0); line_ptrs = list_create((ListDelF)scanner_line_destroy); } void scanner_fini(void) { int i; for (i = 0; i < MAX_INCLUDE_DEPTH; i++) { if (filename[i] != NULL) xfree(filename[i]); } list_destroy(line_ptrs); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/Makefile.am0000644000000000000000000000065311115072462013235 0ustar ##***************************************************************************** ## $Id: Makefile.am,v 1.4 2005/07/27 00:03:37 achu Exp $ ##***************************************************************************** ## Process this file with automake to produce Makefile.in. ##***************************************************************************** SUBDIRS = etc man scripts src lib test EXTRA_DIST = DISCLAIMER META powerman-2.3.5.orig/test/0000755000000000000000000000000011205355431012154 5ustar powerman-2.3.5.orig/test/t45.conf0000644000000000000000000000021711042726422013440 0ustar include "../etc/phantom.dev" device "d0" "phantom" "./phantom -p v3|&" device "d1" "phantom" "./phantom -p v4|&" node "t0" "d0" node "t1" "d1" powerman-2.3.5.orig/test/t47.exp0000644000000000000000000000072111052045335013307 0ustar on: off: t[0-15] unknown: Command completed successfully on: t[0,8] off: t[1-7,9-15] unknown: Command completed successfully on: t[0,8] off: t[1-7,9-15] unknown: Command completed successfully on: off: t[0-15] unknown: Command completed successfully on: t[0-15] off: unknown: Command completed successfully on: t[0-15] off: unknown: Command completed successfully on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t280000755000000000000000000000064011052145100012505 0ustar #!/bin/sh TEST=t28 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -c t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -0 t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -1 t[0-127] \ -q -c t[0-127] \ -q -0 t[0-127] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/Makefile.in0000644000000000000000000014253011151356676014242 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = vpcd$(EXEEXT) check_PROGRAMS = tpl$(EXEEXT) tregex$(EXEEXT) targv$(EXEEXT) \ baytech$(EXEEXT) icebox$(EXEEXT) gpib$(EXEEXT) dli$(EXEEXT) \ phantom$(EXEEXT) cyclades$(EXEEXT) ipmipower$(EXEEXT) \ cli$(EXEEXT) ilom$(EXEEXT) lom$(EXEEXT) subdir = test DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/ac_curl.m4 \ $(top_srcdir)/config/ac_curses.m4 \ $(top_srcdir)/config/ac_forkpty.m4 \ $(top_srcdir)/config/ac_genders.m4 \ $(top_srcdir)/config/ac_httppower.m4 \ $(top_srcdir)/config/ac_pkgconfig.m4 \ $(top_srcdir)/config/ac_runas.m4 \ $(top_srcdir)/config/ac_wrap.m4 \ $(top_srcdir)/config/x_ac_expand_install_dirs.m4 \ $(top_srcdir)/config/x_ac_meta.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am__objects_1 = xread.$(OBJEXT) error.$(OBJEXT) debug.$(OBJEXT) \ pluglist.$(OBJEXT) hostlist.$(OBJEXT) hash.$(OBJEXT) \ list.$(OBJEXT) hprintf.$(OBJEXT) xregex.$(OBJEXT) \ xmalloc.$(OBJEXT) argv.$(OBJEXT) xpoll.$(OBJEXT) \ xpty.$(OBJEXT) am_baytech_OBJECTS = baytech.$(OBJEXT) $(am__objects_1) baytech_OBJECTS = $(am_baytech_OBJECTS) am__DEPENDENCIES_1 = baytech_DEPENDENCIES = $(am__DEPENDENCIES_1) am_cli_OBJECTS = cli.$(OBJEXT) cli_OBJECTS = $(am_cli_OBJECTS) cli_DEPENDENCIES = $(am__DEPENDENCIES_1) am_cyclades_OBJECTS = cyclades.$(OBJEXT) $(am__objects_1) cyclades_OBJECTS = $(am_cyclades_OBJECTS) cyclades_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dli_OBJECTS = dli.$(OBJEXT) $(am__objects_1) dli_OBJECTS = $(am_dli_OBJECTS) dli_DEPENDENCIES = $(am__DEPENDENCIES_1) am_gpib_OBJECTS = gpib.$(OBJEXT) $(am__objects_1) gpib_OBJECTS = $(am_gpib_OBJECTS) gpib_DEPENDENCIES = $(am__DEPENDENCIES_1) am_icebox_OBJECTS = icebox.$(OBJEXT) $(am__objects_1) icebox_OBJECTS = $(am_icebox_OBJECTS) icebox_DEPENDENCIES = $(am__DEPENDENCIES_1) am_ilom_OBJECTS = ilom.$(OBJEXT) $(am__objects_1) ilom_OBJECTS = $(am_ilom_OBJECTS) ilom_DEPENDENCIES = $(am__DEPENDENCIES_1) am_ipmipower_OBJECTS = ipmipower.$(OBJEXT) $(am__objects_1) ipmipower_OBJECTS = $(am_ipmipower_OBJECTS) ipmipower_DEPENDENCIES = $(am__DEPENDENCIES_1) am_lom_OBJECTS = lom.$(OBJEXT) $(am__objects_1) lom_OBJECTS = $(am_lom_OBJECTS) lom_DEPENDENCIES = $(am__DEPENDENCIES_1) am_phantom_OBJECTS = phantom.$(OBJEXT) $(am__objects_1) phantom_OBJECTS = $(am_phantom_OBJECTS) phantom_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_targv_OBJECTS = targv.$(OBJEXT) $(am__objects_1) targv_OBJECTS = $(am_targv_OBJECTS) targv_DEPENDENCIES = $(am__DEPENDENCIES_1) am_tpl_OBJECTS = tpl.$(OBJEXT) $(am__objects_1) tpl_OBJECTS = $(am_tpl_OBJECTS) tpl_DEPENDENCIES = $(am__DEPENDENCIES_1) am_tregex_OBJECTS = tregex.$(OBJEXT) $(am__objects_1) tregex_OBJECTS = $(am_tregex_OBJECTS) tregex_DEPENDENCIES = $(am__DEPENDENCIES_1) am_vpcd_OBJECTS = vpcd.$(OBJEXT) $(am__objects_1) vpcd_OBJECTS = $(am_vpcd_OBJECTS) vpcd_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(baytech_SOURCES) $(cli_SOURCES) $(cyclades_SOURCES) \ $(dli_SOURCES) $(gpib_SOURCES) $(icebox_SOURCES) \ $(ilom_SOURCES) $(ipmipower_SOURCES) $(lom_SOURCES) \ $(phantom_SOURCES) $(targv_SOURCES) $(tpl_SOURCES) \ $(tregex_SOURCES) $(vpcd_SOURCES) DIST_SOURCES = $(baytech_SOURCES) $(cli_SOURCES) $(cyclades_SOURCES) \ $(dli_SOURCES) $(gpib_SOURCES) $(icebox_SOURCES) \ $(ilom_SOURCES) $(ipmipower_SOURCES) $(lom_SOURCES) \ $(phantom_SOURCES) $(targv_SOURCES) $(tpl_SOURCES) \ $(tregex_SOURCES) $(vpcd_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GCCWARN = @GCCWARN@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURSES = @LIBCURSES@ LIBFORKPTY = @LIBFORKPTY@ LIBGENDERS = @LIBGENDERS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBWRAP = @LIBWRAP@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ META_ALIAS = @META_ALIAS@ META_AUTHOR = @META_AUTHOR@ META_DATE = @META_DATE@ META_LT_AGE = @META_LT_AGE@ META_LT_CURRENT = @META_LT_CURRENT@ META_LT_REVISION = @META_LT_REVISION@ META_NAME = @META_NAME@ META_RELEASE = @META_RELEASE@ META_VERSION = @META_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ WITH_HTTPPOWER_FALSE = @WITH_HTTPPOWER_FALSE@ WITH_HTTPPOWER_TRUE = @WITH_HTTPPOWER_TRUE@ WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ X_BINDIR = @X_BINDIR@ X_DATADIR = @X_DATADIR@ X_EXEC_PREFIX = @X_EXEC_PREFIX@ X_INCLUDEDIR = @X_INCLUDEDIR@ X_INFODIR = @X_INFODIR@ X_LIBDIR = @X_LIBDIR@ X_LIBEXECDIR = @X_LIBEXECDIR@ X_LOCALSTATEDIR = @X_LOCALSTATEDIR@ X_MANDIR = @X_MANDIR@ X_OLDINCLUDEDIR = @X_OLDINCLUDEDIR@ X_PREFIX = @X_PREFIX@ X_SBINDIR = @X_SBINDIR@ X_SHAREDSTATEDIR = @X_SHAREDSTATEDIR@ X_SYSCONFDIR = @X_SYSCONFDIR@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ TESTS_ENVIRONMENT = env "PATH_POWERMAN=$(top_builddir)/src/powerman" \ "PATH_POWERMAND=$(top_builddir)/src/powermand" \ "PATH_ETC=$(top_builddir)/etc" TESTS = t00 t01 t02 t03 t04 t05 t06 t07 t08 t09 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 EXTRA_DIST = $(TESTS) *.exp *.conf CLEANFILES = *.out *.err *.diff common_sources = \ $(top_srcdir)/src/xread.c \ $(top_srcdir)/src/error.c \ $(top_srcdir)/src/debug.c \ $(top_srcdir)/src/pluglist.c \ $(top_srcdir)/src/hostlist.c \ $(top_srcdir)/src/hash.c \ $(top_srcdir)/src/list.c \ $(top_srcdir)/src/hprintf.c \ $(top_srcdir)/src/xregex.c \ $(top_srcdir)/src/xmalloc.c \ $(top_srcdir)/src/argv.c \ $(top_srcdir)/src/xpoll.c \ $(top_srcdir)/src/xpty.c AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib vpcd_SOURCES = vpcd.c $(common_sources) vpcd_LDADD = $(LIBFORKPTY) tpl_SOURCES = tpl.c $(common_sources) tpl_LDADD = $(LIBFORKPTY) tregex_SOURCES = tregex.c $(common_sources) tregex_LDADD = $(LIBFORKPTY) targv_SOURCES = targv.c $(common_sources) targv_LDADD = $(LIBFORKPTY) baytech_SOURCES = baytech.c $(common_sources) baytech_LDADD = $(LIBFORKPTY) icebox_SOURCES = icebox.c $(common_sources) icebox_LDADD = $(LIBFORKPTY) gpib_SOURCES = gpib.c $(common_sources) gpib_LDADD = $(LIBFORKPTY) dli_SOURCES = dli.c $(common_sources) dli_LDADD = $(LIBFORKPTY) ilom_SOURCES = ilom.c $(common_sources) ilom_LDADD = $(LIBFORKPTY) lom_SOURCES = lom.c $(common_sources) lom_LDADD = $(LIBFORKPTY) phantom_SOURCES = phantom.c $(common_sources) phantom_LDADD = $(LIBFORKPTY) $(LIBCURSES) cyclades_SOURCES = cyclades.c $(common_sources) cyclades_LDADD = $(LIBFORKPTY) ipmipower_SOURCES = ipmipower.c $(common_sources) ipmipower_LDADD = $(LIBFORKPTY) cli_SOURCES = cli.c cli_LDADD = $(LIBFORKPTY) -L../lib -lpowerman all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done baytech$(EXEEXT): $(baytech_OBJECTS) $(baytech_DEPENDENCIES) @rm -f baytech$(EXEEXT) $(LINK) $(baytech_LDFLAGS) $(baytech_OBJECTS) $(baytech_LDADD) $(LIBS) cli$(EXEEXT): $(cli_OBJECTS) $(cli_DEPENDENCIES) @rm -f cli$(EXEEXT) $(LINK) $(cli_LDFLAGS) $(cli_OBJECTS) $(cli_LDADD) $(LIBS) cyclades$(EXEEXT): $(cyclades_OBJECTS) $(cyclades_DEPENDENCIES) @rm -f cyclades$(EXEEXT) $(LINK) $(cyclades_LDFLAGS) $(cyclades_OBJECTS) $(cyclades_LDADD) $(LIBS) dli$(EXEEXT): $(dli_OBJECTS) $(dli_DEPENDENCIES) @rm -f dli$(EXEEXT) $(LINK) $(dli_LDFLAGS) $(dli_OBJECTS) $(dli_LDADD) $(LIBS) gpib$(EXEEXT): $(gpib_OBJECTS) $(gpib_DEPENDENCIES) @rm -f gpib$(EXEEXT) $(LINK) $(gpib_LDFLAGS) $(gpib_OBJECTS) $(gpib_LDADD) $(LIBS) icebox$(EXEEXT): $(icebox_OBJECTS) $(icebox_DEPENDENCIES) @rm -f icebox$(EXEEXT) $(LINK) $(icebox_LDFLAGS) $(icebox_OBJECTS) $(icebox_LDADD) $(LIBS) ilom$(EXEEXT): $(ilom_OBJECTS) $(ilom_DEPENDENCIES) @rm -f ilom$(EXEEXT) $(LINK) $(ilom_LDFLAGS) $(ilom_OBJECTS) $(ilom_LDADD) $(LIBS) ipmipower$(EXEEXT): $(ipmipower_OBJECTS) $(ipmipower_DEPENDENCIES) @rm -f ipmipower$(EXEEXT) $(LINK) $(ipmipower_LDFLAGS) $(ipmipower_OBJECTS) $(ipmipower_LDADD) $(LIBS) lom$(EXEEXT): $(lom_OBJECTS) $(lom_DEPENDENCIES) @rm -f lom$(EXEEXT) $(LINK) $(lom_LDFLAGS) $(lom_OBJECTS) $(lom_LDADD) $(LIBS) phantom$(EXEEXT): $(phantom_OBJECTS) $(phantom_DEPENDENCIES) @rm -f phantom$(EXEEXT) $(LINK) $(phantom_LDFLAGS) $(phantom_OBJECTS) $(phantom_LDADD) $(LIBS) targv$(EXEEXT): $(targv_OBJECTS) $(targv_DEPENDENCIES) @rm -f targv$(EXEEXT) $(LINK) $(targv_LDFLAGS) $(targv_OBJECTS) $(targv_LDADD) $(LIBS) tpl$(EXEEXT): $(tpl_OBJECTS) $(tpl_DEPENDENCIES) @rm -f tpl$(EXEEXT) $(LINK) $(tpl_LDFLAGS) $(tpl_OBJECTS) $(tpl_LDADD) $(LIBS) tregex$(EXEEXT): $(tregex_OBJECTS) $(tregex_DEPENDENCIES) @rm -f tregex$(EXEEXT) $(LINK) $(tregex_LDFLAGS) $(tregex_OBJECTS) $(tregex_LDADD) $(LIBS) vpcd$(EXEEXT): $(vpcd_OBJECTS) $(vpcd_DEPENDENCIES) @rm -f vpcd$(EXEEXT) $(LINK) $(vpcd_LDFLAGS) $(vpcd_OBJECTS) $(vpcd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/baytech.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cli.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cyclades.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dli.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icebox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ilom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmipower.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/phantom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pluglist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/targv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tregex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vpcd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xregex.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< xread.o: $(top_srcdir)/src/xread.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xread.o -MD -MP -MF "$(DEPDIR)/xread.Tpo" -c -o xread.o `test -f '$(top_srcdir)/src/xread.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xread.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xread.Tpo" "$(DEPDIR)/xread.Po"; else rm -f "$(DEPDIR)/xread.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xread.c' object='xread.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xread.o `test -f '$(top_srcdir)/src/xread.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xread.c xread.obj: $(top_srcdir)/src/xread.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xread.obj -MD -MP -MF "$(DEPDIR)/xread.Tpo" -c -o xread.obj `if test -f '$(top_srcdir)/src/xread.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xread.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xread.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xread.Tpo" "$(DEPDIR)/xread.Po"; else rm -f "$(DEPDIR)/xread.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xread.c' object='xread.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xread.obj `if test -f '$(top_srcdir)/src/xread.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xread.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xread.c'; fi` error.o: $(top_srcdir)/src/error.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.o -MD -MP -MF "$(DEPDIR)/error.Tpo" -c -o error.o `test -f '$(top_srcdir)/src/error.c' || echo '$(srcdir)/'`$(top_srcdir)/src/error.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/error.Tpo" "$(DEPDIR)/error.Po"; else rm -f "$(DEPDIR)/error.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/error.c' object='error.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.o `test -f '$(top_srcdir)/src/error.c' || echo '$(srcdir)/'`$(top_srcdir)/src/error.c error.obj: $(top_srcdir)/src/error.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT error.obj -MD -MP -MF "$(DEPDIR)/error.Tpo" -c -o error.obj `if test -f '$(top_srcdir)/src/error.c'; then $(CYGPATH_W) '$(top_srcdir)/src/error.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/error.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/error.Tpo" "$(DEPDIR)/error.Po"; else rm -f "$(DEPDIR)/error.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/error.c' object='error.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o error.obj `if test -f '$(top_srcdir)/src/error.c'; then $(CYGPATH_W) '$(top_srcdir)/src/error.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/error.c'; fi` debug.o: $(top_srcdir)/src/debug.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug.o -MD -MP -MF "$(DEPDIR)/debug.Tpo" -c -o debug.o `test -f '$(top_srcdir)/src/debug.c' || echo '$(srcdir)/'`$(top_srcdir)/src/debug.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debug.Tpo" "$(DEPDIR)/debug.Po"; else rm -f "$(DEPDIR)/debug.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/debug.c' object='debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug.o `test -f '$(top_srcdir)/src/debug.c' || echo '$(srcdir)/'`$(top_srcdir)/src/debug.c debug.obj: $(top_srcdir)/src/debug.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT debug.obj -MD -MP -MF "$(DEPDIR)/debug.Tpo" -c -o debug.obj `if test -f '$(top_srcdir)/src/debug.c'; then $(CYGPATH_W) '$(top_srcdir)/src/debug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/debug.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/debug.Tpo" "$(DEPDIR)/debug.Po"; else rm -f "$(DEPDIR)/debug.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/debug.c' object='debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o debug.obj `if test -f '$(top_srcdir)/src/debug.c'; then $(CYGPATH_W) '$(top_srcdir)/src/debug.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/debug.c'; fi` pluglist.o: $(top_srcdir)/src/pluglist.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pluglist.o -MD -MP -MF "$(DEPDIR)/pluglist.Tpo" -c -o pluglist.o `test -f '$(top_srcdir)/src/pluglist.c' || echo '$(srcdir)/'`$(top_srcdir)/src/pluglist.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pluglist.Tpo" "$(DEPDIR)/pluglist.Po"; else rm -f "$(DEPDIR)/pluglist.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/pluglist.c' object='pluglist.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pluglist.o `test -f '$(top_srcdir)/src/pluglist.c' || echo '$(srcdir)/'`$(top_srcdir)/src/pluglist.c pluglist.obj: $(top_srcdir)/src/pluglist.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pluglist.obj -MD -MP -MF "$(DEPDIR)/pluglist.Tpo" -c -o pluglist.obj `if test -f '$(top_srcdir)/src/pluglist.c'; then $(CYGPATH_W) '$(top_srcdir)/src/pluglist.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/pluglist.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pluglist.Tpo" "$(DEPDIR)/pluglist.Po"; else rm -f "$(DEPDIR)/pluglist.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/pluglist.c' object='pluglist.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pluglist.obj `if test -f '$(top_srcdir)/src/pluglist.c'; then $(CYGPATH_W) '$(top_srcdir)/src/pluglist.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/pluglist.c'; fi` hostlist.o: $(top_srcdir)/src/hostlist.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hostlist.o -MD -MP -MF "$(DEPDIR)/hostlist.Tpo" -c -o hostlist.o `test -f '$(top_srcdir)/src/hostlist.c' || echo '$(srcdir)/'`$(top_srcdir)/src/hostlist.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/hostlist.Tpo" "$(DEPDIR)/hostlist.Po"; else rm -f "$(DEPDIR)/hostlist.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/hostlist.c' object='hostlist.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hostlist.o `test -f '$(top_srcdir)/src/hostlist.c' || echo '$(srcdir)/'`$(top_srcdir)/src/hostlist.c hostlist.obj: $(top_srcdir)/src/hostlist.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hostlist.obj -MD -MP -MF "$(DEPDIR)/hostlist.Tpo" -c -o hostlist.obj `if test -f '$(top_srcdir)/src/hostlist.c'; then $(CYGPATH_W) '$(top_srcdir)/src/hostlist.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/hostlist.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/hostlist.Tpo" "$(DEPDIR)/hostlist.Po"; else rm -f "$(DEPDIR)/hostlist.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/hostlist.c' object='hostlist.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hostlist.obj `if test -f '$(top_srcdir)/src/hostlist.c'; then $(CYGPATH_W) '$(top_srcdir)/src/hostlist.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/hostlist.c'; fi` hash.o: $(top_srcdir)/src/hash.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hash.o -MD -MP -MF "$(DEPDIR)/hash.Tpo" -c -o hash.o `test -f '$(top_srcdir)/src/hash.c' || echo '$(srcdir)/'`$(top_srcdir)/src/hash.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/hash.Tpo" "$(DEPDIR)/hash.Po"; else rm -f "$(DEPDIR)/hash.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/hash.c' object='hash.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hash.o `test -f '$(top_srcdir)/src/hash.c' || echo '$(srcdir)/'`$(top_srcdir)/src/hash.c hash.obj: $(top_srcdir)/src/hash.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hash.obj -MD -MP -MF "$(DEPDIR)/hash.Tpo" -c -o hash.obj `if test -f '$(top_srcdir)/src/hash.c'; then $(CYGPATH_W) '$(top_srcdir)/src/hash.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/hash.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/hash.Tpo" "$(DEPDIR)/hash.Po"; else rm -f "$(DEPDIR)/hash.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/hash.c' object='hash.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hash.obj `if test -f '$(top_srcdir)/src/hash.c'; then $(CYGPATH_W) '$(top_srcdir)/src/hash.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/hash.c'; fi` list.o: $(top_srcdir)/src/list.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT list.o -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.o `test -f '$(top_srcdir)/src/list.c' || echo '$(srcdir)/'`$(top_srcdir)/src/list.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/list.Tpo" "$(DEPDIR)/list.Po"; else rm -f "$(DEPDIR)/list.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/list.c' object='list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o list.o `test -f '$(top_srcdir)/src/list.c' || echo '$(srcdir)/'`$(top_srcdir)/src/list.c list.obj: $(top_srcdir)/src/list.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT list.obj -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.obj `if test -f '$(top_srcdir)/src/list.c'; then $(CYGPATH_W) '$(top_srcdir)/src/list.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/list.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/list.Tpo" "$(DEPDIR)/list.Po"; else rm -f "$(DEPDIR)/list.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/list.c' object='list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o list.obj `if test -f '$(top_srcdir)/src/list.c'; then $(CYGPATH_W) '$(top_srcdir)/src/list.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/list.c'; fi` hprintf.o: $(top_srcdir)/src/hprintf.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hprintf.o -MD -MP -MF "$(DEPDIR)/hprintf.Tpo" -c -o hprintf.o `test -f '$(top_srcdir)/src/hprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/src/hprintf.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/hprintf.Tpo" "$(DEPDIR)/hprintf.Po"; else rm -f "$(DEPDIR)/hprintf.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/hprintf.c' object='hprintf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hprintf.o `test -f '$(top_srcdir)/src/hprintf.c' || echo '$(srcdir)/'`$(top_srcdir)/src/hprintf.c hprintf.obj: $(top_srcdir)/src/hprintf.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hprintf.obj -MD -MP -MF "$(DEPDIR)/hprintf.Tpo" -c -o hprintf.obj `if test -f '$(top_srcdir)/src/hprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/src/hprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/hprintf.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/hprintf.Tpo" "$(DEPDIR)/hprintf.Po"; else rm -f "$(DEPDIR)/hprintf.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/hprintf.c' object='hprintf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hprintf.obj `if test -f '$(top_srcdir)/src/hprintf.c'; then $(CYGPATH_W) '$(top_srcdir)/src/hprintf.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/hprintf.c'; fi` xregex.o: $(top_srcdir)/src/xregex.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xregex.o -MD -MP -MF "$(DEPDIR)/xregex.Tpo" -c -o xregex.o `test -f '$(top_srcdir)/src/xregex.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xregex.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xregex.Tpo" "$(DEPDIR)/xregex.Po"; else rm -f "$(DEPDIR)/xregex.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xregex.c' object='xregex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xregex.o `test -f '$(top_srcdir)/src/xregex.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xregex.c xregex.obj: $(top_srcdir)/src/xregex.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xregex.obj -MD -MP -MF "$(DEPDIR)/xregex.Tpo" -c -o xregex.obj `if test -f '$(top_srcdir)/src/xregex.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xregex.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xregex.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xregex.Tpo" "$(DEPDIR)/xregex.Po"; else rm -f "$(DEPDIR)/xregex.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xregex.c' object='xregex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xregex.obj `if test -f '$(top_srcdir)/src/xregex.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xregex.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xregex.c'; fi` xmalloc.o: $(top_srcdir)/src/xmalloc.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmalloc.o -MD -MP -MF "$(DEPDIR)/xmalloc.Tpo" -c -o xmalloc.o `test -f '$(top_srcdir)/src/xmalloc.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xmalloc.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xmalloc.Tpo" "$(DEPDIR)/xmalloc.Po"; else rm -f "$(DEPDIR)/xmalloc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xmalloc.c' object='xmalloc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmalloc.o `test -f '$(top_srcdir)/src/xmalloc.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xmalloc.c xmalloc.obj: $(top_srcdir)/src/xmalloc.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xmalloc.obj -MD -MP -MF "$(DEPDIR)/xmalloc.Tpo" -c -o xmalloc.obj `if test -f '$(top_srcdir)/src/xmalloc.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xmalloc.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xmalloc.Tpo" "$(DEPDIR)/xmalloc.Po"; else rm -f "$(DEPDIR)/xmalloc.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xmalloc.c' object='xmalloc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xmalloc.obj `if test -f '$(top_srcdir)/src/xmalloc.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xmalloc.c'; fi` argv.o: $(top_srcdir)/src/argv.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT argv.o -MD -MP -MF "$(DEPDIR)/argv.Tpo" -c -o argv.o `test -f '$(top_srcdir)/src/argv.c' || echo '$(srcdir)/'`$(top_srcdir)/src/argv.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/argv.Tpo" "$(DEPDIR)/argv.Po"; else rm -f "$(DEPDIR)/argv.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/argv.c' object='argv.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o argv.o `test -f '$(top_srcdir)/src/argv.c' || echo '$(srcdir)/'`$(top_srcdir)/src/argv.c argv.obj: $(top_srcdir)/src/argv.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT argv.obj -MD -MP -MF "$(DEPDIR)/argv.Tpo" -c -o argv.obj `if test -f '$(top_srcdir)/src/argv.c'; then $(CYGPATH_W) '$(top_srcdir)/src/argv.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/argv.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/argv.Tpo" "$(DEPDIR)/argv.Po"; else rm -f "$(DEPDIR)/argv.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/argv.c' object='argv.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o argv.obj `if test -f '$(top_srcdir)/src/argv.c'; then $(CYGPATH_W) '$(top_srcdir)/src/argv.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/argv.c'; fi` xpoll.o: $(top_srcdir)/src/xpoll.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xpoll.o -MD -MP -MF "$(DEPDIR)/xpoll.Tpo" -c -o xpoll.o `test -f '$(top_srcdir)/src/xpoll.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xpoll.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xpoll.Tpo" "$(DEPDIR)/xpoll.Po"; else rm -f "$(DEPDIR)/xpoll.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xpoll.c' object='xpoll.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xpoll.o `test -f '$(top_srcdir)/src/xpoll.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xpoll.c xpoll.obj: $(top_srcdir)/src/xpoll.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xpoll.obj -MD -MP -MF "$(DEPDIR)/xpoll.Tpo" -c -o xpoll.obj `if test -f '$(top_srcdir)/src/xpoll.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xpoll.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xpoll.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xpoll.Tpo" "$(DEPDIR)/xpoll.Po"; else rm -f "$(DEPDIR)/xpoll.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xpoll.c' object='xpoll.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xpoll.obj `if test -f '$(top_srcdir)/src/xpoll.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xpoll.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xpoll.c'; fi` xpty.o: $(top_srcdir)/src/xpty.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xpty.o -MD -MP -MF "$(DEPDIR)/xpty.Tpo" -c -o xpty.o `test -f '$(top_srcdir)/src/xpty.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xpty.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xpty.Tpo" "$(DEPDIR)/xpty.Po"; else rm -f "$(DEPDIR)/xpty.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xpty.c' object='xpty.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xpty.o `test -f '$(top_srcdir)/src/xpty.c' || echo '$(srcdir)/'`$(top_srcdir)/src/xpty.c xpty.obj: $(top_srcdir)/src/xpty.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xpty.obj -MD -MP -MF "$(DEPDIR)/xpty.Tpo" -c -o xpty.obj `if test -f '$(top_srcdir)/src/xpty.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xpty.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xpty.c'; fi`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/xpty.Tpo" "$(DEPDIR)/xpty.Po"; else rm -f "$(DEPDIR)/xpty.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/src/xpty.c' object='xpty.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xpty.obj `if test -f '$(top_srcdir)/src/xpty.c'; then $(CYGPATH_W) '$(top_srcdir)/src/xpty.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/src/xpty.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-sbinPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool \ clean-sbinPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: powerman-2.3.5.orig/test/t120000755000000000000000000000024311023523731012505 0ustar #!/bin/sh TEST=t12 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -Q t1 t2 >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t070000755000000000000000000000025611023523731012515 0ustar #!/bin/sh TEST=t07 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -q -Q t1 -Q t[3-5] >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t06.exp0000644000000000000000000000015111023523731013276 0ustar on: off: t[0-15] unknown: on: off: t1 unknown: on: off: t[3-5] unknown: powerman-2.3.5.orig/test/t010000755000000000000000000000016111026010364012476 0ustar #!/bin/sh TEST=t01 ./tpl 't[1,2,3]' 'p[999-1001]' >$TEST.out 2>&1 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t11.exp0000644000000000000000000000037511023523731013302 0ustar on: off: t[0-15] unknown: Command completed successfully on: t4 off: t[0-3,5-15] unknown: Command completed successfully on: off: t[0-15] unknown: Command completed successfully on: t5 off: t[0-4,6-15] unknown: powerman-2.3.5.orig/test/t200000755000000000000000000000026711023607355012517 0ustar #!/bin/sh TEST=t20 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -I -Q t[14-18] -Q t[16-31] >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t48.exp0000644000000000000000000000015111101200642013272 0ustar on: off: t[0-15] unknown: on: off: t1 unknown: on: off: t[3-5] unknown: powerman-2.3.5.orig/test/t370000755000000000000000000000041211052145100012502 0ustar #!/bin/sh TEST=t37 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-19] \ -q -c t[0-19] \ -q -0 t[0-19] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/ilom.c0000644000000000000000000001645711113122517013270 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include "xread.h" #define ILOM_LOGIN_PROMPT "SUNSP00144FEE320F login: " #define ILOM_PASSWD_PROMPT "Password: " #define ILOM_PROMPT " -> " #define ILOM_BANNER "\n\ Sun(TM) Integrated Lights Out Manager\n\ \n\ Version 2.0.2.3\n\ \n\ Copyright 2007 Sun Microsystems, Inc. All rights reserved.\n\ Use is subject to license terms.\n\ \n\ Warning: password is set to factory default.\n\n" #define ILOM_PROP_SYS "\ /SYS\n\ Properties:\n\ type = Host System\n\ chassis_name = SUN FIRE X4140\n\ chassis_part_number = 540-7618-XX\n\ chassis_serial_number = 0226LHF-0823A600HM\n\ chassis_manufacturer = SUN MICROSYSTEMS\n\ product_name = SUN FIRE X4140\n\ product_part_number = 602-4125-01\n\ product_serial_number = 0826QAD075\n\ product_manufacturer = SUN MICROSYSTEMS\n\ power_state = %s\n\n\n" #define ILOM_STOP_RESP "Stopping /SYS immediately\n\n" #define ILOM_STOP_RESP2 "stop: Target already stopped\n\n" #define ILOM_START_RESP "Starting /SYS\n\n" #define ILOM_START_RESP2 "start: Target already started\n\n" #define ILOM_RESET_RESP "Performing hard reset on /SYS\n\n" #define ILOM_RESET_RESP2 "Performing hard reset on /SYS failed\n\ reset: Target already stopped\n\n" #define ILOM_CMD_INVAL "\ Invalid command '%s' - type help for a list of commands.\n\n" #define ILOM_HELP "\ The help command is used to view information about commands and targets\n\ \n\ Usage: help [-o|-output terse|verbose] [|legal|targets]\n\ \n\ Special characters used in the help command are\n\ [] encloses optional keywords or options\n\ <> encloses a description of the keyword\n\ (If <> is not present, an actual keyword is indicated)\n\ | indicates a choice of keywords or options\n\ \n\ help targets displays a list of targets\n\ help legal displays the product legal notice\n\ \n\ Commands are:\n\ cd\n\ create\n\ delete\n\ exit\n\ help\n\ load\n\ reset\n\ set\n\ show\n\ start\n\ stop\n\ version\n\n" #define ILOM_VERS "\ SP firmware 2.0.2.3\n\ SP firmware build number: 29049\n\ SP firmware date: Thu Feb 21 19:42:30 PST 2008\n\ SP filesystem version: 0.1.16\n\n" static void usage(void); static void prompt_loop(void); typedef enum { NONE, SSH, SER, SER_LOGIN } ilomtype_t; static ilomtype_t personality = NONE; static char *prog; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "personality", required_argument, 0, 'p' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': if (strcmp(optarg, "ssh") == 0) personality = SSH; else if (strcmp(optarg, "serial") == 0) personality = SER; else if (strcmp(optarg, "serial_loggedin") == 0) personality = SER_LOGIN; else usage(); break; default: usage(); } } if (optind < argc) usage(); if (personality == NONE) usage(); prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -p ssh|serial|serial_loggedin\n", prog); exit(1); } static void prompt_loop(void) { char buf[128]; static char plug[4]; int authenticated; strcpy(plug, "Off"); switch (personality) { case SER: authenticated = 0; break; case SSH: authenticated = 1; break; case SER_LOGIN: authenticated = 2; break; } for (;;) { switch (authenticated) { case 0: if (xreadline(ILOM_LOGIN_PROMPT, buf, sizeof(buf)) == NULL) goto done; if (!strcmp(buf, "root")) authenticated = 1; break; case 1: if (xreadline(ILOM_PASSWD_PROMPT, buf, sizeof(buf)) == NULL) goto done; if (!strcmp(buf, "changeme")) { authenticated = 2; printf(ILOM_BANNER); } break; case 2: if (xreadline(ILOM_PROMPT, buf, sizeof(buf)) == NULL) goto done; if (!strcmp(buf, "exit")) { goto done; } else if (!strcmp(buf, "help")) { printf(ILOM_HELP); } else if (!strcmp(buf, "version")) { printf(ILOM_VERS); } else if (!strcmp(buf, "show -d properties /SYS")) { printf(ILOM_PROP_SYS, plug); } else if (!strcmp(buf, "start -script /SYS")) { if (!strcmp(plug, "Off")) { strcpy(plug, "On"); printf(ILOM_START_RESP); } else printf(ILOM_START_RESP2); } else if (!strcmp(buf, "stop -script -force /SYS")) { if (!strcmp(plug, "On")) { strcpy(plug, "Off"); printf(ILOM_STOP_RESP); } else printf(ILOM_STOP_RESP2); } else if (!strcmp(buf, "reset -script /SYS")) { if (!strcmp(plug, "On")) { printf(ILOM_RESET_RESP); } else printf(ILOM_RESET_RESP2); } else { printf(ILOM_CMD_INVAL, buf); } } continue; done: break; } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t31.exp0000644000000000000000000000107411052171766013312 0ustar on: off: t[0-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: off: t[0-9] unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: off: t[0-9] unknown: t0: 73,0,0,0 t1: 74,0,0,0 t2: 75,0,0,0 t3: 76,0,0,0 t4: 77,0,0,0 t5: 78,0,0,0 t6: 79,0,0,0 t7: 80,0,0,0 t8: 81,0,0,0 t9: 82,0,0,0 powerman-2.3.5.orig/test/t51.exp0000644000000000000000000000025211151356676013316 0ustar on: off: t[0-2] unknown: Command completed successfully on: t[0-2] off: unknown: Command completed successfully on: off: t[0-2] unknown: powerman-2.3.5.orig/test/t44.conf0000644000000000000000000000030511033004136013424 0ustar include "../etc/ilom.dev" device "d0" "ilom" "./ilom -p ssh|&" device "d1" "ilom" "./ilom -p serial|&" device "d2" "ilom" "./ilom -p serial_loggedin|&" node "t0" "d0" node "t1" "d1" node "t2" "d2" powerman-2.3.5.orig/test/baytech.c0000644000000000000000000006110011113122517013730 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* baytech.c - baytech simulator */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "xread.h" static void usage(void); static void _noop_handler(int signum); static void _prompt_loop_rpc3_de(void); static void _prompt_loop_rpc28_nc(void); static void _prompt_loop_rpc3_nc(void); static void _prompt_loop_rpc3(void); typedef enum { NONE, RPC3, RPC3_NC, RPC28_NC, RPC3_DE } baytype_t; static char *prog; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "personality", required_argument, 0, 'p' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; baytype_t personality = NONE; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': if (strcmp(optarg, "rpc3") == 0) personality = RPC3; else if (strcmp(optarg, "rpc3-nc") == 0) personality = RPC3_NC; else if (strcmp(optarg, "rpc28-nc") == 0) personality = RPC28_NC; else if (strcmp(optarg, "rpc3-de") == 0) personality = RPC3_DE; else usage(); break; default: usage(); } } if (optind < argc) usage(); if (signal(SIGPIPE, _noop_handler) == SIG_ERR) { perror("signal"); exit(1); } switch (personality) { case NONE: usage(); case RPC3: _prompt_loop_rpc3(); break; case RPC3_NC: _prompt_loop_rpc3_nc(); break; case RPC28_NC: _prompt_loop_rpc28_nc(); break; case RPC3_DE: _prompt_loop_rpc3_de(); break; } exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -p rpc3|rpc3-nc|rpc28-nc|rpc3-de\n", prog); exit(1); } static void _noop_handler(int signum) { fprintf(stderr, "%s: received signal %d\n", prog, signum); } #define RPC28_NC_BANNER "\ RPC-28 Series\n\ (C) 2000 by BayTech\n\ F3.01\n\ \n\ Option(s) Installed:\n\ True RMS Current\n\ Internal Temperature\n\ True RMS Voltage\n\ \n" #define RPC28_NC_PROMPT "RPC-28>" #define RPC28_NC_PROMPT2 "RPC-28A>" #define RPC28_NC_STATUS "\r\n\ Outlet 1-10 Outlet 11-21 \r\n\ Average Power: 619 Watts : 5 Watts \r\n\ True RMS Voltage: 117.9 Volts : 118.8 Volts \r\n\ True RMS Current: 5.4 Amps : 0.1 Amps\r\n\ Maximum Detected: 6.9 Amps : 2.8 Amps\r\n\ Circuit Breaker: Good : Good \r\n\ \r\n\ Internal Temperature: 30.0 C\r\n\ \r\n\ \r\n\ 1)...Outlet 1 : %s 2)...Outlet 2 : %s \r\n\ 3)...Outlet 3 : %s 4)...Outlet 4 : %s \r\n\ 5)...Outlet 5 : %s 6)...Outlet 6 : %s \r\n\ 7)...Outlet 7 : %s 8)...Outlet 8 : %s \r\n\ 9)...Outlet 9 : %s 10)...Outlet 10 : %s \r\n\ 11)...Outlet 11 : %s 12)...Outlet 12 : %s \r\n\ 13)...Outlet 13 : %s 14)...Outlet 14 : %s \r\n\ 15)...Outlet 15 : %s 16)...Outlet 16 : %s \r\n\ 17)...Outlet 17 : %s 18)...Outlet 18 : %s \r\n\ 19)...Outlet 19 : %s 20)...Outlet 20 : %s \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC28_NC_HELP "\r\n\ On n --Turn on an Outlet, n=0,1...20,all\r\n\ Off n --Turn off an Outlet, n=0,1...20,all\r\n\ Reboot n --Reboot an Outlet, n=0,1...20,all\r\n\ Status --RPC-28 Status\r\n\ Config --Enter configuration mode\r\n\ Lock n --Locks Outlet(s) state, n=0,1...20,all\r\n\ Unlock n --Unlock Outlet(s) state, n=0,1...20,all\r\n\ Current --Display True RMS Current\r\n\ Clear --Reset the maximum detected current\r\n\ Temp --Read current temperature\r\n\ Voltage --Display True RMS Voltage\r\n\ Logout --Logoff\r\n\ Logoff --Logoff\r\n\ Exit --Logoff\r\n\ Password --Changes the current user password\r\n\ Whoami --Displays the current user name\r\n\ Unitid --Displays the unit ID\r\n\ Help --This Command\r\n\ \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC28_NC_TEMP "\r\n\ Internal Temperature: 30.0 C\r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC28_NC_VOLTAGE "\r\n\ Outlet 1-10 Outlet 11-21 \r\n\ True RMS Voltage: 118.0 Volts : 118.7 Volts \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC28_NC_CURRENT "\r\n\ Outlet 1-10 Outlet 11-21 \r\n\ True RMS Current: 5.5 Amps : 0.1 Amps\r\n\ Maximum Detected: 6.9 Amps : 2.8 Amps\r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" static void _prompt_loop_rpc28_nc(void) { int i; char buf[128]; int num_plugs = 20; char plug[20][4]; int plug_origin = 1; int logged_in = 1; int seq = 0; for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); printf(RPC28_NC_BANNER); while (logged_in) { /* switch between two possible prompts - our scripts must handle both */ if (xreadline((seq++ % 2) ? RPC28_NC_PROMPT : RPC28_NC_PROMPT2, buf, sizeof(buf)) == NULL) break; if (strlen(buf) == 0) { continue; } else if (!strcmp(buf, "logoff") || !strcmp(buf, "logout") || !strcmp(buf, "exit")) { break; } else if (!strcmp(buf, "help")) { printf(RPC28_NC_HELP); } else if (!strcmp(buf, "temp")) printf(RPC28_NC_TEMP); else if (!strcmp(buf, "voltage")) printf(RPC28_NC_VOLTAGE); else if (!strcmp(buf, "current")) printf(RPC28_NC_CURRENT); else if (!strcmp(buf, "status")) { printf(RPC28_NC_STATUS, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7], plug[8], plug[9], plug[10], plug[11], plug[12], plug[13], plug[14], plug[15], plug[16], plug[17], plug[18], plug[19]); /* NOTE: we only suport one plug at a time or all for on,off,reboot */ } else if (sscanf(buf, "on %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "On "); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "On "); else goto err; } else if (sscanf(buf, "off %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "Off"); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); else goto err; } else if (sscanf(buf, "reboot %d", &i) == 1) { /* if off, leaves it off */ if (i == 0 || (i >= plug_origin && i < num_plugs + plug_origin)) { printf("\r\nRebooting... "); for (i = 9; i >= 0; i--) { printf("%d", i); fflush(stdout); sleep(1); } printf("\r\n"); } else goto err; } else goto err; continue; err: printf("Input error\r\n\r\n"); } } #define RPC3_DE_BANNER "\r\n\r\n\ RPC-3/4(A)DE Series\r\n\ (C) 2004 BayTech\r\n\ F1.08\r\n\ \r\n\ Option(s) Installed:\r\n\ True RMS Voltage\r\n\ True RMS Current\r\n\ Internal Temperature\r\n\ \r\n" #define RPC3_DE_PROMPT "RPC-4>" #define RPC3_DE_STATUS "\r\n\ \r\n\ -------------------------------------------------------------------------------\r\n\ | Outlet | True RMS | Peak RMS | True RMS | Average | Volt- |\r\n\ | Group | Current | Current | Voltage | Power | Amps |\r\n\ -------------------------------------------------------------------------------\r\n\ | Outlet 1-4 | 1.8 Amps | 2.3 Amps | 122.5 Volts | 216 Watts | 220 VA |\r\n\ | Outlet 5-8 | 2.4 Amps | 5.0 Amps | 122.1 Volts | 269 Watts | 277 VA |\r\n\ -------------------------------------------------------------------------------\r\n\ \r\n\ Internal Temperature: 78.8 F\r\n\ \r\n\ Switch 1: Open 2: Open\r\n\ \r\n\ 1)...Outlet 1 : %s \r\n\ 2)...Outlet 2 : %s \r\n\ 3)...Outlet 3 : %s \r\n\ 4)...Outlet 4 : %s \r\n\ 5)...Outlet 5 : %s \r\n\ 6)...Outlet 6 : %s \r\n\ 7)...Outlet 7 : %s \r\n\ 8)...Outlet 8 : %s \r\n\ \r\n\ \r\n\ Type Help for a list of commands\r\n\ \r\n" #define RPC3_DE_HELP "\r\n\r\n\ On n --Turn on an Outlet, n=0,1...8,all\r\n\ Off n --Turn off an Outlet, n=0,1...8,all\r\n\ Reboot n --Reboot an Outlet, n=0,1...8,all\r\n\ Status --RPC-4 Status\r\n\ Config --Enter configuration mode\r\n\ RC --Powerup/watchdog reset counts\r\n\ Lock n --Locks Outlet(s) state, n=0,1...8,all\r\n\ Unlock n --Unlock Outlet(s) state, n=0,1...8,all\r\n\ Current --Display True RMS Current\r\n\ Voltage --Display True RMS Voltage\r\n\ Power --Display Average Power\r\n\ Clear --Reset the maximum detected current\r\n\ Temp --Read current temperature\r\n\ Logout --Logoff\r\n\ Logoff --Logoff\r\n\ Exit --Logoff\r\n\ Password --Changes the current user password\r\n\ Whoami --Displays the current user name\r\n\ Unitid --Displays the unit ID\r\n\ \r\n\ \r\n\ Type Help for a list of commands\r\n\ \r\n" #define RPC3_DE_TEMP "\r\n\r\n\ Internal Temperature: 77.9 F\r\n\ \r\n\ Type Help for a list of commands\r\n\ \r\n" #define RPC3_DE_VOLTAGE "\r\n\r\n\ --------------------------------\r\n\ | Outlet | True RMS |\r\n\ | Group | Voltage |\r\n\ --------------------------------\r\n\ | Outlet 1-4 | 122.4 Volts | \r\n\ | Outlet 5-8 | 122.3 Volts | \r\n\ --------------------------------\r\n\ \r\n\ Type Help for a list of commands\r\n\ \r\n" #define RPC3_DE_CURRENT "\r\n\r\n\ ------------------------------------------\r\n\ | Outlet | True RMS | Peak RMS |\r\n\ | Group | Current | Current |\r\n\ ------------------------------------------\r\n\ | Outlet 1-4 | 1.8 Amps | 2.3 Amps |\r\n\ | Outlet 5-8 | 2.3 Amps | 5.0 Amps |\r\n\ ------------------------------------------\r\n\ \r\n\ \r\n\ \r\n\ Type Help for a list of commands\r\n\ \r\n" #define RPC3_DE_POWER "\r\n\r\n\ ------------------------------------------\r\n\ | Outlet | True RMS | Peak RMS |\r\n\ | Group | Current | Current |\r\n\ ------------------------------------------\r\n\ | Outlet 1-4 | 1.8 Amps | 2.3 Amps |\r\n\ | Outlet 5-8 | 2.3 Amps | 5.0 Amps |\r\n\ ------------------------------------------\r\n\ \r\n\ \r\n\ \r\n\ Type Help for a list of commands\r\n\ \r\n" static void _prompt_loop_rpc3_de(void) { int i; char buf[128]; int num_plugs = 8; char plug[8][4]; int plug_origin = 1; int logged_in = 1; for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); printf(RPC3_DE_BANNER); while (logged_in) { if (xreadline(RPC3_DE_PROMPT, buf, sizeof(buf)) == NULL) break; if (strlen(buf) == 0) { continue; } else if (!strcmp(buf, "logoff") || !strcmp(buf, "logout") || !strcmp(buf, "exit")) { break; } else if (!strcmp(buf, "help")) { printf(RPC3_DE_HELP); } else if (!strcmp(buf, "temp")) printf(RPC3_DE_TEMP); else if (!strcmp(buf, "voltage")) printf(RPC3_DE_VOLTAGE); else if (!strcmp(buf, "current")) printf(RPC3_DE_CURRENT); else if (!strcmp(buf, "power")) printf(RPC3_DE_POWER); else if (!strcmp(buf, "status")) { printf(RPC3_DE_STATUS, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7]); /* NOTE: we only suport one plug at a time or all for on,off,reboot */ } else if (sscanf(buf, "on %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "On "); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "On "); else goto err; } else if (sscanf(buf, "off %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "Off"); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); else goto err; } else if (sscanf(buf, "reboot %d", &i) == 1) { /* if off, leaves it off */ if (i == 0 || (i >= plug_origin && i < num_plugs + plug_origin)) { printf("\r\nRebooting... "); for (i = 9; i >= 0; i--) { printf("%d", i); fflush(stdout); sleep(1); } printf("\r\n"); } else goto err; } else goto err; continue; err: printf("Input error\r\n\r\n"); } } #define RPC3_NC_BANNER "\r\n\ \r\n\ RPC3-NC Series\r\n\ (C) 2002 by BayTech\r\n\ F4.00\r\n\ \r\n\ Option(s) Installed:\r\n\ True RMS Current\r\n\ Internal Temperature\r\n\ True RMS Voltage\r\n\ \r\n" #define RPC3_NC_PROMPT "RPC3-NC>" #define RPC3_NC_STATUS "\r\n\ \r\n\ Average Power: 338 Watts\r\n\ True RMS Voltage: 120.9 Volts\r\n\ True RMS Current: 2.9 Amps\r\n\ Maximum Detected: 4.3 Amps\r\n\ Circuit Breaker: Good\r\n\ \r\n\ Internal Temperature: 40.0 C\r\n\ \r\n\ \r\n\ 1)...Outlet 1 : %s \r\n\ 2)...Outlet 2 : %s \r\n\ 3)...Outlet 3 : %s \r\n\ 4)...Outlet 4 : %s \r\n\ 5)...Outlet 5 : %s \r\n\ 6)...Outlet 6 : %s \r\n\ 7)...Outlet 7 : %s \r\n\ 8)...Outlet 8 : %s \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC3_NC_HELP "\r\n\ On n --Turn on an Outlet, n=0,1...8,all\r\n\ Off n --Turn off an Outlet, n=0,1...8,all\r\n\ Reboot n --Reboot an Outlet, n=0,1...8,all\r\n\ Status --RPC3-NC Status\r\n\ Config --Enter configuration mode\r\n\ Lock n --Locks Outlet(s) state, n=0,1...8,all\r\n\ Unlock n --Unlock Outlet(s) state, n=0,1...8,all\r\n\ Current --Display True RMS Current\r\n\ Clear --Reset the maximum detected current\r\n\ Temp --Read current temperature\r\n\ Voltage --Display True RMS Voltage\r\n\ Logout --Logoff\r\n\ Logoff --Logoff\r\n\ Exit --Logoff\r\n\ Password --Changes the current user password\r\n\ Whoami --Displays the current user name\r\n\ Unitid --Displays the unit ID\r\n\ Help --This Command\r\n\ \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC3_NC_TEMP "\r\n\ Internal Temperature: 38.5 C\r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC3_NC_VOLTAGE "\r\n\r\n\ True RMS Voltage: 120.5 Volts \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC3_NC_CURRENT "\r\n\r\n\ True RMS Current: 2.9 Amps\r\n\ Maximum Detected: 4.3 Amps\r\n\ \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" static void _prompt_loop_rpc3_nc(void) { int i; char buf[128]; int num_plugs = 8; char plug[8][4]; int plug_origin = 1; int logged_in = 1; for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); printf(RPC3_NC_BANNER); while (logged_in) { if (xreadline(RPC3_NC_PROMPT, buf, sizeof(buf)) == NULL) break; if (strlen(buf) == 0) { continue; } else if (!strcmp(buf, "logoff") || !strcmp(buf, "logout") || !strcmp(buf, "exit")) { break; } else if (!strcmp(buf, "help")) { printf(RPC3_NC_HELP); } else if (!strcmp(buf, "temp")) printf(RPC3_NC_TEMP); else if (!strcmp(buf, "voltage")) printf(RPC3_NC_VOLTAGE); else if (!strcmp(buf, "current")) printf(RPC3_NC_CURRENT); else if (!strcmp(buf, "status")) { printf(RPC3_NC_STATUS, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7]); /* NOTE: we only suport one plug at a time or all for on,off,reboot */ } else if (sscanf(buf, "on %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "On "); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "On "); else goto err; } else if (sscanf(buf, "off %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "Off"); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); else goto err; } else if (sscanf(buf, "reboot %d", &i) == 1) { /* if off, leaves it off */ if (i == 0 || (i >= plug_origin && i < num_plugs + plug_origin)) { printf("\r\nRebooting... "); for (i = 9; i >= 0; i--) { printf("%d", i); fflush(stdout); sleep(1); } printf("\r\n"); } else goto err; } else goto err; continue; err: printf("Input error\r\n\r\n"); } } #define RPC3_PROMPT " RPC-3>" #define RPC3_WELCOME "\ \r\n\ \r\n\ \r\n\ RPC-3 Telnet Host\r\n\ Revision F 5.01, (C) 2001 \r\n\ Bay Technical Associates\r\n\ Unit ID: BT RPC3-20\r\n" #define RPC3_LOGIN "\ \r\n\ Enter password>" #define RPC3_BANNER "\ Option(s) installed:\r\n\ True RMS Current\r\n\ Internal Temperature\r\n\ \r\n\ \r\n" #define RPC3_MENU "\r\n\ RPC-3 Menu:\r\n\ \r\n\ 1)...Outlet Control\r\n\ 2)...Manage Users\r\n\ 3)...Configuration\r\n\ 4)...Unit Status\r\n\ 5)...Reset Unit\r\n\ 6)...Logout\r\n\ \r\n\ Enter Selection>" #define RPC3_OUTLET "\ True RMS current: 1.7 Amps\r\n\ Maximum Detected: 2.5 Amps\r\n\ \r\n\ Internal Temperature: 32.0 C\r\n\ \r\n\ Circuit Breaker: On \r\n\ \r\n\ Selection Outlet Outlet Power\r\n\ Number Name Number Status\r\n\ 1 Outlet 1 1 %s \r\n\ 2 Outlet 2 2 %s \r\n\ 3 Outlet 3 3 %s \r\n\ 4 Outlet 4 4 %s \r\n\ 5 Outlet 5 5 %s \r\n\ 6 Outlet 6 6 %s \r\n\ 7 Outlet 7 7 %s \r\n\ 8 Outlet 8 8 %s \r\n\ \r\n\ Type \"Help\" for a list of commands\r\n\ \r\n" #define RPC3_OUTLET_HELP "\ RPC3 Command Summary (F 5.01).\r\n\ \"n\" refers to Selection Number, as displayed in outlet status\r\n\ LOGOUT : terminate session\r\n\ OFF n : turn off outlet \"n\", do all for n = 0\r\n\ ON n : turn on outlet \"n\", do all for n = 0\r\n\ REBOOT n : cycle power off/on outlet \"n\", do all for n = 0\r\n\ RC : display outlet relay control info\r\n\ STATUS : display power status of outlets\r\n\ HELP : display this message\r\n\ CLEAR : Reset the maximum detected current\r\n\ CURRENT : Read the current\r\n\ TEMP : Read current temperature\r\n\ MENU : return to main menu\r\n\ \r\n\ " static void _prompt_loop_rpc3(void) { int i; char buf[128]; int num_plugs = 8; char plug[8][4]; int plug_origin = 1; enum { START, MENU, OUTLET, QUIT } state = START; char *prompt; for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); printf(RPC3_WELCOME); while (state != QUIT) { switch (state) { case START: prompt = RPC3_LOGIN; break; case MENU: prompt = RPC3_MENU; break; case OUTLET: printf(RPC3_OUTLET, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7]); prompt = RPC3_PROMPT; break; } if (xreadline(prompt, buf, sizeof(buf)) == NULL) { state = QUIT; continue; } switch (state) { case START: if (!strcmp(buf, "baytech")) { printf(RPC3_BANNER); state = MENU; } else printf(" Invalid password.\r\n\r\n"); break; case MENU: if (!strcmp(buf, "1")) state = OUTLET; else if (!strcmp(buf, "6")) state = QUIT; else goto err; break; case OUTLET: if (!strcmp(buf, "?") || !strcmp(buf, "help")) { if (xreadline(RPC3_OUTLET_HELP, buf, sizeof(buf)) == NULL) state = QUIT; } else if (!strcmp(buf, "menu")) { state = MENU; } else if (!strcmp(buf, "logout")) { state = QUIT; } else if (!strcmp(buf, "status")) { } else if (sscanf(buf, "on %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "On "); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "On "); else goto err; } else if (sscanf(buf, "off %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) strcpy(plug[i - plug_origin], "Off"); else if (i == 0) for (i = 0; i < num_plugs; i++) strcpy(plug[i], "Off"); else goto err; } else goto err; break; } continue; err: printf("\r\n Input error.\r\n\r\n"); } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t340000755000000000000000000000114411052171766012523 0ustar #!/bin/sh TEST=t34 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -c t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -0 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -1 t[0-159] \ -q -c t[0-159] \ -q -0 t[0-159] \ -b -f t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -b -u t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -b -f t[0-159] \ -b -u t[0-159] \ -b -q -t >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t36.exp0000644000000000000000000000121511140656506013312 0ustar on: off: x[0-63] unknown: Command completed successfully on: x[0,8,16,24] off: x[1-7,9-15,17-23,25-63] unknown: Command completed successfully on: x[0,8,16,24] off: x[1-7,9-15,17-23,25-63] unknown: Command completed successfully on: off: x[0-63] unknown: Command completed successfully on: off: x[0-63] unknown: Command completed successfully on: x[0-31] off: x[32-63] unknown: Command completed successfully on: x[0-31] off: x[32-63] unknown: Command completed successfully on: off: x[0-63] unknown: Command completed successfully on: off: x[0-63] unknown: powerman-2.3.5.orig/test/t28.conf0000644000000000000000000000212111024571543013437 0ustar include "../etc/baytech.dev" device "b0" "baytech" "./baytech -p rpc3 |&" device "b1" "baytech" "./baytech -p rpc3 |&" device "b2" "baytech" "./baytech -p rpc3 |&" device "b3" "baytech" "./baytech -p rpc3 |&" device "b4" "baytech" "./baytech -p rpc3 |&" device "b5" "baytech" "./baytech -p rpc3 |&" device "b6" "baytech" "./baytech -p rpc3 |&" device "b7" "baytech" "./baytech -p rpc3 |&" device "b8" "baytech" "./baytech -p rpc3 |&" device "b9" "baytech" "./baytech -p rpc3 |&" device "b10" "baytech" "./baytech -p rpc3 |&" device "b11" "baytech" "./baytech -p rpc3 |&" device "b12" "baytech" "./baytech -p rpc3 |&" device "b13" "baytech" "./baytech -p rpc3 |&" device "b14" "baytech" "./baytech -p rpc3 |&" device "b15" "baytech" "./baytech -p rpc3 |&" node "t[0-7]" "b0" node "t[8-15]" "b1" node "t[16-23]" "b2" node "t[24-31]" "b3" node "t[32-39]" "b4" node "t[40-47]" "b5" node "t[48-55]" "b6" node "t[56-63]" "b7" node "t[64-71]" "b8" node "t[72-79]" "b9" node "t[80-87]" "b10" node "t[88-95]" "b11" node "t[96-103]" "b12" node "t[104-111]" "b13" node "t[112-119]" "b14" node "t[120-127]" "b15" powerman-2.3.5.orig/test/t32.exp0000644000000000000000000000575411052171766013324 0ustar on: off: t[0-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: off: t[0-159] unknown: t0: 73,0,0,0 t1: 74,0,0,0 t2: 75,0,0,0 t3: 76,0,0,0 t4: 77,0,0,0 t5: 78,0,0,0 t6: 79,0,0,0 t7: 80,0,0,0 t8: 81,0,0,0 t9: 82,0,0,0 t10: 73,0,0,0 t11: 74,0,0,0 t12: 75,0,0,0 t13: 76,0,0,0 t14: 77,0,0,0 t15: 78,0,0,0 t16: 79,0,0,0 t17: 80,0,0,0 t18: 81,0,0,0 t19: 82,0,0,0 t20: 73,0,0,0 t21: 74,0,0,0 t22: 75,0,0,0 t23: 76,0,0,0 t24: 77,0,0,0 t25: 78,0,0,0 t26: 79,0,0,0 t27: 80,0,0,0 t28: 81,0,0,0 t29: 82,0,0,0 t30: 73,0,0,0 t31: 74,0,0,0 t32: 75,0,0,0 t33: 76,0,0,0 t34: 77,0,0,0 t35: 78,0,0,0 t36: 79,0,0,0 t37: 80,0,0,0 t38: 81,0,0,0 t39: 82,0,0,0 t40: 73,0,0,0 t41: 74,0,0,0 t42: 75,0,0,0 t43: 76,0,0,0 t44: 77,0,0,0 t45: 78,0,0,0 t46: 79,0,0,0 t47: 80,0,0,0 t48: 81,0,0,0 t49: 82,0,0,0 t50: 73,0,0,0 t51: 74,0,0,0 t52: 75,0,0,0 t53: 76,0,0,0 t54: 77,0,0,0 t55: 78,0,0,0 t56: 79,0,0,0 t57: 80,0,0,0 t58: 81,0,0,0 t59: 82,0,0,0 t60: 73,0,0,0 t61: 74,0,0,0 t62: 75,0,0,0 t63: 76,0,0,0 t64: 77,0,0,0 t65: 78,0,0,0 t66: 79,0,0,0 t67: 80,0,0,0 t68: 81,0,0,0 t69: 82,0,0,0 t70: 73,0,0,0 t71: 74,0,0,0 t72: 75,0,0,0 t73: 76,0,0,0 t74: 77,0,0,0 t75: 78,0,0,0 t76: 79,0,0,0 t77: 80,0,0,0 t78: 81,0,0,0 t79: 82,0,0,0 t80: 73,0,0,0 t81: 74,0,0,0 t82: 75,0,0,0 t83: 76,0,0,0 t84: 77,0,0,0 t85: 78,0,0,0 t86: 79,0,0,0 t87: 80,0,0,0 t88: 81,0,0,0 t89: 82,0,0,0 t90: 73,0,0,0 t91: 74,0,0,0 t92: 75,0,0,0 t93: 76,0,0,0 t94: 77,0,0,0 t95: 78,0,0,0 t96: 79,0,0,0 t97: 80,0,0,0 t98: 81,0,0,0 t99: 82,0,0,0 t100: 73,0,0,0 t101: 74,0,0,0 t102: 75,0,0,0 t103: 76,0,0,0 t104: 77,0,0,0 t105: 78,0,0,0 t106: 79,0,0,0 t107: 80,0,0,0 t108: 81,0,0,0 t109: 82,0,0,0 t110: 73,0,0,0 t111: 74,0,0,0 t112: 75,0,0,0 t113: 76,0,0,0 t114: 77,0,0,0 t115: 78,0,0,0 t116: 79,0,0,0 t117: 80,0,0,0 t118: 81,0,0,0 t119: 82,0,0,0 t120: 73,0,0,0 t121: 74,0,0,0 t122: 75,0,0,0 t123: 76,0,0,0 t124: 77,0,0,0 t125: 78,0,0,0 t126: 79,0,0,0 t127: 80,0,0,0 t128: 81,0,0,0 t129: 82,0,0,0 t130: 73,0,0,0 t131: 74,0,0,0 t132: 75,0,0,0 t133: 76,0,0,0 t134: 77,0,0,0 t135: 78,0,0,0 t136: 79,0,0,0 t137: 80,0,0,0 t138: 81,0,0,0 t139: 82,0,0,0 t140: 73,0,0,0 t141: 74,0,0,0 t142: 75,0,0,0 t143: 76,0,0,0 t144: 77,0,0,0 t145: 78,0,0,0 t146: 79,0,0,0 t147: 80,0,0,0 t148: 81,0,0,0 t149: 82,0,0,0 t150: 73,0,0,0 t151: 74,0,0,0 t152: 75,0,0,0 t153: 76,0,0,0 t154: 77,0,0,0 t155: 78,0,0,0 t156: 79,0,0,0 t157: 80,0,0,0 t158: 81,0,0,0 t159: 82,0,0,0 powerman-2.3.5.orig/test/phantom.c0000644000000000000000000002341211113122517013763 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* phantom.c - rackable phantom simulator */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "xtypes.h" #include "error.h" #include "xread.h" #define _BOOL /* prevent solaris curses.h from defining bool */ #include /* after xtypes.h */ static void usage(void); static void _noop_handler(int signum); static void _prompt_loop(void); typedef enum { NONE, V3, V4 } phantype_t; static phantype_t personality = NONE; static char *prog; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "personality", required_argument, 0, 'p' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': if (strcmp(optarg, "v3") == 0) personality = V3; else if (strcmp(optarg, "v4") == 0) personality = V4; else usage(); break; default: usage(); } } if (optind < argc) usage(); if (personality == NONE) usage(); if (signal(SIGPIPE, _noop_handler) == SIG_ERR) { perror("signal"); exit(1); } _prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -p v3|v4\n", prog); exit(1); } static void _noop_handler(int signum) { fprintf(stderr, "%s: received signal %d\n", prog, signum); } #define PHANTOM_MENU_V3 "\ +---------------------------------------------+\n\ | Rackable Systems |\n\ | Phantom |\n\ | Copyright (c)2002 |\n\ | Firmware v3.02 |\n\ | |\n\ | D - Enter a new power on delay |\n\ | R - Reset the Server |\n\ | P - Turn the Server Off |\n\ | L - Turn the LED On |\n\ | B - Start Blinking |\n\ | E - Erase the LCD |\n\ | M - Enter LCD message |\n\ | S - Save LCD message |\n\ | C - Adjust LCD contrast |\n\ | W - Show Saved LCD message: No |\n\ | T - Read Temperature |\n\ | I - Power Sense: Other |\n\ | ESC - Quit |\n\ | |\n\ | Choose a command |\n\ +---------------------------------------------+\n" #define PHANTOM_MENU_V4 "\ +---------------------------------------------+\n\ | Rackable Systems |\n\ | Phantom |\n\ | Copyright 2003 |\n\ | Firmware v4.0 |\n\ | |\n\ | D - Enter a new power on delay |\n\ | R - Reset the Server |\n\ | P - Turn the Server On |\n\ | L - Turn the LED On |\n\ | B - Start Blinking |\n\ | E - Erase the LCD |\n\ | M - Enter LCD message |\n\ | S - Save LCD message |\n\ | C - Adjust LCD contrast |\n\ | V - View LCD message |\n\ | W - Show Saved LCD message: Yes |\n\ | T - Read Temperature |\n\ | I - Power Sense: Reset |\n\ | H - Change Hotkey |\n\ | A - Change Baud Rate |\n\ | X - Reset the Phantom |\n\ | U - Upgrade Firmware |\n\ | ESC - Quit |\n\ | |\n\ | Choose a command |\n\ +---------------------------------------------+\n" #define PHANTOM_PROMPT "Phantom [? for Help]:\r" #define PHANTOM_STATUS "Server is %s\r" static void _prompt_loop(void) { int led = 0; int blink = 0; int temp = 32; int plug = 0; int c; initscr(); cbreak(); noecho(); nonl(); menu: while (1) { clear(); mvprintw(0, 0, PHANTOM_PROMPT); mvprintw(1, 0, PHANTOM_STATUS, plug ? "on" : "off"); refresh(); menu_reprompt: switch ((c = getch())) { case ERR: goto done; case '\036': /* ctrl-6 reset */ break; case '\035': /* ctrl-5 command mode */ goto cmd; case '?': clear(); if (personality == V3) mvprintw(0, 0, PHANTOM_MENU_V3); else mvprintw(0, 0, PHANTOM_MENU_V4); refresh(); goto menu_reprompt; default: clear(); mvprintw(0, 0, "Not implemented, hit return\r"); refresh(); if (getch() == ERR) goto done; break; } } cmd: move(0,0); clear(); refresh(); printf("ok\r"); fflush(stdout); /* Process comands. */ while (1) { switch ((c = getch())) { case ERR: goto done; case '\036': /* ctrl-6 reset */ goto menu; case '\035': /* ctrl-5 command mode */ goto cmd; case 'P': switch ((c = getch())) { case ERR: goto done; case '?': printf("%d\r", plug); break; case 'T': plug = plug ? 0 : 1; printf("ok\r"); break; default: printf("err\r"); break; } break; case 'L': switch ((c = getch())) { case ERR: goto done; case '?': if (!led) printf("0\r"); else if (led && !blink) printf("1\r"); else if (led && blink) printf("B\r"); break; case '0': led = 0; printf("ok\r"); break; case '1': led = 1; printf("ok\r"); break; default: printf("err\r"); break; } break; case 'B': /* blink */ switch ((c = getch())) { case ERR: goto done; case '0': blink = 0; printf("ok\r"); break; case '1': blink = 1; printf("ok\r"); break; default: printf("err\r"); break; } break; case 'T': if (personality == V4) printf("%.3d\r", temp); else { switch ((c = getch())) { /* V3 has mult temp sensors */ case ERR: goto done; case '0': printf("%.3d\r", temp); break; default: printf("err\r"); break; } } break; } fflush(stdout); } done: endwin(); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t37.exp0000644000000000000000000000070111027327357013315 0ustar on: off: t[0-19] unknown: Command completed successfully on: t0 off: t[1-19] unknown: Command completed successfully on: t0 off: t[1-19] unknown: Command completed successfully on: off: t[0-19] unknown: Command completed successfully on: t[0-19] off: unknown: Command completed successfully on: t[0-19] off: unknown: Command completed successfully on: off: t[0-19] unknown: powerman-2.3.5.orig/test/t21.conf0000644000000000000000000000027411053364010013426 0ustar include "../etc/baytech-rpc3-nc.dev" device "b0" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b1" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" node "t[0-7]" "b0" node "t[8-15]" "b1" powerman-2.3.5.orig/test/t26.exp0000644000000000000000000000760011024571543013313 0ustar Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully powerman-2.3.5.orig/test/t12.exp0000644000000000000000000000004411023410730013266 0ustar on: off: t[1-2] unknown: powerman-2.3.5.orig/test/t13.exp0000644000000000000000000000037711023523731013306 0ustar on: off: t[0-15] unknown: Command completed successfully on: t[13-15] off: t[0-12] unknown: Command completed successfully on: t[14-15] off: t[0-13] unknown: on: off: t13 unknown: on: t14 off: unknown: powerman-2.3.5.orig/test/tpm0000755000000000000000000000017211151356676012716 0ustar #!/bin/bash if [ "$PATH_POWERMAND" = "" ]; then PATH_POWERMAND=../src/powermand fi $PATH_POWERMAND -f -c t51.conf -s powerman-2.3.5.orig/test/t45.exp0000644000000000000000000000075211042726422013313 0ustar on: off: t[0-1] unknown: Command completed successfully on: t[0-1] off: unknown: Command completed successfully on: t[0-1] off: unknown: Command completed successfully on: off: t[0-1] unknown: Command completed successfully on: t[0-1] off: unknown: on: off: t[0-1] unknown: Command completed successfully on: t[0-1] off: unknown: Command completed successfully on: off: t[0-1] unknown: t0: 032 t1: 032 powerman-2.3.5.orig/test/ipmipower.c0000644000000000000000000001720311113122517014331 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* ipmipower.c - simulate FreeIPMI ipmipower */ /* achu: I'm not supporting a full-fledged ipmipower, there are over * 20 different configurations you can set (via cmdline, prompt, and * config file) and 7 power control commands (on, off, stat, cycle, * reset, pulse, soft). Many of the commands accepts all, hostrange, * or single host. * * Assumptions: * * Users configure ipmipower authentication via FreeIPMI's * configuration file. So there is no ipmipower authentication * configuration via powerman. Thus, I assume there is no need for * those configuration capabilities in this simulator (cmdline, config * file, or prompt). * * Users configure hostnames via cmdline in the powerman.conf. So we * support the -h/--hostname option on the command line, but not * anywhere else. * * powerman's ipmipower.dev only utilizes on, off, and stat in * ipmipower. So we only support those power control commands in the * command line prompt of this simulator (not on the cmdline). */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "hash.h" #include "hostlist.h" #include "xread.h" static void usage(void); static void _noop_handler(int signum); static void _prompt_loop(void); static char *prog; static char *hostname = NULL; #define OPTIONS "p:h:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "hostname", required_argument, 0, 'h' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'h': hostname = optarg; break; default: usage(); } } if (optind < argc) usage(); if (hostname == NULL) usage(); if (signal(SIGPIPE, _noop_handler) == SIG_ERR) { perror("signal"); exit(1); } _prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -h hostlist\n", prog); exit(1); } static void _noop_handler(int signum) { fprintf(stderr, "%s: received signal %d\n", prog, signum); } #define CMD_PROMPT "ipmipower> " #define OFF_STATUS "off" #define ON_STATUS "on" #define OK_STATUS "ok" #define HASH_SIZE 1024 static void _stat(hash_t hstatus, const char *nodes) { hostlist_iterator_t hlitr; hostlist_t hlnodes; char *node; char *str; assert(hstatus); if (!(hlnodes = hostlist_create(nodes))) { perror("hostlist_create"); exit(1); } if (!(hlitr = hostlist_iterator_create(hlnodes))) { perror("hostlist_iterator_create"); exit(1); } while ((node = hostlist_next(hlitr))) { if ((str = hash_find(hstatus, node))) printf("%s: %s\n", node, str); else printf("%s: %s\n", node, "invalid hostname"); free(node); } hostlist_iterator_destroy(hlitr); hostlist_destroy(hlnodes); } static void _onoff(hash_t hstatus, const char *nodes, const char *state) { hostlist_iterator_t hlitr; hostlist_t hlnodes; char *node; char *str; assert(hstatus); if (!(hlnodes = hostlist_create(nodes))) { perror("hostlist_create"); exit(1); } if (!(hlitr = hostlist_iterator_create(hlnodes))) { perror("hostlist_iterator_create"); exit(1); } while ((node = hostlist_next(hlitr))) { if ((str = hash_find(hstatus, node))) { printf("%s: %s\n", node, OK_STATUS); hash_remove(hstatus, node); if (!hash_insert(hstatus, (void *)node, (void *)state)) { perror("hash_insert"); exit(1); } /* XXX: Don't free 'node' here, it needs to be alloc'd for * the hash key. It's a mem-leak. Fix later. */ } else { printf("%s: %s\n", node, "invalid hostname"); free(node); } } hostlist_iterator_destroy(hlitr); hostlist_destroy(hlnodes); } static void _prompt_loop(void) { int i; char buf[128]; char bufnode[128]; hash_t hstatus = NULL; hostlist_t hl = NULL; hostlist_iterator_t hlitr = NULL; char *node; assert(hostname); if (!(hstatus = hash_create(HASH_SIZE, (hash_key_f)hash_key_string, (hash_cmp_f)strcmp, (hash_del_f)NULL))) { perror("hash_create"); exit(1); } if (!(hl = hostlist_create(hostname))) { perror("hostlist_create"); exit(1); } if (!(hlitr = hostlist_iterator_create(hl))) { perror("hostlist_iterator"); exit(1); } /* all nodes begin as off */ while ((node = hostlist_next(hlitr))) { if (!hash_insert(hstatus, (void *)node, OFF_STATUS)) { perror("hash_insert"); exit(1); } /* XXX: Don't free 'node' here, it needs to be alloc'd for * the hash key. It's a mem-leak. Fix later. */ } hostlist_iterator_destroy(hlitr); hostlist_destroy(hl); while (1) { if (xreadline(CMD_PROMPT, buf, sizeof(buf)) == NULL) { break; } else if (strlen(buf) == 0) { continue; } else if (!strcmp(buf, "quit")) { break; } else if (!strcmp(buf, "stat")) { _stat(hstatus, hostname); } else if (sscanf(buf, "stat %s", bufnode) == 1) { _stat(hstatus, bufnode); } else if (!strcmp(buf, "on")) { _onoff(hstatus, hostname, ON_STATUS); } else if (sscanf(buf, "on %s", bufnode) == 1) { _onoff(hstatus, bufnode, ON_STATUS); } else if (!strcmp(buf, "off")) { _onoff(hstatus, hostname, OFF_STATUS); } else if (sscanf(buf, "off %s", bufnode) == 1) { _onoff(hstatus, bufnode, OFF_STATUS); } else printf("unknown command - type \"help\"\n"); } hash_destroy(hstatus); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t330000755000000000000000000000052111052171766012520 0ustar #!/bin/sh TEST=t33 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-9] \ -q -c t[0-9] \ -q -0 t[0-9] \ -b -f t0 \ -b -u t0 \ -b -f t[0-9] \ -b -u t[0-9] \ -b -q -t >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t100000755000000000000000000000024111023523731012501 0ustar #!/bin/sh TEST=t10 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -T -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t28.exp0000644000000000000000000000134611024571543013316 0ustar on: off: t[0-127] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127] unknown: Command completed successfully on: off: t[0-127] unknown: Command completed successfully on: t[0-127] off: unknown: Command completed successfully on: t[0-127] off: unknown: Command completed successfully on: off: t[0-127] unknown: powerman-2.3.5.orig/test/t03.exp0000644000000000000000000000022511020052040013260 0ustar unknown plug plug=1 node=foo1 plug=2 node=foo2 plug=3 node=foo3 plug=4 node=foo4 plug=5 node=foo5 plug=6 node=foo6 plug=7 node=foo7 plug=8 node=foo8 powerman-2.3.5.orig/test/t34.conf0000644000000000000000000000204611026355057013444 0ustar include "../etc/icebox3.dev" device "i0" "icebox3" "./icebox -p v4 |&" device "i1" "icebox3" "./icebox -p v4 |&" device "i2" "icebox3" "./icebox -p v4 |&" device "i3" "icebox3" "./icebox -p v4 |&" device "i4" "icebox3" "./icebox -p v4 |&" device "i5" "icebox3" "./icebox -p v4 |&" device "i6" "icebox3" "./icebox -p v4 |&" device "i7" "icebox3" "./icebox -p v4 |&" device "i8" "icebox3" "./icebox -p v4 |&" device "i9" "icebox3" "./icebox -p v4 |&" device "i10" "icebox3" "./icebox -p v4 |&" device "i11" "icebox3" "./icebox -p v4 |&" device "i12" "icebox3" "./icebox -p v4 |&" device "i13" "icebox3" "./icebox -p v4 |&" device "i14" "icebox3" "./icebox -p v4 |&" device "i15" "icebox3" "./icebox -p v4 |&" node "t[0-9]" "i0" node "t[10-19]" "i1" node "t[20-29]" "i2" node "t[30-39]" "i3" node "t[40-49]" "i4" node "t[50-59]" "i5" node "t[60-69]" "i6" node "t[70-79]" "i7" node "t[80-89]" "i8" node "t[90-99]" "i9" node "t[100-109]" "i10" node "t[110-119]" "i11" node "t[120-129]" "i12" node "t[130-139]" "i13" node "t[140-149]" "i14" node "t[150-159]" "i15" powerman-2.3.5.orig/test/t320000755000000000000000000000065711052171766012531 0ustar #!/bin/sh TEST=t32 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -c t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -0 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -1 t[0-159] \ -q -c t[0-159] \ -q -0 t[0-159] \ -q -t >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t030000755000000000000000000000020211026010364012474 0ustar #!/bin/sh TEST=t03 ./tpl -p 1,2,3,4,5,6,7,8 'foo[1-500]' '[1-500]' >$TEST.out 2>&1 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t50.conf0000644000000000000000000000013011137457504013435 0ustar include "../etc/bashfun.dev" device "bf0" "bashfun" "/bin/bash |&" node "t1" "bf0" "1" powerman-2.3.5.orig/test/cli.c0000644000000000000000000000660511115072462013076 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* cli.c - simple client to demo the libpowerman api */ #include #include #include "libpowerman.h" static pm_err_t list_nodes(pm_handle_t pm); static void usage(void); #define statstr(s) ((s) == PM_ON ? "on" : (s) == PM_OFF ? "off" : "unknown") int main(int argc, char *argv[]) { pm_err_t err = PM_ESUCCESS; pm_node_state_t ns; pm_handle_t pm; char *str, ebuf[64]; char *server, *node; char cmd; if (argc < 3 || argc > 4) usage(); server = argv[1]; cmd = argv[2][0]; if (argc == 3 && cmd != 'l') usage(); if (argc == 4 && cmd != '1' && cmd != '0' && cmd != 'c' && cmd != 'q') usage(); if (argc == 4) node = argv[3]; if ((err = pm_connect(server, NULL, &pm, 0)) != PM_ESUCCESS) { fprintf(stderr, "%s: %s\n", server, pm_strerror(err, ebuf, sizeof(ebuf))); exit(1); } switch (cmd) { case '1': err = pm_node_on(pm, node); break; case '0': err = pm_node_off(pm, node); break; case 'c': err = pm_node_cycle(pm, node); break; case 'l': err = list_nodes(pm); break; case 'q': ns = PM_UNKNOWN; if ((err = pm_node_status(pm, node, &ns)) == PM_ESUCCESS) printf("%s: %s\n", node, statstr(ns)); break; } if (err != PM_ESUCCESS) { fprintf(stderr, "Error: %s\n", pm_strerror(err, ebuf, sizeof(ebuf))); pm_disconnect(pm); exit(1); } pm_disconnect(pm); exit(0); } static pm_err_t list_nodes(pm_handle_t pm) { pm_node_iterator_t pmi; pm_err_t err; char *s; if ((err = pm_node_iterator_create(pm, &pmi)) != PM_ESUCCESS) return err; while ((s = pm_node_next(pmi))) printf("%s\n", s); pm_node_iterator_destroy(pmi); return err; } static void usage(void) { fprintf(stderr, "Usage: cli host:port 0|1|q node\n"); fprintf(stderr, " cli host:port l\n"); exit(1); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/lom.c0000644000000000000000000001211211151341561013103 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include "xread.h" #define LOM_LOGIN_PROMPT "SUNSP00144FEE320F login: " #define LOM_PASSWD_PROMPT "admin@paradise-sp's password: " #define LOM_PROMPT "paradise $ " #define LOM_BANNER "\n\ Sun Microsystems\n\ IPMI v1.5 Service Processor\n\ \n\ Version: V2.1.0.16\n" #define LOM_ON_RESP "Scheduled platform on\n" #define LOM_OFF_RESP "Scheduled platform off\n" #define LOM_CMD_INVAL "\ %s: not found\n" static void usage(void); static void prompt_loop(void); typedef enum { NONE, SSH, SER, SER_LOGIN } ilomtype_t; static ilomtype_t personality = NONE; static char *prog; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "personality", required_argument, 0, 'p' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': if (strcmp(optarg, "ssh") == 0) personality = SSH; else if (strcmp(optarg, "serial") == 0) personality = SER; else if (strcmp(optarg, "serial_loggedin") == 0) personality = SER_LOGIN; else usage(); break; default: usage(); } } if (optind < argc) usage(); if (personality == NONE) usage(); prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -p ssh|serial|serial_loggedin\n", prog); exit(1); } static void prompt_loop(void) { char buf[128]; static char plug[4]; int authenticated; strcpy(plug, "Off"); switch (personality) { case SER: authenticated = 0; break; case SSH: authenticated = 1; break; case SER_LOGIN: authenticated = 2; break; } for (;;) { switch (authenticated) { case 0: if (xreadline(LOM_LOGIN_PROMPT, buf, sizeof(buf)) == NULL) goto done; if (!strcmp(buf, "admin")) authenticated = 1; break; case 1: if (xreadline(LOM_PASSWD_PROMPT, buf, sizeof(buf)) == NULL) goto done; if (!strcmp(buf, "admin")) { authenticated = 2; printf(LOM_BANNER); } break; case 2: if (xreadline(LOM_PROMPT, buf, sizeof(buf)) == NULL) goto done; if (!strcmp(buf, "exit")) { goto done; } else if (!strcmp(buf, "platform get power state")) { printf("%s\n", plug); } else if (!strcmp(buf, "platform set power state -W -f -q on")) { if (!strcmp(plug, "Off")) { strcpy(plug, "On"); printf(LOM_ON_RESP); } } else if (!strcmp(buf, "platform set power state -W -f -q off")) { if (!strcmp(plug, "On")) { strcpy(plug, "Off"); printf(LOM_OFF_RESP); } } else { printf(LOM_CMD_INVAL, buf); } } continue; done: break; } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t16.exp0000644000000000000000000000061411023523731013303 0ustar on: off: t1 unknown: test0: state=connected reconnects=000 actions=002 type=vpc hosts=t[0-15] on: off: t1 unknown: test0: state=connected reconnects=000 actions=003 type=vpc hosts=t[0-15] on: off: t1 unknown: test0: state=connected reconnects=000 actions=004 type=vpc hosts=t[0-15] test0: state=connected reconnects=000 actions=004 type=vpc hosts=t[0-15] t[0-15] powerman-2.3.5.orig/test/mkconf.pl0000755000000000000000000000064111021775230013771 0ustar #!/usr/bin/perl # # Usage: mkconf.pl plugcount # # Builds a powerman.conf file for a vpc config for plugcount plugs. $maxnodes = $ARGV[0]; $nodespervpc = 16; $devs = $maxnodes / $nodespervpc; print "include \"vpc.dev\"\n"; for ($i = 0; $i < $devs; $i++) { $m = $i * $nodespervpc; $n = $m + $nodespervpc - 1; print "device \"test$i\" \"vpc\" \"./vpcd |&\"\n"; print "node \"t[$m-$n]\" \"test$i\"\n"; } exit 0; powerman-2.3.5.orig/test/t08.exp0000644000000000000000000000110011023544013013267 0ustar send(test0): 'stat *\n' recv(test0): 'plug 0: OFF\n' recv(test0): 'plug 1: OFF\n' recv(test0): 'plug 2: OFF\n' recv(test0): 'plug 3: OFF\n' recv(test0): 'plug 4: OFF\n' recv(test0): 'plug 5: OFF\n' recv(test0): 'plug 6: OFF\n' recv(test0): 'plug 7: OFF\n' recv(test0): 'plug 8: OFF\n' recv(test0): 'plug 9: OFF\n' recv(test0): 'plug 10: OFF\n' recv(test0): 'plug 11: OFF\n' recv(test0): 'plug 12: OFF\n' recv(test0): 'plug 13: OFF\n' recv(test0): 'plug 14: OFF\n' recv(test0): 'plug 15: OFF\n' recv(test0): '1 OK\n' recv(test0): '2 vpc> ' on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t49.exp0000644000000000000000000000007611115237235013316 0ustar t1: off t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 powerman-2.3.5.orig/test/t140000755000000000000000000000025611023523731012513 0ustar #!/bin/sh TEST=t14 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -t -P t13 -P t[13-15] >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t160000755000000000000000000000027411023523731012515 0ustar #!/bin/sh TEST=t16 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -Q t1 -d -Q t1 -d -Q t1 -d -D t1 -l >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t240000755000000000000000000000053311052145100012502 0ustar #!/bin/sh TEST=t24 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,20,40,60,80,100,120,140] \ -q -c t[0,20,40,60,80,100,120,140] \ -q -0 t[0,20,40,60,80,100,120,140] \ -q -1 t[0-159] \ -q -c t[0-159] \ -q -0 t[0-159] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t000000755000000000000000000000017011026010364012475 0ustar #!/bin/sh TEST=t00 ./tpl -f p493 'foo[1-500]' 'p[1-500]' >$TEST.out 2>&1 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t21.exp0000644000000000000000000000072111053364010013272 0ustar on: off: t[0-15] unknown: Command completed successfully on: t[0,8] off: t[1-7,9-15] unknown: Command completed successfully on: t[0,8] off: t[1-7,9-15] unknown: Command completed successfully on: off: t[0-15] unknown: Command completed successfully on: t[0-15] off: unknown: Command completed successfully on: t[0-15] off: unknown: Command completed successfully on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t07.conf0000644000000000000000000000075711024571543013451 0ustar specification "vpc" { timeout 5.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } script status { send "stat %s\n" expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t10.exp0000644000000000000000000012117011023544013013272 0ustar send(test0): 'spew 512\n' recv(test0): 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJK PQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn stuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^& n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRS XYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv ABCDEFGHIJKLMNOPQ\n1 OK\n' recv(test0): '2 vpc> ' send(test0): 'stat *\n' recv(test0): 'plug 0: OFF\n' recv(test0): 'plug 1: OFF\n' recv(test0): 'plug 2: OFF\n' recv(test0): 'plug 3: OFF\n' recv(test0): 'plug 4: OFF\n' recv(test0): 'plug 5: OFF\n' recv(test0): 'plug 6: OFF\n' recv(test0): 'plug 7: OFF\n' recv(test0): 'plug 8: OFF\n' recv(test0): 'plug 9: OFF\n' recv(test0): 'plug 10: OFF\n' recv(test0): 'plug 11: OFF\n' recv(test0): 'plug 12: OFF\n' recv(test0): 'plug 13: OFF\n' recv(test0): 'plug 14: OFF\n' recv(test0): 'plug 15: OFF\n' recv(test0): '2 OK\n' recv(test0): '3 vpc> ' on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t24.conf0000644000000000000000000000124511024324444013435 0ustar include "../etc/baytech-rpc28-nc.dev" device "b0" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" device "b1" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" device "b2" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" device "b3" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" device "b4" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" device "b5" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" device "b6" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" device "b7" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" node "t[0-19]" "b0" node "t[20-39]" "b1" node "t[40-59]" "b2" node "t[60-79]" "b3" node "t[80-99]" "b4" node "t[100-119]" "b5" node "t[120-139]" "b6" node "t[140-159]" "b7" powerman-2.3.5.orig/test/t400000755000000000000000000000045311052145100012501 0ustar #!/bin/sh TEST=t40 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,16,32,48] \ -q -c t[0,16,32,48] \ -q -0 t[0,16,32,48] \ -q -1 t[0-63] \ -q -c t[0-63] \ -q -0 t[0-63] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t15.exp0000644000000000000000000000007611052171766013315 0ustar Command completed successfully Command completed successfully powerman-2.3.5.orig/test/t17.conf0000644000000000000000000000126211024571543013442 0ustar specification "vpc" { timeout 15.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } script status_all { # noise generator # spew more than 64K (MAX_DEV_BUF) to cause cbuf wrap. # (1024 * 78 char = 78K) send "spew 1024\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " send "stat *\n" foreachplug { expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t460000755000000000000000000000043711073767566012546 0ustar #!/bin/sh TEST=t46 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,8,16] \ -q -c t[0,8,16] \ -q -0 t[0,8,16] \ -q -1 t[0-57] \ -q -c t[0-57] \ -q -0 t[0-57] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t360000755000000000000000000000052511052145100012506 0ustar #!/bin/sh TEST=t36 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 x[0,8,16,24] \ -q -c x[0,8,16,24] \ -q -0 x[0,8,16,24] \ -q -r x[0,8,16,24] \ -q -1 x[0-31] \ -q -c x[0-31] \ -q -0 x[0-31] \ -q -r x[0-31] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t39.exp0000644000000000000000000000070111027327357013317 0ustar on: off: t[0-15] unknown: Command completed successfully on: t0 off: t[1-15] unknown: Command completed successfully on: t0 off: t[1-15] unknown: Command completed successfully on: off: t[0-15] unknown: Command completed successfully on: t[0-15] off: unknown: Command completed successfully on: t[0-15] off: unknown: Command completed successfully on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t250000755000000000000000000000213311024571543012516 0ustar #!/bin/sh TEST=t25 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t49.conf0000644000000000000000000000015111164745453013453 0ustar listen "0.0.0.0:10103" include "../etc/vpc.dev" device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t19.exp0000644000000000000000000000016711052171766013322 0ustar test0: action timed out waiting for expected response on: off: unknown: t[0-15] Query completed with errors powerman-2.3.5.orig/test/t500000755000000000000000000000026011137457504012520 0ustar #!/bin/sh TEST=t50 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t1 -q -0 t1 -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t39.conf0000644000000000000000000000013611027327357013452 0ustar include "../etc/ics8064.dev" device "i0" "ics8064" "./gpib -p ics8064|&" node "t[0-15]" "i0" powerman-2.3.5.orig/test/t01.exp0000644000000000000000000000007011020052040013254 0ustar plug=p1001 node=t3 plug=p1000 node=t2 plug=p999 node=t1 powerman-2.3.5.orig/test/t050000755000000000000000000000013311021775230012506 0ustar #!/bin/sh TEST=t05 ./tregex >$TEST.out 2>&1 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t20.exp0000644000000000000000000000024611023607355013304 0ustar test0: action timed out waiting for expected response on: off: t[16-18] unknown: t[14-15] Query completed with errors on: off: t[16-31] unknown: powerman-2.3.5.orig/test/t450000755000000000000000000000044611052145100012510 0ustar #!/bin/sh TEST=t45 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0-1] \ -q -c t[0-1] \ -q -0 t[0-1] \ -q -c t[0-1] \ -q \ -b -f t[0-1] \ -b -u t[0-1] \ -b -t t[0-1] >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t20.conf0000644000000000000000000000204511024571543013434 0ustar specification "vpc" { timeout 2.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } # Hacked not to work script status_all { send "stat *\n" expect "WONTGETTHIS" } } specification "vpc2" { timeout 2.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } script status_all { send "stat *\n" foreachplug { expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } } device "test0" "vpc" "./vpcd |&" device "test1" "vpc2" "./vpcd |&" node "t[0-15]" "test0" node "t[16-31]" "test1" powerman-2.3.5.orig/test/t230000755000000000000000000000041211052145100012475 0ustar #!/bin/sh TEST=t23 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-19] \ -q -c t[0-19] \ -q -0 t[0-19] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t41.exp0000644000000000000000000000065011030214456013300 0ustar on: off: t0 unknown: t1 Command completed successfully on: t0 off: unknown: t1 Command completed successfully on: t0 off: unknown: t1 Command completed successfully on: off: t0 unknown: t1 Command completed successfully on: t0 off: unknown: t1 Command completed successfully on: t0 off: unknown: t1 Command completed successfully on: off: t0 unknown: t1 powerman-2.3.5.orig/test/t22.exp0000644000000000000000000000134611024324444013304 0ustar on: off: t[0-127] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127] unknown: Command completed successfully on: off: t[0-127] unknown: Command completed successfully on: t[0-127] off: unknown: Command completed successfully on: t[0-127] off: unknown: Command completed successfully on: off: t[0-127] unknown: powerman-2.3.5.orig/test/t440000755000000000000000000000040011052145100012475 0ustar #!/bin/sh TEST=t44 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0-2] \ -q -r t[0-2] \ -q -c t[0-2] \ -q -0 t[0-2] \ -q -r t[0-2] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t30.exp0000644000000000000000000000524111052171766013311 0ustar on: off: t[0-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: off: t[0-159] unknown: on: off: t[0-159] unknown: t0: 73: t1: 74: t2: 75: t3: 76: t4: 77: t5: 78: t6: 79: t7: 80: t8: 81: t9: 82: t10: 73: t11: 74: t12: 75: t13: 76: t14: 77: t15: 78: t16: 79: t17: 80: t18: 81: t19: 82: t20: 73: t21: 74: t22: 75: t23: 76: t24: 77: t25: 78: t26: 79: t27: 80: t28: 81: t29: 82: t30: 73: t31: 74: t32: 75: t33: 76: t34: 77: t35: 78: t36: 79: t37: 80: t38: 81: t39: 82: t40: 73: t41: 74: t42: 75: t43: 76: t44: 77: t45: 78: t46: 79: t47: 80: t48: 81: t49: 82: t50: 73: t51: 74: t52: 75: t53: 76: t54: 77: t55: 78: t56: 79: t57: 80: t58: 81: t59: 82: t60: 73: t61: 74: t62: 75: t63: 76: t64: 77: t65: 78: t66: 79: t67: 80: t68: 81: t69: 82: t70: 73: t71: 74: t72: 75: t73: 76: t74: 77: t75: 78: t76: 79: t77: 80: t78: 81: t79: 82: t80: 73: t81: 74: t82: 75: t83: 76: t84: 77: t85: 78: t86: 79: t87: 80: t88: 81: t89: 82: t90: 73: t91: 74: t92: 75: t93: 76: t94: 77: t95: 78: t96: 79: t97: 80: t98: 81: t99: 82: t100: 73: t101: 74: t102: 75: t103: 76: t104: 77: t105: 78: t106: 79: t107: 80: t108: 81: t109: 82: t110: 73: t111: 74: t112: 75: t113: 76: t114: 77: t115: 78: t116: 79: t117: 80: t118: 81: t119: 82: t120: 73: t121: 74: t122: 75: t123: 76: t124: 77: t125: 78: t126: 79: t127: 80: t128: 81: t129: 82: t130: 73: t131: 74: t132: 75: t133: 76: t134: 77: t135: 78: t136: 79: t137: 80: t138: 81: t139: 82: t140: 73: t141: 74: t142: 75: t143: 76: t144: 77: t145: 78: t146: 79: t147: 80: t148: 81: t149: 82: t150: 73: t151: 74: t152: 75: t153: 76: t154: 77: t155: 78: t156: 79: t157: 80: t158: 81: t159: 82: powerman-2.3.5.orig/test/t170000755000000000000000000000024111023607355012515 0ustar #!/bin/sh TEST=t17 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -T -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t27.exp0000644000000000000000000000067211024600603013304 0ustar on: off: t[0-7] unknown: Command completed successfully on: t0 off: t[1-7] unknown: Command completed successfully on: t0 off: t[1-7] unknown: Command completed successfully on: off: t[0-7] unknown: Command completed successfully on: t[0-7] off: unknown: Command completed successfully on: t[0-7] off: unknown: Command completed successfully on: off: t[0-7] unknown: powerman-2.3.5.orig/test/t30.conf0000644000000000000000000000204611026352165013435 0ustar include "../etc/icebox3.dev" device "i0" "icebox3" "./icebox -p v3 |&" device "i1" "icebox3" "./icebox -p v3 |&" device "i2" "icebox3" "./icebox -p v3 |&" device "i3" "icebox3" "./icebox -p v3 |&" device "i4" "icebox3" "./icebox -p v3 |&" device "i5" "icebox3" "./icebox -p v3 |&" device "i6" "icebox3" "./icebox -p v3 |&" device "i7" "icebox3" "./icebox -p v3 |&" device "i8" "icebox3" "./icebox -p v3 |&" device "i9" "icebox3" "./icebox -p v3 |&" device "i10" "icebox3" "./icebox -p v3 |&" device "i11" "icebox3" "./icebox -p v3 |&" device "i12" "icebox3" "./icebox -p v3 |&" device "i13" "icebox3" "./icebox -p v3 |&" device "i14" "icebox3" "./icebox -p v3 |&" device "i15" "icebox3" "./icebox -p v3 |&" node "t[0-9]" "i0" node "t[10-19]" "i1" node "t[20-29]" "i2" node "t[30-39]" "i3" node "t[40-49]" "i4" node "t[50-59]" "i5" node "t[60-69]" "i6" node "t[70-79]" "i7" node "t[80-89]" "i8" node "t[90-99]" "i9" node "t[100-109]" "i10" node "t[110-119]" "i11" node "t[120-129]" "i12" node "t[130-139]" "i13" node "t[140-149]" "i14" node "t[150-159]" "i15" powerman-2.3.5.orig/test/t10.conf0000644000000000000000000000133711024571543013436 0ustar specification "vpc" { timeout 5.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } script status_all { # noise generator # spew more than 1K (MIN_DEV_BUF) but less than 64K (MAX_DEV_BUF) to # cause cbuf expansion but no wrap. (512 * 78 char = 39K) send "spew 512\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " send "stat *\n" foreachplug { expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t23.exp0000644000000000000000000000070111024600603013271 0ustar on: off: t[0-19] unknown: Command completed successfully on: t0 off: t[1-19] unknown: Command completed successfully on: t0 off: t[1-19] unknown: Command completed successfully on: off: t[0-19] unknown: Command completed successfully on: t[0-19] off: unknown: Command completed successfully on: t[0-19] off: unknown: Command completed successfully on: off: t[0-19] unknown: powerman-2.3.5.orig/test/t480000755000000000000000000000100011115072462012510 0ustar #!/bin/sh # # All the previous tests use pty's to communicate between # client and server, server and power controller. # This one uses sockets. # TEST=t48 ./vpcd -p 10102 & sleep 1 # -1 means handle one client connection and exit when it exits # $TEST.conf file specifies nonstandard port of 10103 $PATH_POWERMAND -c $TEST.conf -f -1 2>/dev/null& sleep 1 $PATH_POWERMAN -h localhost:10103 \ -q -Q t1 -Q t[3-5] >$TEST.out 2>$TEST.err test $? = 0 || exit 1 wait; wait diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t02.exp0000644000000000000000000000015311020052040013257 0ustar plug=1 node=foo11 plug=2 node=foo12 plug=3 node=foo13 plug=4 node=foo14 plug=5 node=foo15 plug=6 node=NULL powerman-2.3.5.orig/test/t110000755000000000000000000000026611023523731012511 0ustar #!/bin/sh TEST=t11 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -q -1 t4 -q -0 t4 -q -c t5 -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t090000755000000000000000000000024111023523731012511 0ustar #!/bin/sh TEST=t09 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -T -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t07.exp0000644000000000000000000000015111023523731013277 0ustar on: off: t[0-15] unknown: on: off: t1 unknown: on: off: t[3-5] unknown: powerman-2.3.5.orig/test/Makefile.am0000644000000000000000000000407711151356676014234 0ustar sbin_PROGRAMS = vpcd check_PROGRAMS = tpl tregex targv \ baytech icebox gpib dli phantom cyclades ipmipower cli \ ilom lom TESTS_ENVIRONMENT = env TESTS_ENVIRONMENT += "PATH_POWERMAN=$(top_builddir)/src/powerman" TESTS_ENVIRONMENT += "PATH_POWERMAND=$(top_builddir)/src/powermand" TESTS_ENVIRONMENT += "PATH_ETC=$(top_builddir)/etc" TESTS = t00 t01 t02 t03 t04 t05 t06 t07 t08 t09 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 EXTRA_DIST = $(TESTS) *.exp *.conf CLEANFILES = *.out *.err *.diff common_sources = \ $(top_srcdir)/src/xread.c \ $(top_srcdir)/src/error.c \ $(top_srcdir)/src/debug.c \ $(top_srcdir)/src/pluglist.c \ $(top_srcdir)/src/hostlist.c \ $(top_srcdir)/src/hash.c \ $(top_srcdir)/src/list.c \ $(top_srcdir)/src/hprintf.c \ $(top_srcdir)/src/xregex.c \ $(top_srcdir)/src/xmalloc.c \ $(top_srcdir)/src/argv.c \ $(top_srcdir)/src/xpoll.c \ $(top_srcdir)/src/xpty.c AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib vpcd_SOURCES = vpcd.c $(common_sources) vpcd_LDADD = $(LIBFORKPTY) tpl_SOURCES = tpl.c $(common_sources) tpl_LDADD = $(LIBFORKPTY) tregex_SOURCES = tregex.c $(common_sources) tregex_LDADD = $(LIBFORKPTY) targv_SOURCES = targv.c $(common_sources) targv_LDADD = $(LIBFORKPTY) baytech_SOURCES = baytech.c $(common_sources) baytech_LDADD = $(LIBFORKPTY) icebox_SOURCES = icebox.c $(common_sources) icebox_LDADD = $(LIBFORKPTY) gpib_SOURCES = gpib.c $(common_sources) gpib_LDADD = $(LIBFORKPTY) dli_SOURCES = dli.c $(common_sources) dli_LDADD = $(LIBFORKPTY) ilom_SOURCES = ilom.c $(common_sources) ilom_LDADD = $(LIBFORKPTY) lom_SOURCES = lom.c $(common_sources) lom_LDADD = $(LIBFORKPTY) phantom_SOURCES = phantom.c $(common_sources) phantom_LDADD = $(LIBFORKPTY) $(LIBCURSES) cyclades_SOURCES = cyclades.c $(common_sources) cyclades_LDADD = $(LIBFORKPTY) ipmipower_SOURCES = ipmipower.c $(common_sources) ipmipower_LDADD = $(LIBFORKPTY) cli_SOURCES = cli.c cli_LDADD = $(LIBFORKPTY) -L../lib -lpowerman powerman-2.3.5.orig/test/t25.exp0000644000000000000000000000760011024571543013312 0ustar Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully Command completed successfully powerman-2.3.5.orig/test/t490000755000000000000000000000072511115237235012527 0ustar #!/bin/sh TEST=t49 $PATH_POWERMAND -c $TEST.conf -f -1 2>/dev/null& sleep 1 ./cli localhost:10103 q t1 >$TEST.out 2>$TEST.err test $? = 0 || exit 1 wait $PATH_POWERMAND -c $TEST.conf -f -1 2>/dev/null& sleep 1 ./cli localhost:10103 l >>$TEST.out 2>>$TEST.err test $? = 0 || exit 1 wait $PATH_POWERMAND -c $TEST.conf -f -1 2>/dev/null& sleep 1 ./cli localhost:10103 1 t0 >>$TEST.out 2>>$TEST.err test $? = 0 || exit 1 wait diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t19.conf0000644000000000000000000000064311052171766013452 0ustar specification "vpc" { timeout 2.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } # Hacked not to work script status_all { send "stat *\n" expect "WONTGETTHIS" } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t27.conf0000644000000000000000000000013511024571543013441 0ustar include "../etc/baytech.dev" device "b0" "baytech" "./baytech -p rpc3 |&" node "t[0-7]" "b0" powerman-2.3.5.orig/test/icebox.c0000644000000000000000000001707311113122517013574 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* icebox.c - icebox simulator */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "xread.h" static void usage(void); static void _noop_handler(int signum); static void _prompt_loop(void); typedef enum { NONE, V2, V3, V4 } icetype_t; static icetype_t personality = NONE; static char *prog; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "personality", required_argument, 0, 'p' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': if (strcmp(optarg, "v2") == 0) personality = V2; else if (strcmp(optarg, "v3") == 0) personality = V3; else if (strcmp(optarg, "v4") == 0) personality = V4; else usage(); break; default: usage(); } } if (optind < argc) usage(); if (personality == NONE) usage(); if (signal(SIGPIPE, _noop_handler) == SIG_ERR) { perror("signal"); exit(1); } _prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -p v2|v3|v4\n", prog); exit(1); } static void _noop_handler(int signum) { fprintf(stderr, "%s: received signal %d\n", prog, signum); } #define V2_BANNER "V2.1\r\n" #define V3_BANNER "V3.0\r\n" #define V4_BANNER "V4.0\r\n" #define V3_AUTHCMD "auth icebox\r\n" #define V3_RESP_OK "OK\r\n" #define V3_ERROR_CMD "ERROR 0\r\n" #define V3_ERROR_AUTH "ERROR 4\r\n" #define V3_POWER_STATUS "\ N1:%d N2:%d N3:%d N4:%d N5:%d N6:%d N7:%d N8:%d N9:%d N10:%d\r\n" #define V3_BEACON_STATUS "\ N1:%s N2:%s N3:%s N4:%s N5:%s N6:%s N7:%s N8:%s N9:%s N10:%s N11:%s N12:%s\r\n" #define V2_TEMP "\ N1:%d,0,0,0 N2:%d,0,0,0 N3:%d,0,0,0 N4:%d,0,0,0 N5:%d,0,0,0 N6:%d,0,0,0 N7:%d,0,0,0 N8:%d,0,0,0 N9:%d,0,0,0 N10:%d,0,0,0 N11:%d,0,0,0 N12:%d,0,0,0\r\n" #define V3_TEMP "\ N1:%d: N2:%d: N3:%d: N4:%d: N5:%d: N6:%d: N7:%d: N8:%d: N9:%d: N10:%d: N11:%d: N12:%d:\r\n" static void _prompt_loop(void) { int i; char buf[128]; int num_plugs = 10; int num_plugs_ext = 12; int plug[12]; char beacon[12][4]; int temp[12]; int plug_origin = 1; int logged_in = 0; int seq = 0; int quit = 0; char arg[80]; for (i = 0; i < num_plugs_ext; i++) { plug[i] = 0; temp[i] = 73 + i; strcpy(beacon[i], "OFF"); } /* User must first authenticate. */ switch (personality) { case V2: printf(V2_BANNER); break; case V3: printf(V3_BANNER); break; case V4: printf(V4_BANNER); break; } while (!logged_in) { if (xreadline("", buf, sizeof(buf)) == NULL) return; if (strcmp(buf, "auth icebox") == 0) { logged_in = 1; printf(V3_RESP_OK); } else printf(V3_ERROR_AUTH); } /* Process comands. */ while (logged_in) { if (xreadline("", buf, sizeof(buf)) == NULL) break; if (strlen(buf) == 0) { goto err; } else if (!strcmp(buf, "q")) { logged_in = 0; } else if (!strcmp(buf, "ps *") || !strcmp(buf, "ns *")) { printf(V3_POWER_STATUS, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7], plug[8], plug[9]); } else if (personality != V2 && !strcmp(buf, "be *")) { printf(V3_BEACON_STATUS, beacon[0], beacon[1], beacon[2], beacon[3], beacon[4], beacon[5], beacon[6], beacon[7], beacon[8], beacon[9], beacon[10], beacon[11]); } else if (personality != V2 && !strcmp(buf, "is *")) { printf(V3_TEMP, temp[0], temp[1], temp[2], temp[3], temp[4], temp[5], temp[6], temp[7], temp[8], temp[9], temp[10], temp[11]); } else if (personality == V2 && !strcmp(buf, "ts *")) { printf(V2_TEMP, temp[0], temp[1], temp[2], temp[3], temp[4], temp[5], temp[6], temp[7], temp[8], temp[9], temp[10], temp[11]); } else if (!strcmp(buf, "ph *")) { for (i = 0; i < num_plugs; i++) plug[i] = 1; } else if (sscanf(buf, "ph %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) plug[i - plug_origin] = 1; else goto err; } else if (!strcmp(buf, "pl *")) { for (i = 0; i < num_plugs; i++) plug[i] = 0; } else if (sscanf(buf, "pl %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) plug[i - plug_origin] = 0; else goto err; } else if (!strcmp(buf, "rp *")) { } else if (sscanf(buf, "rp %d", &i) == 1) { if (!(i >= plug_origin && i < num_plugs + plug_origin)) goto err; } else if (personality != V2 && sscanf(buf, "be %d %s", &i, arg) == 2) { if (i >= plug_origin && i < num_plugs_ext + plug_origin) { if (!strcmp(arg, "off")) strcpy(beacon[i - plug_origin], "OFF"); else if (!strcmp(arg, "on")) strcpy(beacon[i - plug_origin], "ON"); else goto err; } else goto err; } else goto err; if (logged_in) printf(V3_RESP_OK); continue; err: printf(V3_ERROR_CMD); } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/cyclades.c0000644000000000000000000003475611113122517014121 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* cyclades.c - simulate cyclades power controllers */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "xread.h" static void usage(void); static void _noop_handler(int signum); static void _prompt_loop(void); typedef enum { NONE, PM8, PM10, PM20, PM42 } cytype_t; static char *prog; static cytype_t personality = NONE; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "personality", required_argument, 0, 'p' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': if (strcmp(optarg, "pm8") == 0) personality = PM8; else if (strcmp(optarg, "pm10") == 0) personality = PM10; else if (strcmp(optarg, "pm20") == 0) personality = PM20; else if (strcmp(optarg, "pm42") == 0) personality = PM42; else usage(); break; default: usage(); } } if (optind < argc) usage(); if (personality == NONE) usage(); if (signal(SIGPIPE, _noop_handler) == SIG_ERR) { perror("signal"); exit(1); } _prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -p pm8|pm10|pm20|pm42\n", prog); exit(1); } static void _noop_handler(int signum) { fprintf(stderr, "%s: received signal %d\n", prog, signum); } #define BANNER "\ AlterPath PM\n\ Copyright (c) 2002-2003 Cyclades Corporation\n\ V 1.0.9a Jun 26, 2003\n\n" #define BANNER2 "\ AlterPath PM\n\ Copyright (c) 2007 Avocent Corporation\n\ V 1.9.1 May 2, 2007\n\ [PM]: IPDU: 1\n\ [PM]: OUT: 42\n" #define USER_PROMPT "Username: " /* admin */ #define PASS_PROMPT "Password: " /* pm8 */ #define CMD_PROMPT "pm>" #define FAILED_MSG "\nAuthentication failed.\n" #define HELP_MSG "\n\n\n\ Available commands:\n\ \n\ adduser alarm assign buzzer current\n\ cycle deluser factory_defaults help\n\ list lock name off on\n\ passwd reboot restore save status\n\ syslog unassign unlock ver whoami\n\ \n\ NOTE: To get detailed help on the commands listed above type\n\ ' help';\n\ NOTE: Some commands accept as input a data type called \n\ . is a string representing\n\ one or more outlets. This string can be:\n\ - one single outlet.\n\ Examples: on 3 (turn on outlet 3);\n\ off router (turn off the outlet called router).\n\ - a group of outlets.\n\ Examples: status 1,3,5 (get status of outlets 1, 3 and 5);\n\ cycle 2-7 (cycle the outlets 2, 3, 4, 5, 6, 7)\n\ lock 2,5-7 (lock the outlets 2, 5, 6 and 7).\n" #define HELP_MSG2 "\n\ Available commands:\n\ \n\ adduser alarm assign \n\ buzzer current currentprotection\n\ currseg cycle dbsync \n\ deluser display exit \n\ factory_defaults help hwocp \n\ humidity id interval \n\ list lock name \n\ off on outcycledelay \n\ passwd reboot restore \n\ save status syslog \n\ temperature unassign unlock \n\ upgrade ver voltage \n\ whoami \n\ \n\ NOTE: To get detailed help on the commands listed above type\n\ ' help'\n\n" #define STATUS_TMPL_PM8 "\ Outlet Name Status Users\n\ 1 Unlocked %s\n\ 2 Unlocked %s\n\ 3 Unlocked %s\n\ 4 Unlocked %s\n\ 5 Unlocked %s\n\ 6 Unlocked %s\n\ 7 Unlocked %s\n\ 8 Unlocked %s\n" #define STATUS_TMPL_PM10 "\ Outlet Name Status Users\n\ 1 Unlocked %s\n\ 2 Unlocked %s\n\ 3 Unlocked %s\n\ 4 Unlocked %s\n\ 5 Unlocked %s\n\ 6 Unlocked %s\n\ 7 Unlocked %s\n\ 8 Unlocked %s\n\ 9 Unlocked %s\n\ 10 Unlocked %s\n" #define STATUS_TMPL_PM20 "\ Outlet Name Status Users\n\ 1 Unlocked %s\n\ 2 Unlocked %s\n\ 3 Unlocked %s\n\ 4 Unlocked %s\n\ 5 Unlocked %s\n\ 6 Unlocked %s\n\ 7 Unlocked %s\n\ 8 Unlocked %s\n\ 9 Unlocked %s\n\ 10 Unlocked %s\n\ 11 Unlocked %s\n\ 12 Unlocked %s\n\ 13 Unlocked %s\n\ 14 Unlocked %s\n\ 15 Unlocked %s\n\ 16 Unlocked %s\n\ 17 Unlocked %s\n\ 18 Unlocked %s\n\ 19 Unlocked %s\n\ 20 Unlocked %s\n" #define STATUS_TMPL_PM42 "\ Outlet Name Status Interval (s) Users\n\ 1 Unlocked %s 0.0\n\ 2 Unlocked %s 0.0\n\ 3 Unlocked %s 0.0\n\ 4 Unlocked %s 0.0\n\ 5 Unlocked %s 0.0\n\ 6 Unlocked %s 0.0\n\ 7 Unlocked %s 0.0\n\ 8 Unlocked %s 0.0\n\ 9 Unlocked %s 0.0\n\ 10 Unlocked %s 0.0\n\ 11 Unlocked %s 0.0\n\ 12 Unlocked %s 0.0\n\ 13 Unlocked %s 0.0\n\ 14 Unlocked %s 0.0\n\ 15 Unlocked %s 0.0\n\ 16 Unlocked %s 0.0\n\ 17 Unlocked %s 0.0\n\ 18 Unlocked %s 0.0\n\ 19 Unlocked %s 0.0\n\ 20 Unlocked %s 0.0\n\ 21 Unlocked %s 0.0\n\ 22 Unlocked %s 0.0\n\ 23 Unlocked %s 0.0\n\ 24 Unlocked %s 0.0\n\ 25 Unlocked %s 0.0\n\ 26 Unlocked %s 0.0\n\ 27 Unlocked %s 0.0\n\ 28 Unlocked %s 0.0\n\ 29 Unlocked %s 0.0\n\ 30 Unlocked %s 0.0\n\ 31 Unlocked %s 0.0\n\ 32 Unlocked %s 0.0\n\ 33 Unlocked %s 0.0\n\ 34 Unlocked %s 0.0\n\ 35 Unlocked %s 0.0\n\ 36 Unlocked %s 0.0\n\ 37 Unlocked %s 0.0\n\ 38 Unlocked %s 0.0\n\ 39 Unlocked %s 0.0\n\ 40 Unlocked %s 0.0\n\ 41 Unlocked %s 0.0\n\ 42 Unlocked %s 0.0\n" #define CURRENT_PM42 "\ IPDU #1: RMS current for phase X: 2.3A. Maximum current for phase X: 10.8A\n\ IPDU #1: RMS current for phase Y: 0.0A. Maximum current for phase Y: 11.6A\n\ IPDU #1: RMS current for phase Z: 2.5A. Maximum current for phase Z: 11.0A\n" #define OFF_MSG "%d: Outlet turned off.\n" #define ON_MSG "%d: Outlet turned on.\n" static void _prompt_loop(void) { int i; char buf[128]; int num_plugs; char plug[42][4]; int plug_origin = 1; char user[32], pass[32]; char status_all[32]; char on_all[32]; char off_all[32]; char c; switch (personality) { case PM8: num_plugs = 8; break; case PM10: num_plugs = 10; break; case PM20: num_plugs = 20; break; case PM42: num_plugs = 42; break; case NONE: num_plugs = 0; } snprintf(status_all, sizeof(status_all), "status 1-%d", num_plugs); snprintf(on_all, sizeof(on_all), "on 1-%d", num_plugs); snprintf(off_all, sizeof(off_all), "off 1-%d", num_plugs); for (i = 0; i < num_plugs; i++) strcpy(plug[i], "OFF"); login_again: printf(personality == PM42 ? BANNER2 : BANNER); do { if (xreadline(USER_PROMPT, user, sizeof(user)) == NULL) goto done; if (xreadline(PASS_PROMPT, pass, sizeof(pass)) == NULL) goto done; } while (strcmp(user, "admin") != 0 || strcmp(pass, "pm8") != 0); while (1) { if (xreadline(CMD_PROMPT, buf, sizeof(buf)) == NULL) { goto done; } else if (strlen(buf) == 0) { continue; } else if (!strcmp(buf, "exit")) { sleep(1); goto login_again; } else if (!strcmp(buf, "help")) { printf(personality == PM42 ? HELP_MSG2 : HELP_MSG); } else if (!strcmp(buf, status_all)) { if (personality == PM8) { printf(STATUS_TMPL_PM8, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7]); } else if (personality == PM10) { printf(STATUS_TMPL_PM10, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7], plug[8], plug[9]); } else if (personality == PM20) { printf(STATUS_TMPL_PM20, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7], plug[8], plug[9], plug[10], plug[11], plug[12], plug[13], plug[14], plug[15], plug[16], plug[17], plug[18], plug[19]); } else if (personality == PM42) { printf(STATUS_TMPL_PM42, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7], plug[8], plug[9], plug[10], plug[11], plug[12], plug[13], plug[14], plug[15], plug[16], plug[17], plug[18], plug[19], plug[20], plug[21], plug[22], plug[23], plug[24], plug[25], plug[26], plug[27], plug[28], plug[29], plug[30], plug[31], plug[32], plug[33], plug[34], plug[35], plug[36], plug[37], plug[38], plug[39], plug[40], plug[41]); } } else if (!strcmp(buf, on_all)) { for (i = 0; i < num_plugs; i++) { strcpy(plug[i], personality == PM42 ? "ON " : "ON"); printf(ON_MSG, i); } } else if (sscanf(buf, "on %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) { strcpy(plug[i - plug_origin], personality == PM42 ? "ON ":"ON"); printf(ON_MSG, i); } else goto err; } else if (!strcmp(buf, off_all)) { for (i = 0; i < num_plugs; i++) { strcpy(plug[i], "OFF"); printf(OFF_MSG, i); } } else if (sscanf(buf, "off %d", &i) == 1) { if (i >= plug_origin && i < num_plugs + plug_origin) { strcpy(plug[i - plug_origin], "OFF"); printf(OFF_MSG, i); } else goto err; } else goto err; continue; err: printf("Input error\r\n\r\n"); } done: return; } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t22.conf0000644000000000000000000000241111053364010013422 0ustar include "../etc/baytech-rpc3-nc.dev" device "b0" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b1" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b2" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b3" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b4" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b5" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b6" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b7" "baytech-rpc3-nc" "./baytech -p rpc3-nc |&" device "b8" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" device "b9" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" device "b10" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" device "b11" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" device "b12" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" device "b13" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" device "b14" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" device "b15" "baytech-rpc3-nc" "./baytech -p rpc3-de |&" node "t[0-7]" "b0" node "t[8-15]" "b1" node "t[16-23]" "b2" node "t[24-31]" "b3" node "t[32-39]" "b4" node "t[40-47]" "b5" node "t[48-55]" "b6" node "t[56-63]" "b7" node "t[64-71]" "b8" node "t[72-79]" "b9" node "t[80-87]" "b10" node "t[88-95]" "b11" node "t[96-103]" "b12" node "t[104-111]" "b13" node "t[112-119]" "b14" node "t[120-127]" "b15" powerman-2.3.5.orig/test/t420000755000000000000000000000040711052145100012502 0ustar #!/bin/sh TEST=t42 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-7] \ -q -c t[0-7] \ -q -0 t[0-7] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t36.conf0000644000000000000000000000017511140656506013447 0ustar include "../etc/powerman.dev" device "p0" "powerman" "../src/powermand -f -c test4.conf -s |&" node "x[0-63]" "p0" "t[0-63]" powerman-2.3.5.orig/test/t150000755000000000000000000000025011052171766012517 0ustar #!/bin/sh TEST=t15 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -r t1 -r t[3-5] >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t25.conf0000644000000000000000000000047711032214434013440 0ustar specification "vpc" { # reduced timeout timeout 2 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script cycle { delay 0.01 } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t470000755000000000000000000000042611052145100012510 0ustar #!/bin/sh TEST=t47 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,8] \ -q -c t[0,8] \ -q -0 t[0,8] \ -q -1 t[0-15] \ -q -c t[0-15] \ -q -0 t[0-15] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t290000755000000000000000000000052111052171766012525 0ustar #!/bin/sh TEST=t29 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-9] \ -q -c t[0-9] \ -q -0 t[0-9] \ -b -f t0 \ -b -u t0 \ -b -f t[0-9] \ -b -u t[0-9] \ -b -q -t >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t040000755000000000000000000000013311023343502012500 0ustar #!/bin/sh TEST=t04 ./targv >$TEST.out 2>&1 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t32.conf0000644000000000000000000000202511026352165013434 0ustar include "../etc/icebox.dev" device "i0" "icebox" "./icebox -p v2 |&" device "i1" "icebox" "./icebox -p v2 |&" device "i2" "icebox" "./icebox -p v2 |&" device "i3" "icebox" "./icebox -p v2 |&" device "i4" "icebox" "./icebox -p v2 |&" device "i5" "icebox" "./icebox -p v2 |&" device "i6" "icebox" "./icebox -p v2 |&" device "i7" "icebox" "./icebox -p v2 |&" device "i8" "icebox" "./icebox -p v2 |&" device "i9" "icebox" "./icebox -p v2 |&" device "i10" "icebox" "./icebox -p v2 |&" device "i11" "icebox" "./icebox -p v2 |&" device "i12" "icebox" "./icebox -p v2 |&" device "i13" "icebox" "./icebox -p v2 |&" device "i14" "icebox" "./icebox -p v2 |&" device "i15" "icebox" "./icebox -p v2 |&" node "t[0-9]" "i0" node "t[10-19]" "i1" node "t[20-29]" "i2" node "t[30-39]" "i3" node "t[40-49]" "i4" node "t[50-59]" "i5" node "t[60-69]" "i6" node "t[70-79]" "i7" node "t[80-89]" "i8" node "t[90-99]" "i9" node "t[100-109]" "i10" node "t[110-119]" "i11" node "t[120-129]" "i12" node "t[130-139]" "i13" node "t[140-149]" "i14" node "t[150-159]" "i15" powerman-2.3.5.orig/test/t220000755000000000000000000000064011052145100012477 0ustar #!/bin/sh TEST=t22 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -c t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -0 t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -1 t[0-127] \ -q -c t[0-127] \ -q -0 t[0-127] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t23.conf0000644000000000000000000000016411024324444013433 0ustar include "../etc/baytech-rpc28-nc.dev" device "b0" "baytech-rpc28-nc" "./baytech -p rpc28-nc |&" node "t[0-19]" "b0" powerman-2.3.5.orig/test/t38.conf0000644000000000000000000000123111027327357013446 0ustar include "../etc/hp3488.dev" device "h0" "hp3488" "./gpib -p hp3488|&" device "h1" "hp3488" "./gpib -p hp3488|&" device "h2" "hp3488" "./gpib -p hp3488|&" node "t[0-9]" "h0" "[100-109]" node "t[10-19]" "h0" "[200-209]" node "t[20-29]" "h0" "[300-309]" node "t[30-39]" "h0" "[400-409]" node "t[40-49]" "h0" "[500-509]" node "t[50-59]" "h1" "[100-109]" node "t[60-69]" "h1" "[200-209]" node "t[70-79]" "h1" "[300-309]" node "t[80-89]" "h1" "[400-409]" node "t[90-99]" "h1" "[500-509]" node "t[100-109]" "h2" "[100-109]" node "t[110-119]" "h2" "[200-209]" node "t[120-129]" "h2" "[300-309]" node "t[130-139]" "h2" "[400-409]" node "t[140-149]" "h2" "[500-509]" powerman-2.3.5.orig/test/t350000755000000000000000000000060511052145100012504 0ustar #!/bin/sh TEST=t35 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,8,16,24,32,40,48,56] \ -q -c t[0,8,16,24,32,40,48,56] \ -q -0 t[0,8,16,24,32,40,48,56] \ -q -r t[0,8,16,24,32,40,48,56] \ -q -1 t[0-63] \ -q -c t[0-63] \ -q -0 t[0-63] \ -q -r t[0-63] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t020000755000000000000000000000016711021775230012512 0ustar #!/bin/sh TEST=t02 ./tpl -p1,2,3,4,5,6 foo[11-15] [1-5] >$TEST.out 2>&1 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t29.conf0000644000000000000000000000013211026352165013437 0ustar include "../etc/icebox3.dev" device "i0" "icebox3" "./icebox -p v3 |&" node "t[0-9]" "i0" powerman-2.3.5.orig/test/dli.c0000644000000000000000000002107611113122517013071 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* dli.c - mimic httpposer talking to a Digital Loggers Inc LPC */ #include #include #include #include "xread.h" #define DLI_POST "\ \n\ \n\ \n\ \n\ \n" #define DLI_GET "\ \n\ \n\ \n\ \n\ Outlet Control - Lite Power Controller\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\
\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\
\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\
\n\ \n\
Ethernet Power Controller
\n\
\n\
Outlet Control
Setup
AutoPing
Logout
Help

Link 1
Link 2
Link 3
Link 4
\n\
\n\ Version 1.2.1 (Aug 23 2007 / 20:14:33) 1555A5A1-D43E3FC2\n\
\n\ S/N:0000130175\n\
\n\ \n\ \n\
\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\
\n\ Controller: Lite Power Controller\n\
\n\ Uptime: 0:35:01 \n\
\n\ \n\ \n\
\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\
\n\ Individual Control\n\
#NameStateAction
1Outlet 1\n\ %s\n\ Switch ON\n\ \n\ \n\
2Outlet 2\n\ %s\n\ Switch ON\n\ \n\ \n\
3Outlet 3\n\ %s\n\ Switch ON\n\ \n\ \n\
4Outlet 4\n\ %s\n\ Switch ON\n\ \n\ \n\
5Outlet 5\n\ %s\n\ Switch ON\n\ \n\ \n\
6Outlet 6\n\ %s\n\ Switch ON\n\ \n\ \n\
7Outlet 7\n\ %s\n\ Switch ON\n\ \n\ \n\
8Outlet 8\n\ %s\n\ Switch ON\n\ \n\ \n\
\n\ \n\ \n\
\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\
Master Control
All outlets OFF
All outlets ON
Cycle all outlets
Sequence delay: 1 sec.
\n\ \n\ \n\
\n\ \n\ \n\ \n" static void prompt_loop(void) { char buf[128], tmp[32]; char plug[8][4]; int num_plugs = 8; int plug_origin = 1; int i; int authenticated = 0; for (i = 0; i < num_plugs; i++) strcpy(plug[i], "OFF"); for (;;) { if (xreadline("httppower> ", buf, sizeof(buf)) == NULL) break; if (!strcmp(buf, "help")) { printf("Commands are:\n"); printf(" auth admin:admin\n"); printf(" get\n"); printf(" post outlet [1-8]=ON|OFF\n"); } else if (!strcmp(buf, "auth admin:admin")) { authenticated = 1; } else if (!strcmp(buf, "get")) { if (!authenticated) goto err; printf(DLI_GET, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7]); } else if (sscanf(buf, "post outlet %d=%s", &i, tmp) == 2) { if (!authenticated) goto err; if (i < plug_origin || i >= num_plugs + plug_origin) goto err; if (!strcmp(tmp, "ON")) strcpy(plug[i - plug_origin], "ON"); else if (!strcmp(tmp, "OFF")) strcpy(plug[i - plug_origin], "OFF"); else goto err; printf(DLI_POST); } else goto err; continue; err: printf("Error\n"); } } int main(int argc, char *argv[]) { prompt_loop(); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t46.exp0000644000000000000000000000076311104074331013310 0ustar on: off: t[0-77] unknown: Command completed successfully on: t[0,8,16] off: t[1-7,9-15,17-77] unknown: Command completed successfully on: t[0,8,16] off: t[1-7,9-15,17-77] unknown: Command completed successfully on: off: t[0-77] unknown: Command completed successfully on: t[0-57] off: t[58-77] unknown: Command completed successfully on: t[0-57] off: t[58-77] unknown: Command completed successfully on: off: t[0-77] unknown: powerman-2.3.5.orig/test/t29.exp0000644000000000000000000000147411052171766013325 0ustar on: off: t[0-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: off: t[0-9] unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: off: t[0-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: off: t[0-9] unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: off: t[0-9] unknown: on: off: t[0-9] unknown: t0: 73: t1: 74: t2: 75: t3: 76: t4: 77: t5: 78: t6: 79: t7: 80: t8: 81: t9: 82: powerman-2.3.5.orig/test/t42.conf0000644000000000000000000000011111031754257013433 0ustar include "../etc/dli.dev" device "d0" "dli" "./dli |&" node "t[0-7]" "d0" powerman-2.3.5.orig/test/t09.exp0000644000000000000000000000360611023544013013305 0ustar send(test0): 'spew 16\n' recv(test0): 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\n1 OK\n' recv(test0): '2 vpc> ' send(test0): 'stat *\n' recv(test0): 'plug 0: OFF\n' recv(test0): 'plug 1: OFF\n' recv(test0): 'plug 2: OFF\n' recv(test0): 'plug 3: OFF\n' recv(test0): 'plug 4: OFF\n' recv(test0): 'plug 5: OFF\n' recv(test0): 'plug 6: OFF\n' recv(test0): 'plug 7: OFF\n' recv(test0): 'plug 8: OFF\n' recv(test0): 'plug 9: OFF\n' recv(test0): 'plug 10: OFF\n' recv(test0): 'plug 11: OFF\n' recv(test0): 'plug 12: OFF\n' recv(test0): 'plug 13: OFF\n' recv(test0): 'plug 14: OFF\n' recv(test0): 'plug 15: OFF\n' recv(test0): '2 OK\n' recv(test0): '3 vpc> ' on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t130000755000000000000000000000030211023523731012502 0ustar #!/bin/sh TEST=t13 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -b -f t[13-15] -b -u t13 -b -B t13 -B t14 >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t390000755000000000000000000000041211052145100012504 0ustar #!/bin/sh TEST=t39 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-15] \ -q -c t[0-15] \ -q -0 t[0-15] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t33.conf0000644000000000000000000000013211026355057013435 0ustar include "../etc/icebox3.dev" device "i0" "icebox3" "./icebox -p v4 |&" node "t[0-9]" "i0" powerman-2.3.5.orig/test/t24.exp0000644000000000000000000000113211024324444013277 0ustar on: off: t[0-159] unknown: Command completed successfully on: t[0,20,40,60,80,100,120,140] off: t[1-19,21-39,41-59,61-79,81-99,101-119,121-139,141-159] unknown: Command completed successfully on: t[0,20,40,60,80,100,120,140] off: t[1-19,21-39,41-59,61-79,81-99,101-119,121-139,141-159] unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: off: t[0-159] unknown: powerman-2.3.5.orig/test/t180000755000000000000000000000024111023607355012516 0ustar #!/bin/sh TEST=t18 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -T -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t05.exp0000644000000000000000000000000011020564654013274 0ustar powerman-2.3.5.orig/test/t40.exp0000644000000000000000000000077311027327357013320 0ustar on: off: t[0-63] unknown: Command completed successfully on: t[0,16,32,48] off: t[1-15,17-31,33-47,49-63] unknown: Command completed successfully on: t[0,16,32,48] off: t[1-15,17-31,33-47,49-63] unknown: Command completed successfully on: off: t[0-63] unknown: Command completed successfully on: t[0-63] off: unknown: Command completed successfully on: t[0-63] off: unknown: Command completed successfully on: off: t[0-63] unknown: powerman-2.3.5.orig/test/test4.conf0000644000000000000000000000037511115104225014064 0ustar include "../etc/vpc.dev" device "test0" "vpc" "./vpcd |&" device "test1" "vpc" "./vpcd |&" device "test2" "vpc" "./vpcd |&" device "test3" "vpc" "./vpcd |&" node "t[0-15]" "test0" node "t[16-31]" "test1" node "t[32-47]" "test2" node "t[48-63]" "test3" powerman-2.3.5.orig/test/README0000644000000000000000000000602111151356676013047 0ustar On running 'make check': The test methodology here is to run the powerman daemon as a child of the powerman client, connected via pty. The powerman daemon in turn spawns copies of 'vpcd' (virtual power control device), connected via ptys. Each test starts a fresh powerman+powermand+vpcd(s) so no state is preserved between tests. Root privilage or available well known ports are not required to run these tests. The client can send multiple commands, so we can send commands and change state and then query the state to see what happened. The output of each command is compared against expected output. The tests are summarized here: t00-t03 pluglist.c tests using tpl.c. t04 argv.c test using targv.c. t05 xregex.c tests using tregex.c. t06 Check power status query options pm --query-all --query t1 --query t[3-5] t07 Check power status query options with no status_all script implemented. pm --query-all --query t1 --query t[3-5] t08 Telemetry option check. pm --telemetry --query-all t09 Check handling of large volume (size < min) of data returned by device. pm --telemetry --query-all t10 Check handling of large volume (min < size < max) of data returned by device. pm --telemetry --query-all t11 Check power options. pm --query-all --on t4 --query-all --off t4 --query-all \ --cycle t5 --query-all t12 Check handling of "dangling" target args. pm --query t1 t2 t13 Check beacon options: pm --beacon-all --flash t[13-15] --beacon-all --unflash t13 \ --beacon-all --beacon t13 --beacon t14 t14 Check temperature options: pm --temp-all --temp t13 --temp t[13-15] t15 Check reset options pm --reset t1 --reset t[3-5] t16 Check list and device options pm --list \ --device-all --query t1 --device-all --query t1 --device test0 t17 Check handling of large volume (max < size) of data returned by device. pm --telemetry --query-all t18 Check handling of large volume (2*max < size) of data returned by device. pm --telemetry --query-all t19 Check timeout/reconnect. pm -I --query-all t20 Check timeout/reconnect with partial success (32 plugs). pm -I --query t[14-18] --query t[16-31] t21-t22 Test baytech-rpc3-nc script using baytech.c. t23-t24 Test baytech-rpc28-nc script using baytech.c. t25-t26 Ensure that delays are process expeditiously. t27-t28 Test baytech script using baytech.c. t29-t30 Test icebox v3 using icebox.c. t31-t32 Test icebox v2 using icebox.c. t33-t34 Test icebox v4 using icebox.c. t35 Powerman as a pseudo-power controller, direct mapping. t36 Powerman as a pseudo-power controller, remapped. t37-38 Test hp3488 using gpib.c t39-40 Test ics8064 using gpib.c t41 Test plmpower using plm.c t42-t43 Test DLI LPC using dli.c t44 Test Sun ILOM using ilom.c t45 Test Rackable Phantom using phantom.c t46 Test cyclades pm8/pm10 using cyclades.c t47 Test FreeIPMI ipmipower using ipmipower.c t48 Run some simple vpcd tests using sockets. t49 Test libpowerman API t50 Test bashfun demo script. t51 Test Sun LOM using lom.c powerman-2.3.5.orig/test/t080000755000000000000000000000024011023523731012507 0ustar #!/bin/sh TEST=t08 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -T -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t410000755000000000000000000000040711052145100012501 0ustar #!/bin/sh TEST=t41 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-1] \ -q -c t[0-1] \ -q -0 t[0-1] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/mcr.conf0000644000000000000000000011760711115266304013620 0ustar # # $Id: powerman.conf-mcr 789 2006-10-27 22:28:44Z garlick $ # # MCR powerman.conf (1152 nodes, 121 iceboxes) - mod to work in test harness. # FIXME: we run out of ptys on some platforms with this many (121) coprocesses # include "../etc/icebox3.dev" tcpwrappers yes # 10 ports per power controller. device "ice-r1-1" "icebox3" "icebox -pv3|&" device "ice-r2-1" "icebox3" "icebox -pv3|&" device "ice-r4-1" "icebox3" "icebox -pv3|&" device "ice-r5-1" "icebox3" "icebox -pv3|&" device "ice-r6-1" "icebox3" "icebox -pv3|&" device "ice-r7-1" "icebox3" "icebox -pv3|&" device "ice-r7-2" "icebox3" "icebox -pv3|&" device "ice-r7-3" "icebox3" "icebox -pv3|&" device "ice-r8-1" "icebox3" "icebox -pv3|&" device "ice-r8-2" "icebox3" "icebox -pv3|&" device "ice-r8-3" "icebox3" "icebox -pv3|&" device "ice-r9-1" "icebox3" "icebox -pv3|&" device "ice-r9-2" "icebox3" "icebox -pv3|&" device "ice-r9-3" "icebox3" "icebox -pv3|&" device "ice-r9-4" "icebox3" "icebox -pv3|&" device "ice-r10-1" "icebox3" "icebox -pv3|&" device "ice-r10-2" "icebox3" "icebox -pv3|&" device "ice-r11-1" "icebox3" "icebox -pv3|&" device "ice-r11-2" "icebox3" "icebox -pv3|&" device "ice-r11-3" "icebox3" "icebox -pv3|&" device "ice-r11-4" "icebox3" "icebox -pv3|&" device "ice-r15-1" "icebox3" "icebox -pv3|&" device "ice-r15-2" "icebox3" "icebox -pv3|&" device "ice-r15-3" "icebox3" "icebox -pv3|&" device "ice-r15-4" "icebox3" "icebox -pv3|&" device "ice-r16-1" "icebox3" "icebox -pv3|&" device "ice-r16-2" "icebox3" "icebox -pv3|&" device "ice-r17-1" "icebox3" "icebox -pv3|&" device "ice-r17-2" "icebox3" "icebox -pv3|&" device "ice-r17-3" "icebox3" "icebox -pv3|&" device "ice-r17-4" "icebox3" "icebox -pv3|&" device "ice-r18-1" "icebox3" "icebox -pv3|&" device "ice-r18-2" "icebox3" "icebox -pv3|&" device "ice-r18-3" "icebox3" "icebox -pv3|&" device "ice-r18-4" "icebox3" "icebox -pv3|&" device "ice-r19-1" "icebox3" "icebox -pv3|&" device "ice-r19-2" "icebox3" "icebox -pv3|&" device "ice-r20-1" "icebox3" "icebox -pv3|&" device "ice-r20-2" "icebox3" "icebox -pv3|&" device "ice-r20-3" "icebox3" "icebox -pv3|&" device "ice-r20-4" "icebox3" "icebox -pv3|&" device "ice-r23-1" "icebox3" "icebox -pv3|&" device "ice-r23-2" "icebox3" "icebox -pv3|&" device "ice-r23-3" "icebox3" "icebox -pv3|&" device "ice-r23-4" "icebox3" "icebox -pv3|&" device "ice-r24-1" "icebox3" "icebox -pv3|&" device "ice-r24-2" "icebox3" "icebox -pv3|&" device "ice-r25-1" "icebox3" "icebox -pv3|&" device "ice-r25-2" "icebox3" "icebox -pv3|&" device "ice-r25-3" "icebox3" "icebox -pv3|&" device "ice-r25-4" "icebox3" "icebox -pv3|&" device "ice-r26-1" "icebox3" "icebox -pv3|&" device "ice-r26-2" "icebox3" "icebox -pv3|&" device "ice-r26-3" "icebox3" "icebox -pv3|&" device "ice-r26-4" "icebox3" "icebox -pv3|&" device "ice-r27-1" "icebox3" "icebox -pv3|&" device "ice-r27-2" "icebox3" "icebox -pv3|&" device "ice-r28-1" "icebox3" "icebox -pv3|&" device "ice-r28-2" "icebox3" "icebox -pv3|&" device "ice-r28-3" "icebox3" "icebox -pv3|&" device "ice-r28-4" "icebox3" "icebox -pv3|&" device "ice-r29-1" "icebox3" "icebox -pv3|&" device "ice-r29-2" "icebox3" "icebox -pv3|&" device "ice-r29-3" "icebox3" "icebox -pv3|&" device "ice-r29-4" "icebox3" "icebox -pv3|&" device "ice-r30-1" "icebox3" "icebox -pv3|&" device "ice-r30-2" "icebox3" "icebox -pv3|&" device "ice-r31-1" "icebox3" "icebox -pv3|&" device "ice-r31-2" "icebox3" "icebox -pv3|&" device "ice-r31-3" "icebox3" "icebox -pv3|&" device "ice-r31-4" "icebox3" "icebox -pv3|&" device "ice-r32-1" "icebox3" "icebox -pv3|&" device "ice-r32-2" "icebox3" "icebox -pv3|&" device "ice-r32-3" "icebox3" "icebox -pv3|&" device "ice-r32-4" "icebox3" "icebox -pv3|&" device "ice-r33-1" "icebox3" "icebox -pv3|&" device "ice-r33-2" "icebox3" "icebox -pv3|&" device "ice-r34-1" "icebox3" "icebox -pv3|&" device "ice-r34-2" "icebox3" "icebox -pv3|&" device "ice-r34-3" "icebox3" "icebox -pv3|&" device "ice-r34-4" "icebox3" "icebox -pv3|&" device "ice-r35-1" "icebox3" "icebox -pv3|&" device "ice-r35-2" "icebox3" "icebox -pv3|&" device "ice-r35-3" "icebox3" "icebox -pv3|&" device "ice-r35-4" "icebox3" "icebox -pv3|&" device "ice-r36-1" "icebox3" "icebox -pv3|&" device "ice-r36-2" "icebox3" "icebox -pv3|&" device "ice-r37-1" "icebox3" "icebox -pv3|&" device "ice-r37-2" "icebox3" "icebox -pv3|&" device "ice-r37-3" "icebox3" "icebox -pv3|&" device "ice-r37-4" "icebox3" "icebox -pv3|&" device "ice-r38-1" "icebox3" "icebox -pv3|&" device "ice-r38-2" "icebox3" "icebox -pv3|&" device "ice-r38-3" "icebox3" "icebox -pv3|&" device "ice-r38-4" "icebox3" "icebox -pv3|&" device "ice-r39-1" "icebox3" "icebox -pv3|&" device "ice-r39-2" "icebox3" "icebox -pv3|&" device "ice-r40-1" "icebox3" "icebox -pv3|&" device "ice-r40-2" "icebox3" "icebox -pv3|&" device "ice-r40-3" "icebox3" "icebox -pv3|&" device "ice-r40-4" "icebox3" "icebox -pv3|&" device "ice-r41-1" "icebox3" "icebox -pv3|&" device "ice-r41-2" "icebox3" "icebox -pv3|&" device "ice-r41-3" "icebox3" "icebox -pv3|&" device "ice-r41-4" "icebox3" "icebox -pv3|&" device "ice-r42-1" "icebox3" "icebox -pv3|&" device "ice-r42-2" "icebox3" "icebox -pv3|&" device "ice-r43-1" "icebox3" "icebox -pv3|&" device "ice-r43-2" "icebox3" "icebox -pv3|&" device "ice-r43-3" "icebox3" "icebox -pv3|&" device "ice-r43-4" "icebox3" "icebox -pv3|&" device "ice-r12-1" "icebox3" "icebox -pv3|&" device "ice-r12-2" "icebox3" "icebox -pv3|&" device "ice-r12-3" "icebox3" "icebox -pv3|&" device "ice-r12-4" "icebox3" "icebox -pv3|&" device "ice-r13-1" "icebox3" "icebox -pv3|&" device "ice-r13-2" "icebox3" "icebox -pv3|&" device "ice-r14-1" "icebox3" "icebox -pv3|&" device "ice-r14-2" "icebox3" "icebox -pv3|&" device "ice-r14-3" "icebox3" "icebox -pv3|&" device "ice-r14-4" "icebox3" "icebox -pv3|&" node "mcr0" "ice-r1-1" "1" node "mcr1" "ice-r1-1" "2" node "mcr2" "ice-r1-1" "3" node "mcr3" "ice-r1-1" "4" node "mcr4" "ice-r1-1" "5" node "mcr5" "ice-r1-1" "6" node "mcr6" "ice-r1-1" "7" node "mcr7" "ice-r1-1" "8" node "mcr8" "ice-r1-1" "9" node "mcr9" "ice-r1-1" "10" # node "mcr10" "ice-r2-1" "1" node "mcr11" "ice-r2-1" "2" node "mcr12" "ice-r2-1" "3" node "mcr13" "ice-r2-1" "4" node "mcr14" "ice-r2-1" "5" node "mcr15" "ice-r2-1" "6" node "mcr16" "ice-r2-1" "7" node "mcr17" "ice-r2-1" "8" node "mcr18" "ice-r2-1" "9" node "mcr19" "ice-r2-1" "10" # node "mcr20" "ice-r4-1" "1" node "mcr21" "ice-r4-1" "2" node "mcr22" "ice-r4-1" "3" node "mcr23" "ice-r4-1" "4" # node "mcr36" "ice-r4-1" "5" node "mcr37" "ice-r4-1" "6" node "mcr38" "ice-r4-1" "7" node "mcr39" "ice-r4-1" "8" # node "mcr24" "ice-r5-1" "1" node "mcr25" "ice-r5-1" "2" node "mcrj" "ice-r5-1" "4" # node "mcr26" "ice-r6-1" "1" node "mcr27" "ice-r6-1" "2" node "mcr28" "ice-r6-1" "3" node "mcr29" "ice-r6-1" "4" node "mcr30" "ice-r6-1" "5" node "mcr31" "ice-r6-1" "6" node "mcr32" "ice-r6-1" "7" node "mcr33" "ice-r6-1" "8" node "mcr34" "ice-r6-1" "9" node "mcr35" "ice-r6-1" "10" # #OLD node "mcr36" "ice-r7-1" "1" #OLD node "mcr37" "ice-r7-1" "2" #OLD node "mcr38" "ice-r7-1" "3" #OLD node "mcr39" "ice-r7-1" "4" node "mcr40" "ice-r7-1" "5" node "mcr41" "ice-r7-1" "6" node "mcr42" "ice-r7-1" "7" node "mcr43" "ice-r7-1" "8" node "mcr44" "ice-r7-1" "9" node "mcr45" "ice-r7-1" "10" # node "mcr46" "ice-r7-2" "1" node "mcr47" "ice-r7-2" "2" node "mcr48" "ice-r7-2" "3" node "mcr49" "ice-r7-2" "4" node "mcr50" "ice-r7-2" "5" node "mcr51" "ice-r7-2" "6" node "mcr52" "ice-r7-2" "7" node "mcr53" "ice-r7-2" "8" node "mcr54" "ice-r7-2" "9" node "mcr55" "ice-r7-2" "10" # node "mcr56" "ice-r7-3" "1" node "mcr57" "ice-r7-3" "2" node "mcr58" "ice-r7-3" "3" node "mcr59" "ice-r7-3" "4" node "mcr60" "ice-r7-3" "5" node "mcr61" "ice-r7-3" "6" node "mcr62" "ice-r7-3" "7" node "mcr63" "ice-r7-3" "8" node "mcr64" "ice-r7-3" "9" node "mcr65" "ice-r7-3" "10" # node "mcr66" "ice-r8-1" "1" node "mcr67" "ice-r8-1" "2" node "mcr68" "ice-r8-1" "3" node "mcr69" "ice-r8-1" "4" node "mcr70" "ice-r8-1" "5" node "mcr71" "ice-r8-1" "6" node "mcr72" "ice-r8-1" "7" node "mcr73" "ice-r8-1" "8" node "mcr74" "ice-r8-1" "9" node "mcr75" "ice-r8-1" "10" # node "mcr76" "ice-r8-2" "1" node "mcr77" "ice-r8-2" "2" node "mcr78" "ice-r8-2" "3" node "mcr79" "ice-r8-2" "4" node "mcr80" "ice-r8-2" "5" node "mcr81" "ice-r8-2" "6" node "mcr82" "ice-r8-2" "7" node "mcr83" "ice-r8-2" "8" node "mcr84" "ice-r8-2" "9" node "mcr85" "ice-r8-2" "10" # node "mcr86" "ice-r8-3" "1" node "mcr87" "ice-r8-3" "2" node "mcr88" "ice-r8-3" "3" node "mcr89" "ice-r8-3" "4" node "mcr90" "ice-r8-3" "5" node "mcr91" "ice-r8-3" "6" node "mcr92" "ice-r8-3" "7" node "mcr93" "ice-r8-3" "8" node "mcr94" "ice-r8-3" "9" node "mcr95" "ice-r8-3" "10" # # # CNSU0 # node "mcr96" "ice-r9-1" "1" node "mcr97" "ice-r9-1" "2" node "mcr98" "ice-r9-1" "3" node "mcr99" "ice-r9-1" "4" node "mcr100" "ice-r9-1" "5" node "mcr101" "ice-r9-1" "6" node "mcr102" "ice-r9-1" "7" node "mcr103" "ice-r9-1" "8" node "mcr104" "ice-r9-1" "9" node "mcr105" "ice-r9-1" "10" # node "mcr106" "ice-r9-2" "1" node "mcr107" "ice-r9-2" "2" node "mcr108" "ice-r9-2" "3" node "mcr109" "ice-r9-2" "4" node "mcr110" "ice-r9-2" "5" node "mcr111" "ice-r9-2" "6" node "mcr112" "ice-r9-2" "7" node "mcr113" "ice-r9-2" "8" node "mcr114" "ice-r9-2" "9" node "mcr115" "ice-r9-2" "10" # node "mcr116" "ice-r9-3" "1" node "mcr117" "ice-r9-3" "2" node "mcr118" "ice-r9-3" "3" node "mcr119" "ice-r9-3" "4" node "mcr120" "ice-r9-3" "5" node "mcr121" "ice-r9-3" "6" node "mcr122" "ice-r9-3" "7" node "mcr123" "ice-r9-3" "8" node "mcr124" "ice-r9-3" "9" node "mcr125" "ice-r9-3" "10" # node "mcr126" "ice-r9-4" "1" node "mcr127" "ice-r9-4" "2" node "mcr128" "ice-r9-4" "3" node "mcr129" "ice-r9-4" "4" node "mcr130" "ice-r9-4" "5" node "mcr131" "ice-r9-4" "6" node "mcr132" "ice-r9-4" "7" node "mcr133" "ice-r9-4" "8" node "mcr134" "ice-r9-4" "9" node "mcr135" "ice-r9-4" "10" # node "mcr136" "ice-r10-1" "1" node "mcr137" "ice-r10-1" "2" node "mcr138" "ice-r10-1" "3" node "mcr139" "ice-r10-1" "4" node "mcr140" "ice-r10-1" "5" node "mcr141" "ice-r10-1" "6" # node "mcr142" "ice-r10-2" "1" node "mcr143" "ice-r10-2" "2" node "mcr144" "ice-r10-2" "3" node "mcr145" "ice-r10-2" "4" node "mcr146" "ice-r10-2" "5" node "mcr147" "ice-r10-2" "6" node "mcr148" "ice-r10-2" "7" node "mcr149" "ice-r10-2" "8" node "mcr150" "ice-r10-2" "9" node "mcr151" "ice-r10-2" "10" # node "mcr152" "ice-r11-1" "1" node "mcr153" "ice-r11-1" "2" node "mcr154" "ice-r11-1" "3" node "mcr155" "ice-r11-1" "4" node "mcr156" "ice-r11-1" "5" node "mcr157" "ice-r11-1" "6" node "mcr158" "ice-r11-1" "7" node "mcr159" "ice-r11-1" "8" node "mcr160" "ice-r11-1" "9" node "mcr161" "ice-r11-1" "10" # node "mcr162" "ice-r11-2" "1" node "mcr163" "ice-r11-2" "2" node "mcr164" "ice-r11-2" "3" node "mcr165" "ice-r11-2" "4" node "mcr166" "ice-r11-2" "5" node "mcr167" "ice-r11-2" "6" node "mcr168" "ice-r11-2" "7" node "mcr169" "ice-r11-2" "8" node "mcr170" "ice-r11-2" "9" node "mcr171" "ice-r11-2" "10" # node "mcr172" "ice-r11-3" "1" node "mcr173" "ice-r11-3" "2" node "mcr174" "ice-r11-3" "3" node "mcr175" "ice-r11-3" "4" node "mcr176" "ice-r11-3" "5" node "mcr177" "ice-r11-3" "6" node "mcr178" "ice-r11-3" "7" node "mcr179" "ice-r11-3" "8" node "mcr180" "ice-r11-3" "9" node "mcr181" "ice-r11-3" "10" # node "mcr182" "ice-r11-4" "1" node "mcr183" "ice-r11-4" "2" node "mcr184" "ice-r11-4" "3" node "mcr185" "ice-r11-4" "4" node "mcr186" "ice-r11-4" "5" node "mcr187" "ice-r11-4" "6" node "mcr188" "ice-r11-4" "7" node "mcr189" "ice-r11-4" "8" node "mcr190" "ice-r11-4" "9" node "mcr191" "ice-r11-4" "10" # # CNSU1 # node "mcr192" "ice-r15-1" "1" node "mcr193" "ice-r15-1" "2" node "mcr194" "ice-r15-1" "3" node "mcr195" "ice-r15-1" "4" node "mcr196" "ice-r15-1" "5" node "mcr197" "ice-r15-1" "6" node "mcr198" "ice-r15-1" "7" node "mcr199" "ice-r15-1" "8" node "mcr200" "ice-r15-1" "9" node "mcr201" "ice-r15-1" "10" # node "mcr202" "ice-r15-2" "1" node "mcr203" "ice-r15-2" "2" node "mcr204" "ice-r15-2" "3" node "mcr205" "ice-r15-2" "4" node "mcr206" "ice-r15-2" "5" node "mcr207" "ice-r15-2" "6" node "mcr208" "ice-r15-2" "7" node "mcr209" "ice-r15-2" "8" node "mcr210" "ice-r15-2" "9" node "mcr211" "ice-r15-2" "10" # node "mcr212" "ice-r15-3" "1" node "mcr213" "ice-r15-3" "2" node "mcr214" "ice-r15-3" "3" node "mcr215" "ice-r15-3" "4" node "mcr216" "ice-r15-3" "5" node "mcr217" "ice-r15-3" "6" node "mcr218" "ice-r15-3" "7" node "mcr219" "ice-r15-3" "8" node "mcr220" "ice-r15-3" "9" node "mcr221" "ice-r15-3" "10" # node "mcr222" "ice-r15-4" "1" node "mcr223" "ice-r15-4" "2" node "mcr224" "ice-r15-4" "3" node "mcr225" "ice-r15-4" "4" node "mcr226" "ice-r15-4" "5" node "mcr227" "ice-r15-4" "6" node "mcr228" "ice-r15-4" "7" node "mcr229" "ice-r15-4" "8" node "mcr230" "ice-r15-4" "9" node "mcr231" "ice-r15-4" "10" # node "mcr232" "ice-r16-1" "1" node "mcr233" "ice-r16-1" "2" node "mcr234" "ice-r16-1" "3" node "mcr235" "ice-r16-1" "4" node "mcr236" "ice-r16-1" "5" node "mcr237" "ice-r16-1" "6" # node "mcr238" "ice-r16-2" "1" node "mcr239" "ice-r16-2" "2" node "mcr240" "ice-r16-2" "3" node "mcr241" "ice-r16-2" "4" node "mcr242" "ice-r16-2" "5" node "mcr243" "ice-r16-2" "6" node "mcr244" "ice-r16-2" "7" node "mcr245" "ice-r16-2" "8" node "mcr246" "ice-r16-2" "9" node "mcr247" "ice-r16-2" "10" # node "mcr248" "ice-r17-1" "1" node "mcr249" "ice-r17-1" "2" node "mcr250" "ice-r17-1" "3" node "mcr251" "ice-r17-1" "4" node "mcr252" "ice-r17-1" "5" node "mcr253" "ice-r17-1" "6" node "mcr254" "ice-r17-1" "7" node "mcr255" "ice-r17-1" "8" node "mcr256" "ice-r17-1" "9" node "mcr257" "ice-r17-1" "10" # node "mcr258" "ice-r17-2" "1" node "mcr259" "ice-r17-2" "2" node "mcr260" "ice-r17-2" "3" node "mcr261" "ice-r17-2" "4" node "mcr262" "ice-r17-2" "5" node "mcr263" "ice-r17-2" "6" node "mcr264" "ice-r17-2" "7" node "mcr265" "ice-r17-2" "8" node "mcr266" "ice-r17-2" "9" node "mcr267" "ice-r17-2" "10" # node "mcr268" "ice-r17-3" "1" node "mcr269" "ice-r17-3" "2" node "mcr270" "ice-r17-3" "3" node "mcr271" "ice-r17-3" "4" node "mcr272" "ice-r17-3" "5" node "mcr273" "ice-r17-3" "6" node "mcr274" "ice-r17-3" "7" node "mcr275" "ice-r17-3" "8" node "mcr276" "ice-r17-3" "9" node "mcr277" "ice-r17-3" "10" # node "mcr278" "ice-r17-4" "1" node "mcr279" "ice-r17-4" "2" node "mcr280" "ice-r17-4" "3" node "mcr281" "ice-r17-4" "4" node "mcr282" "ice-r17-4" "5" node "mcr283" "ice-r17-4" "6" node "mcr284" "ice-r17-4" "7" node "mcr285" "ice-r17-4" "8" node "mcr286" "ice-r17-4" "9" node "mcr287" "ice-r17-4" "10" # # CNSU2 # node "mcr288" "ice-r18-1" "1" node "mcr289" "ice-r18-1" "2" node "mcr290" "ice-r18-1" "3" node "mcr291" "ice-r18-1" "4" node "mcr292" "ice-r18-1" "5" node "mcr293" "ice-r18-1" "6" node "mcr294" "ice-r18-1" "7" node "mcr295" "ice-r18-1" "8" node "mcr296" "ice-r18-1" "9" node "mcr297" "ice-r18-1" "10" # node "mcr298" "ice-r18-2" "1" node "mcr299" "ice-r18-2" "2" node "mcr300" "ice-r18-2" "3" node "mcr301" "ice-r18-2" "4" node "mcr302" "ice-r18-2" "5" node "mcr303" "ice-r18-2" "6" node "mcr304" "ice-r18-2" "7" node "mcr305" "ice-r18-2" "8" node "mcr306" "ice-r18-2" "9" node "mcr307" "ice-r18-2" "10" # node "mcr308" "ice-r18-3" "1" node "mcr309" "ice-r18-3" "2" node "mcr310" "ice-r18-3" "3" node "mcr311" "ice-r18-3" "4" node "mcr312" "ice-r18-3" "5" node "mcr313" "ice-r18-3" "6" node "mcr314" "ice-r18-3" "7" node "mcr315" "ice-r18-3" "8" node "mcr316" "ice-r18-3" "9" node "mcr317" "ice-r18-3" "10" # node "mcr318" "ice-r18-4" "1" node "mcr319" "ice-r18-4" "2" node "mcr320" "ice-r18-4" "3" node "mcr321" "ice-r18-4" "4" node "mcr322" "ice-r18-4" "5" node "mcr323" "ice-r18-4" "6" node "mcr324" "ice-r18-4" "7" node "mcr325" "ice-r18-4" "8" node "mcr326" "ice-r18-4" "9" node "mcr327" "ice-r18-4" "10" # node "mcr328" "ice-r19-1" "1" node "mcr329" "ice-r19-1" "2" node "mcr330" "ice-r19-1" "3" node "mcr331" "ice-r19-1" "4" node "mcr332" "ice-r19-1" "5" node "mcr333" "ice-r19-1" "6" # node "mcr334" "ice-r19-2" "1" node "mcr335" "ice-r19-2" "2" node "mcr336" "ice-r19-2" "3" node "mcr337" "ice-r19-2" "4" node "mcr338" "ice-r19-2" "5" node "mcr339" "ice-r19-2" "6" node "mcr340" "ice-r19-2" "7" node "mcr341" "ice-r19-2" "8" node "mcr342" "ice-r19-2" "9" node "mcr343" "ice-r19-2" "10" # node "mcr344" "ice-r20-1" "1" node "mcr345" "ice-r20-1" "2" node "mcr346" "ice-r20-1" "3" node "mcr347" "ice-r20-1" "4" node "mcr348" "ice-r20-1" "5" node "mcr349" "ice-r20-1" "6" node "mcr350" "ice-r20-1" "7" node "mcr351" "ice-r20-1" "8" node "mcr352" "ice-r20-1" "9" node "mcr353" "ice-r20-1" "10" # node "mcr354" "ice-r20-2" "1" node "mcr355" "ice-r20-2" "2" node "mcr356" "ice-r20-2" "3" node "mcr357" "ice-r20-2" "4" node "mcr358" "ice-r20-2" "5" node "mcr359" "ice-r20-2" "6" node "mcr360" "ice-r20-2" "7" node "mcr361" "ice-r20-2" "8" node "mcr362" "ice-r20-2" "9" node "mcr363" "ice-r20-2" "10" # node "mcr364" "ice-r20-3" "1" node "mcr365" "ice-r20-3" "2" node "mcr366" "ice-r20-3" "3" node "mcr367" "ice-r20-3" "4" node "mcr368" "ice-r20-3" "5" node "mcr369" "ice-r20-3" "6" node "mcr370" "ice-r20-3" "7" node "mcr371" "ice-r20-3" "8" node "mcr372" "ice-r20-3" "9" node "mcr373" "ice-r20-3" "10" # node "mcr374" "ice-r20-4" "1" node "mcr375" "ice-r20-4" "2" node "mcr376" "ice-r20-4" "3" node "mcr377" "ice-r20-4" "4" node "mcr378" "ice-r20-4" "5" node "mcr379" "ice-r20-4" "6" node "mcr380" "ice-r20-4" "7" node "mcr381" "ice-r20-4" "8" node "mcr382" "ice-r20-4" "9" node "mcr383" "ice-r20-4" "10" # # CNSU3 # node "mcr384" "ice-r23-1" "1" node "mcr385" "ice-r23-1" "2" node "mcr386" "ice-r23-1" "3" node "mcr387" "ice-r23-1" "4" node "mcr388" "ice-r23-1" "5" node "mcr389" "ice-r23-1" "6" node "mcr390" "ice-r23-1" "7" node "mcr391" "ice-r23-1" "8" node "mcr392" "ice-r23-1" "9" node "mcr393" "ice-r23-1" "10" # node "mcr394" "ice-r23-2" "1" node "mcr395" "ice-r23-2" "2" node "mcr396" "ice-r23-2" "3" node "mcr397" "ice-r23-2" "4" node "mcr398" "ice-r23-2" "5" node "mcr399" "ice-r23-2" "6" node "mcr400" "ice-r23-2" "7" node "mcr401" "ice-r23-2" "8" node "mcr402" "ice-r23-2" "9" node "mcr403" "ice-r23-2" "10" # node "mcr404" "ice-r23-3" "1" node "mcr405" "ice-r23-3" "2" node "mcr406" "ice-r23-3" "3" node "mcr407" "ice-r23-3" "4" node "mcr408" "ice-r23-3" "5" node "mcr409" "ice-r23-3" "6" node "mcr410" "ice-r23-3" "7" node "mcr411" "ice-r23-3" "8" node "mcr412" "ice-r23-3" "9" node "mcr413" "ice-r23-3" "10" # node "mcr414" "ice-r23-4" "1" node "mcr415" "ice-r23-4" "2" node "mcr416" "ice-r23-4" "3" node "mcr417" "ice-r23-4" "4" node "mcr418" "ice-r23-4" "5" node "mcr419" "ice-r23-4" "6" node "mcr420" "ice-r23-4" "7" node "mcr421" "ice-r23-4" "8" node "mcr422" "ice-r23-4" "9" node "mcr423" "ice-r23-4" "10" # node "mcr424" "ice-r24-1" "1" node "mcr425" "ice-r24-1" "2" node "mcr426" "ice-r24-1" "3" node "mcr427" "ice-r24-1" "4" node "mcr428" "ice-r24-1" "5" node "mcr429" "ice-r24-1" "6" # node "mcr430" "ice-r24-2" "1" node "mcr431" "ice-r24-2" "2" node "mcr432" "ice-r24-2" "3" node "mcr433" "ice-r24-2" "4" node "mcr434" "ice-r24-2" "5" node "mcr435" "ice-r24-2" "6" node "mcr436" "ice-r24-2" "7" node "mcr437" "ice-r24-2" "8" node "mcr438" "ice-r24-2" "9" node "mcr439" "ice-r24-2" "10" # node "mcr440" "ice-r25-1" "1" node "mcr441" "ice-r25-1" "2" node "mcr442" "ice-r25-1" "3" node "mcr443" "ice-r25-1" "4" node "mcr444" "ice-r25-1" "5" node "mcr445" "ice-r25-1" "6" node "mcr446" "ice-r25-1" "7" node "mcr447" "ice-r25-1" "8" node "mcr448" "ice-r25-1" "9" node "mcr449" "ice-r25-1" "10" # node "mcr450" "ice-r25-2" "1" node "mcr451" "ice-r25-2" "2" node "mcr452" "ice-r25-2" "3" node "mcr453" "ice-r25-2" "4" node "mcr454" "ice-r25-2" "5" node "mcr455" "ice-r25-2" "6" node "mcr456" "ice-r25-2" "7" node "mcr457" "ice-r25-2" "8" node "mcr458" "ice-r25-2" "9" node "mcr459" "ice-r25-2" "10" # node "mcr460" "ice-r25-3" "1" node "mcr461" "ice-r25-3" "2" node "mcr462" "ice-r25-3" "3" node "mcr463" "ice-r25-3" "4" node "mcr464" "ice-r25-3" "5" node "mcr465" "ice-r25-3" "6" node "mcr466" "ice-r25-3" "7" node "mcr467" "ice-r25-3" "8" node "mcr468" "ice-r25-3" "9" node "mcr469" "ice-r25-3" "10" # node "mcr470" "ice-r25-4" "1" node "mcr471" "ice-r25-4" "2" node "mcr472" "ice-r25-4" "3" node "mcr473" "ice-r25-4" "4" node "mcr474" "ice-r25-4" "5" node "mcr475" "ice-r25-4" "6" node "mcr476" "ice-r25-4" "7" node "mcr477" "ice-r25-4" "8" node "mcr478" "ice-r25-4" "9" node "mcr479" "ice-r25-4" "10" # # CNSU4 # node "mcr480" "ice-r26-1" "1" node "mcr481" "ice-r26-1" "2" node "mcr482" "ice-r26-1" "3" node "mcr483" "ice-r26-1" "4" node "mcr484" "ice-r26-1" "5" node "mcr485" "ice-r26-1" "6" node "mcr486" "ice-r26-1" "7" node "mcr487" "ice-r26-1" "8" node "mcr488" "ice-r26-1" "9" node "mcr489" "ice-r26-1" "10" # node "mcr490" "ice-r26-2" "1" node "mcr491" "ice-r26-2" "2" node "mcr492" "ice-r26-2" "3" node "mcr493" "ice-r26-2" "4" node "mcr494" "ice-r26-2" "5" node "mcr495" "ice-r26-2" "6" node "mcr496" "ice-r26-2" "7" node "mcr497" "ice-r26-2" "8" node "mcr498" "ice-r26-2" "9" node "mcr499" "ice-r26-2" "10" # node "mcr500" "ice-r26-3" "1" node "mcr501" "ice-r26-3" "2" node "mcr502" "ice-r26-3" "3" node "mcr503" "ice-r26-3" "4" node "mcr504" "ice-r26-3" "5" node "mcr505" "ice-r26-3" "6" node "mcr506" "ice-r26-3" "7" node "mcr507" "ice-r26-3" "8" node "mcr508" "ice-r26-3" "9" node "mcr509" "ice-r26-3" "10" # node "mcr510" "ice-r26-4" "1" node "mcr511" "ice-r26-4" "2" node "mcr512" "ice-r26-4" "3" node "mcr513" "ice-r26-4" "4" node "mcr514" "ice-r26-4" "5" node "mcr515" "ice-r26-4" "6" node "mcr516" "ice-r26-4" "7" node "mcr517" "ice-r26-4" "8" node "mcr518" "ice-r26-4" "9" node "mcr519" "ice-r26-4" "10" # node "mcr520" "ice-r27-1" "1" node "mcr521" "ice-r27-1" "2" node "mcr522" "ice-r27-1" "3" node "mcr523" "ice-r27-1" "4" node "mcr524" "ice-r27-1" "5" node "mcr525" "ice-r27-1" "6" # node "mcr526" "ice-r27-2" "1" node "mcr527" "ice-r27-2" "2" node "mcr528" "ice-r27-2" "3" node "mcr529" "ice-r27-2" "4" node "mcr530" "ice-r27-2" "5" node "mcr531" "ice-r27-2" "6" node "mcr532" "ice-r27-2" "7" node "mcr533" "ice-r27-2" "8" node "mcr534" "ice-r27-2" "9" node "mcr535" "ice-r27-2" "10" # node "mcr536" "ice-r28-1" "1" node "mcr537" "ice-r28-1" "2" node "mcr538" "ice-r28-1" "3" node "mcr539" "ice-r28-1" "4" node "mcr540" "ice-r28-1" "5" node "mcr541" "ice-r28-1" "6" node "mcr542" "ice-r28-1" "7" node "mcr543" "ice-r28-1" "8" node "mcr544" "ice-r28-1" "9" node "mcr545" "ice-r28-1" "10" # node "mcr546" "ice-r28-2" "1" node "mcr547" "ice-r28-2" "2" node "mcr548" "ice-r28-2" "3" node "mcr549" "ice-r28-2" "4" node "mcr550" "ice-r28-2" "5" node "mcr551" "ice-r28-2" "6" node "mcr552" "ice-r28-2" "7" node "mcr553" "ice-r28-2" "8" node "mcr554" "ice-r28-2" "9" node "mcr555" "ice-r28-2" "10" # node "mcr556" "ice-r28-3" "1" node "mcr557" "ice-r28-3" "2" node "mcr558" "ice-r28-3" "3" node "mcr559" "ice-r28-3" "4" node "mcr560" "ice-r28-3" "5" node "mcr561" "ice-r28-3" "6" node "mcr562" "ice-r28-3" "7" node "mcr563" "ice-r28-3" "8" node "mcr564" "ice-r28-3" "9" node "mcr565" "ice-r28-3" "10" # node "mcr566" "ice-r28-4" "1" node "mcr567" "ice-r28-4" "2" node "mcr568" "ice-r28-4" "3" node "mcr569" "ice-r28-4" "4" node "mcr570" "ice-r28-4" "5" node "mcr571" "ice-r28-4" "6" node "mcr572" "ice-r28-4" "7" node "mcr573" "ice-r28-4" "8" node "mcr574" "ice-r28-4" "9" node "mcr575" "ice-r28-4" "10" # # CNSU5 # node "mcr576" "ice-r29-1" "1" node "mcr577" "ice-r29-1" "2" node "mcr578" "ice-r29-1" "3" node "mcr579" "ice-r29-1" "4" node "mcr580" "ice-r29-1" "5" node "mcr581" "ice-r29-1" "6" node "mcr582" "ice-r29-1" "7" node "mcr583" "ice-r29-1" "8" node "mcr584" "ice-r29-1" "9" node "mcr585" "ice-r29-1" "10" # node "mcr586" "ice-r29-2" "1" node "mcr587" "ice-r29-2" "2" node "mcr588" "ice-r29-2" "3" node "mcr589" "ice-r29-2" "4" node "mcr590" "ice-r29-2" "5" node "mcr591" "ice-r29-2" "6" node "mcr592" "ice-r29-2" "7" node "mcr593" "ice-r29-2" "8" node "mcr594" "ice-r29-2" "9" node "mcr595" "ice-r29-2" "10" # node "mcr596" "ice-r29-3" "1" node "mcr597" "ice-r29-3" "2" node "mcr598" "ice-r29-3" "3" node "mcr599" "ice-r29-3" "4" node "mcr600" "ice-r29-3" "5" node "mcr601" "ice-r29-3" "6" node "mcr602" "ice-r29-3" "7" node "mcr603" "ice-r29-3" "8" node "mcr604" "ice-r29-3" "9" node "mcr605" "ice-r29-3" "10" # node "mcr606" "ice-r29-4" "1" node "mcr607" "ice-r29-4" "2" node "mcr608" "ice-r29-4" "3" node "mcr609" "ice-r29-4" "4" node "mcr610" "ice-r29-4" "5" node "mcr611" "ice-r29-4" "6" node "mcr612" "ice-r29-4" "7" node "mcr613" "ice-r29-4" "8" node "mcr614" "ice-r29-4" "9" node "mcr615" "ice-r29-4" "10" # node "mcr616" "ice-r30-1" "1" node "mcr617" "ice-r30-1" "2" node "mcr618" "ice-r30-1" "3" node "mcr619" "ice-r30-1" "4" node "mcr620" "ice-r30-1" "5" node "mcr621" "ice-r30-1" "6" # node "mcr622" "ice-r30-2" "1" node "mcr623" "ice-r30-2" "2" node "mcr624" "ice-r30-2" "3" node "mcr625" "ice-r30-2" "4" node "mcr626" "ice-r30-2" "5" node "mcr627" "ice-r30-2" "6" node "mcr628" "ice-r30-2" "7" node "mcr629" "ice-r30-2" "8" node "mcr630" "ice-r30-2" "9" node "mcr631" "ice-r30-2" "10" # node "mcr632" "ice-r31-1" "1" node "mcr633" "ice-r31-1" "2" node "mcr634" "ice-r31-1" "3" node "mcr635" "ice-r31-1" "4" node "mcr636" "ice-r31-1" "5" node "mcr637" "ice-r31-1" "6" node "mcr638" "ice-r31-1" "7" node "mcr639" "ice-r31-1" "8" node "mcr640" "ice-r31-1" "9" node "mcr641" "ice-r31-1" "10" # node "mcr642" "ice-r31-2" "1" node "mcr643" "ice-r31-2" "2" node "mcr644" "ice-r31-2" "3" node "mcr645" "ice-r31-2" "4" node "mcr646" "ice-r31-2" "5" node "mcr647" "ice-r31-2" "6" node "mcr648" "ice-r31-2" "7" node "mcr649" "ice-r31-2" "8" node "mcr650" "ice-r31-2" "9" node "mcr651" "ice-r31-2" "10" # node "mcr652" "ice-r31-3" "1" node "mcr653" "ice-r31-3" "2" node "mcr654" "ice-r31-3" "3" node "mcr655" "ice-r31-3" "4" node "mcr656" "ice-r31-3" "5" node "mcr657" "ice-r31-3" "6" node "mcr658" "ice-r31-3" "7" node "mcr659" "ice-r31-3" "8" node "mcr660" "ice-r31-3" "9" node "mcr661" "ice-r31-3" "10" # node "mcr662" "ice-r31-4" "1" node "mcr663" "ice-r31-4" "2" node "mcr664" "ice-r31-4" "3" node "mcr665" "ice-r31-4" "4" node "mcr666" "ice-r31-4" "5" node "mcr667" "ice-r31-4" "6" node "mcr668" "ice-r31-4" "7" node "mcr669" "ice-r31-4" "8" node "mcr670" "ice-r31-4" "9" node "mcr671" "ice-r31-4" "10" # # CNSU6 # node "mcr672" "ice-r32-1" "1" node "mcr673" "ice-r32-1" "2" node "mcr674" "ice-r32-1" "3" node "mcr675" "ice-r32-1" "4" node "mcr676" "ice-r32-1" "5" node "mcr677" "ice-r32-1" "6" node "mcr678" "ice-r32-1" "7" node "mcr679" "ice-r32-1" "8" node "mcr680" "ice-r32-1" "9" node "mcr681" "ice-r32-1" "10" # node "mcr682" "ice-r32-2" "1" node "mcr683" "ice-r32-2" "2" node "mcr684" "ice-r32-2" "3" node "mcr685" "ice-r32-2" "4" node "mcr686" "ice-r32-2" "5" node "mcr687" "ice-r32-2" "6" node "mcr688" "ice-r32-2" "7" node "mcr689" "ice-r32-2" "8" node "mcr690" "ice-r32-2" "9" node "mcr691" "ice-r32-2" "10" # node "mcr692" "ice-r32-3" "1" node "mcr693" "ice-r32-3" "2" node "mcr694" "ice-r32-3" "3" node "mcr695" "ice-r32-3" "4" node "mcr696" "ice-r32-3" "5" node "mcr697" "ice-r32-3" "6" node "mcr698" "ice-r32-3" "7" node "mcr699" "ice-r32-3" "8" node "mcr700" "ice-r32-3" "9" node "mcr701" "ice-r32-3" "10" # node "mcr702" "ice-r32-4" "1" node "mcr703" "ice-r32-4" "2" node "mcr704" "ice-r32-4" "3" node "mcr705" "ice-r32-4" "4" node "mcr706" "ice-r32-4" "5" node "mcr707" "ice-r32-4" "6" node "mcr708" "ice-r32-4" "7" node "mcr709" "ice-r32-4" "8" node "mcr710" "ice-r32-4" "9" node "mcr711" "ice-r32-4" "10" # node "mcr712" "ice-r33-1" "1" node "mcr713" "ice-r33-1" "2" node "mcr714" "ice-r33-1" "3" node "mcr715" "ice-r33-1" "4" node "mcr716" "ice-r33-1" "5" node "mcr717" "ice-r33-1" "6" # node "mcr718" "ice-r33-2" "1" node "mcr719" "ice-r33-2" "2" node "mcr720" "ice-r33-2" "3" node "mcr721" "ice-r33-2" "4" node "mcr722" "ice-r33-2" "5" node "mcr723" "ice-r33-2" "6" node "mcr724" "ice-r33-2" "7" node "mcr725" "ice-r33-2" "8" node "mcr726" "ice-r33-2" "9" node "mcr727" "ice-r33-2" "10" # node "mcr728" "ice-r34-1" "1" node "mcr729" "ice-r34-1" "2" node "mcr730" "ice-r34-1" "3" node "mcr731" "ice-r34-1" "4" node "mcr732" "ice-r34-1" "5" node "mcr733" "ice-r34-1" "6" node "mcr734" "ice-r34-1" "7" node "mcr735" "ice-r34-1" "8" node "mcr736" "ice-r34-1" "9" node "mcr737" "ice-r34-1" "10" # node "mcr738" "ice-r34-2" "1" node "mcr739" "ice-r34-2" "2" node "mcr740" "ice-r34-2" "3" node "mcr741" "ice-r34-2" "4" node "mcr742" "ice-r34-2" "5" node "mcr743" "ice-r34-2" "6" node "mcr744" "ice-r34-2" "7" node "mcr745" "ice-r34-2" "8" node "mcr746" "ice-r34-2" "9" node "mcr747" "ice-r34-2" "10" # node "mcr748" "ice-r34-3" "1" node "mcr749" "ice-r34-3" "2" node "mcr750" "ice-r34-3" "3" node "mcr751" "ice-r34-3" "4" node "mcr752" "ice-r34-3" "5" node "mcr753" "ice-r34-3" "6" node "mcr754" "ice-r34-3" "7" node "mcr755" "ice-r34-3" "8" node "mcr756" "ice-r34-3" "9" node "mcr757" "ice-r34-3" "10" # node "mcr758" "ice-r34-4" "1" node "mcr759" "ice-r34-4" "2" node "mcr760" "ice-r34-4" "3" node "mcr761" "ice-r34-4" "4" node "mcr762" "ice-r34-4" "5" node "mcr763" "ice-r34-4" "6" node "mcr764" "ice-r34-4" "7" node "mcr765" "ice-r34-4" "8" node "mcr766" "ice-r34-4" "9" node "mcr767" "ice-r34-4" "10" # # CNSU7 # node "mcr768" "ice-r35-1" "1" node "mcr769" "ice-r35-1" "2" node "mcr770" "ice-r35-1" "3" node "mcr771" "ice-r35-1" "4" node "mcr772" "ice-r35-1" "5" node "mcr773" "ice-r35-1" "6" node "mcr774" "ice-r35-1" "7" node "mcr775" "ice-r35-1" "8" node "mcr776" "ice-r35-1" "9" node "mcr777" "ice-r35-1" "10" # node "mcr778" "ice-r35-2" "1" node "mcr779" "ice-r35-2" "2" node "mcr780" "ice-r35-2" "3" node "mcr781" "ice-r35-2" "4" node "mcr782" "ice-r35-2" "5" node "mcr783" "ice-r35-2" "6" node "mcr784" "ice-r35-2" "7" node "mcr785" "ice-r35-2" "8" node "mcr786" "ice-r35-2" "9" node "mcr787" "ice-r35-2" "10" # node "mcr788" "ice-r35-3" "1" node "mcr789" "ice-r35-3" "2" node "mcr790" "ice-r35-3" "3" node "mcr791" "ice-r35-3" "4" node "mcr792" "ice-r35-3" "5" node "mcr793" "ice-r35-3" "6" node "mcr794" "ice-r35-3" "7" node "mcr795" "ice-r35-3" "8" node "mcr796" "ice-r35-3" "9" node "mcr797" "ice-r35-3" "10" # node "mcr798" "ice-r35-4" "1" node "mcr799" "ice-r35-4" "2" node "mcr800" "ice-r35-4" "3" node "mcr801" "ice-r35-4" "4" node "mcr802" "ice-r35-4" "5" node "mcr803" "ice-r35-4" "6" node "mcr804" "ice-r35-4" "7" node "mcr805" "ice-r35-4" "8" node "mcr806" "ice-r35-4" "9" node "mcr807" "ice-r35-4" "10" # node "mcr808" "ice-r36-1" "1" node "mcr809" "ice-r36-1" "2" node "mcr810" "ice-r36-1" "3" node "mcr811" "ice-r36-1" "4" node "mcr812" "ice-r36-1" "5" node "mcr813" "ice-r36-1" "6" # node "mcr814" "ice-r36-2" "1" node "mcr815" "ice-r36-2" "2" node "mcr816" "ice-r36-2" "3" node "mcr817" "ice-r36-2" "4" node "mcr818" "ice-r36-2" "5" node "mcr819" "ice-r36-2" "6" node "mcr820" "ice-r36-2" "7" node "mcr821" "ice-r36-2" "8" node "mcr822" "ice-r36-2" "9" node "mcr823" "ice-r36-2" "10" # node "mcr824" "ice-r37-1" "1" node "mcr825" "ice-r37-1" "2" node "mcr826" "ice-r37-1" "3" node "mcr827" "ice-r37-1" "4" node "mcr828" "ice-r37-1" "5" node "mcr829" "ice-r37-1" "6" node "mcr830" "ice-r37-1" "7" node "mcr831" "ice-r37-1" "8" node "mcr832" "ice-r37-1" "9" node "mcr833" "ice-r37-1" "10" # node "mcr834" "ice-r37-2" "1" node "mcr835" "ice-r37-2" "2" node "mcr836" "ice-r37-2" "3" node "mcr837" "ice-r37-2" "4" node "mcr838" "ice-r37-2" "5" node "mcr839" "ice-r37-2" "6" node "mcr840" "ice-r37-2" "7" node "mcr841" "ice-r37-2" "8" node "mcr842" "ice-r37-2" "9" node "mcr843" "ice-r37-2" "10" # node "mcr844" "ice-r37-3" "1" node "mcr845" "ice-r37-3" "2" node "mcr846" "ice-r37-3" "3" node "mcr847" "ice-r37-3" "4" node "mcr848" "ice-r37-3" "5" node "mcr849" "ice-r37-3" "6" node "mcr850" "ice-r37-3" "7" node "mcr851" "ice-r37-3" "8" node "mcr852" "ice-r37-3" "9" node "mcr853" "ice-r37-3" "10" # node "mcr854" "ice-r37-4" "1" node "mcr855" "ice-r37-4" "2" node "mcr856" "ice-r37-4" "3" node "mcr857" "ice-r37-4" "4" node "mcr858" "ice-r37-4" "5" node "mcr859" "ice-r37-4" "6" node "mcr860" "ice-r37-4" "7" node "mcr861" "ice-r37-4" "8" node "mcr862" "ice-r37-4" "9" node "mcr863" "ice-r37-4" "10" # # CNSU8 # node "mcr864" "ice-r38-1" "1" node "mcr865" "ice-r38-1" "2" node "mcr866" "ice-r38-1" "3" node "mcr867" "ice-r38-1" "4" node "mcr868" "ice-r38-1" "5" node "mcr869" "ice-r38-1" "6" node "mcr870" "ice-r38-1" "7" node "mcr871" "ice-r38-1" "8" node "mcr872" "ice-r38-1" "9" node "mcr873" "ice-r38-1" "10" # node "mcr874" "ice-r38-2" "1" node "mcr875" "ice-r38-2" "2" node "mcr876" "ice-r38-2" "3" node "mcr877" "ice-r38-2" "4" node "mcr878" "ice-r38-2" "5" node "mcr879" "ice-r38-2" "6" node "mcr880" "ice-r38-2" "7" node "mcr881" "ice-r38-2" "8" node "mcr882" "ice-r38-2" "9" node "mcr883" "ice-r38-2" "10" # node "mcr884" "ice-r38-3" "1" node "mcr885" "ice-r38-3" "2" node "mcr886" "ice-r38-3" "3" node "mcr887" "ice-r38-3" "4" node "mcr888" "ice-r38-3" "5" node "mcr889" "ice-r38-3" "6" node "mcr890" "ice-r38-3" "7" node "mcr891" "ice-r38-3" "8" node "mcr892" "ice-r38-3" "9" node "mcr893" "ice-r38-3" "10" # node "mcr894" "ice-r38-4" "1" node "mcr895" "ice-r38-4" "2" node "mcr896" "ice-r38-4" "3" node "mcr897" "ice-r38-4" "4" node "mcr898" "ice-r38-4" "5" node "mcr899" "ice-r38-4" "6" node "mcr900" "ice-r38-4" "7" node "mcr901" "ice-r38-4" "8" node "mcr902" "ice-r38-4" "9" node "mcr903" "ice-r38-4" "10" # node "mcr904" "ice-r39-1" "1" node "mcr905" "ice-r39-1" "2" node "mcr906" "ice-r39-1" "3" node "mcr907" "ice-r39-1" "4" node "mcr908" "ice-r39-1" "5" node "mcr909" "ice-r39-1" "6" # node "mcr910" "ice-r39-2" "1" node "mcr911" "ice-r39-2" "2" node "mcr912" "ice-r39-2" "3" node "mcr913" "ice-r39-2" "4" node "mcr914" "ice-r39-2" "5" node "mcr915" "ice-r39-2" "6" node "mcr916" "ice-r39-2" "7" node "mcr917" "ice-r39-2" "8" node "mcr918" "ice-r39-2" "9" node "mcr919" "ice-r39-2" "10" # node "mcr920" "ice-r40-1" "1" node "mcr921" "ice-r40-1" "2" node "mcr922" "ice-r40-1" "3" node "mcr923" "ice-r40-1" "4" node "mcr924" "ice-r40-1" "5" node "mcr925" "ice-r40-1" "6" node "mcr926" "ice-r40-1" "7" node "mcr927" "ice-r40-1" "8" node "mcr928" "ice-r40-1" "9" node "mcr929" "ice-r40-1" "10" # node "mcr930" "ice-r40-2" "1" node "mcr931" "ice-r40-2" "2" node "mcr932" "ice-r40-2" "3" node "mcr933" "ice-r40-2" "4" node "mcr934" "ice-r40-2" "5" node "mcr935" "ice-r40-2" "6" node "mcr936" "ice-r40-2" "7" node "mcr937" "ice-r40-2" "8" node "mcr938" "ice-r40-2" "9" node "mcr939" "ice-r40-2" "10" # node "mcr940" "ice-r40-3" "1" node "mcr941" "ice-r40-3" "2" node "mcr942" "ice-r40-3" "3" node "mcr943" "ice-r40-3" "4" node "mcr944" "ice-r40-3" "5" node "mcr945" "ice-r40-3" "6" node "mcr946" "ice-r40-3" "7" node "mcr947" "ice-r40-3" "8" node "mcr948" "ice-r40-3" "9" node "mcr949" "ice-r40-3" "10" # node "mcr950" "ice-r40-4" "1" node "mcr951" "ice-r40-4" "2" node "mcr952" "ice-r40-4" "3" node "mcr953" "ice-r40-4" "4" node "mcr954" "ice-r40-4" "5" node "mcr955" "ice-r40-4" "6" node "mcr956" "ice-r40-4" "7" node "mcr957" "ice-r40-4" "8" node "mcr958" "ice-r40-4" "9" node "mcr959" "ice-r40-4" "10" # # CNSU9 # node "mcr960" "ice-r41-1" "1" node "mcr961" "ice-r41-1" "2" node "mcr962" "ice-r41-1" "3" node "mcr963" "ice-r41-1" "4" node "mcr964" "ice-r41-1" "5" node "mcr965" "ice-r41-1" "6" node "mcr966" "ice-r41-1" "7" node "mcr967" "ice-r41-1" "8" node "mcr968" "ice-r41-1" "9" node "mcr969" "ice-r41-1" "10" # node "mcr970" "ice-r41-2" "1" node "mcr971" "ice-r41-2" "2" node "mcr972" "ice-r41-2" "3" node "mcr973" "ice-r41-2" "4" node "mcr974" "ice-r41-2" "5" node "mcr975" "ice-r41-2" "6" node "mcr976" "ice-r41-2" "7" node "mcr977" "ice-r41-2" "8" node "mcr978" "ice-r41-2" "9" node "mcr979" "ice-r41-2" "10" # node "mcr980" "ice-r41-3" "1" node "mcr981" "ice-r41-3" "2" node "mcr982" "ice-r41-3" "3" node "mcr983" "ice-r41-3" "4" node "mcr984" "ice-r41-3" "5" node "mcr985" "ice-r41-3" "6" node "mcr986" "ice-r41-3" "7" node "mcr987" "ice-r41-3" "8" node "mcr988" "ice-r41-3" "9" node "mcr989" "ice-r41-3" "10" # node "mcr990" "ice-r41-4" "1" node "mcr991" "ice-r41-4" "2" node "mcr992" "ice-r41-4" "3" node "mcr993" "ice-r41-4" "4" node "mcr994" "ice-r41-4" "5" node "mcr995" "ice-r41-4" "6" node "mcr996" "ice-r41-4" "7" node "mcr997" "ice-r41-4" "8" node "mcr998" "ice-r41-4" "9" node "mcr999" "ice-r41-4" "10" # node "mcr1000" "ice-r42-1" "1" node "mcr1001" "ice-r42-1" "2" node "mcr1002" "ice-r42-1" "3" node "mcr1003" "ice-r42-1" "4" node "mcr1004" "ice-r42-1" "5" node "mcr1005" "ice-r42-1" "6" # node "mcr1006" "ice-r42-2" "1" node "mcr1007" "ice-r42-2" "2" node "mcr1008" "ice-r42-2" "3" node "mcr1009" "ice-r42-2" "4" node "mcr1010" "ice-r42-2" "5" node "mcr1011" "ice-r42-2" "6" node "mcr1012" "ice-r42-2" "7" node "mcr1013" "ice-r42-2" "8" node "mcr1014" "ice-r42-2" "9" node "mcr1015" "ice-r42-2" "10" # node "mcr1016" "ice-r43-1" "1" node "mcr1017" "ice-r43-1" "2" node "mcr1018" "ice-r43-1" "3" node "mcr1019" "ice-r43-1" "4" node "mcr1020" "ice-r43-1" "5" node "mcr1021" "ice-r43-1" "6" node "mcr1022" "ice-r43-1" "7" node "mcr1023" "ice-r43-1" "8" node "mcr1024" "ice-r43-1" "9" node "mcr1025" "ice-r43-1" "10" # node "mcr1026" "ice-r43-2" "1" node "mcr1027" "ice-r43-2" "2" node "mcr1028" "ice-r43-2" "3" node "mcr1029" "ice-r43-2" "4" node "mcr1030" "ice-r43-2" "5" node "mcr1031" "ice-r43-2" "6" node "mcr1032" "ice-r43-2" "7" node "mcr1033" "ice-r43-2" "8" node "mcr1034" "ice-r43-2" "9" node "mcr1035" "ice-r43-2" "10" # node "mcr1036" "ice-r43-3" "1" node "mcr1037" "ice-r43-3" "2" node "mcr1038" "ice-r43-3" "3" node "mcr1039" "ice-r43-3" "4" node "mcr1040" "ice-r43-3" "5" node "mcr1041" "ice-r43-3" "6" node "mcr1042" "ice-r43-3" "7" node "mcr1043" "ice-r43-3" "8" node "mcr1044" "ice-r43-3" "9" node "mcr1045" "ice-r43-3" "10" # node "mcr1046" "ice-r43-4" "1" node "mcr1047" "ice-r43-4" "2" node "mcr1048" "ice-r43-4" "3" node "mcr1049" "ice-r43-4" "4" node "mcr1050" "ice-r43-4" "5" node "mcr1051" "ice-r43-4" "6" node "mcr1052" "ice-r43-4" "7" node "mcr1053" "ice-r43-4" "8" node "mcr1054" "ice-r43-4" "9" node "mcr1055" "ice-r43-4" "10" # # CNSU10 # node "mcr1056" "ice-r12-1" "1" node "mcr1057" "ice-r12-1" "2" node "mcr1058" "ice-r12-1" "3" node "mcr1059" "ice-r12-1" "4" node "mcr1060" "ice-r12-1" "5" node "mcr1061" "ice-r12-1" "6" node "mcr1062" "ice-r12-1" "7" node "mcr1063" "ice-r12-1" "8" node "mcr1064" "ice-r12-1" "9" node "mcr1065" "ice-r12-1" "10" # node "mcr1066" "ice-r12-2" "1" node "mcr1067" "ice-r12-2" "2" node "mcr1068" "ice-r12-2" "3" node "mcr1069" "ice-r12-2" "4" node "mcr1070" "ice-r12-2" "5" node "mcr1071" "ice-r12-2" "6" node "mcr1072" "ice-r12-2" "7" node "mcr1073" "ice-r12-2" "8" node "mcr1074" "ice-r12-2" "9" node "mcr1075" "ice-r12-2" "10" # node "mcr1076" "ice-r12-3" "1" node "mcr1077" "ice-r12-3" "2" node "mcr1078" "ice-r12-3" "3" node "mcr1079" "ice-r12-3" "4" node "mcr1080" "ice-r12-3" "5" node "mcr1081" "ice-r12-3" "6" node "mcr1082" "ice-r12-3" "7" node "mcr1083" "ice-r12-3" "8" node "mcr1084" "ice-r12-3" "9" node "mcr1085" "ice-r12-3" "10" # node "mcr1086" "ice-r12-4" "1" node "mcr1087" "ice-r12-4" "2" node "mcr1088" "ice-r12-4" "3" node "mcr1089" "ice-r12-4" "4" node "mcr1090" "ice-r12-4" "5" node "mcr1091" "ice-r12-4" "6" node "mcr1092" "ice-r12-4" "7" node "mcr1093" "ice-r12-4" "8" node "mcr1094" "ice-r12-4" "9" node "mcr1095" "ice-r12-4" "10" # node "mcr1096" "ice-r13-1" "1" node "mcr1097" "ice-r13-1" "2" node "mcr1098" "ice-r13-1" "3" node "mcr1099" "ice-r13-1" "4" node "mcr1100" "ice-r13-1" "5" node "mcr1101" "ice-r13-1" "6" # node "mcr1102" "ice-r13-2" "1" node "mcr1103" "ice-r13-2" "2" node "mcr1104" "ice-r13-2" "3" node "mcr1105" "ice-r13-2" "4" node "mcr1106" "ice-r13-2" "5" node "mcr1107" "ice-r13-2" "6" node "mcr1108" "ice-r13-2" "7" node "mcr1109" "ice-r13-2" "8" node "mcr1110" "ice-r13-2" "9" node "mcr1111" "ice-r13-2" "10" # node "mcr1112" "ice-r14-1" "1" node "mcr1113" "ice-r14-1" "2" node "mcr1114" "ice-r14-1" "3" node "mcr1115" "ice-r14-1" "4" node "mcr1116" "ice-r14-1" "5" node "mcr1117" "ice-r14-1" "6" node "mcr1118" "ice-r14-1" "7" node "mcr1119" "ice-r14-1" "8" node "mcr1120" "ice-r14-1" "9" node "mcr1121" "ice-r14-1" "10" # node "mcr1122" "ice-r14-2" "1" node "mcr1123" "ice-r14-2" "2" node "mcr1124" "ice-r14-2" "3" node "mcr1125" "ice-r14-2" "4" node "mcr1126" "ice-r14-2" "5" node "mcr1127" "ice-r14-2" "6" node "mcr1128" "ice-r14-2" "7" node "mcr1129" "ice-r14-2" "8" node "mcr1130" "ice-r14-2" "9" node "mcr1131" "ice-r14-2" "10" # node "mcr1132" "ice-r14-3" "1" node "mcr1133" "ice-r14-3" "2" node "mcr1134" "ice-r14-3" "3" node "mcr1135" "ice-r14-3" "4" node "mcr1136" "ice-r14-3" "5" node "mcr1137" "ice-r14-3" "6" node "mcr1138" "ice-r14-3" "7" node "mcr1139" "ice-r14-3" "8" node "mcr1140" "ice-r14-3" "9" node "mcr1141" "ice-r14-3" "10" # node "mcr1142" "ice-r14-4" "1" node "mcr1143" "ice-r14-4" "2" node "mcr1144" "ice-r14-4" "3" node "mcr1145" "ice-r14-4" "4" node "mcr1146" "ice-r14-4" "5" node "mcr1147" "ice-r14-4" "6" node "mcr1148" "ice-r14-4" "7" node "mcr1149" "ice-r14-4" "8" node "mcr1150" "ice-r14-4" "9" node "mcr1151" "ice-r14-4" "10" powerman-2.3.5.orig/test/t44.exp0000644000000000000000000000056311033255554013315 0ustar on: off: t[0-2] unknown: Command completed successfully on: t[0-2] off: unknown: Command completed successfully on: t[0-2] off: unknown: Command completed successfully on: t[0-2] off: unknown: Command completed successfully on: off: t[0-2] unknown: Command completed successfully on: off: t[0-2] unknown: powerman-2.3.5.orig/test/t17.exp0000644000000000000000000020264211023607355013316 0ustar send(test0): 'spew 1024\n' recv(test0): 'ghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ VWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrs xyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY 34\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzA FGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd ijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n12345 !@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHI NOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\n1 OK\n' recv(test0): '2 vpc> ' send(test0): 'stat *\n' recv(test0): 'plug 0: OFF\n' recv(test0): 'plug 1: OFF\n' recv(test0): 'plug 2: OFF\n' recv(test0): 'plug 3: OFF\n' recv(test0): 'plug 4: OFF\n' recv(test0): 'plug 5: OFF\n' recv(test0): 'plug 6: OFF\n' recv(test0): 'plug 7: OFF\n' recv(test0): 'plug 8: OFF\n' recv(test0): 'plug 9: OFF\n' recv(test0): 'plug 10: OFF\n' recv(test0): 'plug 11: OFF\n' recv(test0): 'plug 12: OFF\n' recv(test0): 'plug 13: OFF\n' recv(test0): 'plug 14: OFF\n' recv(test0): 'plug 15: OFF\n' recv(test0): '2 OK\n' recv(test0): '3 vpc> ' on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t38.exp0000644000000000000000000000134211027327357013320 0ustar on: off: t[0-149] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149] unknown: Command completed successfully on: off: t[0-149] unknown: Command completed successfully on: t[0-149] off: unknown: Command completed successfully on: t[0-149] off: unknown: Command completed successfully on: off: t[0-149] unknown: powerman-2.3.5.orig/test/t04.exp0000644000000000000000000000000011023343502013261 0ustar powerman-2.3.5.orig/test/t510000755000000000000000000000027011151356676012526 0ustar #!/bin/sh TEST=t51 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0-2] -q -0 t[0-2] -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/vpcd.c0000644000000000000000000002670411103715720013263 0ustar /*****************************************************************************\ * $Id: vpcd.c 1057 2008-11-04 00:48:16Z garlick $ ***************************************************************************** * Copyright (C) 2001-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Andrew Uselton * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "xmalloc.h" #include "xread.h" #include "xpoll.h" static void usage(void); static void _noop_handler(int signum); static void _spew_one(int linenum); static void _spew(int lines); static void _prompt_loop(void); static void _setup_socket(char *port); #define NUM_PLUGS 16 static int plug[NUM_PLUGS]; static int beacon[NUM_PLUGS]; static int temp[NUM_PLUGS]; static int logged_in = 0; static char *prog; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { {"port", required_argument, 0, 'p'}, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; char *port = NULL; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': /* --port n */ port = xstrdup(optarg); break; default: usage(); } } if (optind < argc) usage(); if (signal(SIGPIPE, _noop_handler) == SIG_ERR) { perror("signal"); exit(1); } if (port) _setup_socket(port); for (i = 0; i < NUM_PLUGS; i++) { plug[i] = 0; beacon[i] = 0; temp[i] = 83 + i; } _prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s\n", prog); exit(1); } static void _noop_handler(int signum) { fprintf(stderr, "%s: received signal %d\n", prog, signum); } /* Return with stdin/stdout reopened as a connected socket. */ #define LISTEN_BACKLOG 5 static void _setup_socket(char *serv) { struct addrinfo hints, *res, *r; int *fds, fd, fdlen, saved_errno, count, error, i, opt; char *what; xpollfd_t pfd; struct sockaddr_storage addr; socklen_t addr_size; short flags; /* get addresses to listen on for this port */ memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; if ((error = getaddrinfo(NULL, serv, &hints, &res))) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(error)); exit(1); } if (res == NULL) { fprintf(stderr, "getaddrinfo: no address to bind to\n"); exit(1); } /* allocate array of listen fd's */ fdlen = 0; for (r = res; r != NULL; r = r->ai_next) fdlen++; fds = (int *)xmalloc(sizeof(int) * fdlen); /* bind fds to addresses and listen */ count = 0; saved_errno = 0; for (r = res, i = 0; r != NULL; r = r->ai_next, i++) { fds[i] = -1; if ((fd = socket(r->ai_family, r->ai_socktype, 0)) < 0) { saved_errno = errno; what = "socket"; continue; } opt = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) { saved_errno = errno; what = "setsockopt"; close(fd); continue; } if (bind(fd, r->ai_addr, r->ai_addrlen) < 0) { saved_errno = errno; what = "bind"; close(fd); continue; } if (listen(fd, LISTEN_BACKLOG) < 0) { saved_errno = errno; what = "listen"; close(fd); continue; } fds[i] = fd; count++; } freeaddrinfo(res); if (count == 0) { fprintf(stderr, "%s: %s\n", what, strerror(saved_errno)); exit(1); } /* accept a connection on 'fd' */ pfd = xpollfd_create(); fd = -1; while (fd == -1) { xpollfd_zero(pfd); for (i = 0; i < fdlen; i++) { if (fds[i] != -1) xpollfd_set(pfd, fds[i], XPOLLIN); } if (xpoll(pfd, NULL) < 0) { fprintf(stderr, "poll: %s\n", strerror(errno)); exit(1); } for (i = 0; i < fdlen; i++) { if (fds[i] != -1) { flags = xpollfd_revents(pfd, fds[i]); if ((flags & (XPOLLERR|XPOLLHUP|XPOLLNVAL))) { fprintf(stderr, "poll: error on fd %d\n", fds[i]); exit(1); } if ((flags & XPOLLIN)) { addr_size = sizeof(addr); fd = accept(fds[i], (struct sockaddr *)&addr, &addr_size); if (fd < 0) { fprintf(stderr, "accept: %s\n", strerror(errno)); exit(1); } break; } } } } xpollfd_destroy(pfd); for (i = 0; i < fdlen; i++) { if (fds[i] != -1 && fds[i] != fd) close(fds[i]); } /* dup socket to stdio */ (void)close(0); if (dup2(fd, 0) < 0) { fprintf(stderr, "dup2(stdin): %s\n", strerror(errno)); exit(1); } (void)close(1); if (dup2(fd, 1) < 0) { fprintf(stderr, "dup2(stdout): %s\n", strerror(errno)); exit(1); } } #define SPEW \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]" static void _spew_one(int linenum) { char buf[80]; linenum %= strlen(SPEW); memcpy(buf, SPEW + linenum, strlen(SPEW) - linenum); memcpy(buf + strlen(SPEW) - linenum, SPEW, linenum); buf[strlen(SPEW)] = '\0'; printf("%s\n", buf); } static void _spew(int lines) { int i; for (i = 0; i < lines; i++) _spew_one(i); } static void _prompt_loop(void) { int seq, i, res; char buf[128]; char prompt[16]; for (seq = 0;; seq++) { snprintf(prompt, sizeof(prompt), "%d vpc> ", seq); if (xreadline(prompt, buf, sizeof(buf)) == NULL) break; if (strlen(buf) == 0) continue; if (strcmp(buf, "logoff") == 0) { /* logoff */ printf("%d OK\n", seq); logged_in = 0; break; } if (strcmp(buf, "login") == 0) { /* logon */ logged_in = 1; goto ok; } if (!logged_in) { printf("%d Please login\n", seq); continue; } if (sscanf(buf, "stat %d", &i) == 1) { /* stat */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } printf("plug %d: %s\n", i, plug[i] ? "ON" : "OFF"); goto ok; } if (strcmp(buf, "stat *") == 0) { /* stat * */ for (i = 0; i < NUM_PLUGS; i++) printf("plug %d: %s\n", i, plug[i] ? "ON" : "OFF"); goto ok; } if (sscanf(buf, "beacon %d", &i) == 1) { /* beacon */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } printf("plug %d: %s\n", i, beacon[i] ? "ON" : "OFF"); goto ok; } if (strcmp(buf, "beacon *") == 0) { /* beacon * */ for (i = 0; i < NUM_PLUGS; i++) printf("plug %d: %s\n", i, beacon[i] ? "ON" : "OFF"); goto ok; } if (sscanf(buf, "temp %d", &i) == 1) { /* temp */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } printf("plug %d: %d\n", i, temp[i]); } if (strcmp(buf, "temp *") == 0) { /* temp * */ for (i = 0; i < NUM_PLUGS; i++) printf("plug %d: %d\n", i, temp[i]); goto ok; } if (sscanf(buf, "spew %d", &i) == 1) { /* spew */ if (i <= 0) { printf("%d BADVAL: %d\n", seq, i); continue; } _spew(i); goto ok; } if (sscanf(buf, "on %d", &i) == 1) { /* on */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } plug[i] = 1; goto ok; } if (sscanf(buf, "off %d", &i) == 1) { /* off */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } plug[i] = 0; goto ok; } if (sscanf(buf, "flash %d", &i) == 1) { /* flash */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } beacon[i] = 1; goto ok; } if (sscanf(buf, "unflash %d", &i) == 1) { /* unflash */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } beacon[i] = 0; goto ok; } if (strcmp(buf, "on *") == 0) { /* on * */ for (i = 0; i < NUM_PLUGS; i++) plug[i] = 1; goto ok; } if (strcmp(buf, "off *") == 0) { /* off * */ for (i = 0; i < NUM_PLUGS; i++) plug[i] = 0; goto ok; } if (sscanf(buf, "reset %d", &i) == 1) { /* reset */ if (i < 0 || i >= NUM_PLUGS) { printf("%d BADVAL: %d\n", seq, i); continue; } sleep(1); /* noop */ goto ok; } if (strcmp(buf, "reset *") == 0) { /* reset * */ sleep(1); /* noop */ goto ok; } printf("%d UNKNOWN: %s\n", seq, buf); continue; ok: printf("%d OK\n", seq); } } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t43.exp0000644000000000000000000000134611031754257013316 0ustar on: off: t[0-127] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127] unknown: Command completed successfully on: off: t[0-127] unknown: Command completed successfully on: t[0-127] off: unknown: Command completed successfully on: t[0-127] off: unknown: Command completed successfully on: off: t[0-127] unknown: powerman-2.3.5.orig/test/t34.exp0000644000000000000000000000524111052171766013315 0ustar on: off: t[0-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] off: t[1-9,11-19,21-29,31-39,41-49,51-59,61-69,71-79,81-89,91-99,101-109,111-119,121-129,131-139,141-149,151-159] unknown: Command completed successfully on: off: t[0-159] unknown: Command completed successfully on: t[0-159] off: unknown: Command completed successfully on: off: t[0-159] unknown: on: off: t[0-159] unknown: t0: 73: t1: 74: t2: 75: t3: 76: t4: 77: t5: 78: t6: 79: t7: 80: t8: 81: t9: 82: t10: 73: t11: 74: t12: 75: t13: 76: t14: 77: t15: 78: t16: 79: t17: 80: t18: 81: t19: 82: t20: 73: t21: 74: t22: 75: t23: 76: t24: 77: t25: 78: t26: 79: t27: 80: t28: 81: t29: 82: t30: 73: t31: 74: t32: 75: t33: 76: t34: 77: t35: 78: t36: 79: t37: 80: t38: 81: t39: 82: t40: 73: t41: 74: t42: 75: t43: 76: t44: 77: t45: 78: t46: 79: t47: 80: t48: 81: t49: 82: t50: 73: t51: 74: t52: 75: t53: 76: t54: 77: t55: 78: t56: 79: t57: 80: t58: 81: t59: 82: t60: 73: t61: 74: t62: 75: t63: 76: t64: 77: t65: 78: t66: 79: t67: 80: t68: 81: t69: 82: t70: 73: t71: 74: t72: 75: t73: 76: t74: 77: t75: 78: t76: 79: t77: 80: t78: 81: t79: 82: t80: 73: t81: 74: t82: 75: t83: 76: t84: 77: t85: 78: t86: 79: t87: 80: t88: 81: t89: 82: t90: 73: t91: 74: t92: 75: t93: 76: t94: 77: t95: 78: t96: 79: t97: 80: t98: 81: t99: 82: t100: 73: t101: 74: t102: 75: t103: 76: t104: 77: t105: 78: t106: 79: t107: 80: t108: 81: t109: 82: t110: 73: t111: 74: t112: 75: t113: 76: t114: 77: t115: 78: t116: 79: t117: 80: t118: 81: t119: 82: t120: 73: t121: 74: t122: 75: t123: 76: t124: 77: t125: 78: t126: 79: t127: 80: t128: 81: t129: 82: t130: 73: t131: 74: t132: 75: t133: 76: t134: 77: t135: 78: t136: 79: t137: 80: t138: 81: t139: 82: t140: 73: t141: 74: t142: 75: t143: 76: t144: 77: t145: 78: t146: 79: t147: 80: t148: 81: t149: 82: t150: 73: t151: 74: t152: 75: t153: 76: t154: 77: t155: 78: t156: 79: t157: 80: t158: 81: t159: 82: powerman-2.3.5.orig/test/t31.conf0000644000000000000000000000013011026352165013426 0ustar include "../etc/icebox.dev" device "i0" "icebox" "./icebox -p v2 |&" node "t[0-9]" "i0" powerman-2.3.5.orig/test/test.conf0000644000000000000000000000012111115104225013765 0ustar include "../etc/vpc.dev" device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/targv.c0000644000000000000000000000411511113122517013437 0ustar /*****************************************************************************\ * $Id: arglist.c 955 2008-06-10 22:34:16Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "argv.h" int main(int argc, char *argv[]) { char **av; av = argv_create("foo bar baz", ""); assert(argv_length(av) == 3); av = argv_append(av, "bonk"); assert(argv_length(av) == 4); assert(strcmp(av[0], "foo") == 0); assert(strcmp(av[1], "bar") == 0); assert(strcmp(av[2], "baz") == 0); assert(strcmp(av[3], "bonk") == 0); assert(av[4] == NULL); argv_destroy(av); av = argv_create("a,b:c d", ",:"); assert(argv_length(av) == 4); assert(strcmp(av[0], "a") == 0); assert(strcmp(av[1], "b") == 0); assert(strcmp(av[2], "c") == 0); assert(strcmp(av[3], "d") == 0); assert(av[4] == NULL); argv_destroy(av); exit(0); } powerman-2.3.5.orig/test/t310000755000000000000000000000041211052171766012515 0ustar #!/bin/sh TEST=t31 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-9] \ -q -c t[0-9] \ -q -0 t[0-9] \ -q -t >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t210000755000000000000000000000042311053364010012501 0ustar #!/bin/sh TEST=t21 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0,t8 \ -q -c t0,t8 \ -q -0 t0,t8 \ -q -1 t[0-15] \ -q -c t[0-15] \ -q -0 t[0-15] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t260000755000000000000000000000213311025756255012525 0ustar #!/bin/sh TEST=t26 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ -c t1 -c t1 -c t1 -c t1 \ >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t35.exp0000644000000000000000000000130511026514142013301 0ustar on: off: t[0-63] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63] unknown: Command completed successfully on: t[0,8,16,24,32,40,48,56] off: t[1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63] unknown: Command completed successfully on: off: t[0-63] unknown: Command completed successfully on: off: t[0-63] unknown: Command completed successfully on: t[0-63] off: unknown: Command completed successfully on: t[0-63] off: unknown: Command completed successfully on: off: t[0-63] unknown: Command completed successfully on: off: t[0-63] unknown: powerman-2.3.5.orig/test/t300000755000000000000000000000114411052171766012517 0ustar #!/bin/sh TEST=t30 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -c t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -0 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -q -1 t[0-159] \ -q -c t[0-159] \ -q -0 t[0-159] \ -b -f t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -b -u t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150] \ -b -f t[0-159] \ -q -u t[0-159] \ -b -q -t >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t18.conf0000644000000000000000000000130011024571543013434 0ustar specification "vpc" { timeout 60.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } script status_all { # noise generator # spew more than twice 64K (MAX_DEV_BUF) to cause double cbuf wrap. # (1900 * 78 char = 144K) send "spew 1900\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " send "stat *\n" foreachplug { expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t14.exp0000644000000000000000000000022611023523731013300 0ustar t0: 83 t1: 84 t2: 85 t3: 86 t4: 87 t5: 88 t6: 89 t7: 90 t8: 91 t9: 92 t10: 93 t11: 94 t12: 95 t13: 96 t14: 97 t15: 98 t13: 96 t13: 96 t14: 97 t15: 98 powerman-2.3.5.orig/test/t50.exp0000644000000000000000000000023611137457504013313 0ustar on: off: t1 unknown: Command completed successfully on: t1 off: unknown: Command completed successfully on: off: t1 unknown: powerman-2.3.5.orig/test/t46.conf0000644000000000000000000000060311104074331013432 0ustar include "../etc/cyclades-pm8.dev" include "../etc/cyclades-pm10.dev" include "../etc/cyclades-pm20.dev" include "../etc/cyclades-pm42.dev" device "d0" "pm8" "./cyclades -p pm8|&" device "d1" "pm10" "./cyclades -p pm10|&" device "d2" "pm42" "./cyclades -p pm42|&" device "d3" "pm20" "./cyclades -p pm20|&" node "t[0-7]" "d0" node "t[8-15]" "d1" node "t[16-57]" "d2" node "t[58-77]" "d3" powerman-2.3.5.orig/test/t48.conf0000644000000000000000000000016011164745453013452 0ustar listen "127.0.0.1:10103" include "../etc/vpc.dev" device "test0" "vpc" "mrhankey:10102" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t190000755000000000000000000000024111052171766012523 0ustar #!/bin/sh TEST=t19 $PATH_POWERMAN -S $PATH_POWERMAND -C $TEST.conf \ -I -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t430000755000000000000000000000064011052145100012502 0ustar #!/bin/sh TEST=t43 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -c t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -0 t[0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120] \ -q -1 t[0-127] \ -q -c t[0-127] \ -q -0 t[0-127] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/tpl.c0000644000000000000000000000704011113122517013113 0ustar /*****************************************************************************\ * $Id: tpl.c 1081 2008-11-26 01:24:31Z garlick $ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* * Test driver for pluglist module. */ #include #include #include #include #include "list.h" #include "xtypes.h" #include "pluglist.h" #include "hostlist.h" #include "error.h" #include "xmalloc.h" void usage(void) { fprintf(stderr, "Usage: tpl [-f plug_to_find] [-p fixed_plugs] nodelist [pluglist]\n"); exit(1); } int main(int argc, char *argv[]) { extern int optind; extern char *optarg; int c; PlugList pl = NULL; char *hwplugs = NULL; char *nodelist = NULL; char *pluglist = NULL; char *findplug = NULL; err_init(basename(argv[0])); while ((c = getopt(argc, argv, "p:f:")) != EOF) { switch (c) { case 'p': hwplugs = optarg; break; case 'f': findplug = optarg; break; default: usage(); } } if (argc - optind == 0) usage(); nodelist = argv[optind++]; if (argc - optind == 1) pluglist = argv[optind++]; if (argc - optind != 0) usage(); if (hwplugs) { hostlist_t hl = hostlist_create(hwplugs); hostlist_iterator_t itr = hostlist_iterator_create(hl); List l = list_create((ListDelF)xfree); char *plug; while ((plug = hostlist_next(itr))) list_append(l, xstrdup(plug)); hostlist_iterator_destroy(itr); hostlist_destroy(hl); pl = pluglist_create(l); list_destroy(l); } else pl = pluglist_create(NULL); switch (pluglist_map(pl, nodelist, pluglist)) { case EPL_DUPNODE: fprintf(stderr, "duplicate node\n"); break; case EPL_UNKPLUG: fprintf(stderr, "unknown plug\n"); break; case EPL_DUPPLUG: fprintf(stderr, "duplicate plug\n"); break; case EPL_NOPLUGS: fprintf(stderr, "more nodes than plugs\n"); break; case EPL_NONODES: fprintf(stderr, "more plugs than nodes\n"); break; case EPL_SUCCESS: break; } if (findplug) { Plug *plug = pluglist_find(pl, findplug); if (plug) printf("plug=%s node=%s\n", plug->name, plug->node ? plug->node : "NULL"); else printf("plug %s: not found\n", findplug); } else { PlugListIterator itr = pluglist_iterator_create(pl); Plug *plug; while ((plug = pluglist_next(itr))) { printf("plug=%s node=%s\n", plug->name, plug->node ? plug->node : "NULL"); } pluglist_iterator_destroy(itr); } exit(0); } powerman-2.3.5.orig/test/t09.conf0000644000000000000000000000113611024571543013443 0ustar specification "vpc" { timeout 5.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } script status_all { send "spew 16\n" # noise generator expect "[0-9]* OK\n" expect "[0-9]* vpc> " send "stat *\n" foreachplug { expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t35.conf0000644000000000000000000000016511113345200013427 0ustar include "../etc/powerman.dev" device "p0" "powerman" "../src/powermand -f -c test4.conf -s |&" node "t[0-63]" "p0" powerman-2.3.5.orig/test/gpib.c0000644000000000000000000002065411113122517013243 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ /* gpib.c - gpib-utils hp3488/ics8064 simulator */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if HAVE_GETOPT_H #include #endif #include #include #include #include #include #include #include #include #include #include "hostlist.h" #include "argv.h" #include "xmalloc.h" typedef enum { QUERY, OFF, ON } relayop_t; typedef enum { NONE, ICS8064, HP3488 } gptype_t; static void usage(void); static void _noop_handler(int signum); static void _prompt_loop(void); static int relay_op(char *s, relayop_t op, int *plug, int num_plugs, int plug_origin); static int ics8064_cmd(char **av, int plug[], int num_plugs, int plug_origin, int *qp); static int hp3488_cmd(char **av, int plug[], int num_plugs, int plug_origin, int *qp); static gptype_t personality = NONE; static char *prog; #define OPTIONS "p:" #if HAVE_GETOPT_LONG #define GETOPT(ac,av,opt,lopt) getopt_long(ac,av,opt,lopt,NULL) static const struct option longopts[] = { { "personality", required_argument, 0, 'p' }, {0, 0, 0, 0}, }; #else #define GETOPT(ac,av,opt,lopt) getopt(ac,av,opt) #endif int main(int argc, char *argv[]) { int i, c; prog = basename(argv[0]); while ((c = GETOPT(argc, argv, OPTIONS, longopts)) != -1) { switch (c) { case 'p': if (strcmp(optarg, "hp3488") == 0) personality = HP3488; else if (strcmp(optarg, "ics8064") == 0) personality = ICS8064; else usage(); break; default: usage(); } } if (optind < argc) usage(); if (personality == NONE) usage(); if (signal(SIGPIPE, _noop_handler) == SIG_ERR) { perror("signal"); exit(1); } _prompt_loop(); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s -p ics8064|hp3488\n", prog); exit(1); } static void _noop_handler(int signum) { fprintf(stderr, "%s: received signal %d\n", prog, signum); } static int relay_op(char *s, relayop_t op, int *plug, int num_plugs, int plug_origin) { /* N.B. WANT_RECKLESS_HOSTRANGE_EXPANSION is defined by gpib-utils, * but not by powerman. Dev script will work but help cmd lies. */ hostlist_t h = hostlist_create(s); hostlist_iterator_t it = hostlist_iterator_create(h); char *tmp; int i; while (tmp = hostlist_next(it)) { i = strtoul(tmp, NULL, 10); if (i < plug_origin || i >= num_plugs + plug_origin) break; if (op == ON) { plug[i - plug_origin] = 1; } else if (op == OFF) { plug[i - plug_origin] = 0; } else if (op == QUERY) { if (personality != HP3488) break; printf("%.3d: %d\n", i, plug[i - plug_origin]); } } hostlist_iterator_destroy(it); hostlist_destroy(h); return (tmp ? 0 : 1); } #define ICS8064_STATUS "ics8064> %d, %d, %d, %d, %d, %d, %d,\ %d, %d, %d, %d, %d, %d, %d, %d, %d\n" static int ics8064_cmd(char **av, int plug[], int num_plugs, int plug_origin, int *qp) { if (argv_length(av) == 0) { } else if (!strcmp(av[0], "quit")) { *qp = 1; } else if (!strcmp(av[0], "help")) { printf("Commands:\n"); printf("open relay-list open the specified relay(s)\n"); printf("close relay-list close the specified relay(s)\n"); printf("status show relay status\n"); printf("quit exit interactive mode\n"); printf("Relay-list is comma-separated and may include ranges,\n"); printf(" e.g.: \"1,2\", \"1-16\", or \"1-10,16\".\n"); } else if (!strcmp(av[0], "status")) { if (argv_length(av) != 1) return 0; printf(ICS8064_STATUS, plug[0], plug[1], plug[2], plug[3], plug[4], plug[5], plug[6], plug[7], plug[8], plug[9], plug[10], plug[11], plug[12], plug[13], plug[14], plug[15]); } else if (!strcmp(av[0], "close")) { if (argv_length(av) != 2) return 0; if (!relay_op(av[1], ON, plug, num_plugs, plug_origin)) return 0; } else if (!strcmp(av[0], "open")) { if (argv_length(av) != 2) return 0; if (!relay_op(av[1], OFF, plug, num_plugs, plug_origin)) return 0; } else return 0; return 1; } static int hp3488_cmd(char **av, int plug[], int num_plugs, int plug_origin, int *qp) { if (argv_length(av) == 0) { } else if (!strcmp(av[0], "quit")) { *qp = 1; } else if (!strcmp(av[0], "help")) { printf("Possible commands are:\n"); printf(" on [targets] - turn on specified channels\n"); printf(" off [targets] - turn off specified channels\n"); printf(" query [targets] - query specified channels (0=off,1=on)\n"); printf(" list - list valid caddrs\n"); printf(" show - show slot configuration\n"); printf(" id - query instrument id\n"); printf(" verbose - toggle verbose flag\n"); printf(" help - display this help text\n"); printf(" quit - exit this shell\n"); printf("Where channel address is (3 digits).\n"); } else if (!strcmp(av[0], "query")) { if (argv_length(av) != 2) return 0; if (!relay_op(av[1], QUERY, plug, num_plugs, plug_origin)) return 0; } else if (!strcmp(av[0], "on")) { if (argv_length(av) != 2) return 0; if (!relay_op(av[1], ON, plug, num_plugs, plug_origin)) return 0; } else if (!strcmp(av[0], "off")) { if (argv_length(av) != 2) return 0; if (!relay_op(av[1], OFF, plug, num_plugs, plug_origin)) return 0; } else return 0; return 1; } void _prompt_loop(void) { char buf[128]; int num_plugs; int plug_origin; int res, quit = 0; int *plug; char **av; if (personality == ICS8064) { num_plugs = 16; plug_origin = 1; plug = (int *)xmalloc(sizeof(int) * num_plugs); } else { num_plugs = 500; /* 100-599 */ plug_origin = 100; } plug = (int *)xmalloc(sizeof(int) * num_plugs); memset(plug, 0, sizeof(int) * num_plugs); while (!quit) { if (xreadline(personality == ICS8064 ? "ics8064> " : "hp3488> ", buf, sizeof(buf))) { av = argv_create(buf, ""); if (personality == ICS8064) res = ics8064_cmd(av, plug, num_plugs, plug_origin, &quit); else res = hp3488_cmd(av, plug, num_plugs, plug_origin, &quit); if (!res) printf("Unknown command\n"); argv_destroy(av); } else break; } xfree(plug); } /* * vi:tabstop=4 shiftwidth=4 expandtab */ powerman-2.3.5.orig/test/t51.conf0000644000000000000000000000027611151356676013455 0ustar include "../etc/lom.dev" device "d0" "lom" "./lom -p ssh|&" device "d1" "lom" "./lom -p serial|&" device "d2" "lom" "./lom -p serial_loggedin|&" node "t0" "d0" node "t1" "d1" node "t2" "d2" powerman-2.3.5.orig/test/t26.conf0000644000000000000000000000052111024571543013437 0ustar specification "vpc" { timeout 2 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script cycle { delay 0.01 send "\n" expect "[0-9]* vpc> " } } device "test0" "vpc" "./vpcd |&" node "t[0-15]" "test0" powerman-2.3.5.orig/test/t18.exp0000644000000000000000000020264211023607355013317 0ustar send(test0): 'spew 1900\n' recv(test0): 'yzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678 $%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJK PQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn stuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^& _=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRS XYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv ABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+ cdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\nCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzAB\nDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABC\nEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCD\nFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDE\nGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEF\nHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFG\nIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGH\nJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHI\nKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJ\nLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJK\nMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL\nNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM\nOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN\nPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO\nQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\nRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ\nSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR\nTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS\nUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST\nVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU\nWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV\nXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW\nYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX\nZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY\n0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0\n23456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01\n3456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012\n456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123\n56789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234\n6789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345\n789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456\n89!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567\n9!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678\n!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\n#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@\n$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#\n%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$\n^&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\n&*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^\n*()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&\n()-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*\n)-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(\n-_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()\n_=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-\n=+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_\n+[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=\n[]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+\n]abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\nbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]a\ncdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]ab\ndefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abc\nefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcd\nfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcde\nghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdef\nhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefg\nijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefgh\njklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghi\nklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghij\nlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijk\nmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijkl\nnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklm\nopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmn\npqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmno\nqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnop\nrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0 56789!@#$%^&*()-_=+[]abcdefghijklmnopq\nstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqr\ntuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrs\nuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrst\nvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstu\nwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuv\nxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvw\nyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwx\nzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxy\nABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyz\nBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]abcdefghijklmnopqrstuvwxyzA\n1 OK\n' recv(test0): '2 vpc> ' send(test0): 'stat *\n' recv(test0): 'plug 0: OFF\n' recv(test0): 'plug 1: OFF\n' recv(test0): 'plug 2: OFF\n' recv(test0): 'plug 3: OFF\n' recv(test0): 'plug 4: OFF\n' recv(test0): 'plug 5: OFF\n' recv(test0): 'plug 6: OFF\n' recv(test0): 'plug 7: OFF\n' recv(test0): 'plug 8: OFF\n' recv(test0): 'plug 9: OFF\n' recv(test0): 'plug 10: OFF\n' recv(test0): 'plug 11: OFF\n' recv(test0): 'plug 12: OFF\n' recv(test0): 'plug 13: OFF\n' recv(test0): 'plug 14: OFF\n' recv(test0): 'plug 15: OFF\n' recv(test0): '2 OK\n' recv(test0): '3 vpc> ' on: off: t[0-15] unknown: powerman-2.3.5.orig/test/t43.conf0000644000000000000000000000151511031754257013445 0ustar include "../etc/dli.dev" device "b0" "dli" "./dli |&" device "b1" "dli" "./dli |&" device "b2" "dli" "./dli |&" device "b3" "dli" "./dli |&" device "b4" "dli" "./dli |&" device "b5" "dli" "./dli |&" device "b6" "dli" "./dli |&" device "b7" "dli" "./dli |&" device "b8" "dli" "./dli |&" device "b9" "dli" "./dli |&" device "b10" "dli" "./dli |&" device "b11" "dli" "./dli |&" device "b12" "dli" "./dli |&" device "b13" "dli" "./dli |&" device "b14" "dli" "./dli |&" device "b15" "dli" "./dli |&" node "t[0-7]" "b0" node "t[8-15]" "b1" node "t[16-23]" "b2" node "t[24-31]" "b3" node "t[32-39]" "b4" node "t[40-47]" "b5" node "t[48-55]" "b6" node "t[56-63]" "b7" node "t[64-71]" "b8" node "t[72-79]" "b9" node "t[80-87]" "b10" node "t[88-95]" "b11" node "t[96-103]" "b12" node "t[104-111]" "b13" node "t[112-119]" "b14" node "t[120-127]" "b15" powerman-2.3.5.orig/test/t37.conf0000644000000000000000000000021111027327357013442 0ustar include "../etc/hp3488.dev" device "h0" "hp3488" "./gpib -p hp3488|&" node "t[0-9]" "h0" "[100-109]" node "t[10-19]" "h0" "[200-209]" powerman-2.3.5.orig/test/t42.exp0000644000000000000000000000067211031754257013316 0ustar on: off: t[0-7] unknown: Command completed successfully on: t0 off: t[1-7] unknown: Command completed successfully on: t0 off: t[1-7] unknown: Command completed successfully on: off: t[0-7] unknown: Command completed successfully on: t[0-7] off: unknown: Command completed successfully on: t[0-7] off: unknown: Command completed successfully on: off: t[0-7] unknown: powerman-2.3.5.orig/test/t33.exp0000644000000000000000000000147411052171766013320 0ustar on: off: t[0-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: off: t[0-9] unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: off: t[0-9] unknown: Command completed successfully on: t0 off: t[1-9] unknown: Command completed successfully on: off: t[0-9] unknown: Command completed successfully on: t[0-9] off: unknown: Command completed successfully on: off: t[0-9] unknown: on: off: t[0-9] unknown: t0: 73: t1: 74: t2: 75: t3: 76: t4: 77: t5: 78: t6: 79: t7: 80: t8: 81: t9: 82: powerman-2.3.5.orig/test/t47.conf0000644000000000000000000000014611052045335013441 0ustar include "../etc/ipmipower.dev" device "d0" "ipmipower" "./ipmipower -h t[0-15]|&" node "t[0-15]" "d0" powerman-2.3.5.orig/test/t00.exp0000644000000000000000000000002611020044237013265 0ustar plug=p493 node=foo493 powerman-2.3.5.orig/test/t41.conf0000644000000000000000000000017711031510250013425 0ustar include "../etc/plmpower.dev" device "i0" "plmpower" "../src/plmpower -T |&" node "t0" "i0" "aa.bb.cc" node "t1" "i0" "G1" powerman-2.3.5.orig/test/t40.conf0000644000000000000000000000044111027327357013441 0ustar include "../etc/ics8064.dev" device "i0" "ics8064" "./gpib -p ics8064|&" device "i1" "ics8064" "./gpib -p ics8064|&" device "i2" "ics8064" "./gpib -p ics8064|&" device "i3" "ics8064" "./gpib -p ics8064|&" node "t[0-15]" "i0" node "t[16-31]" "i1" node "t[32-47]" "i2" node "t[48-63]" "i3" powerman-2.3.5.orig/test/t380000755000000000000000000000064011052145100012506 0ustar #!/bin/sh TEST=t38 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140] \ -q -c t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140] \ -q -0 t[0,10,20,30,40,50,60,70,80,90,100,110,120,130,140] \ -q -1 t[0-149] \ -q -c t[0-149] \ -q -0 t[0-149] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t270000755000000000000000000000040711052145100012505 0ustar #!/bin/sh TEST=t27 $PATH_POWERMAN -Y -S $PATH_POWERMAND -C $TEST.conf \ -q -1 t0 \ -q -c t0 \ -q -0 t0 \ -q -1 t[0-7] \ -q -c t[0-7] \ -q -0 t[0-7] \ -q >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/t060000755000000000000000000000025511023523731012513 0ustar #!/bin/sh TEST=t06 $PATH_POWERMAN -S $PATH_POWERMAND -C test.conf \ -q -Q t1 -Q t[3-5] >$TEST.out 2>$TEST.err test $? = 0 || exit 1 diff $TEST.out $TEST.exp >$TEST.diff powerman-2.3.5.orig/test/tregex.c0000644000000000000000000001307311113122517013615 0ustar /*****************************************************************************\ * $Id:$ ***************************************************************************** * Copyright (C) 2004-2008 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Jim Garlick * UCRL-CODE-2002-008. * * This file is part of PowerMan, a remote power management program. * For details, see . * * PowerMan 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. * * PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. \*****************************************************************************/ #include #include #include #include #include "xtypes.h" #include "xregex.h" #include "xmalloc.h" /* Return true if regex [r] matches exactly [p] in [s]. */ static bool _matchstr(char *r, char *s, char *p) { xregex_t re; xregex_match_t rm; int res; char *tmp; re = xregex_create(); rm = xregex_match_create(2); xregex_compile(re, r, TRUE); res = xregex_exec(re, s, rm); if (res && p) { tmp = xregex_match_strdup(rm); if (strcmp(tmp, p) != 0) res = FALSE; xfree(tmp); } xregex_match_destroy(rm); xregex_destroy(re); return res; } /* Return true if regex [r] matches exactly [s] in [s]. */ static bool _matchstr_all(char *r, char *s) { return _matchstr(r, s, s); } /* Return true if regex [r] matches anything in [s]. */ static bool _match(char *r, char *s) { return _matchstr(r, s, NULL); } static void _check_substr_match(void) { xregex_t re; xregex_match_t rm; char *s; re = xregex_create(); rm = xregex_match_create(2); xregex_compile(re, "foo([0-9]+)bar([0-9]+)", TRUE); assert(xregex_exec(re, "xxxfoo1bar2", rm) == TRUE); s = xregex_match_sub_strdup(rm, 0); assert(s != NULL); assert(strcmp(s, "foo1bar2") == 0); xfree(s); s = xregex_match_sub_strdup(rm, 1); assert(s != NULL); assert(strcmp(s, "1") == 0); xfree(s); s = xregex_match_sub_strdup(rm, 2); assert(s != NULL); assert(strcmp(s, "2") == 0); xfree(s); s = xregex_match_sub_strdup(rm, 3); assert(s == NULL); s = xregex_match_sub_strdup(rm, -1); /* powerman actually does this! */ assert(s == NULL); s = xregex_match_strdup(rm); assert(strcmp(s, "xxxfoo1bar2") == 0); assert(xregex_match_strlen(rm) == strlen(s)); xfree(s); xregex_match_recycle(rm); assert(xregex_exec(re, "foobar2", rm) == FALSE); s = xregex_match_sub_strdup(rm, 0); assert(s == NULL); s = xregex_match_sub_strdup(rm, 1); assert(s == NULL); xregex_match_recycle(rm); assert(xregex_exec(re, "xxxfoo1bar2yyy", rm) == TRUE); s = xregex_match_sub_strdup(rm, 0); assert(s != NULL); assert(strcmp(s, "foo1bar2") == 0); xfree(s); s = xregex_match_sub_strdup(rm, 1); assert(s != NULL); assert(strcmp(s, "1") == 0); xfree(s); s = xregex_match_sub_strdup(rm, 2); assert(s != NULL); assert(strcmp(s, "2") == 0); xfree(s); s = xregex_match_strdup(rm); assert(strcmp(s, "xxxfoo1bar2") == 0); assert(xregex_match_strlen(rm) == strlen(s)); xfree(s); xregex_match_destroy(rm); xregex_destroy(re); } int main(int argc, char *argv[]) { char *s; err_init("tregex"); assert(_match("foo", "foo")); assert(_match("foo", "fooxxx")); assert(_match("foo", "xxxfoo")); assert(!_match("foo", "bar")); _check_substr_match(); /* verify that \\n and \\r are converted into \r and \r */ assert(!_match("foo\\r\\n", "foo\\r\\n")); assert( _match("foo\\r\\n", "foo\r\n")); /* check a really long string for a regex */ #define LONG_STR_LEN (64*1024*1024) #define POS_MAGIC 42 #define POS_WONDERFUL 32*1024*1024 #define POS_COOKIE 63*1024*1024 s = xmalloc(LONG_STR_LEN); memset(s, 'a', LONG_STR_LEN - 1); memcpy(s + POS_MAGIC, "MAGIC", 5); memcpy(s + POS_WONDERFUL, "WONDERFUL", 9); memcpy(s + POS_COOKIE, "COOKIE", 6); s[LONG_STR_LEN - 1] = '\0'; assert( _match("MAGIC", s)); assert( _match("WONDERFUL", s)); assert( _match("COOKIE", s)); assert(!_match("CHOCOLATE", s)); xfree(s); /* end of line handling should be disabled since end of string * (which normally matches) is non-deterministic in powerman. * We should be explicitly matching end-of-line sentinels like * \n in scripts. */ assert(!_match("foo$", "foo")); assert(!_match("foo$", "foo\n")); assert(!_match("foo\n", "foo")); assert(!_match("foo\n", "bar\nfoo")); assert( _match("foo\n", "barfoo\n")); /* regex takes first match if there are > 1, * but leading wildcard matches greedily */ assert(_matchstr("foo", "abfoocdfoo", "abfoo")); assert(_matchstr_all(".*foo", "abfoocdfoo")); /* check that [:space:] character class works inside bracket * expression */ assert(_matchstr_all("bar[0-9[:space:]]*foo", "bar 42 foo")); /* debug apcpdu3 regex */ #define B3RX "([0-9])*[^\r\n]*(ON|OFF)\r\n" assert(_matchstr_all(B3RX, " 2- Outlet 2 ON\r\n")); assert(_matchstr_all(B3RX, " 9- ON\r\n")); exit(0); } powerman-2.3.5.orig/powerman.spec0000644000000000000000000000720011172212766013706 0ustar Name: powerman Version:2.3.5 Release:1%{?dist} Summary: PowerMan - centralized power control for clusters License: GPL Group: Applications/System Url: http://sourceforge.net/projects/powerman Source0: powerman-2.3.5.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if 0%{?rhel} %define _with_httppower 1 %define _with_genders 0 %define _with_tcp_wrappers 1 %endif %if 0%{?chaos} %define _with_httppower 1 %define _with_genders 1 %define _with_tcp_wrappers 1 %endif %if 0%{?fedora} %define _with_httppower 1 %define _with_genders 0 %define _with_tcp_wrappers 1 %endif %if 0%{?_with_tcp_wrappers} BuildRequires: tcp_wrappers %endif %if 0%{?_with_genders} BuildRequires: genders %endif %if 0%{?_with_httppower} BuildRequires: curl-devel %endif %package devel Requires: %{name} = %{version}-%{release} Summary: Headers and libraries for developing applications using PowerMan Group: Development/Libraries %package libs Requires: %{name} = %{version}-%{release} Summary: Libraries for applications using PowerMan Group: System Environment/Libraries %description PowerMan is a tool for manipulating remote power control (RPC) devices from a central location. Several RPC varieties are supported natively by PowerMan and Expect-like configurability simplifies the addition of new devices. %description devel A header file and static library for developing applications using PowerMan. %description libs A shared library for applications using PowerMan. %prep %setup -n powerman-2.3.5 %build %configure \ %{?_with_genders: --with-genders} \ %{?_with_httppower: --with-httppower} \ --program-prefix=%{?_program_prefix:%{_program_prefix}} make %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %post if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add powerman; fi %post libs if [ -x /sbin/ldconfig ]; then /sbin/ldconfig %{_libdir}; fi %preun if [ "$1" = 0 ]; then %{_sysconfdir}/init.d/powerman stop >/dev/null 2>&1 || : if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --del powerman; fi fi %postun if [ "$1" -ge 1 ]; then %{_sysconfdir}/init.d/powerman condrestart >/dev/null 2>&1 || : fi %postun libs if [ -x /sbin/ldconfig ]; then /sbin/ldconfig %{_libdir}; fi %files %defattr(-,root,root,0755) %doc ChangeLog %doc DISCLAIMER %doc COPYING %doc NEWS %doc TODO %{_bindir}/powerman %{_bindir}/pm %{_sbindir}/powermand %{_sbindir}/vpcd %if 0%{?_with_httppower} %{_sbindir}/httppower %endif %{_sbindir}/plmpower %dir %config %{_sysconfdir}/powerman %{_sysconfdir}/powerman/*.dev %{_sysconfdir}/powerman/powerman.conf.example %{_mandir}/*1/* %{_mandir}/*5/* %{_mandir}/*7/* %{_mandir}/*8/* %{_libdir}/stonith/plugins/external/powerman %{_sysconfdir}/init.d/powerman %dir %attr(0755,daemon,root) %config %{_localstatedir}/run/powerman %files devel %defattr(-,root,root,0755) %{_includedir}/* %{_libdir}/*.la %{_mandir}/*3/* %ifnos aix5.3 aix5.2 aix5.1 aix5.0 aix4.3 %{_libdir}/*.a %{_libdir}/*.so %{_libdir}/pkgconfig/* %endif %files libs %defattr(-,root,root,0755) %ifnos aix5.3 aix5.2 aix5.1 aix5.0 aix4.3 %{_libdir}/*.so.* %else %{_libdir}/*.a %endif %changelog * Tue Feb 14 2006 Ben Woodard 1.0.22-3 - Changed /usr/bin to bindir - Changed /usr/sbin to sbindir - Added COPYING to list of docs. - Changed /etc/rc.d/init.d/ to initrddir - Changed /usr/man to mandir - Added a fully qualified path to the source file. - Fixed buildroot - Added a patch which should fix a fc4 build problem. * Thu Feb 09 2006 Ben Woodard 1.0.22-2 - changed the buildroot to match fedora guidlines - changed permissions of spec and src files. - added changelog to spec file powerman-2.3.5.orig/INSTALL0000644000000000000000000002207110526654720012240 0ustar Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PREFIX', the package will use PREFIX as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. powerman-2.3.5.orig/META0000644000000000000000000000021111172212766011646 0ustar Date: 2009-02-09 Meta: 1 Name: powerman Release: 1 Release_tags: dist Version: 2.3.5 powerman-2.3.5.orig/configure.ac0000644000000000000000000000444211115104225013460 0ustar ##***************************************************************************** ## $Id: configure.ac,v 1.40 2006/09/27 00:44:07 achu Exp $ ##***************************************************************************** ## Process this file with autoconf to produce a configure script. ##***************************************************************************** ## # Prologue. ## AC_INIT([powerman]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_SRCDIR([NEWS]) AC_CANONICAL_SYSTEM X_AC_META X_AC_EXPAND_INSTALL_DIRS ## # Automake support. ## AM_INIT_AUTOMAKE([$META_NAME], [$META_VERSION]) AM_CONFIG_HEADER([config/config.h]) AM_MAINTAINER_MODE ## # Checks for programs. ## AC_PROG_CC if test "$GCC" = yes; then GCCWARN="-Wall" AC_SUBST([GCCWARN]) fi AC_PROG_LN_S AC_PROG_MAKE_SET AM_PROG_LEX AC_PROG_YACC AC_PROG_LIBTOOL AM_CONDITIONAL(WITH_GNU_LD, test "$with_gnu_ld" = "yes") ## # ## AC_CHECK_FILES(/dev/ptmx) AC_CHECK_FILES(/dev/ptc) ## # Checks for header files. ## AC_HEADER_STDC AC_CHECK_HEADERS( \ getopt.h \ poll.h \ sys/select.h \ sys/syscall.h \ ) ## # Checks for typedefs, structures, and compiler characteristics. ## AC_C_BIGENDIAN AC_TYPE_UID_T AC_C_CONST AC_CHECK_TYPES(socklen_t, [], [], [#include ]) ## # Check for httppower, genders ## AC_HTTPPOWER AM_CONDITIONAL(WITH_HTTPPOWER, [test "$ac_with_httppower" = "yes"]) AC_GENDERS ## # Checks for library functions. ## AC_CHECK_FUNCS( \ getopt_long \ cfmakeraw ) AC_SEARCH_LIBS([bind],[socket]) AC_SEARCH_LIBS([gethostbyaddr],[nsl]) AC_CURSES AC_FORKPTY AC_WRAP AC_CHECK_FUNC([poll], AC_DEFINE([HAVE_POLL], [1], [Define if you have poll])) AC_CURL # for list.c, cbuf.c, hostlist.c, and wrappers.c */ AC_DEFINE(WITH_LSD_FATAL_ERROR_FUNC, 1, [Define lsd_fatal_error]) AC_DEFINE(WITH_LSD_NOMEM_ERROR_FUNC, 1, [Define lsd_fatal_error]) # whether to install pkg-config file for API AC_PKGCONFIG # what user to run daemon as AC_RUNAS ## # Epilogue. ## AC_CONFIG_FILES( \ Makefile \ src/Makefile \ lib/Makefile \ lib/libpowerman.pc \ etc/Makefile \ scripts/Makefile \ scripts/powerman.init \ test/Makefile \ man/Makefile \ man/powerman.1 \ man/libpowerman.3 \ man/powerman.conf.5 \ man/powerman.dev.5 \ man/powerman-devices.7 \ man/httppower.8 \ man/plmpower.8 \ man/powermand.8 \ man/vpcd.8 \ ) AC_OUTPUT powerman-2.3.5.orig/htdocs/0000755000000000000000000000000011205355432012462 5ustar powerman-2.3.5.orig/htdocs/supported.html0000644000000000000000000001022111164522265015375 0ustar

powerman supported power controllers


Make and Model Plugs Device Name Notes
Appro SWPDU 48 swpdu
APC AP9210 8 apcnew Firmware APP v2.2.0 or newer.
APC AP9210 8 apc Firmware APP v2.2.0 through APP v.1.1.1 (not inclusive)
APC AP9210 8 apcold Firmware APP v1.1.1 or older.
APC AP7900, 01, 20, 21 8 apc7900 Firmware APP v2.6.5 and older
APC AP7930, 32, 40, 41, 60, 61, 68, 90, 91, 98, 51, 52, 53, 54 24 apcpdu Firmware APP v2.6.5 and older
APC AP7930 et al 24 apcpdu3 Firmware APP v3.3.3 and newer
Baytech RPC3 8 baytech
Baytech RPC3-20NC 8 baytech-rpc3-nc
Baytech RPC28-30NC 20 baytech-rpc28-nc
Cyclades PM8 8 pm8
Cyclades PM10 10 pm10
Cyclades PM20 20 pm20
Cyclades PM42 42 pm42
Digital Loggers LPC, EPCR2, DIN 8 dli
HP3488 Switch/Control Unit configurable hp3488 Requires gpib-utils hp3488 utility
HP Integrated Lights-Out management device (iLO) 1 hpilo
HP Management Processor Device (MP) 1 hpmp
HP Management Processor Device (MP) for mid-range ceullular systems configurable hpmpcell
HP Management Processor Device (MP) for high-end ceullular systems configurable hpmpdome
HP Management Processor Device (MP) for HP integrity blade servers 1 hpmpblade
IBM Blade Center Management Module 15 ibmbladecenter
ICS 8064 Ethernet Relay Interface 16 ics8064 Requires gpib-utils ics8064 utility
SmartLabs 2412S Power Line Modem (for X10/Insteon) configurable plmpower
LNXI Icebox v2 10 icebox
LNXI Icebox v3, v4 10 icebox3
Sun ILOM Management Module 1 ilom-inline Inline with serial console
IPMI 1.5 terminal mode 1 ipmi Serial only
IPMI configurable ipmipower Requires FreeIPMI ipmipower utility
Rackable Systems Phantom v3 and v4 1 phantom
WTI RPS-10 10 wti-rps10 Single plug controller, up to 10 units daisy chained.
WTI NPS 8 wti

$Id: supported.html 1124 2009-03-31 23:18:13Z garlick $ powerman-2.3.5.orig/htdocs/sfcopy0000755000000000000000000000020011015207376013705 0ustar #!/bin/sh FILES="index.html powerman47.jpg supported.html" scp $FILES shell.sourceforge.net:/home/groups/p/po/powerman/htdocs/ powerman-2.3.5.orig/htdocs/index.html0000644000000000000000000000272011021324462014453 0ustar

powerman

Power to the cluster!
powerman is free UNIX/Linux software that controls (remotely and in parallel) switched power distribution units.

powerman is suitable for remote operation of Linux systems in a data center or compute cluster environment. (See conman for complementary serial console management)

powerman can be extended to support new devices using an expect-like scripting language.

powerman can use ethernet, serial, or pipe connections to communicate with remote power distribution units or power control daemons such as ipmipower from the FreeIPMI project.

See SourceForge summary page for downloads, mailing list, etc..

[Powerman Comic jpg]

SourceForge.net Logo $Id: index.html 938 2008-06-03 20:27:30Z garlick $ powerman-2.3.5.orig/DISCLAIMER0000644000000000000000000000507607515126721012553 0ustar #################################################################### # $Id: DISCLAIMER 137 2002-07-16 23:35:45Z auselton $ #################################################################### Copyright (C) 2001-2002 The Regents of the University of California. Produced at Lawrence Livermore National Laboratory. Written by Andrew Uselton (uselton2@llnl.gov>. UCRL-CODE-2002-008. This file is part of PowerMan, a remote power management program. For details, see . PowerMan 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. PowerMan 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 PowerMan; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. This work was produced at the University of California, Lawrence Livermore National Laboratory (UC LLNL) under contract no. W-7405-ENG-48 (Contract 48) between the U.S. Department of Energy (DOE) and The Regents of the University of California (University) for the operation of UC LLNL. The rights of the Federal Government are reserved under Contract 48 subject to the restrictions agreed upon by the DOE and University as allowed under DOE Acquisition Letter 97-1. DISCLAIMER This work was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. powerman-2.3.5.orig/README0000644000000000000000000000030410526654720012062 0ustar Powerman provides power management in a data center or compute cluster environment. It performs operations such as power on, power off, and power cycle via remote power controller (RPC) devices. powerman-2.3.5.orig/configure0000755000000000000000000271134511115104225013112 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $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" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.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 $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } 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 if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval 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="eval 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 # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # 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 ac_config_libobj_dir=. 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="powerman" ac_unique_file="NEWS" # 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" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os META_NAME META_VERSION META_RELEASE META_ALIAS META_DATE META_AUTHOR META_LT_CURRENT META_LT_REVISION META_LT_AGE X_PREFIX X_EXEC_PREFIX X_BINDIR X_SBINDIR X_LIBEXECDIR X_DATADIR X_SYSCONFDIR X_SHAREDSTATEDIR X_LOCALSTATEDIR X_LIBDIR X_INCLUDEDIR X_OLDINCLUDEDIR X_INFODIR X_MANDIR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE GCCWARN LN_S LEX LEXLIB LEX_OUTPUT_ROOT YACC SED EGREP ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL WITH_GNU_LD_TRUE WITH_GNU_LD_FALSE WITH_HTTPPOWER_TRUE WITH_HTTPPOWER_FALSE LIBGENDERS LIBCURSES LIBFORKPTY LIBWRAP LIBCURL WITH_PKG_CONFIG_TRUE WITH_PKG_CONFIG_FALSE pkgconfigdir RUN_AS_USER LIBOBJS LTLIBOBJS' ac_subst_files='' # 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 (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } 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 ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # 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 Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-httppower Build httppower executable --with-genders Build genders support --with-ncurses Force the use of ncurses over curses --with-pkgconfig-dir=PATH where to install pkg-config *.pc files (EPREFIX/lib/pkgconfig) --with-user=username user for powerman daemon (daemon) 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 CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags 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 # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac 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 (C) 2003 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.59. 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. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # 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 cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f 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_aux_dir= for ac_dir in config $srcdir/config; 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 config $srcdir/config" >&5 echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&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. # 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/'` echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- echo "$as_me:$LINENO: checking metadata" >&5 echo $ECHO_N "checking metadata... $ECHO_C" >&6 META="$srcdir/META" _x_ac_meta_got_file=no if test -f "$META"; then _x_ac_meta_got_file=yes META_NAME=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ '(?:NAME|PROJECT|PACKAGE)' $META`; if test -n "$META_NAME"; then cat >>confdefs.h <<_ACEOF #define META_NAME "$META_NAME" _ACEOF fi META_VERSION=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ 'VERSION' $META`; if test -n "$META_VERSION"; then cat >>confdefs.h <<_ACEOF #define META_VERSION "$META_VERSION" _ACEOF fi META_RELEASE=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ 'RELEASE' $META`; if test -n "$META_RELEASE"; then cat >>confdefs.h <<_ACEOF #define META_RELEASE "$META_RELEASE" _ACEOF fi if test -n "$META_NAME" -a -n "$META_VERSION"; then META_ALIAS="$META_NAME-$META_VERSION" test -n "$META_RELEASE" -a "$META_RELEASE" != "1" \ && META_ALIAS="$META_ALIAS-$META_RELEASE" cat >>confdefs.h <<_ACEOF #define META_ALIAS "$META_ALIAS" _ACEOF fi META_DATE=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ 'DATE' $META`; if test -n "$META_DATE"; then cat >>confdefs.h <<_ACEOF #define META_DATE "$META_DATE" _ACEOF fi META_AUTHOR=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ 'AUTHOR' $META`; if test -n "$META_AUTHOR"; then cat >>confdefs.h <<_ACEOF #define META_AUTHOR "$META_AUTHOR" _ACEOF fi META_LT_CURRENT=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ 'LT_CURRENT' $META`; META_LT_REVISION=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ 'LT_REVISION' $META`; META_LT_AGE=`perl -n\ -e "BEGIN { \\$key=shift @ARGV; }"\ -e "next unless s/^\s*\\$key[:=]//i;"\ -e "s/^((?:[^'\"#]*(?:(['\"])[^\2]*\2)*)*)#.*/\\$1/;"\ -e "s/^\s+//;"\ -e "s/\s+$//;"\ -e "s/^(['\"])(.*)\1/\\$2/;"\ -e "\\$val=\\$_;"\ -e "END { print \\$val if defined \\$val; }"\ 'LT_AGE' $META`; if test -n "$META_LT_CURRENT" \ -o -n "$META_LT_REVISION" \ -o -n "$META_LT_AGE"; then test -n "$META_LT_CURRENT" || META_LT_CURRENT="0" test -n "$META_LT_REVISION" || META_LT_REVISION="0" test -n "$META_LT_AGE" || META_LT_AGE="0" cat >>confdefs.h <<_ACEOF #define META_LT_CURRENT "$META_LT_CURRENT" _ACEOF cat >>confdefs.h <<_ACEOF #define META_LT_REVISION "$META_LT_REVISION" _ACEOF cat >>confdefs.h <<_ACEOF #define META_LT_AGE "$META_LT_AGE" _ACEOF fi fi echo "$as_me:$LINENO: result: $_x_ac_meta_got_file" >&5 echo "${ECHO_T}$_x_ac_meta_got_file" >&6 echo "$as_me:$LINENO: checking installation directory variables" >&5 echo $ECHO_N "checking installation directory variables... $ECHO_C" >&6 _x_ac_expand_install_dirs_prefix="$prefix" test "$prefix" = NONE && prefix="$ac_default_prefix" _x_ac_expand_install_dirs_exec_prefix="$exec_prefix" test "$exec_prefix" = NONE && exec_prefix="$prefix" eval X_PREFIX="$prefix" cat >>confdefs.h <<_ACEOF #define X_PREFIX "$X_PREFIX" _ACEOF eval X_EXEC_PREFIX="$exec_prefix" cat >>confdefs.h <<_ACEOF #define X_EXEC_PREFIX "$X_EXEC_PREFIX" _ACEOF eval X_BINDIR="$bindir" cat >>confdefs.h <<_ACEOF #define X_BINDIR "$X_BINDIR" _ACEOF eval X_SBINDIR="$sbindir" cat >>confdefs.h <<_ACEOF #define X_SBINDIR "$X_SBINDIR" _ACEOF eval X_LIBEXECDIR="$libexecdir" cat >>confdefs.h <<_ACEOF #define X_LIBEXECDIR "$X_LIBEXECDIR" _ACEOF eval X_DATADIR="$datadir" cat >>confdefs.h <<_ACEOF #define X_DATADIR "$X_DATADIR" _ACEOF eval X_SYSCONFDIR="$sysconfdir" cat >>confdefs.h <<_ACEOF #define X_SYSCONFDIR "$X_SYSCONFDIR" _ACEOF eval X_SHAREDSTATEDIR="$sharedstatedir" cat >>confdefs.h <<_ACEOF #define X_SHAREDSTATEDIR "$X_SHAREDSTATEDIR" _ACEOF eval X_LOCALSTATEDIR="$localstatedir" cat >>confdefs.h <<_ACEOF #define X_LOCALSTATEDIR "$X_LOCALSTATEDIR" _ACEOF eval X_LIBDIR="$libdir" cat >>confdefs.h <<_ACEOF #define X_LIBDIR "$X_LIBDIR" _ACEOF eval X_INCLUDEDIR="$includedir" cat >>confdefs.h <<_ACEOF #define X_INCLUDEDIR "$X_INCLUDEDIR" _ACEOF eval X_OLDINCLUDEDIR="$oldincludedir" cat >>confdefs.h <<_ACEOF #define X_OLDINCLUDEDIR "$X_OLDINCLUDEDIR" _ACEOF eval X_INFODIR="$infodir" cat >>confdefs.h <<_ACEOF #define X_INFODIR "$X_INFODIR" _ACEOF eval X_MANDIR="$mandir" cat >>confdefs.h <<_ACEOF #define X_MANDIR "$X_MANDIR" _ACEOF prefix="$_x_ac_expand_install_dirs_prefix" exec_prefix="$_x_ac_expand_install_dirs_exec_prefix" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 ## # Automake support. ## am__api_version="1.9" # 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" # OS/2's system install, which has a completely different semantic # ./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/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /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' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk 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_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=$META_NAME VERSION=$META_VERSION cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config/config.h" echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ## # Checks for programs. ## 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" 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 See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # 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 file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $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= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].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, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&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'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&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 b.out 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 conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) 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 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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 | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err 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 echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 \ '' \ '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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err 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 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "$GCC" = yes; then GCCWARN="-Wall" fi echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi for ac_prog in flex lex 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_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc 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_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext 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 case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4390 "configure"' > conftest.$ac_ext 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 if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext 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 case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext 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 fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext 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 case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" 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. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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 See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&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 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err 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 dlfcn.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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; 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: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&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 ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC 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_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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_CXX="$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 CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC 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_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # 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); } 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_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ '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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err 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 ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_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 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif 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=$? grep -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_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 sed 's/^/| /' 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 sed 's/^/| /' 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_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif 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=$? grep -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_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 sed 's/^/| /' 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_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 sed 's/^/| /' 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 \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran 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_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # 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_F77="$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 F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran 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_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5989:" \ "checking for Fortran 77 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); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` 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 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" 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); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; 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_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; 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_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; 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_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7052: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7056: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7320: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7324: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7424: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7428: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext 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); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 8893 "configure"' > conftest.$ac_ext 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 case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* 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 shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* 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 dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF 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); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF 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); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12233: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12237: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12337: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12341: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext 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); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 12873 "configure"' > conftest.$ac_ext 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 case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13931: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13935: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14035: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14039: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext 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); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 15484 "configure"' > conftest.$ac_ext 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 case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16262: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16266: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16530: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16534: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16634: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16638: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext 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); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '#line 18103 "configure"' > conftest.$ac_ext 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 case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion if test "$with_gnu_ld" = "yes"; then WITH_GNU_LD_TRUE= WITH_GNU_LD_FALSE='#' else WITH_GNU_LD_TRUE='#' WITH_GNU_LD_FALSE= fi ## # ## echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6 if test "${ac_cv_file__dev_ptmx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/dev/ptmx"; then ac_cv_file__dev_ptmx=yes else ac_cv_file__dev_ptmx=no fi fi echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptmx" >&5 echo "${ECHO_T}$ac_cv_file__dev_ptmx" >&6 if test $ac_cv_file__dev_ptmx = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__DEV_PTMX 1 _ACEOF fi echo "$as_me:$LINENO: checking for /dev/ptc" >&5 echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6 if test "${ac_cv_file__dev_ptc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/dev/ptc"; then ac_cv_file__dev_ptc=yes else ac_cv_file__dev_ptc=no fi fi echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptc" >&5 echo "${ECHO_T}$ac_cv_file__dev_ptc" >&6 if test $ac_cv_file__dev_ptc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__DEV_PTC 1 _ACEOF fi ## # Checks for header files. ## 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out 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 for ac_header in \ getopt.h \ poll.h \ sys/select.h \ sys/syscall.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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; 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: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&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 ## # Checks for typedefs, structures, and compiler characteristics. ## echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _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 ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi ## # Check for httppower, genders ## echo "$as_me:$LINENO: checking for whether to build httppower executable" >&5 echo $ECHO_N "checking for whether to build httppower executable... $ECHO_C" >&6 # Check whether --with-httppower or --without-httppower was given. if test "${with_httppower+set}" = set; then withval="$with_httppower" case "$withval" in no) ac_httppower_test=no ;; yes) ac_httppower_test=yes ;; *) { { echo "$as_me:$LINENO: error: bad value \"$withval\" for --with-httppower" >&5 echo "$as_me: error: bad value \"$withval\" for --with-httppower" >&2;} { (exit 1); exit 1; }; } ;; esac fi; echo "$as_me:$LINENO: result: ${ac_httppower_test=no}" >&5 echo "${ECHO_T}${ac_httppower_test=no}" >&6 if test "$ac_httppower_test" = "yes"; then ac_with_httppower=yes else ac_with_httppower=no fi if test "$ac_with_httppower" = "yes"; then WITH_HTTPPOWER_TRUE= WITH_HTTPPOWER_FALSE='#' else WITH_HTTPPOWER_TRUE='#' WITH_HTTPPOWER_FALSE= fi echo "$as_me:$LINENO: checking for whether to build genders support" >&5 echo $ECHO_N "checking for whether to build genders support... $ECHO_C" >&6 # Check whether --with-genders or --without-genders was given. if test "${with_genders+set}" = set; then withval="$with_genders" case "$withval" in no) ac_genders_test=no ;; yes) ac_genders_test=yes ;; *) { { echo "$as_me:$LINENO: error: bad value \"$withval\" for --with-genders" >&5 echo "$as_me: error: bad value \"$withval\" for --with-genders" >&2;} { (exit 1); exit 1; }; } ;; esac fi; echo "$as_me:$LINENO: result: ${ac_genders_test=no}" >&5 echo "${ECHO_T}${ac_genders_test=no}" >&6 if test "$ac_genders_test" = "yes"; then echo "$as_me:$LINENO: checking for genders_handle_create in -lgenders" >&5 echo $ECHO_N "checking for genders_handle_create in -lgenders... $ECHO_C" >&6 if test "${ac_cv_lib_genders_genders_handle_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgenders $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 genders_handle_create (); int main () { genders_handle_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_genders_genders_handle_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_genders_genders_handle_create=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_genders_genders_handle_create" >&5 echo "${ECHO_T}$ac_cv_lib_genders_genders_handle_create" >&6 if test $ac_cv_lib_genders_genders_handle_create = yes; then ac_have_genders=yes fi fi if test "$ac_have_genders" = "yes"; then cat >>confdefs.h <<\_ACEOF #define WITH_GENDERS 1 _ACEOF for ac_header in genders.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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; 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: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&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 LIBGENDERS="-lgenders" ac_with_genders=yes else LIBGENDERS= ac_with_genders=no fi ## # Checks for library functions. ## for ac_func in \ getopt_long \ cfmakeraw 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 (); /* 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 char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err 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 echo "$as_me:$LINENO: checking for library containing bind" >&5 echo $ECHO_N "checking for library containing bind... $ECHO_C" >&6 if test "${ac_cv_search_bind+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_bind=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 bind (); int main () { bind (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_search_bind="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_bind" = no; then for ac_lib in socket; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 bind (); int main () { bind (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_search_bind="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_bind" >&5 echo "${ECHO_T}$ac_cv_search_bind" >&6 if test "$ac_cv_search_bind" != no; then test "$ac_cv_search_bind" = "none required" || LIBS="$ac_cv_search_bind $LIBS" fi echo "$as_me:$LINENO: checking for library containing gethostbyaddr" >&5 echo $ECHO_N "checking for library containing gethostbyaddr... $ECHO_C" >&6 if test "${ac_cv_search_gethostbyaddr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_gethostbyaddr=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 gethostbyaddr (); int main () { gethostbyaddr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_search_gethostbyaddr="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_gethostbyaddr" = no; then for ac_lib in nsl; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 gethostbyaddr (); int main () { gethostbyaddr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_search_gethostbyaddr="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyaddr" >&5 echo "${ECHO_T}$ac_cv_search_gethostbyaddr" >&6 if test "$ac_cv_search_gethostbyaddr" != no; then test "$ac_cv_search_gethostbyaddr" = "none required" || LIBS="$ac_cv_search_gethostbyaddr $LIBS" fi # Check whether --with-ncurses or --without-ncurses was given. if test "${with_ncurses+set}" = set; then withval="$with_ncurses" fi; mp_save_LIBS="$LIBS" LIBCURSES="" if test "$with_ncurses" != yes then echo "$as_me:$LINENO: checking for working curses" >&5 echo $ECHO_N "checking for working curses... $ECHO_C" >&6 if test "${mp_cv_curses+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else LIBS="$LIBS -lcurses" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 mp_cv_curses=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 mp_cv_curses=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $mp_cv_curses" >&5 echo "${ECHO_T}$mp_cv_curses" >&6 if test "$mp_cv_curses" = yes then cat >>confdefs.h <<\_ACEOF #define HAVE_CURSES_H _ACEOF LIBCURSES="-lcurses" fi fi if test ! "$LIBCURSES" then echo "$as_me:$LINENO: checking for working ncurses" >&5 echo $ECHO_N "checking for working ncurses... $ECHO_C" >&6 if test "${mp_cv_ncurses+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else LIBS="$mp_save_LIBS -lncurses" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 mp_cv_ncurses=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 mp_cv_ncurses=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $mp_cv_ncurses" >&5 echo "${ECHO_T}$mp_cv_ncurses" >&6 if test "$mp_cv_ncurses" = yes then cat >>confdefs.h <<\_ACEOF #define HAVE_NCURSES_H _ACEOF LIBCURSES="-lncurses" fi fi LIBS="$mp_save_LIBS" echo "$as_me:$LINENO: checking for forkpty" >&5 echo $ECHO_N "checking for forkpty... $ECHO_C" >&6 if test "${ac_cv_func_forkpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define forkpty to an innocuous variant, in case declares forkpty. For example, HP-UX 11i declares gettimeofday. */ #define forkpty innocuous_forkpty /* System header to define __stub macros and hopefully few prototypes, which can conflict with char forkpty (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef forkpty /* 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 forkpty (); /* 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_forkpty) || defined (__stub___forkpty) choke me #else char (*f) () = forkpty; #endif #ifdef __cplusplus } #endif int main () { return f != forkpty; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_forkpty=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_forkpty=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_forkpty" >&5 echo "${ECHO_T}$ac_cv_func_forkpty" >&6 if test $ac_cv_func_forkpty = yes; then ac_have_forkpty=yes else ac_have_forkpty=no fi if test "$ac_have_forkpty" = "no"; then echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6 if test "${ac_cv_lib_util_forkpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 forkpty (); int main () { forkpty (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_util_forkpty=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_forkpty=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6 if test $ac_cv_lib_util_forkpty = yes; then LIBFORKPTY=-lutil else echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_forkpty+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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 forkpty (); int main () { forkpty (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_forkpty=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_forkpty=no fi rm -f conftest.err 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_forkpty" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6 if test $ac_cv_lib_bsd_forkpty = yes; then LIBFORKPTY=-lbsd fi fi if test -n "$LIBFORKPTY"; then ac_have_forkpty=yes else ac_have_forkpty=no fi fi if test "$ac_have_forkpty" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF for ac_header in pty.h util.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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err 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 /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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=$? grep -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 ac_cpp_err=$ac_cpp_err$ac_c_werror_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 sed 's/^/| /' 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:$ac_c_preproc_warn_flag 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 compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; 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: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&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;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&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 fi echo "$as_me:$LINENO: checking for hosts_ctl in -lwrap" >&5 echo $ECHO_N "checking for hosts_ctl in -lwrap... $ECHO_C" >&6 if test "${ac_cv_lib_wrap_hosts_ctl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwrap $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 hosts_ctl (); int main () { hosts_ctl (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_wrap_hosts_ctl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_wrap_hosts_ctl=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_wrap_hosts_ctl" >&5 echo "${ECHO_T}$ac_cv_lib_wrap_hosts_ctl" >&6 if test $ac_cv_lib_wrap_hosts_ctl = yes; then ac_have_wrap=yes else ac_have_wrap=no fi if test "$ac_have_wrap" = "yes"; then LIBWRAP="-lwrap" cat >>confdefs.h <<\_ACEOF #define HAVE_TCP_WRAPPERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for poll" >&5 echo $ECHO_N "checking for poll... $ECHO_C" >&6 if test "${ac_cv_func_poll+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define poll to an innocuous variant, in case declares poll. For example, HP-UX 11i declares gettimeofday. */ #define poll innocuous_poll /* System header to define __stub macros and hopefully few prototypes, which can conflict with char poll (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef poll /* 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 poll (); /* 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_poll) || defined (__stub___poll) choke me #else char (*f) () = poll; #endif #ifdef __cplusplus } #endif int main () { return f != poll; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_poll=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_poll=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_poll" >&5 echo "${ECHO_T}$ac_cv_func_poll" >&6 if test $ac_cv_func_poll = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_POLL 1 _ACEOF fi echo "$as_me:$LINENO: checking for curl_easy_setopt in -lcurl" >&5 echo $ECHO_N "checking for curl_easy_setopt in -lcurl... $ECHO_C" >&6 if test "${ac_cv_lib_curl_curl_easy_setopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end 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 curl_easy_setopt (); int main () { curl_easy_setopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (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); }; } && { 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_curl_curl_easy_setopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curl_curl_easy_setopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_curl_curl_easy_setopt" >&5 echo "${ECHO_T}$ac_cv_lib_curl_curl_easy_setopt" >&6 if test $ac_cv_lib_curl_curl_easy_setopt = yes; then ac_have_curl=yes else ac_have_curl=no fi if test "$ac_have_curl" = "yes"; then LIBCURL="-lcurl" cat >>confdefs.h <<\_ACEOF #define HAVE_CURL 1 _ACEOF fi # for list.c, cbuf.c, hostlist.c, and wrappers.c */ cat >>confdefs.h <<\_ACEOF #define WITH_LSD_FATAL_ERROR_FUNC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define WITH_LSD_NOMEM_ERROR_FUNC 1 _ACEOF # whether to install pkg-config file for API pkgconfigdir='${libdir}/pkgconfig' echo "$as_me:$LINENO: checking whether to install pkg-config *.pc files" >&5 echo $ECHO_N "checking whether to install pkg-config *.pc files... $ECHO_C" >&6 # Check whether --with-pkgconfig-dir or --without-pkgconfig-dir was given. if test "${with_pkgconfig_dir+set}" = set; then withval="$with_pkgconfig_dir" case "${withval}" in yes|auto) ;; no) pkgconfigdir="" ;; *) pkgconfigdir="${withval}" ;; esac fi; if test -n "${pkgconfigdir}"; then echo "$as_me:$LINENO: result: ${pkgconfigdir}" >&5 echo "${ECHO_T}${pkgconfigdir}" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -n "${pkgconfigdir}"; then WITH_PKG_CONFIG_TRUE= WITH_PKG_CONFIG_FALSE='#' else WITH_PKG_CONFIG_TRUE='#' WITH_PKG_CONFIG_FALSE= fi # what user to run daemon as RUN_AS_USER="daemon" echo "$as_me:$LINENO: checking user to run as" >&5 echo $ECHO_N "checking user to run as... $ECHO_C" >&6 # Check whether --with-user or --without-user was given. if test "${with_user+set}" = set; then withval="$with_user" case "${withval}" in yes|no) ;; *) RUN_AS_USER="${withval}" ;; esac fi; cat >>confdefs.h <<_ACEOF #define RUN_AS_USER "${RUN_AS_USER}" _ACEOF echo "$as_me:$LINENO: result: ${RUN_AS_USER}" >&5 echo "${ECHO_T}${RUN_AS_USER}" >&6 ## # Epilogue. ## ac_config_files="$ac_config_files Makefile src/Makefile lib/Makefile lib/libpowerman.pc etc/Makefile scripts/Makefile scripts/powerman.init test/Makefile man/Makefile man/powerman.1 man/libpowerman.3 man/powerman.conf.5 man/powerman.dev.5 man/powerman-devices.7 man/httppower.8 man/plmpower.8 man/powermand.8 man/vpcd.8" 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 overridden 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 diff $cache_file confcache >/dev/null 2>&1; 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 ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_GNU_LD_TRUE}" && test -z "${WITH_GNU_LD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_HTTPPOWER_TRUE}" && test -z "${WITH_HTTPPOWER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_HTTPPOWER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_HTTPPOWER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_PKG_CONFIG_TRUE}" && test -z "${WITH_PKG_CONFIG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_PKG_CONFIG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_PKG_CONFIG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${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 ac_cs_recheck=false ac_cs_silent=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=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $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" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.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 $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } 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 if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval 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="eval 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 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.59. 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 -q, --quiet do not print progress messages -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 Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 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[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --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 ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # 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 ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _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" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/libpowerman.pc" ) CONFIG_FILES="$CONFIG_FILES lib/libpowerman.pc" ;; "etc/Makefile" ) CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/powerman.init" ) CONFIG_FILES="$CONFIG_FILES scripts/powerman.init" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "man/powerman.1" ) CONFIG_FILES="$CONFIG_FILES man/powerman.1" ;; "man/libpowerman.3" ) CONFIG_FILES="$CONFIG_FILES man/libpowerman.3" ;; "man/powerman.conf.5" ) CONFIG_FILES="$CONFIG_FILES man/powerman.conf.5" ;; "man/powerman.dev.5" ) CONFIG_FILES="$CONFIG_FILES man/powerman.dev.5" ;; "man/powerman-devices.7" ) CONFIG_FILES="$CONFIG_FILES man/powerman-devices.7" ;; "man/httppower.8" ) CONFIG_FILES="$CONFIG_FILES man/httppower.8" ;; "man/plmpower.8" ) CONFIG_FILES="$CONFIG_FILES man/plmpower.8" ;; "man/powermand.8" ) CONFIG_FILES="$CONFIG_FILES man/powermand.8" ;; "man/vpcd.8" ) CONFIG_FILES="$CONFIG_FILES man/vpcd.8" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config/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 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # 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. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&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,@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,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@META_NAME@,$META_NAME,;t t s,@META_VERSION@,$META_VERSION,;t t s,@META_RELEASE@,$META_RELEASE,;t t s,@META_ALIAS@,$META_ALIAS,;t t s,@META_DATE@,$META_DATE,;t t s,@META_AUTHOR@,$META_AUTHOR,;t t s,@META_LT_CURRENT@,$META_LT_CURRENT,;t t s,@META_LT_REVISION@,$META_LT_REVISION,;t t s,@META_LT_AGE@,$META_LT_AGE,;t t s,@X_PREFIX@,$X_PREFIX,;t t s,@X_EXEC_PREFIX@,$X_EXEC_PREFIX,;t t s,@X_BINDIR@,$X_BINDIR,;t t s,@X_SBINDIR@,$X_SBINDIR,;t t s,@X_LIBEXECDIR@,$X_LIBEXECDIR,;t t s,@X_DATADIR@,$X_DATADIR,;t t s,@X_SYSCONFDIR@,$X_SYSCONFDIR,;t t s,@X_SHAREDSTATEDIR@,$X_SHAREDSTATEDIR,;t t s,@X_LOCALSTATEDIR@,$X_LOCALSTATEDIR,;t t s,@X_LIBDIR@,$X_LIBDIR,;t t s,@X_INCLUDEDIR@,$X_INCLUDEDIR,;t t s,@X_OLDINCLUDEDIR@,$X_OLDINCLUDEDIR,;t t s,@X_INFODIR@,$X_INFODIR,;t t s,@X_MANDIR@,$X_MANDIR,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;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,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@GCCWARN@,$GCCWARN,;t t s,@LN_S@,$LN_S,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@SED@,$SED,;t t s,@EGREP@,$EGREP,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@WITH_GNU_LD_TRUE@,$WITH_GNU_LD_TRUE,;t t s,@WITH_GNU_LD_FALSE@,$WITH_GNU_LD_FALSE,;t t s,@WITH_HTTPPOWER_TRUE@,$WITH_HTTPPOWER_TRUE,;t t s,@WITH_HTTPPOWER_FALSE@,$WITH_HTTPPOWER_FALSE,;t t s,@LIBGENDERS@,$LIBGENDERS,;t t s,@LIBCURSES@,$LIBCURSES,;t t s,@LIBFORKPTY@,$LIBFORKPTY,;t t s,@LIBWRAP@,$LIBWRAP,;t t s,@LIBCURL@,$LIBCURL,;t t s,@WITH_PKG_CONFIG_TRUE@,$WITH_PKG_CONFIG_TRUE,;t t s,@WITH_PKG_CONFIG_FALSE@,$WITH_PKG_CONFIG_FALSE,;t t s,@pkgconfigdir@,$pkgconfigdir,;t t s,@RUN_AS_USER@,$RUN_AS_USER,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;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'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } 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 # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac 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; }; } # Do quote $f, to prevent DOS paths from being IFS'd. 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 grep "^[ ]*#[ ]*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 # grep' >>$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 diff $ac_file $tmp/config.h >/dev/null 2>&1; 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'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(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'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } 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 # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac 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=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || 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 powerman-2.3.5.orig/etc/0000755000000000000000000000000011205355435011754 5ustar powerman-2.3.5.orig/etc/cyclades-pm8.dev0000644000000000000000000000275011104074331014740 0ustar # # Cyclades PM8/PM8i s/w v. 1.0.9a # specification "pm8" { timeout 10 pingperiod 60 plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { expect "Username: " send "admin\n" expect "Password: " send "pm8\n" expect "pm>" } script ping { send "\n" expect "pm>" } script status_all { send "status 1-8\n" expect "Users" foreachplug { expect "([0-9]+)[[:space:]]+Unlocked (ON|OFF)" setplugstate $1 $2 on="ON" off="OFF" } expect "pm>" } script on { send "on %s\n" expect "Outlet turned on." expect "pm>" } script on_all { send "on 1-8\n" foreachplug { expect "Outlet turned on." } expect "pm>" } script off { send "off %s\n" expect "Outlet turned off." expect "pm>" } script off_all { send "off 1-8\n" foreachplug { expect "Outlet turned off." } expect "pm>" } script cycle { send "off %s\n" expect "Outlet turned off." expect "pm>" delay 4 send "on %s\n" expect "Outlet turned on." expect "pm>" } script cycle_all { send "off 1-8\n" foreachplug { expect "Outlet turned off." } expect "pm>" delay 4 send "on 1-8\n" foreachplug { expect "Outlet turned on." } expect "pm>" } script status_temp_all { send "temperature\n" expect "IPDU #1: Temperature: ([0-9.]+)" setplugstate "1" $1 setplugstate "2" $1 setplugstate "3" $1 setplugstate "4" $1 setplugstate "5" $1 setplugstate "6" $1 setplugstate "7" $1 setplugstate "8" $1 } } powerman-2.3.5.orig/etc/Makefile.in0000644000000000000000000002616411164522265014033 0ustar # Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = etc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/ac_curl.m4 \ $(top_srcdir)/config/ac_curses.m4 \ $(top_srcdir)/config/ac_forkpty.m4 \ $(top_srcdir)/config/ac_genders.m4 \ $(top_srcdir)/config/ac_httppower.m4 \ $(top_srcdir)/config/ac_pkgconfig.m4 \ $(top_srcdir)/config/ac_runas.m4 \ $(top_srcdir)/config/ac_wrap.m4 \ $(top_srcdir)/config/x_ac_expand_install_dirs.m4 \ $(top_srcdir)/config/x_ac_meta.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GCCWARN = @GCCWARN@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBCURL = @LIBCURL@ LIBCURSES = @LIBCURSES@ LIBFORKPTY = @LIBFORKPTY@ LIBGENDERS = @LIBGENDERS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBWRAP = @LIBWRAP@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ META_ALIAS = @META_ALIAS@ META_AUTHOR = @META_AUTHOR@ META_DATE = @META_DATE@ META_LT_AGE = @META_LT_AGE@ META_LT_CURRENT = @META_LT_CURRENT@ META_LT_REVISION = @META_LT_REVISION@ META_NAME = @META_NAME@ META_RELEASE = @META_RELEASE@ META_VERSION = @META_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WITH_GNU_LD_FALSE = @WITH_GNU_LD_FALSE@ WITH_GNU_LD_TRUE = @WITH_GNU_LD_TRUE@ WITH_HTTPPOWER_FALSE = @WITH_HTTPPOWER_FALSE@ WITH_HTTPPOWER_TRUE = @WITH_HTTPPOWER_TRUE@ WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ X_BINDIR = @X_BINDIR@ X_DATADIR = @X_DATADIR@ X_EXEC_PREFIX = @X_EXEC_PREFIX@ X_INCLUDEDIR = @X_INCLUDEDIR@ X_INFODIR = @X_INFODIR@ X_LIBDIR = @X_LIBDIR@ X_LIBEXECDIR = @X_LIBEXECDIR@ X_LOCALSTATEDIR = @X_LOCALSTATEDIR@ X_MANDIR = @X_MANDIR@ X_OLDINCLUDEDIR = @X_OLDINCLUDEDIR@ X_PREFIX = @X_PREFIX@ X_SBINDIR = @X_SBINDIR@ X_SHAREDSTATEDIR = @X_SHAREDSTATEDIR@ X_SYSCONFDIR = @X_SYSCONFDIR@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ CONFFILE = \ powerman.conf.example DEVFILES = \ apc7900.dev \ apc.dev \ apcnew.dev \ apcold.dev \ apcpdu3.dev \ apcpdu.dev \ bashfun.dev \ baytech.dev \ baytech-rpc28-nc.dev \ baytech-rpc3-nc.dev \ cb-7050.dev \ cyclades-pm8.dev \ cyclades-pm10.dev \ cyclades-pm20.dev \ cyclades-pm42.dev \ dli.dev \ hp3488.dev \ hpilo.dev \ hpmp.dev \ hpmpblade.dev \ hpmpcell.dev \ hpmpdome.dev \ ibmbladecenter.dev \ icebox.dev \ icebox3.dev \ ics8064.dev \ ilom.dev \ lom.dev \ ipmi.dev \ ipmipower.dev \ phantom.dev \ plmpower.dev \ powerman.dev \ swpdu.dev \ vpc.dev \ wti.dev \ wti-rps10.dev EXTRA_DIST = $(DEVFILES) $(CONFFILE) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-info-am install-data-local: -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(sysconfdir)/powerman for file in $(DEVFILES); do \ $(top_srcdir)/config/install-sh -m 644 \ $(srcdir)/$$file $(DESTDIR)$(sysconfdir)/powerman; \ done test -f $(DESTDIR)$(sysconfdir)/powerman/$(CONFFILE) || \ $(top_srcdir)/config/install-sh -m 644 \ $(srcdir)/$(CONFFILE) $(DESTDIR)$(sysconfdir)/powerman/$(CONFFILE) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: powerman-2.3.5.orig/etc/hpmpblade.dev0000644000000000000000000000247611164522265014422 0ustar # HP Management Processor device (MP) # a.k.a. Integrity Integrated Lights-Out 2 # # (c) Copyright 2009 Hewlett-Packard Development Company, L.P. # Bjorn Helgaas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # Example: # device "bl860c-001" "hpmpblade" "bl860c-001-mp.test:23" # node "bl860c-001" "bl860c-001" # # Tested on: # BL860c (MP firmware T.02.16) specification "hpmpblade" { timeout 10 plug name { "1" } script login { expect "login: " send "Admin\r\n" expect "password: " send "Admin\r\n" expect "MP> " send "cm\r\n" expect "MP:CM> " } script status { send "ps\r\n" expect "System Power state[^O]+(On|Off)" setplugstate "1" $1 on="On" off="Off" expect "MP:CM> " } script on { send "pc -on -nc\r\n" expect "MP:CM> " } script off { send "pc -off -nc\r\n" expect "MP:CM> " } script reset { send "rs -nc\r\n" expect "MP:CM> " } script status_beacon { send "loc -nc\r\n" expect "Server Locator UID LED[^O]+(On|Off)" setplugstate "1" $1 on="On" off="Off" expect "MP:CM> " } script beacon_on { send "loc -on -nc\r\n" expect "MP:CM> " } script beacon_off { send "loc -off -nc\r\n" expect "MP:CM> " } } powerman-2.3.5.orig/etc/hpilo.dev0000644000000000000000000000247411164522265013577 0ustar # HP Integrated Lights-Out management device (iLO) # # (c) Copyright 2009 Hewlett-Packard Development Company, L.P. # Bjorn Helgaas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # Example: # device "dl360-001" "hpilo" "dl360-001-ilo.test:23" # node "dl360-001" "dl360-001" # # Tested on: # DL360 (iLO firmware 1.93) # DL320 (iLO firmware 1.42) # BL465c G5 (iLO firmware 1.61) specification "hpilo" { timeout 10 plug name { "1" } script login { expect "Login Name: " send "Admin\r\n" expect "Password: " send "Admin\r\n" expect "hpiLO-> " } script status { send "power\r\n" expect "server power is currently: (On|Off)" setplugstate "1" $1 on="On" off="Off" expect "hpiLO-> " } script on { send "power on\r\n" expect "hpiLO-> " } script off { send "power off\r\n" expect "hpiLO-> " } script reset { send "reset system1\r\n" expect "hpiLO-> " } script status_beacon { send "uid\r\n" expect "The UID light is currently: (On|Off)" setplugstate "1" $1 on="On" off="Off" expect "hpiLO-> " } script beacon_on { send "uid on\r\n" expect "hpiLO-> " } script beacon_off { send "uid off\r\n" expect "hpiLO-> " } } powerman-2.3.5.orig/etc/bashfun.dev0000644000000000000000000000130511145140014014065 0ustar # Here's an example of how to start bash as a coprocess from powerman # and get it to execute commands for you. powerman.conf should contain: # # include "/etc/powerman/bashfun.dev" # device "bf0" "bashfun" "/bin/bash |&" # node "b1" "bf0" "1" # specification "bashfun" { timeout 5 plug name { "1" } script login { send "stty -echo" send "unset PROMPT_COMMAND\n" send "export PS1=P\n" expect "P" send "echo off >/tmp/state\n" expect "P" } script status { send "cat /tmp/state\n" expect "(off|on)" setplugstate "1" $1 on="on" off="off" expect "P" } script on { send "echo on >/tmp/state\n" expect "P" } script off { send "echo off >/tmp/state\n" expect "P" } } powerman-2.3.5.orig/etc/cb-7050.dev0000644000000000000000000000745111015104475013433 0ustar # # Measurement Computing Corp. CB-7050 digital I/O module # # This is "laboratory quality" power control as it requires wires # connected directly to motherboards and some hand tuning of delay values. # # Ref: CB-7000 DIO User's Manual # # Notes: # - Important note: CB-7050 data lines are not isolated and share a common # ground. Beware of ground loops! # - Wire DI[0-6] to +5V side of reset header # - Wire D0[0-7] (open collector) to +5 side of power switch header. # - Wire the CB-7050 ground to moboard ground (send to reset/power headers). # - CB-7050 is presumed to be at address 01 # - CB-7520 RS-232 to RS-485 converter connects to Cyclades TS at 115000 baud. # - DO lines are "open" (0) at power on. Writing 1 connects the line to gnd. # - DI7 is n.c. on the CB-7050. Although plug 7 can be controlled via D07, # power state will always be "unknown" and on/off are effectively toggles. # - [HDAMA] power on delay = 2s, power off delay = 5s. Tune for your moboard. # - This would be cleaner if we could call status_all from off|on scripts. # - This would be cleaner if we had "whileon|whileoff" (no hard coded delays). # specification "cb7050" { timeout 10.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" } script login { send "$01M\r" # verify module name expect "!017050\r" # model 7050 send "$012\r" # verify conf (type,baud,dfmt) expect "!0140..00\r" # type=40 baud=?? dfmt=00 } script status_all { send "$016\r" # read digital I/O status expect "!..(.)(.)00\r" # $1=DI[4-7] $2=DI[0-3] setplugstate "0" $2 on="1|3|5|7|9|B|D|F" off="0|2|4|6|8|A|C|E" setplugstate "1" $2 on="2|3|6|7|A|B|E|F" off="0|1|4|5|8|9|C|D" setplugstate "2" $2 on="4|5|6|7|C|D|E|F" off="0|1|2|3|8|9|A|B" setplugstate "3" $2 on="8|9|A|B|C|D|E|F" off="0|1|2|3|4|5|6|7" setplugstate "4" $1 on="1|3|5|7|9|B|D|F" off="0|2|4|6|8|A|C|E" setplugstate "5" $1 on="2|3|6|7|A|B|E|F" off="0|1|4|5|8|9|C|D" setplugstate "6" $1 on="4|5|6|7|C|D|E|F" off="0|1|2|3|8|9|A|B" setplugstate "7" $1 # set to unknown } script on { send "$016\r" expect "!..(.)(.)00\r" setplugstate "0" $2 on="1|3|5|7|9|B|D|F" off="0|2|4|6|8|A|C|E" setplugstate "1" $2 on="2|3|6|7|A|B|E|F" off="0|1|4|5|8|9|C|D" setplugstate "2" $2 on="4|5|6|7|C|D|E|F" off="0|1|2|3|8|9|A|B" setplugstate "3" $2 on="8|9|A|B|C|D|E|F" off="0|1|2|3|4|5|6|7" setplugstate "4" $1 on="1|3|5|7|9|B|D|F" off="0|2|4|6|8|A|C|E" setplugstate "5" $1 on="2|3|6|7|A|B|E|F" off="0|1|4|5|8|9|C|D" setplugstate "6" $1 on="4|5|6|7|C|D|E|F" off="0|1|2|3|8|9|A|B" setplugstate "7" $1 off="." # set to off ifoff { send "#01A%s01\r" # 0xA0 | bitnum (set) expect ">\r" delay 4 # XXX: tune me for moboard! send "#01A%s00\r" # 0xA0 | bitnum (clear) expect ">\r" } } script off { send "$016\r" expect "!..(.)(.)00\r" setplugstate "0" $2 on="1|3|5|7|9|B|D|F" off="0|2|4|6|8|A|C|E" setplugstate "1" $2 on="2|3|6|7|A|B|E|F" off="0|1|4|5|8|9|C|D" setplugstate "2" $2 on="4|5|6|7|C|D|E|F" off="0|1|2|3|8|9|A|B" setplugstate "3" $2 on="8|9|A|B|C|D|E|F" off="0|1|2|3|4|5|6|7" setplugstate "4" $1 on="1|3|5|7|9|B|D|F" off="0|2|4|6|8|A|C|E" setplugstate "5" $1 on="2|3|6|7|A|B|E|F" off="0|1|4|5|8|9|C|D" setplugstate "6" $1 on="4|5|6|7|C|D|E|F" off="0|1|2|3|8|9|A|B" setplugstate "7" $1 on="." # set to on ifon { send "#01A%s01\r" # 0xA0 | bitnum (set) expect ">\r" delay 5 # XXX tune me for moboard! send "#01A%s00\r" # 0xA0 | bitnum (clear) expect ">\r" } } # XXX Evil hack - short init* to ground on the module and run pm -f to set # baud rate to 115000 (0A). If beacon isn't shorted, this will just time out. # Power cycle the module after the change. script beacon_on { send "%%0101400A00\r" expect "!01\r" } # # TODO: add support for a CB-7018P at address 02 wired to eight # thermocouples for status_temp support? # } powerman-2.3.5.orig/etc/ipmipower.dev0000644000000000000000000000200111172212766014462 0ustar # # $Id: ipmipower.dev 1127 2009-04-17 23:51:18Z garlick $ # # This device configuration supports power control via the # 'ipmipower' utility. # # See powerman-devices(7) for more info on running ipmipower under # powerman. # # some IPMI devices require some time for the firmware to # reload/re-settle itself after a power-off. A delay of 5 seconds # seems to work fine pretty well. # # off,delay,on used in place of IPMI cycle to ensure full command # completion before returning to the user. # specification "ipmipower" { timeout 60 script login { expect "ipmipower> " } script logout { send "quit\n" } script status_all { send "stat\n" foreachnode { expect "([^\n:]+): ([^\n]+)\n" setplugstate $1 $2 on="on" off="off" } expect "ipmipower> " } script on_ranged { send "on %s\n" expect "ipmipower> " } script off_ranged { send "off %s\n" expect "ipmipower> " } script cycle_ranged { send "off %s\n" expect "ipmipower> " delay 5 send "on %s\n" expect "ipmipower> " } } powerman-2.3.5.orig/etc/icebox3.dev0000644000000000000000000000623211052171766014016 0ustar # # $Id: icebox3.dev 1039 2008-08-18 04:00:54Z garlick $ # # Linux Networx ICE Box firmware version 3.x and 4.x on port 1010. # # For 3.0 B70 or better, 2 sec delays in beacon_on/beacon_off can be # commented out. # specification "icebox3" { timeout 20 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" } script login { expect "V[34][^\n]*\r\n" send "auth icebox\r\n" expect "OK\r\n" } script logout { send "q\r\n" } script status_all { send "ps *\r\n" expect "N1:([01]) N2:([01]) N3:([01]) N4:([01]) N5:([01]) N6:([01]) N7:([01]) N8:([01]) N9:([01]) N10:([01])[[:space:]]*\r\n" setplugstate "1" $1 off="0" on="1" setplugstate "2" $2 off="0" on="1" setplugstate "3" $3 off="0" on="1" setplugstate "4" $4 off="0" on="1" setplugstate "5" $5 off="0" on="1" setplugstate "6" $6 off="0" on="1" setplugstate "7" $7 off="0" on="1" setplugstate "8" $8 off="0" on="1" setplugstate "9" $9 off="0" on="1" setplugstate "10" $10 off="0" on="1" } # Assumption: v3 implies that "ts" is deprecated in favor of "is" script status_temp_all { send "is *\r\n" expect "N1:([^ ]+) N2:([^ ]+) N3:([^ ]+) N4:([^ ]+) N5:([^ ]+) N6:([^ ]+) N7:([^ ]+) N8:([^ ]+) N9:([^ ]+) N10:([^ ]+) N11:[^ ]+ N12:[^ ]+[[:space:]]*\r\n" setplugstate "1" $1 setplugstate "2" $2 setplugstate "3" $3 setplugstate "4" $4 setplugstate "5" $5 setplugstate "6" $6 setplugstate "7" $7 setplugstate "8" $8 setplugstate "9" $9 setplugstate "10" $10 } script status_beacon_all { send "be *\r\n" expect "N1:([A-Z]+) N2:([A-Z]+) N3:([A-Z]+) N4:([A-Z]+) N5:([A-Z]+) N6:([A-Z]+) N7:([A-Z]+) N8:([A-Z]+) N9:([A-Z]+) N10:([A-Z]+) N11:[A-Z]+ N12:[A-Z]+[[:space:]]*\r\n" setplugstate "1" $1 off="OFF" on="ON" setplugstate "2" $2 off="OFF" on="ON" setplugstate "3" $3 off="OFF" on="ON" setplugstate "4" $4 off="OFF" on="ON" setplugstate "5" $5 off="OFF" on="ON" setplugstate "6" $6 off="OFF" on="ON" setplugstate "7" $7 off="OFF" on="ON" setplugstate "8" $8 off="OFF" on="ON" setplugstate "9" $9 off="OFF" on="ON" setplugstate "10" $10 off="OFF" on="ON" } script on { send "ph %s\r\n" expect "OK\r\n" delay 0.7 } script on_all { send "ph *\r\n" expect "OK\r\n" delay 7 } script off { send "pl %s\r\n" expect "OK\r\n" delay 0.7 } script off_all { send "pl *\r\n" expect "OK\r\n" delay 7 } script cycle { send "pl %s\r\n" expect "OK\r\n" delay 4 send "ph %s\r\n" expect "OK\r\n" delay 0.7 } script cycle_all { send "pl *\r\n" expect "OK\r\n" delay 9 send "ph *\r\n" expect "OK\r\n" delay 7 } script reset { send "rp %s\r\n" expect "OK\r\n" delay 0.7 } script reset_all { send "rp *\r\n" expect "OK\r\n" delay 7 } script beacon_on { send "be %s on\r\n" expect "OK\r\n" delay 2 } script beacon_off { send "be %s off\r\n" expect "OK\r\n" delay 2 } } powerman-2.3.5.orig/etc/apcnew.dev0000644000000000000000000000674611015104475013741 0ustar # # $Id: apcnew.dev 866 2008-05-21 20:42:37Z garlick $ # # APC MasterSwitch Plus # # Firmware rev may not be the best indicator of whether you need "apc" # or "apcnew" scripts. We have two data points for "apcnew": # # - Firmware: APP v2.2.0 / AOS v3.0.3 # - Firmware: APP v2.0.2 / AOS v2.5.3 # specification "apcnew" { timeout 10 plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { expect "\n" expect "User Name : " send "apc\r\n" expect "Password : " send "apc\r\n" expect "> " send "1\r\n" # device manager menu expect "> " } script logout { send "\033\r\n" } script status_all { send "\r\n" # refresh foreachplug { expect "([0-9]+)-[^\n]*(ON|OFF)[^\n]*\r\n" setplugstate $1 $2 on="ON" off="OFF" } expect "> " } script on { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script on_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script off { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script off_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } # If outlet is initially off, "immediate reboot" (4) will leave it off. # This doesn't match PowerMan's semantics for cycle, therefore do explicit # immediate off + immediate on. script cycle { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script cycle_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "8\r\n" # cancel any pending delays expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Command successfully issued.\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } } powerman-2.3.5.orig/etc/vpc.dev0000644000000000000000000000432711115104225013237 0ustar # # $Id: vpc.dev 1093 2008-12-02 01:00:05Z garlick $ # specification "vpc" { timeout 5.0 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { send "login\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script logout { send "logoff\n" expect "[0-9]* OK\n" } script status_all { send "stat *\n" foreachplug { expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script on { send "on %s\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script on_all { send "on *\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script off { send "off %s\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script off_all { send "off *\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script cycle { send "off %s\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " delay 1.0 send "on %s\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script cycle_all { send "off *\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " delay 1.0 send "on *\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script beacon_on { send "flash %s\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script beacon_off { send "unflash %s\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script status_beacon_all { send "beacon *\n" foreachplug { expect "plug ([0-9]+): (ON|OFF)\n" setplugstate $1 $2 on="ON" off="OFF" } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script status_temp_all { send "temp *\n" foreachplug { expect "plug ([0-9]+): ([0-9]+)\n" setplugstate $1 $2 } expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script reset_all { send "reset *\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } script reset { send "reset %s\n" expect "[0-9]* OK\n" expect "[0-9]* vpc> " } } powerman-2.3.5.orig/etc/baytech.dev0000644000000000000000000000316511015104475014073 0ustar # # $Id: baytech.dev 866 2008-05-21 20:42:37Z garlick $ # # Baytech RPC-3 - old style model (not "NC") # # Tested the following firmware versions: # Revision F 5.00, (C) 2001 # Revision F 5.01, (C) 2001 # Assumes: # 1. command confirmation : disabled (3/configuration, 6/outlets, 2/...) # 2. admin account password : "baytech" (2/manage users, 2/admin, 1/...) # 3. net: prompt for password : enabled (3/configuration, 5/access, 2/...) # Note: prompt is not returned until device is ready to accept another commmand # specification "baytech" { timeout 10 # about 5 sec for cycle command pingperiod 90 plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script ping { send "\r\n" expect ">" } script login { expect "\n" expect "Enter password>" send "baytech\r\n" expect "Enter Selection>" send "1\r\n" expect ">" } script logout { send "menu\r\n" expect "Enter Selection>" send "6\r\n" } script status_all { send "status\r\n" expect "Circuit Breaker:[^\n]*\r\n" foreachplug { expect "([0-9]+)[ ]+(On|Off)" setplugstate $1 $2 on="On" off="Off" } expect ">" } script on { send "on %s\r\n" expect ">" } script on_all { send "on 0\r\n" expect ">" } script off { send "off %s\r\n" expect ">" } script off_all { send "off 0\r\n" expect ">" } # If outlet is initially off, "reboot" will leave it off. # This doesn't match PowerMan's semantics for cycle, so explicitly power # off then on. script cycle { send "off %s\r\n" expect ">" delay 4 send "on %s\r\n" expect ">" } script cycle_all { send "off 0\r\n" expect ">" delay 4 send "on 0\r\n" expect ">" } } powerman-2.3.5.orig/etc/baytech-rpc3-nc.dev0000644000000000000000000000317211163732064015341 0ustar # # $Id: baytech-rpc3-nc.dev 1123 2009-03-29 17:47:32Z garlick $ # # Baytech RPC3-20NC # # Tested the following firmware versions: # RPC3-NC Series (C) 2002 by BayTech F4.00 # RPC-3/4(A)DE Series (C) 2004 BayTech F1.08 # RPC-3/4(A)DE Series (C) 2004 BayTech F1.09 # # Note: # Type ";;;;;" to access "network interface module". # Prompt is not returned until device is ready to accept another commmand. # # Assumes: # Command confirmation : disabled # Status menu : disabled # No access control # No idle timeout # No active restore (causes disconnections) # specification "baytech-rpc3-nc" { timeout 10 # about 5 sec for cycle command plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { send "\r\n" expect ">" } script logout { send "exit\r\n" } script status_all { # XXX this works around bug where foreachplug # counter doesn't reset when script restarts after reconnect send "\r\n" expect ">" # XXX end workaround send "status\r\n" foreachplug { expect "Outlet ([0-9]+)[^:0-9]+: (On|Off)" setplugstate $1 $2 on="On" off="Off" } expect ">" } script on { send "on %s\r\n" expect ">" } script on_all { send "on 0\r\n" expect ">" } script off { send "off %s\r\n" expect ">" } script off_all { send "off 0\r\n" expect ">" } # If outlet is initially off, "reboot" will leave it off. # This doesn't match PowerMan's semantics for cycle, so explicitly power # off then on. script cycle { send "off %s\r\n" expect ">" delay 4 send "on %s\r\n" expect ">" } script cycle_all { send "off 0\r\n" expect ">" delay 4 send "on 0\r\n" expect ">" } } powerman-2.3.5.orig/etc/ipmi.dev0000644000000000000000000000253311015104475013410 0ustar # # $Id: ipmi.dev 866 2008-05-21 20:42:37Z garlick $ # # IPMI 1.5 in terminal mode # Tested on Intel SE7501WV2 motherboard over serial. # On this motherboard, the System Setup Utility is used to switch # the BMC into terminal mode. # # References: # "IPMI over Cyclades TS2000", M.P. Anand Babu # "IPMI 1.5 Reference Guide", 13.7.8 Terminal Mode ASCII Text Commands (p.175) # http://www.intel.com/design/servers/ipmi/ # http://www.intel.com/design/servers/ipmi/spec.htm # # specification "ipmi" { timeout 10 plug name { "1" } script login { send "\033(" expect "\\[TMODE OK\\]\r\n" send "[SYS PWD -N]\r" # null password/username expect "\\[OK\\]\r\n" } script logout { send "[SYS PWD -X]\r" } script status { send "[SYS HEALTH QUERY]\r" expect "\\[OK PWR:(ON|OFF|SLP|S4|S3|S2|S1).*\\]\r\n" setplugstate "1" $1 on="ON" off="OFF|SLP|S4|S3|S2|S1" } script on { send "[SYS POWER ON]\r" expect "\\[OK\\]\r\n" } script off { send "[SYS POWER OFF]\r" expect "\\[OK\\]\r\n" } script reset { send "[SYS RESET]\r" expect "\\[OK\\]\r\n" } script cycle { send "[SYS POWER OFF]\r" expect "\\[OK\\]\r\n" delay 4 send "[SYS POWER ON]\r" expect "\\[OK\\]\r\n" } script status_temp { send "[SYS HEALTH QUERY]\r" expect "\\[OK PWR:[^ ]* H:.. T:(ok|nc|cr|nr|uf).*\\]\r\n" setplugstate "1" $1 } } powerman-2.3.5.orig/etc/cyclades-pm42.dev0000644000000000000000000000272111073767566015044 0ustar # # Cyclades PM42 # specification "pm42" { timeout 10 pingperiod 60 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" } script login { expect "Username: " send "admin\n" expect "Password: " send "pm8\n" expect "pm>" } script ping { send "\n" expect "pm>" } script status_all { send "status 1-42\n" expect "Users" foreachplug { expect "([0-9]+)[[:space:]]+Unlocked (ON|OFF)" setplugstate $1 $2 on="ON" off="OFF" } expect "pm>" } script on { send "on %s\n" expect "Outlet turned on." expect "pm>" } script on_all { send "on 1-42\n" foreachplug { expect "Outlet turned on." } expect "pm>" } script off { send "off %s\n" expect "Outlet turned off." expect "pm>" } script off_all { send "off 1-42\n" foreachplug { expect "Outlet turned off." } expect "pm>" } script cycle { send "off %s\n" expect "Outlet turned off." expect "pm>" delay 4 send "on %s\n" expect "Outlet turned on." expect "pm>" } script cycle_all { send "off 1-42\n" foreachplug { expect "Outlet turned off." } expect "pm>" delay 4 send "on 1-42\n" foreachplug { expect "Outlet turned on." } expect "pm>" } } powerman-2.3.5.orig/etc/baytech-rpc28-nc.dev0000644000000000000000000000320311024474337015425 0ustar # # $Id: baytech-rpc28-nc.dev 964 2008-06-13 13:40:47Z garlick $ # # Baytech RPC28-30NC # # Default config, then disable confirmation, and disable status menu. # # Firmware version: F3.01 (C) 2000 # # Maybe it is accumulated serial noise or some other issue, but this # model seems to require a little handshake: # send "\r\n" # expect ".*RPC-28[A]*>" # before each command to avoid dropping the command. # specification "baytech-rpc28-nc" { timeout 10 # about 5 sec for cycle command plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" } script login { send "\r\n" expect ".*RPC-28[A]*>" } script logout { send "\r\n" expect ".*RPC-28[A]*>" send "exit\r\n" } script status_all { send "\r\n" expect ".*RPC-28[A]*>" send "status\r\n" foreachplug { expect "Outlet[ ]+([0-9]+)[^:0-9]+: (On|Off)" setplugstate $1 $2 on="On" off="Off" } expect "RPC-28[A]*>" } script on { send "\r\n" expect ".*RPC-28[A]*>" send "on %s\r\n" expect "RPC-28[A]*>" } script on_all { send "\r\n" expect ".*RPC-28[A]*>" send "on 0\r\n" expect "RPC-28[A]*>" } script off { send "\r\n" expect ".*RPC-28[A]*>" send "off %s\r\n" expect "RPC-28[A]*>" } script off_all { send "\r\n" expect ".*RPC-28[A]*>" send "off 0\r\n" expect "RPC-28[A]*>" } script cycle { send "\r\n" expect ".*RPC-28[A]*>" send "off %s\r\n" expect "RPC-28[A]*>" delay 4 send "on %s\r\n" expect "RPC-28[A]*>" } script cycle_all { send "\r\n" expect ".*RPC-28[A]*>" send "off 0\r\n" expect "RPC-28[A]*>" delay 4 send "on 0\r\n" expect "RPC-28[A]*>" } } powerman-2.3.5.orig/etc/hpmp.dev0000644000000000000000000000256511164522265013431 0ustar # HP Management Processor device (MP) # a.k.a. Integrated Lights-Out HP Integrity # # (c) Copyright 2009 Hewlett-Packard Development Company, L.P. # Bjorn Helgaas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # Example: # device "rx3600-001" "hpmp" "rx3600-001-mp.test:23" # node "rx3600-001" "rx3600-001" # # Tested on: # rx3600 (MP firmware F.01.41) # rx1600 (MP firmware E.03.30) # rx1620 (MP firmware E.03.30) specification "hpmp" { timeout 10 plug name { "1" } script login { expect "MP login: " send "Admin\r\n" expect "MP password: " send "Admin\r\n" expect "MP> " send "cm\r\n" expect "MP:CM> " } script status { send "ps\r\n" expect "System Power state[^O]+(On|Off)" setplugstate "1" $1 on="On" off="Off" expect "MP:CM> " } script on { send "pc -on -nc\r\n" expect "MP:CM> " } script off { send "pc -off -nc\r\n" expect "MP:CM> " } script reset { send "rs -nc\r\n" expect "MP:CM> " } script status_beacon { send "loc -nc\r\n" expect "Current -> Locator LED (On|Off)" setplugstate "1" $1 on="On" off="Off" expect "MP:CM> " } script beacon_on { send "loc -on -nc\r\n" expect "MP:CM> " } script beacon_off { send "loc -off -nc\r\n" expect "MP:CM> " } } powerman-2.3.5.orig/etc/icebox.dev0000644000000000000000000000372611052171766013740 0ustar # # $Id: icebox.dev 1039 2008-08-18 04:00:54Z garlick $ # # Linux Networx ICE box firmware version 2.x on port 1010. # specification "icebox" { timeout 20 # accomodate 14 sec plus "cycle *" time */ plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" } script login { expect "V2[^\n]*\r\n" send "auth icebox\r\n" expect "OK\r\n" } script logout { send "q\r\n" } script status_all { send "ps *\r\n" expect "N1:([01]) N2:([01]) N3:([01]) N4:([01]) N5:([01]) N6:([01]) N7:([01]) N8:([01]) N9:([01]) N10:([01])[[:space:]]*\r\n" setplugstate "1" $1 off="0" on="1" setplugstate "2" $2 off="0" on="1" setplugstate "3" $3 off="0" on="1" setplugstate "4" $4 off="0" on="1" setplugstate "5" $5 off="0" on="1" setplugstate "6" $6 off="0" on="1" setplugstate "7" $7 off="0" on="1" setplugstate "8" $8 off="0" on="1" setplugstate "9" $9 off="0" on="1" setplugstate "10" $10 off="0" on="1" } script status_temp_all { send "ts *\r\n" expect "N1:([0-9,]+) N2:([0-9,]+) N3:([0-9,]+) N4:([0-9,]+) N5:([0-9,]+) N6:([0-9,]+) N7:([0-9,]+) N8:([0-9,]+) N9:([0-9,]+) N10:([0-9,]+) N11:[0-9,]+ N12:[0-9,]+[[:space:]]*\r\n" setplugstate "1" $1 setplugstate "2" $2 setplugstate "3" $3 setplugstate "4" $4 setplugstate "5" $5 setplugstate "6" $6 setplugstate "7" $7 setplugstate "8" $8 setplugstate "9" $9 setplugstate "10" $10 } script on { send "ph %s\r\n" expect "OK\r\n" delay 0.7 } script on_all { send "ph *\r\n" expect "OK\r\n" delay 7 } script off { send "pl %s\r\n" expect "OK\r\n" delay 0.7 } script off_all { send "pl *\r\n" expect "OK\r\n" delay 7 } script cycle { send "pl %s\r\n" expect "OK\r\n" delay 4 send "ph %s\r\n" expect "OK\r\n" delay 0.7 } script cycle_all { send "pl *\r\n" expect "OK\r\n" delay 9 send "ph *\r\n" expect "OK\r\n" delay 7 } script reset { send "rp %s\r\n" expect "OK\r\n" delay 0.7 } script reset_all { send "rp *\r\n" expect "OK\r\n" delay 7 } } powerman-2.3.5.orig/etc/hp3488.dev0000644000000000000000000000137211052145100013377 0ustar # # HP3488 switch/control unit using 'hp3488' utility from gpib-utils project. # # device "hp0" "hp3488" "/usr/bin/hp3488 --shell|&" # # "Plug" names for this device are three digit values consisting of # a single digit slot number (1-5) followed by two digit channel number. # specification "hp3488" { timeout 5 script login { expect "hp3488> " } script logout { send "quit\n" } script status { send "query %s\n" expect "([1-5][0-9]{2}): ([01])\n" setplugstate $1 $2 off="0" on="1" expect "hp3488> " } script on_ranged { send "on %s\n" expect "hp3488> " } script off_ranged { send "off %s\n" expect "hp3488> " } script cycle_ranged { send "off %s\n" expect "hp3488> " delay 4 send "on %s\n" expect "hp3488> " } } powerman-2.3.5.orig/etc/hpmpdome.dev0000644000000000000000000000360311164522265014270 0ustar # HP Management Processor device (MP) for high-end cellular systems # # (c) Copyright 2009 Hewlett-Packard Development Company, L.P. # Bjorn Helgaas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # Example: # device "sd-001" "hpmpdome" "sd-001-mp.test:23" # node "sd-001-p0" "sd-001" "0" # # Tested on: # SD64B (MP firmware 26.5.1) # # This handles each partition separately. The "plug" argument to node is the # partition number. # # N.B. This only works on Superdomes, not mid-range cellular systems. specification "hpmpdome" { timeout 10 script login { expect "MP login: " send "Admin\r\n" expect "MP password: " send "Admin\r\n" expect "MP> " send "cm\r\n" expect "MP:CM> " } script status { send "pe\r\n" expect "Select Device: " send "p\r\n" expect "Select a partition number: " send "%s\r\n" expect "The power state is (ON|OFF)" setplugstate $1 on="ON" off="OFF" expect "In what state do you want the power.*\? " send "q\r\n" expect "MP:CM> " } script on { send "pe\r\n" expect "Select Device: " send "p\r\n" expect "Select a partition number: " send "%s\r\n" expect "The power state is (ON|OFF)" setplugstate $1 on="ON" off="OFF" expect "In what state do you want the power.*\? " send "on\r\n" expect "MP:CM> " } script off { send "pe\r\n" expect "Select Device: " send "p\r\n" expect "Select a partition number: " send "%s\r\n" expect "The power state is (ON|OFF)" setplugstate $1 on="ON" off="OFF" expect "In what state do you want the power.*\? " send "off\r\n" expect "MP:CM> " } script reset { send "rs\r\n" expect "Select a partition number: " send "%s\r\n" expect "Do you want to reset partition number.*\? " send "y\r\n" expect "MP:CM> " } } powerman-2.3.5.orig/etc/cyclades-pm10.dev0000644000000000000000000000301611104074331015005 0ustar # # Cyclades PM10 # specification "pm10" { timeout 10 pingperiod 60 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" } script login { expect "Username: " send "admin\n" expect "Password: " send "pm8\n" expect "pm>" } script ping { send "\n" expect "pm>" } script status_all { send "status 1-10\n" expect "Users" foreachplug { expect "([0-9]+)[[:space:]]+Unlocked (ON|OFF)" setplugstate $1 $2 on="ON" off="OFF" } expect "pm>" } script on { send "on %s\n" expect "Outlet turned on." expect "pm>" } script on_all { send "on 1-10\n" foreachplug { expect "Outlet turned on." } expect "pm>" } script off { send "off %s\n" expect "Outlet turned off." expect "pm>" } script off_all { send "off 1-10\n" foreachplug { expect "Outlet turned off." } expect "pm>" } script cycle { send "off %s\n" expect "Outlet turned off." expect "pm>" delay 4 send "on %s\n" expect "Outlet turned on." expect "pm>" } script cycle_all { send "off 1-10\n" foreachplug { expect "Outlet turned off." } expect "pm>" delay 4 send "on 1-10\n" foreachplug { expect "Outlet turned on." } expect "pm>" } script status_temp_all { send "temperature\n" expect "IPDU #1: Temperature: ([0-9.]+)" setplugstate "1" $1 setplugstate "2" $1 setplugstate "3" $1 setplugstate "4" $1 setplugstate "5" $1 setplugstate "6" $1 setplugstate "7" $1 setplugstate "8" $1 setplugstate "9" $1 setplugstate "10" $1 } } powerman-2.3.5.orig/etc/apc7900.dev0000644000000000000000000000744011015104475013537 0ustar # # $Id:$ # # Written by Martin K. Petersen # Based upon apcpdc.dev by Trent D'Hooge and Makia Minich # # APC MasterSwitch AP7900 (and most likely AP7901, AP7920 & AP7921) # - Firmware: APP v2.7.3 / AOS v2.7.0 # specification "apc7900" { timeout 10 plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { expect "\rUser Name : " send "apc\r\n" expect "\rPassword : " send "apc\r\n" expect "> " send "1\r\n" # device manager menu expect "> " send "3\r\n" # outlet control/configuration expect "> " } script logout { send "\033" expect "> " send "\033" expect "> " send "4\r\n" } script status_all { send "\r\n" # refresh foreachplug { expect "([0-9]+)-[^\n]*(ON|OFF)[^\n]*\r\n" setplugstate $1 $2 on="ON" off="OFF" } expect "> " } script on { send "%s\r\n" expect "> " send "1\r\n" # select control outlet expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "1\r\n" # immediate on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" send "\r\n" expect "> " } script on_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "4\r\n" # delayed on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" send "\r\n" expect "> " } script off { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "2\r\n" # immediate off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" send "\r\n" expect "> " } script off_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "5\r\n" # delayed off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" send "\r\n" expect "> " } # If outlet is initially off, "immediate reboot" (4) will leave it off. # This doesn't match PowerMan's semantics for cycle, therefore do explicit # immediate off + immediate on. script cycle { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "2\r\n" # immediate off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" send "\r\n" } script cycle_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "5\r\n" # delayed off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " delay 4 send "4\r\n" # delayed on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" send "\r\n" expect "> " } } powerman-2.3.5.orig/etc/Makefile.am0000644000000000000000000000264411164522265014017 0ustar ##***************************************************************************** ## $Id: Makefile.am,v 1.4 2005/07/27 00:03:37 achu Exp $ ##***************************************************************************** ## Process this file with automake to produce Makefile.in. ##***************************************************************************** CONFFILE = \ powerman.conf.example DEVFILES = \ apc7900.dev \ apc.dev \ apcnew.dev \ apcold.dev \ apcpdu3.dev \ apcpdu.dev \ bashfun.dev \ baytech.dev \ baytech-rpc28-nc.dev \ baytech-rpc3-nc.dev \ cb-7050.dev \ cyclades-pm8.dev \ cyclades-pm10.dev \ cyclades-pm20.dev \ cyclades-pm42.dev \ dli.dev \ hp3488.dev \ hpilo.dev \ hpmp.dev \ hpmpblade.dev \ hpmpcell.dev \ hpmpdome.dev \ ibmbladecenter.dev \ icebox.dev \ icebox3.dev \ ics8064.dev \ ilom.dev \ lom.dev \ ipmi.dev \ ipmipower.dev \ phantom.dev \ plmpower.dev \ powerman.dev \ swpdu.dev \ vpc.dev \ wti.dev \ wti-rps10.dev install-data-local: -$(top_srcdir)/config/install-sh -m 755 -d \ $(DESTDIR)$(sysconfdir)/powerman for file in $(DEVFILES); do \ $(top_srcdir)/config/install-sh -m 644 \ $(srcdir)/$$file $(DESTDIR)$(sysconfdir)/powerman; \ done test -f $(DESTDIR)$(sysconfdir)/powerman/$(CONFFILE) || \ $(top_srcdir)/config/install-sh -m 644 \ $(srcdir)/$(CONFFILE) $(DESTDIR)$(sysconfdir)/powerman/$(CONFFILE) EXTRA_DIST = $(DEVFILES) $(CONFFILE) powerman-2.3.5.orig/etc/powerman.conf.example0000644000000000000000000000766111172212766016121 0ustar # Example powerman.conf file - see powerman.conf(1) # Uncomment to enable TCP wrappers #tcpwrappers yes # Uncomment to listen on all ports (default is 127.0.0.1:10101) #listen "0.0.0.0:10101" # Include device specifications for power controllers #include "/etc/powerman/apc7900.dev" #include "/etc/powerman/apc.dev" #include "/etc/powerman/apcnew.dev" #include "/etc/powerman/apcold.dev" #include "/etc/powerman/apcpdu3.dev" #include "/etc/powerman/apcpdu.dev" #include "/etc/powerman/bashfun.dev" #include "/etc/powerman/baytech.dev" #include "/etc/powerman/baytech-rpc28-nc.dev" #include "/etc/powerman/baytech-rpc3-nc.dev" #include "/etc/powerman/cb-7050.dev" #include "/etc/powerman/cyclades-pm10.dev" #include "/etc/powerman/cyclades-pm20.dev" #include "/etc/powerman/cyclades-pm42.dev" #include "/etc/powerman/cyclades-pm8.dev" #include "/etc/powerman/dli.dev" #include "/etc/powerman/hp3488.dev" #include "/etc/powerman/hpilo.dev" #include "/etc/powerman/hpmpblade.dev" #include "/etc/powerman/hpmpcell.dev" #include "/etc/powerman/hpmp.dev" #include "/etc/powerman/hpmpdome.dev" #include "/etc/powerman/ibmbladecenter.dev" #include "/etc/powerman/icebox3.dev" #include "/etc/powerman/icebox.dev" #include "/etc/powerman/ics8064.dev" #include "/etc/powerman/ilom.dev" #include "/etc/powerman/ipmi.dev" #include "/etc/powerman/ipmipower.dev" #include "/etc/powerman/lom.dev" #include "/etc/powerman/phantom.dev" #include "/etc/powerman/plmpower.dev" #include "/etc/powerman/powerman.dev" #include "/etc/powerman/swpdu.dev" #include "/etc/powerman/wti.dev" #include "/etc/powerman/wti-rps10.dev" # Define devices (instances of power controllers) # - Network-attached devices use the form: # device "name" "type" "host:port" # - Serial-attached devices use the form # device "name" "type" "special file" "flags" # where "flags" specifies baud and parms such as "9600,8n1" # - Devices that are accessed via coprocesses use the form # device "name" "type" "executable-path [args...] |&" # - The "name" field should be unique, and will be referenced in node defs. # - The "type" field should match the quoted string at the beginning of # the device specification. #device "b1" "baytech-rpc28-nc" "cyclades1:7032" #device "b2" "baytech-rpc28-nc" "cyclades1:7016" #device "b3" "baytech-rpc28-nc" "/usr/bin/conman -j -Q b3 |&" #device "b4" "baytech-rpc3-nc" "baytech4:23" #device "lpc" "dli" "/usr/sbin/httppower -u http://192.168.0.100 |&" #device "plm" "plmpower" "/usr/sbin/plmpower -d /dev/ttyS1 |&" #device "wti1" "wti-rps10" "/dev/ttyS0" "9600,8n1" #device "wti2" "wti-rps10" "/dev/ttyS2" "9600,8n1" #device "ipmi1" "ipmipower" "/usr/sbin/ipmipower -AgG -h py[0-10] |&" # Define nodes (the entities you turn on and off with powerman) # - The longhand form is one line per node like this: # node "node" "device" "plug" # where "node" is the name you will use to refer to the node, # "device" refers to the name you assigned above to the device the # node is plugged into, and "plug" is the (device specific) plug identifier # defined in the "plug name" portion of the device specification or # otherwise following the pattern expected by that device. # - It is possible to use hostranges to map ranges of nodes to ranges # of plugs as follows: # node "noderange" "device" "plugrange" # - And if you just want to assign all the plugs in order, you can drop # the plug range: # node "noderange" "device" #node "t1" "b1" "4" # first four plugs of 'b1' wired backwards #node "t2" "b1" "3" #node "t3" "b1" "2" #node "t4" "b1" "1" #node "t[5-20]" "b1" "[5-20]" #node "t[21-40]" "b2" #node "t[41-60]" "b3" #node "x[1-8]" "lpc" #node "y[0-10]" "ipmi1" "py[0-10]" #node "porchlight" "plm" "A4.02.B3" #node "kitchen" "plm" "A4.97.44" #node "lamp" "plm" "G13" # Aliases can be used to make new names for plugs, or to have one name # refer to redundant power supplies. #node "jimmy-ps1" "wti1" "7" #node "jimmy-ps2" "wti2" "7" #alias "jimmy" "jimmy-ps[1-2]" powerman-2.3.5.orig/etc/wti.dev0000644000000000000000000000227310263562616013267 0ustar # # $Id: wti.dev 705 2005-07-08 20:43:58Z garlick $ # # WTI NPS # # Tested the following firmware versions: # v3.02 # Assumes: # 1. password: "wti" (/g general parms, 1 system passwd) # 3. command confirmation: off (/g general parms, 8 command confirmation) # 4. disconnect timeout: set to max (30 min) # Note: prompt is not returned until device is ready to accept another command # specification "wti" { timeout 30 # "/boot *" command takes about 20 sec plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { expect "\n" expect "word: " send "wti\r\n" expect "NPS> " } script logout { send "/x\r\n" } script status_all { send "/s\r\n" expect "Default" expect "\\+\r\n" foreachplug { expect " ([0-9]+)[^\n]*(ON|OFF)[^\n]*(ON|OFF)[^\n]*\r\n" setplugstate $1 $2 off="OFF" on="ON" } expect "\\+\r\n" expect "NPS> " } script on { send "/on %s\r\n" expect "NPS> " } script on_all { send "/on *\r\n" expect "NPS> " } script off { send "/off %s\r\n" expect "NPS> " } script off_all { send "/off *\r\n" expect "NPS> " } script cycle { send "/boot %s\r\n" expect "NPS> " } script cycle_all { send "/boot *\r\n" expect "NPS> " } } powerman-2.3.5.orig/etc/cyclades-pm20.dev0000644000000000000000000000344711104074331015016 0ustar # # Cyclades PM20 # specification "pm20" { timeout 25 pingperiod 60 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" } script login { expect "Username: " send "admin\n" expect "Password: " send "pm8\n" expect "pm>" } script ping { send "\n" expect "pm>" } script status_all { send "status 1-20\n" expect "Users" foreachplug { expect "([0-9]+)[[:space:]]+Unlocked (ON|OFF)" setplugstate $1 $2 on="ON" off="OFF" } expect "pm>" } script on { send "on %s\n" expect "Outlet turned on." expect "pm>" } script on_all { send "on 1-20\n" foreachplug { expect "Outlet turned on." } expect "pm>" } script off { send "off %s\n" expect "Outlet turned off." expect "pm>" } script off_all { send "off 1-20\n" foreachplug { expect "Outlet turned off." } expect "pm>" } script cycle { send "off %s\n" expect "Outlet turned off." expect "pm>" delay 4 send "on %s\n" expect "Outlet turned on." expect "pm>" } script cycle_all { send "off 1-20\n" foreachplug { expect "Outlet turned off." } expect "pm>" delay 4 send "on 1-20\n" foreachplug { expect "Outlet turned on." } expect "pm>" } script status_temp_all { send "temperature\n" expect "IPDU #1: Temperature: ([0-9.]+)" setplugstate "1" $1 setplugstate "2" $1 setplugstate "3" $1 setplugstate "4" $1 setplugstate "5" $1 setplugstate "6" $1 setplugstate "7" $1 setplugstate "8" $1 setplugstate "9" $1 setplugstate "10" $1 setplugstate "11" $1 setplugstate "12" $1 setplugstate "13" $1 setplugstate "14" $1 setplugstate "15" $1 setplugstate "16" $1 setplugstate "17" $1 setplugstate "18" $1 setplugstate "19" $1 setplugstate "20" $1 } } powerman-2.3.5.orig/etc/phantom.dev0000644000000000000000000000230111042726422014113 0ustar # # Rackable Phantom v3 and v4. # specification "phantom" { timeout 15.0 plug name { "1" } script login { send "\036\035" # enter "shell mode" expect "ok\r" } script status { send "P?" expect "(0|1)\r" setplugstate "1" $1 on="1" off="0" } script on { send "P?" expect "(0|1)\r" setplugstate "1" $1 on="1" off="0" ifoff { send "PT" expect "ok\r" } } script off { send "P?" expect "(0|1)\r" setplugstate "1" $1 on="1" off="0" ifon { send "PT" expect "ok\r" } } script cycle { send "P?" expect "(0|1)\r" setplugstate "1" $1 on="1" off="0" ifon { send "PT" expect "ok\r" delay 4 } send "PT" expect "ok\r" } script beacon_on { send "L1" # LED on expect "ok\r" send "B1" # blink LED expect "ok\r" } script beacon_off { send "L0" # LED off expect "ok\r" send "B0" # unblink LED expect "ok\r" } script status_beacon { send "L?" # get LED status 1=on, 0=off, B=blink expect "(0|1|B)\r" setplugstate "1" $1 on="(B|1)" off="0" } # N.B. phantom 3 requires probe #, phantom 4 ignores it script status_temp { send "T0" # get temp probe 0 expect "([0-9]+)\r" # value is 8-bit Celcius setplugstate "1" $1 } } powerman-2.3.5.orig/etc/apcpdu.dev0000644000000000000000000001045111025537517013734 0ustar # # $Id:$ # # Written by Trent D'Hooge and Makia Minich # # Should support the following 24-plug APC Switched Rack PDU models: # AP7930, AP7932 # AP7940, AP7941 # AP7960, AP7961, AP7968, AP7990, AP7991, AP7998 # AP7951, AP7952, AP7953, AP7954 # # - Firmware: APP v2.6.5 / AOS v2.6.4 # specification "apcpdu" { timeout 10 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" } script login { expect "\n" expect "\rUser Name : " send "apc\r\n" expect "\rPassword : " send "apc\r\n" expect "> " send "1\r\n" # device manager menu expect "> " send "3\r\n" # outlet control/configuration expect "to continue..." send "\r\n" expect "> " } script logout { send "\033" expect "> " send "\033" expect "> " send "4\r\n" } script status_all { send "\r\n" # refresh send "\r\n" # to continue... (after plug 22) foreachplug { expect "([0-9])*[^\r\n]*(ON|OFF)\r\n" setplugstate $1 $2 on="ON" off="OFF" } expect "> " } script on { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "1\r\n" # immediate on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } script on_all { send "25\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "4\r\n" # delayed on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } script off { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "2\r\n" # immediate off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } script off_all { send "25\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "5\r\n" # delayed off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } # If outlet is initially off, "immediate reboot" (4) will leave it off. # This doesn't match PowerMan's semantics for cycle, therefore do explicit # immediate off + immediate on. script cycle { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "2\r\n" # immediate off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" } script cycle_all { send "25\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "5\r\n" # delayed off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " delay 4 send "4\r\n" # delayed on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } } powerman-2.3.5.orig/etc/hpmpcell.dev0000644000000000000000000000410011164522265014254 0ustar # HP Management Processor device (MP) for mid-range cellular systems # # (c) Copyright 2009 Hewlett-Packard Development Company, L.P. # Bjorn Helgaas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # Example: # device "rx8620-001" "hpmpcell" "rx8620-001-mp.test:23" # node "rx8620-001-p0" "rx8620-001" "0" # # Tested on: # rx8620 (MP firmware A.7.008, A.8.005) # # This handles each partition separately. The "plug" argument to node is the # partition number. # # N.B. This only works on mid-range, e.g., rx7620, rx7640, rx8620, and rx8640. # It doesn't handle Superdome because Superdome uses "P" to select partition, # not "R". It should support PA-RISC systems, e.g., rp7620, rp7640, etc. specification "hpmpcell" { timeout 10 script login { expect "MP login: " send "Admin\r\n" expect "MP password: " send "Admin\r\n" expect "MP> " send "cm\r\n" expect "MP:CM> " } script status { send "pe\r\n" expect "Select Device: " send "r\r\n" expect "Select a partition number: " send "%s\r\n" expect "The power state is (ON|OFF)" setplugstate $1 on="ON" off="OFF" expect "In what state do you want the power.*\? " send "q\r\n" expect "MP:CM> " } script on { send "pe\r\n" expect "Select Device: " send "r\r\n" expect "Select a partition number: " send "%s\r\n" expect "The power state is (ON|OFF)" setplugstate $1 on="ON" off="OFF" expect "In what state do you want the power.*\? " send "on\r\n" expect "MP:CM> " } script off { send "pe\r\n" expect "Select Device: " send "r\r\n" expect "Select a partition number: " send "%s\r\n" expect "The power state is (ON|OFF)" setplugstate $1 on="ON" off="OFF" expect "In what state do you want the power.*\? " send "off\r\n" expect "MP:CM> " } script reset { send "rs\r\n" expect "Select a partition number: " send "%s\r\n" expect "Do you want to reset partition number.*\? " send "y\r\n" expect "MP:CM> " } } powerman-2.3.5.orig/etc/apcold.dev0000644000000000000000000000666411015104475013725 0ustar # # $Id:$ # # apparently there is an apc interface older than "apc.dev" # # This talks to: # # Model Number : AP9210 Serial Number : WA9903036579 # Firmware Revision : v1.1.1 Hardware Revision : C4 # Manufacture Date : 01/14/1999 # # specification "apcold" { timeout 10 plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { expect "\n" expect "User Name : " send "apc\r\n" expect "Password : " send "apc\r\n" expect "> " send "1\r\n" # outlet manager menu expect "> " } script logout { send "\033" # ESC back to control console menu expect "> " send "4\r\n" } script status_all { send "9\r\n" # master/pdu control expect "> " send "1\r\n" # control of master pdu foreachplug { expect "([1-8]+):(ON|OFF)[^\n]*\r\n" setplugstate $1 $2 on="ON" off="OFF" } expect "> " send "\033" # ESC back to master/pdu expect "> " send "\033" # ESC back to outlet manager menu expect "> " } script on { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " send "\033" # ESC back to outlet expect "> " send "\033" # ESC back to outlet manager expect "> " } script on_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script off { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script off_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } # If outlet is initially off, "immediate reboot" (4) will leave it off. # This doesn't match PowerMan's semantics for cycle, therefore do explicit # immediate off + immediate on. script cycle { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script cycle_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "2\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "successfully!\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } } powerman-2.3.5.orig/etc/ics8064.dev0000644000000000000000000000324411052145100013541 0ustar # # ICS 8064 16-port relay box using 'ics8064' utility from gpib-utils project. # # "/usr/bin/ics8064 --shell|&" # # Remember to run: # ics8064 --comm-timeout=0 # ics8064 --commit-config # specification "ics8064" { timeout 5 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" } script login { expect "ics8064> " } script logout { send "quit\n" } script status_all { send "status\n" expect "([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01]), ([01])\n" setplugstate "1" $1 off="0" on="1" setplugstate "2" $2 off="0" on="1" setplugstate "3" $3 off="0" on="1" setplugstate "4" $4 off="0" on="1" setplugstate "5" $5 off="0" on="1" setplugstate "6" $6 off="0" on="1" setplugstate "7" $7 off="0" on="1" setplugstate "8" $8 off="0" on="1" setplugstate "9" $9 off="0" on="1" setplugstate "10" $10 off="0" on="1" setplugstate "11" $11 off="0" on="1" setplugstate "12" $12 off="0" on="1" setplugstate "13" $13 off="0" on="1" setplugstate "14" $14 off="0" on="1" setplugstate "15" $15 off="0" on="1" setplugstate "16" $16 off="0" on="1" expect "ics8064> " } script on_ranged { send "close %s\n" expect "ics8064> " } script off_ranged { send "open %s\n" expect "ics8064> " } script cycle_ranged { send "open %s\n" expect "ics8064> " delay 4 send "close %s\n" expect "ics8064> " } } powerman-2.3.5.orig/etc/ilom.dev0000644000000000000000000000250111135425557013417 0ustar # # Sun Integrated Lights Out Management card # # Verified on: # Sunfire X4140 SP firmware 2.0.2.3 build 29049, SP file system 0.1.16 # Sunfire X4550 SP firmware 2.0.2.5 build 32394, SP file system 0.1.16 # # Examples: # over SER MGT RJ-45 (serial via cyclades) # device "ilom" "ilom" "usr-ts:7016" # over SER MGT RJ-45 (direct serial) # device "ilom" "ilom" "/dev/ttyS1" "9600,8n1" # over NET MGT RJ-45 (network over ssh) # device "ilom" "ilom" "ssh -o StrictHostKeyChecking=no -lroot sol|&" # specification "ilom" { timeout 10 plug name { "1" } # login script handles three cases: # 1) serial port, already logged in # 2) serial port, not logged in # 3) ssh, enter password only script login { send "\n" expect "->|Password:|login: " send "root\n" expect "->|Password: " send "changeme\n" expect "->" } script status { send "show -d properties /SYS\n" expect "(POWERSTATE|power_state)[^Oo]+(On|Off|on|off)" setplugstate "1" $2 on="On|on" off="Off|off" expect "->" } script on { send "start -script /SYS\n" expect "->" } script off { send "stop -script -force /SYS\n" expect "->" } script cycle { send "stop -script -force /SYS\n" expect "->" delay 4 send "start -script /SYS\n" expect "->" } script reset { send "reset -script /SYS\n" expect "->" } } powerman-2.3.5.orig/etc/dli.dev0000644000000000000000000000234211015104475013220 0ustar # Support for 8-port Digital Loggers, Inc. models: # # www.digital-loggers.com/lpc.html # www.digital-loggers.com/epcr2.html # www.digital-loggers.com/din.html # # Powerman.conf should look something like this: # include "/etc/powerman/dli.dev" # device "lpc" "dli" "/usr/sbin/httppower -u http://192.168.0.100 |&" # node "p[1-8]" "lpc" "[1-8]" # specification "dli" { timeout 30 plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { expect "httppower> " send "auth admin:admin\n" expect "httppower> " } script logout { send "quit\n" } script status_all { send "get\n" expect "Controller:" foreachplug { expect "Outlet ([1-8]+)[^O]*(ON|OFF)" setplugstate $1 $2 on="ON" off="OFF" } expect "httppower> " } script on { send "post outlet %s=ON\n" expect "httppower> " } script off { send "post outlet %s=OFF\n" expect "httppower> " } script cycle { send "post outlet %s=OFF\n" expect "httppower> " delay 4 send "post outlet %s=ON\n" expect "httppower> " } script cycle_all { foreachplug { send "post outlet %s=OFF\n" expect "httppower> " } delay 4 foreachplug { send "post outlet %s=ON\n" expect "httppower> " } } } powerman-2.3.5.orig/etc/apcpdu3.dev0000644000000000000000000001011111025537070014002 0ustar # # Derived from apcpdu.dev, but updated for new firmware # # - Firmware: APP v3.3.3 / AOS v3.3.4 # specification "apcpdu3" { timeout 10 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" } script login { expect "\n" expect "\rUser Name : " send "apc\r\n" expect "\rPassword : " send "apc\r\n" expect "> " send "1\r\n" # device manager menu expect "> " send "2\r\n" # outlet management expect "> " send "1\r\n" # Outlet Control/Configuration expect "to continue..." send "\r\n" expect "> " } script logout { send "\033" expect "> " send "\033" expect "> " send "4\r\n" } script status_all { send "\r\n" # refresh send "\r\n" # to continue... (after plug 22) foreachplug { expect "([0-9])*[^\r\n]*(ON|OFF)\r\n" setplugstate $1 $2 on="ON" off="OFF" } expect "> " } script on { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "1\r\n" # immediate on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } script on_all { send "25\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "4\r\n" # delayed on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } script off { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "2\r\n" # immediate off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } script off_all { send "25\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "5\r\n" # delayed off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } # If outlet is initially off, "immediate reboot" (4) will leave it off. # This doesn't match PowerMan's semantics for cycle, therefore do explicit # immediate off + immediate on. script cycle { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "2\r\n" # immediate off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" } script cycle_all { send "25\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "7\r\n" # cancel any pending delays expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "5\r\n" # delayed off expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " delay 4 send "4\r\n" # delayed on expect "to cancel : " send "YES\r\n" expect "to continue..." send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "to continue..." send "\r\n" expect "> " } } powerman-2.3.5.orig/etc/swpdu.dev0000644000000000000000000000220311015104475013606 0ustar # # Appro SWPDU # # swpdu.dev,v 1.0 2007/11/07 23:50:34 kolee APPRO # /etc/powerman/swpdu.dev,v # specification "swpdu" { timeout 20.0 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" "46" "47" "48" } script ping { send "\r\n" expect "swpdu> " } script login { # expect "Password:" # send "111111\r\n" send "\r\n" expect "swpdu> " send "exprange on\r\n" expect "swpdu> " } script logout { send "exprange off\r\n" expect "swpdu> " } script status_all { send "status\r\n" foreachplug { expect "port([0-9]+)[^\n]*(on|off|unknown|^n)" setplugstate $1 $2 on="on" off="off" } expect "swpdu> " } script status { send "status %s\r\n" expect "port([0-9]+)[^\n]*(on|off|unknown|^n)" setplugstate $1 $2 on="on" off="off" expect "swpdu> " } script on { send "on %s\r\n" expect "swpdu> " } script off { send "off %s\r\n" expect "swpdu> " } script cycle { send "cycle %s\r\n" expect "swpdu> " } } powerman-2.3.5.orig/etc/powerman.dev0000644000000000000000000000211411140656506014303 0ustar # # $Id: powerman.dev 1110 2009-01-30 20:04:22Z garlick $ # # PowerMan script for controlling another PowerMan daemon, e.g. # # device "cartman" "powerman" "cartman.llnl.gov:10101" # node "b[1-4]" "cartman" "b[1-4]" # # N.B. master powerman.conf must contain the union of all slave # powerman.conf plugs, or status_all script will not work. # specification "powerman" { timeout 100.0 script login { expect "powerman> " send "exprange\r\n" expect "105 Hostrange expansion ON\r\npowerman> " } script logout { send "quit\r\n" } script status_all { send "status\r\n" foreachplug { expect "303 ([^:]+): (off|on|unknown)\r\n" setplugstate $1 $2 off="off" on="on" } expect "powerman> " } script on_ranged { send "on %s\r\n" expect "powerman> " } script off_ranged { send "off %s\r\n" expect "powerman> " } script cycle_ranged { send "cycle %s\r\n" expect "powerman> " } script reset_ranged { send "reset %s\r\n" expect "powerman> " } } powerman-2.3.5.orig/etc/lom.dev0000644000000000000000000000226211151356676013255 0ustar # # Sun LOM # # Verified on (only via ssh so far): # Sun v40, Version V2.1.0.16 # # Examples: # over SER MGT RJ-45 (serial via cyclades) # device "lom" "lom" "usr-ts:7016" # over SER MGT RJ-45 (direct serial) # device "lom" "lom" "/dev/ttyS1" "9600,8n1" # over NET MGT RJ-45 (network over ssh) # device "lom" "lom" "ssh -o StrictHostKeyChecking=no -ladmin sol|&" # specification "lom" { timeout 10 plug name { "1" } # login script handles three cases: # 1) serial port, already logged in # 2) serial port, not logged in # 3) ssh, enter password only script login { send "\n" expect "\\$|assword:|login: " send "admin\n" expect "\\$|assword: " send "admin\n" expect "\\$" } script status { send "platform get power state\n" expect "(On|Off)" setplugstate "1" $1 on="On" off="Off" expect "\\$" } script on { send "platform set power state -W -f -q on\n" expect "\\$" delay 3 } script off { send "platform set power state -W -f -q off\n" expect "\\$" delay 3 } script cycle { send "platform set power state -W -f -q off\n" expect "\\$" delay 4 send "platform set power state -W -f -q on\n" expect "\\$" delay 3 } } powerman-2.3.5.orig/etc/plmpower.dev0000644000000000000000000000153711031754257014331 0ustar # # Control Insteon/X10 devices via SmartLabs PLM 2412S using the plmpower # utility supplied with powerman, e.g. # # device "plm" "plmpower" "/usr/sbin/plmpower -d /dev/ttyS1 |&" # # Plug names are one of: # - Insteon addresses printed on device xx.xx.xx, e.g. "A4.02.B3" # - X10 address [A-P][1-16], e.g. "G13" # # N.B.: X10 devices will always show power status "unknown". # specification "plmpower" { timeout 10 script login { expect "plmpower> " } script logout { send "quit\n" } script status { send "status %s\n" expect "([^:]+): ([^\n]+)\n" setplugstate $1 $2 off="00" on="[0-9A-F]{2}" expect "plmpower> " } script on { send "on %s\n" expect "plmpower> " } script off { send "off %s\n" expect "plmpower> " } script cycle { send "off %s\n" expect "plmpower> " delay 4 send "on %s\n" expect "plmpower> " } } powerman-2.3.5.orig/etc/wti-rps10.dev0000644000000000000000000000234711015104475014223 0ustar # # $Id: wti-rps10.dev 866 2008-05-21 20:42:37Z garlick $ # # WTI RPS-10 # # Master configured for 9600 baud: # if 9600 - wait 0.5 sec before sending next command # if 2400 - wait 1.5 sec before sending next command # Format of commands is ^X^X^B^X^X^B^X^XPC\r # where P is port number (0-9) and C is command (0,1,T,?) # # N.B. The 0.5 sec delays mentioned in the documentation don't seem to be # needed on my setup... # specification "wti-rps10" { timeout 5 plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" } script login { delay 2 } script status { send "\030\030\002\030\030\002\030\030%s?\r" expect "Plug ([0-9]) (On|Off)" setplugstate $1 $2 off="Off" on="On" expect "Complete" } script on { send "\030\030\002\030\030\002\030\030%s1\r" expect "Plug [0-9] On" expect "Complete" } script off { send "\030\030\002\030\030\002\030\030%s0\r" expect "Plug [0-9] Off" expect "Complete" } # The T command is dip switch configurable for 5 or 10 second delay # Shorter delays have to be done in s/w. script cycle { send "\030\030\002\030\030\002\030\030%s0\r" expect "Plug [0-9] Off" expect "Complete" delay 4 send "\030\030\002\030\030\002\030\030%s1\r" expect "Plug [0-9] On" expect "Complete" } } powerman-2.3.5.orig/etc/ibmbladecenter.dev0000644000000000000000000000220211015104475015403 0ustar # # Originally ibmbladecenter.dev. RJG, 11/17/04 # # Ref: Command-Line Interface Reference Guide for # IBM BladeCenter Management Module, BladeCenter T Management Module, # Advanced Management Module, BladeCenter T Advanced Management Module. # specification "ibmbladecenter" { timeout 15 plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" } script login { expect "username: " send "USERID\r\n" expect "password: " send "PASSW0RD\r\n" expect "system> " send "telnetcfg -t 0 -T mm[1]\r\n" expect "OK\r\nsystem> " } script logout { send "exit\r\n" } script status { send "power -state -T blade\[%s\]\r\n" expect "(On|Off)\r\nsystem> " setplugstate $1 on="On" off="Off" } script on { send "power -on -T blade\[%s\]\r\n" delay 1 # settling time expect "OK\r\nsystem> " } script off { send "power -off -T blade\[%s\]\r\n" delay 5 # settling time expect "OK\r\nsystem> " } script cycle { send "power -off -T blade\[%s\]\r\n" expect "OK\r\nsystem> " delay 5 # settling time delay 4 send "power -on -T blade\[%s\]\r\n" expect "OK\r\nsystem> " } } powerman-2.3.5.orig/etc/apc.dev0000644000000000000000000001021211015104475013206 0ustar # # $Id: apc.dev 866 2008-05-21 20:42:37Z garlick $ # # APC MasterSwitch Plus # # Firmware rev may not be the best indicator of whether you need "apc" # or "apcnew" scripts. We have one data point for "apc": # # - Firmware: APP v2.0.0 / AOS v2.5.4 # specification "apc" { timeout 10 plug name { "1" "2" "3" "4" "5" "6" "7" "8" } script login { expect "\n" expect "User Name : " send "apc\r\n" expect "Password : " send "apc\r\n" expect "> " send "1\r\n" # device manager menu expect "> " send "1\r\n" # select master switch plus 1 expect "> " } script logout { send "4\r\n" } script status_all { send "\r\n" # refresh foreachplug { expect "([0-9]+)-[^\n]*(ON|OFF)[^\n]*\r\n" setplugstate $1 $2 on="ON" off="OFF" } expect "> " } script on { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "8\r\n" # cancel any pending delays expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script on_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "8\r\n" # cancel any pending delays expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script off { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "8\r\n" # cancel any pending delays expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "3\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script off_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "8\r\n" # cancel any pending delays expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "3\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } # If outlet is initially off, "immediate reboot" (4) will leave it off. # This doesn't match PowerMan's semantics for cycle, therefore do explicit # immediate off + immediate on. script cycle { send "%s\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "8\r\n" # cancel any pending delays expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "3\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } script cycle_all { send "9\r\n" expect "> " send "1\r\n" # select outlet control expect "> " send "8\r\n" # cancel any pending delays expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "3\r\n" # immediate off expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " delay 4 send "1\r\n" # immediate on expect "Enter 'YES' to continue or to cancel : " send "YES\r\n" expect "Success\r\n" send "\r\n" expect "> " send "\033" expect "> " send "\033" expect "> " } } powerman-2.3.5.orig/AUTHORS0000644000000000000000000000011311111411740012230 0ustar Andrew Uselton Jim Garlick Al Chu powerman-2.3.5.orig/ChangeLog0000644000000000000000000005245411172212766012767 0ustar 2009-04-17 Jim Garlick * : tag powerman-2.3.5 * scripts/stonith-powerman : Test with heartbeat and reinstate in the powerman package now that it works. 2009-04-08 Albert Chu * etc/ipmipower.dev: Add comment about why cycle is implemented as "off,delay,on" instead of using a normal IPMI cycle. 2009-04-01 Jim Garlick * test/t58.conf, test/t59.conf : Use listen directive instead of port directive to alter the daemon port. * man/powerman.conf.5.in : Document listen directive. Deprecated port directive was not documented. * src/client.c : Bind daemon to all configured host:port tuples. * src/parse_util.[ch] : Allow multiple listen directives to specify host:port tuples for daemon to listen on. If none are configured, use default of "127.0.0.1:10101". NOTE: we used to default to "0.0.0.0:10101"! See https://bugs.launchpad.net/bugs/337226. * src/parse_tab.y, src/parse_lex.l : Deprecate "port" directive. Add "listen" directive. USER NOTE: config file syntax change! * src/powerman.h : Use numerical address for DFLT_HOSTNAME. 2009-03-31 Jim Garlick * etc/Makefile.am, man/powerman-devices.7.in, etc/hpilo.dev, etc/hpmpblade.dev, etc/hpmpcell.dev, etc/hpmp.dev, etc/hpmpdome.dev : New support for HP systems [Bjorn Helgaas]. 2009-03-29 Jim Garlick * src/powerman.c : Fix -h option parsing so port is optional. 2009-03-20 Albert Chu * man/powerman-devices.7.in: Re-add IPMI/ipmipower section. Update with new FreeIPMI information and troubleshooting information. 2009-03-17 Albert Chu * man/powerman.dev.5.in: Fix spelling typo (seperated -> separated). 2009-03-09 Jim Garlick * scripts/powerman.init.in : Change log_init() message on Red Hat from e.g. "Starting Powerman: powermand" to "Starting Powerman: ", per chaos bug 710. 2009-02-25 Jim Garlick * etc/lom.dev : Added initial support for Sun LOM. * test/t51, test/lom.c : Test for above. 2009-02-12 Jim Garlick * etc/bashfun.dev : Small tweak to get working on AIX. 2009-02-09 Jim Garlick * : tag powerman-2.3.4 2009-01-30 Jim Garlick * etc/powerman.dev : Revert change on 2008-04-25 to drop status_all. Document that master must powerman.conf control all the plugs in the slave powerman.conf's. * test/t36 : Alter test to check that a remapped superset works, not a subset. 2009-01-26 Jim Garlick * etc/bashfun.dev : This wasn't working. Simplify and fix prompt expects so they don't depend on root's prompt initially being a '#'. * test/t50 : New test for above. * test/Makefile.am : Add -L to cli target so we can find libpowerman. 2009-01-20 Jim Garlick * : Continued audit for Debian [Arnaud Quette] - fix typo in man/powermand.8.in - add config file path to scripts/powerman.init.in so it properly handles startup when config file is missing - install sample powerman.conf as powerman.conf.example 2009-01-09 Jim Garlick * : tag powerman-2.3.3 2008-12-21 Jim Garlick * man/*.\d.in : Standardize headers, and fix typos etc. 2008-12-02 Jim Garlick * : tag powerman-2.3.2 * src/daemon.[ch], src/powermand.c: Fix pidfile management. * man/* : Fix misc. typos. * lib/libpowerman.c : Fix a use-after-free bug in _list_free(). * test/t49* : Use iterator functions. 2008-12-01 Jim Garlick * : tag powerman-2.3.1 * man/libopwerman.3.in, man/vpcd.8.in : New. * man/* : Process through autoconf to get version and path substitution. Normalize headers and SEE ALSO section. * test/t49* : Simple test of libpowerman API using cli.c. * test/cli.c : Modified to reflect API changes. * lib/libpowerman.[ch] : Represent all server errors in pm_err_t. Add a flags argument to pm_connect() and a flag for IPv6 only. * powerman.spec : Add devel and libs subpackages. * lib/* : Move lib sources from src. * : Continued audit for Debian [Arnaud Quette] - rename autoreconf to autogen.sh, I misunderstood previous suggestion. - drop sysconfdir from libpowerman.pc.in - install powerman.conf.example as the actual config file - install vpcd as part of the base package 2008-11-26 Jim Garlick * scripts/Makefile.am : Create /var/run/powerman during install. * src/powermand.c, src/daemon.c : Don't chdir to /var/run/powerman in daemon initialization. Let the init script do that for us. Also don't attempt to create /var/run/powerman. * src/powermand.c : Drop --force-notroot option and do not insist that the daemon run as root. * config/ac_runas.m4 : New. * src/Makefile.am : Install pkg-config file and header. * config/ac_pkgconfig.m4 : New [Arnaud Quette]. * src/libpowerman.pc.in : New [Arnaud Quette] * configure.ac : Add support for above. 2008-11-25 Jim Garlick * : Add some missing copyright headers. * src/libpowerman.[ch] : Some refactoring and cleanup. 2008-11-20 Jim Garlick * : Audit for Debian [Arnaud Quette] - rename bootstrap to autoreconf (convention) - remove htdocs/powerman47.jpg (redistribution rights) - fix AUTHORS typo - remove comments from man pages - add man pages for httppower, plmpower - make pm man page an alias for powerman man page 2008-11-16 Jim Garlick * src/libpowerman.[ch] : New. * bootstrap, autoconf.ac, src/Makefile.am : Add infrastructure for libtoolized powerman library. 2008-11-12 Jim Garlick * : tag powerman-2.3 * etc/powerman.conf.example : Renamed from powerman.conf. 2008-11-11 Jim Garlick * parse_util.c : Declare config invalid if no nodes are defined. * etc/ibmh8.dev : Removed. 008-11-07 Jim Garlick * src/parse_tab.y : Relax order of types of config entries. * etc/powerman.conf : Config file example. 2008-11-06 Jim Garlick * scripts/powerman.init.in : Replace old powerman.init with Chris Dunlap's portable init script (lifted fron ConMan). * powerman.spec : Make crufty %post, %preun, %postun scripts look more like ConMan's. 2008-11-05 Jim Garlick * scripts/Makefile.am : Fix a typo in install command line that broke on Solaris. 2008-11-04 Jim Garlick * src/device.c : Fix memory leak [Scott Burns]. * etc/cyclades-pm20.dev : New [Scott Burns]. * etc/cyclades-pm[8,10,42].dev : Added temp script [Scott Burns]. * test/t46, test/cyclades.c : Added PM20. 2008-11-03 Jim Garlick * test/vpcd.c : Fix logic error. 2008-10-26 Jim Garlick * test/vpcd.c : Add -p port option and code to accept a connection on the specified socket. * test/t48 : Simple test using socket between powermand and vpcd. * src/powermand.c, src/client.[ch] : Added --one-client option for testing. 2008-10-22 Jim Garlick * src/client.c : Additional changes for IPv6 support. 2008-10-21 Jim Garlick * src/client.c, src/powermand.c, src/daemon.c, src/powerman.c, src/device_tcp.c : Added preliminary IPv6 support. 2008-10-20 Jim Garlick * : tag powerman-2.2.2 * src/client.c : Revert change to client.c pending debug (r1039:1049). * etc/Makefile.am : Add cyclades-pm42.dev to installed dev scripts. 2008-10-15 Jim Garlick * src/client.c : Use getaddrinfo() instead of gethostbyaddr() to prepare for ipv6 support. 2008-10-10 Jim Garlick * etc/cyclades-pm42.dev : New. * test/cyclades.c, test/t46* : Test for above. 2008-09-15 Jim Garlick * : tag powerman-2.2.1 * powerman.spec : Handle case when %chaos and %rhel are both defined. 2008-08-27 Jim Garlick * : tag powerman-2.2 2008-08-21 Jim Garlick * test/baytech.c, test/t21*, test/t22* : Also test rpc3-de model. 2008-08-18 Jim Garlick * etc/ipmipower.c, test/t47 : Add ipmipower test [Al Chu]. * etc/ipmipower.dev : Use \n to terminate commands instead of \r. * etc/hp3488.dev, etc/ics8064.dev, etc/powerman.dev, etc/ipmipower.dev : Define only 'ranged' version of scripts. * src/device.c : Use ranged version of scripts instead of singlet versions if defined. Allow only the ranged script to be defined. * src/device.c, src/powermand.c, src/powerman.c, test/t?? : Add -Y,--short-circuit-delay option to expedite testing. * etc/icebox.dev, etc/icebox3.dev : Drop status_soft_all scripts. * tests/* : Drop soft power status related tests. * src/powerman.c, src/client_proto.h, src/client.c, src/parse_tab.y, src/parse_lex.l : Drop --soft and --soft-all queries and status_soft, status_soft_all scripts. 2008-07-27 Jim Garlick * etc/cyclades-pm10.dev, etc/cyclades-pm8.dev : Simplified. * test/cyclades.c, test/t46 : Add cyclades tests. 2008-07-26 Jim Garlick * test/phantom.c, t45 : Add phantom tests. * etc/phantom.dev : Make it work for v3 and v4. * etc/phantom4.dev : Removed. * config/ac_curses.m4 : Added curses config check, needed by phantom. 2008-07-05 Jim Garlick * src/xread.c : Add xreadline(). 2008-07-03 Jim Garlick * etc/ilom.dev, test/ilom.c, test/t44 : Added reset support. 2008-07-02 Jim Garlick * etc/ilom-inline.dev : Removed. * etc/ilom.dev : Added, new and improved. * test/t44, test/ilom.c : Test for above. * src/devices.c : Call device disconnect method during device teardown, which occurs as a result of receiving a SIGINT. 2008-06-30 Jim Garlick * src/plmpower.c : Fix compilation #if !HAVE_GETOPT_LONG. * test/t25.conf : Relax timeout for slow AIX test system. * src/device.c : Use actual number of bytes in buffer instead of maximum expanded size of buffer to copy buffer contents into for regex match. This 64k memory allocation would fail on AIX in t35-t36. * src/xpty.c : xcfmakeraw(): check properly for tcsetattr errors(). * src/xpty.c : Avoid cfmakeraw() on AIX. This fixed failures on tests t21-t24,t27-t28,t38. * src/powerman.c : Stop leaking a file descriptor for duped stderr in _connect_to_server_pipe(). 2008-06-29 Jim Garlick * src/httppower.c, src/Makefile.am, config/ac_readline.m4, configure.ac : Drop readline dependency. * test/dli.c, test/t42, test/t43 : Test for DLI LPC device. 2008-06-28 Jim Garlick * src/plmpower.c : Tighten up PLM synchronization and clean up: - Send X10 commands 3 times (override with -x option) - Handle PLM-not-ready NAK properly. - Timeout/retry (1s) insteon packets (override timeout with -t option). - Added ping command. - Rename --testmode,-t to --testmode,-T. - Drop monitor command. * etc/plmpower.dev : Remove delays. 2008-06-27 Jim Garlick * src/plmpower.c : Correct serial port initialization. * etc/plmpower.dev : Add 1 sec delay between commands. 2008-06-24 Jim Garlick * src/plmpower.c : Added -t option. * test/t41 : Test for above. 2008-06-23 Jim Garlick * htdocs/supported.html : Add hp3488, ics8064, plmpower, swpdu. * etc/ipmipower.dev : Change status scripts to not expect local command echo since we turned that off, and to expect \r\n rather than $ when setting plug state. * src/xregex.c, test/tregex.c : Drop NOT_BOL flag from xregexec, so ^ is allowed but $ still isn't. * etc/plmpower.dev : Add PLM reset to login script, in case someone ran 'monitor' and left PLM in monitor mode. * src/plmpower.c : Add 'monitor' command. 2008-06-22 Jim Garlick * src/plmpower.c, etc/plmpower.dev : Add support for SmartLabs PLM 2412S controller, controlling Insteon and X10 devices. 2008-06-21 Jim Garlick * powerman.spec: Test %{?fedora} not %{?fc9}, %{?chaos} not %{?ch4}. Add test for %{?rhel}. * etc/ics8064.dev, etc/hp3488.dev : New gpib-utils devices. * tests/t37-t40, tests/gpib.c : Tests for above. * test/t32.exp : Added missing file. * test/icebox.c : Fix incorrect plug array declaration. 2008-06-19 Jim Garlick * etc/powerman.dev : Implement ranged scripts. * test/t35 : Test for powerman vs powerman configuration. 2008-06-18 Jim Garlick * test/icebox.c, t29 thru t34 : Tests for icebox support. * etc/icebox3.dev : Make it work for v3 and v4. * etc/icebox4.dev : Removed. * etc/mcr.conf : Test harness version of mcr powerman.conf. * examples/* : Removed as the examples were out of date and there are now plenty in test/*.conf. * src/xpty.[ch], src/device_pipe.c, src/device_serial.c, src/device_tcp.c, src/client.c : Factor out nonblock_set() and nonblock_clr() functions. 2008-06-18 Albert Chu * etc/ipmipower.dev: Fix tabbing. 2008-06-18 Jim Garlick * : tag powerman-2.1 * powerman.spec: Add fc9 stanza. 2008-06-17 Jim Garlick * src/device.c : Fix bug where expired delays could be extended by the device timeout. * test/baytech.c : Fix bug in plug array declarations. * test/tregex.c : Initialize error.c for out of memory case. * src/poweramn.c : Make argument handling fully backwards compat with powerman-2.0 and earlier. 2008-06-16 Jim Garlick * etc/apcpdu3.dev : Fixed problem with intermittent failures of query script. * etc/apcpdu.dev : Backport change from above. 2008-06-13 Jim Garlick * test/baytech.c : Add classic baytech rpc3 support. * test/t25, test/t26 : Investigate some funny business with delay handling. * test/27, test/28 : Check classic baytech functionality. 2008-06-12 Jim Garlick * test/baytech.c : New, Baytech emulator. * test/t21, test/t22 : Check basic baytech-rpc3-nc functionality. * test/t23, test/t24 : Check basic baytech-rpc28-nc functionality. * src/regex.c : Refuse to compile regex > 256 bytes for portability. * etc/baytech-rpc28-nc.dev : Eliminate delays from initial handshake. * test/tregex.c : Test some more assumptions about how regexes work. 2008-06-11 Jim Garlick * src/hostlist.[ch], src/list.[ch], src/cbuf.[ch] : Update to latest versions from lsd-tools trunk. * test/t17.conf, test/t18.conf : Increase timeouts so tests can succeed on slower systems. * src/powerman.c : Append any "dangling" arguments to the target list of the last command queued. 2008-06-10 Jim Garlick * src/powerman.c : Misc cleanup: - make server_fd not global - handle --telemetry and --exprange like other commands by enqueuing them at the head of the command queue. - drop hard coded daemon and config file locations. - add --ignore-errs option. * test/* : Lots of new tests. * device_pipe.c : Make pty connection use raw mode. * src/xregex.c : Pass REG_NOTBOL and REG_NOTEOL to regexec. The end of line ($) and beginning of line (^) operators cannot match determinstically the way powerman applies regexes to buffers repeatedly as they fill. * etc/baytech-rpc28-nc.dev : Replace use of end of line operator with full text of prompt. * config/x_ac_expand_install_dirs.m4 : New, borrow from munge. * src/Makefile.am : Drop command line CONFIG_DIR definition. * src/powermand.c : Construct default config_filename using X_SYSCONFDIR setting, and use directory based on X_LOCALSTATEDIR for run directory passed to daemon_init(). * src/daemon.c : Create rootdir if it doesn't exist. * src/device.c : Switch cbuf overwrite mode from NO_DROP to WRAP_MANY and make dropping characters non-fatal. * src/client.c : Switch client fd to blocking mode before writing exit response. 2008-06-09 Jim Garlick * src/powerman.c : Option changes: - change -q,--query option to -q,--query-all with no_arguments - add -Q,--query option with required_arguments - change -n,--node option to -n,--soft-all with no_arguments - add -N,--soft option with required_arguments - change -t,--temp option to -t,--temp-all with no_arguments - add -P,--temp option with required_arguments - change -b,--beacon option to -b,--beacon-all with no_arguments - add -B,--beacon option with required_arguments - change -d,--destination option to -h,--server-host - change -D,--device option to -d,--device-all with no_arguments - add -D,--device option with required_arguments * scripts/stonith : Reflect option changes above. * man/powerman.1 : Reflect option changes above. * src/powerman.c : Cleanup: - deprecate "off" and "on" program name support - abbreviate usage() message to only the most common options - allow multiple commands to be run in one invocation - add -Z,--dump-cmds option to list commands without executing * src/argv.c : Added argv_length(), argv_append(). * test/targv.c : Sanity check for argv.c. * test/* : Tests that exercise the work above. 2008-06-04 Jim Garlick * src/powermand.c : Fix signal handling in test (coprocess) mode. 2008-06-02 Jim Garlick * : tag powerman-2.0 * src/xregex.c : Allow main expression match information to be obtained. * src/device_pipe.c : Make forkpty() error fatal. * src/xpty.c : Call err_exit() not lsd_fatal_error() on error. 2008-06-01 Jim Garlick * src/xregex.c : Rework. * src/device.c, src/parse_tab.y : Rework regex calls. * src/device_private.h : Extract from device.h the stuff that should not be exposed to powermand.c. * : More general cleanup of header files, copyright block, etc.. * test/tregex.c, test/t05, test/t05.exp : Added tests for xregex.c. * test/vpcd.c : Remove pthreads support. * src/xpoll.c : Disable poll() on darwin. 2008-05-30 Jim Garlick * src/client.c : Allow instantiation with a single stdin/stdout client which causes daemon to terminate when it goes away. * src/powermand.c : Add --stdio and --force-notroot options. * src/powerman.c : Add --server-path and --config-path options which allow client and server to run together as coprocesses. * src/wrappers.c : Allow NULL ptyname argument to Forkpty(). * src/error.c : Removed file::line from lsd error messages. * test/* : Add integrated tests. * configure.ac, src/Makefile.am, src/parse_* : Disable fatal configure error if flex is not found. Check in lex/yacc build products so powerman can be built without those. * wrappers.[ch] : Many wrappers dropped, others renamed and split off to x*.[ch] files. 2008-05-23 Jim Garlick * autoconf.ac, src/powerman.c : Use HAVE_GENDERS_H for . * autoconf.ac, src/wrappers.c : Use HAVE_PTY_H for . 2008-05-22 Jim Garlick * parse_tab.y, parse_lex.l, Makefile.am : Use default automake rules for lex/yacc and rename files so they fit. * parse_tab.y, parse_lex.l : Removed deprecated config file syntax, which emitted warnings since 1.0.16 (Jan 2002). Reformatted some lex code for readability. * autoconf.ac : Require flex as scaner is (currently) flex specific. * autoconf.ac, config/ac_genders.m4, src/Makefile.am, powerman.c : Add --genders option. * src/powerman.c, src/powermand.c : Handle missing getopt_long(). 2008-05-21 Jim Garlick * ChangeLog-1.0 : Updated to reflect trunk (1.0.32+) * htdocs, scripts/stonith-powerman, man/powerman-devices.7, etc/*.dev, NEWS : Updated [copy from trunk]. * config/ac_curl.m4, config/ac_readline.m4, config/ac_httppower.m4, src/Makefile.am, src/httppower.c : Support httppower [port from trunk]. * src/parse.lex : Update white space rule [port from trunk]. * src/parse.y, src/wrappers.c, src/client.c, src/powerman.c, src/powermand.c : Include limits.h. [port from trunk]. * config/ac_forkpty.m4, src/device_pipe.c, src/wrappers.[ch] : Provide substitute forkpty() if missing (via Forkpty() wrapper). * src/client.c, src/powerman.c, src/powermand.c, Makefile.am : Stop defining POWERMAN_VERSION in CFLAGS and use VERSION from config.h. * config/ac_wrap.m4, src/parse_util.c, src/client.c : Make tcp_wrappers optional. * man/powerman.1.in, config/ac_debug.m4, config/ac_genders.m4, config/ac_static_modules.m4, config/ac_powerman_module_dir.m4, configure.ac, src/Makefile.am, src/powerman.c, src/ltdl.[ch], src/powerman_options.h, src/powerman_options_genders.c : Drop modules, genders support (temporarily?) to focus on portability. * src/device.c, src/debug.[ch], src/wrappers.[ch], src/device_tcp.c : Fix compiler warnings. * src/wrappers.[ch] : Add Dprintf() wrapper to avoid glibc dependency. Add timersub() and timeradd() if undefined. 2006-11-16 Jim Garlick * ChangeLog : Start over for 2.0 branch. Old moved to ChangeLog-1.0. * etc/bashfun.dev : New. 2006-11-15 Albert Chu * : Added autoconf/automake support globally. * man/powermand.1 : Renamed to powermand.8. Adjust text appropriately. * man/powerman.1.in, powerman.conf.5, powerman.dev.5: Adjust SEE ALSO section for change in section for powermand. * src/parse.lex (yywrap): Add function to remove need to link to -lfl. * powerman.spec.in: Add man8 directory. * src/*.c : Load config.h appropriately. * src/config.h: Remove file. * src/powerman_options.h, src/powerman_options_genders.c, src/powerman.c, man/powerman.1.in: Add module support and -g support. * powerman.spec.in: Update with genders module. * : branched at 1.0.26+ powerman-2.3.5.orig/NEWS0000644000000000000000000002136611172212766011712 0ustar ========================================================================= Release Notes for PowerMan version 2.3.5 17 Apr 2009 ========================================================================= * Deprecated undocumented powerman.conf port directive. * Added powerman.conf listen directive to configure which interfaces and ports the server listens on. Make the default localhost:10101. * Add support for HP integrated power control devices [Bjorn Helgaas] * Add support for Sun LOM. * Misc. documentation improvements * Add heartbeat STONITH plugin. ========================================================================= Release Notes for PowerMan version 2.3.4 09 Feb 2009 ========================================================================= * Fix powerman-controlling-powerman config so that status command is fast for large configs again. * Fix "bashfun" device script and add regression test. * Various changes coming from Debian audit [Arnaud Quette]. ========================================================================= Release Notes for PowerMan version 2.3.1 01 Dec 2008 ========================================================================= * Initial powerman client API. * Run the powerman daemon (and all coprocesses) as 'daemon' by default instead of root. To override, set USER=root or other user in /etc/sysconfig/powerman. * New man pages for httppower, plmpower, libpowerman, vpcd. * Include vpcd in the dist. * Various changes coming from Debian audit [Arnaud Quette]. ========================================================================= Release Notes for PowerMan version 2.3 12 Nov 2008 ========================================================================= * Make init script work on Solaris. * IPv6 support. * Include example powerman.conf file (/etc/powerman/powerman.conf.example) * Added support for Cyclades PM20, PM42. ========================================================================= Release Notes for PowerMan version 2.2 27 Aug 2008 ========================================================================= * Send a SIGINT to coprocesses rather than just closing file descriptors during powermand shutdown. This is required to terminate an ssh client running in coprocess mode. * Make it possible to only define the _ranged version of scripts. Scripts are selected using the following precedence: _all, _ranged, singlet. * Drop "soft power status" support. This allowed iceboxes to detect whether a node was powered up or not, independently of plug state. * [ipmipower] Drop _all and singlet version of scripts. * [ilom] Revised Sun Integrated Lights Out Management support to work over ssh and serial. Dropped shared console/serial "ilom-inline" support. * [icebox3] Now supports both v3 and v4 Ice Box. Users of icebox4 should change their device types to icebox3 in powerman.conf. * [plmpower] Added support for controlling Insteon/X10 devices via SmartLabs PLM 2412S. * [hp3488] Added support for modular GPIB-based HP 3488A switch/control unit via gpib-utils project. * [ics8064] Added support for VXI-11-based ICS 8064 16-port relay unit via gpib-utils project. * [powerman] Improved efficiency of powerman-controlling-powerman configurations, when one powerman controls a subset of the plugs of another powerman through the use of _ranged scripts. * Enhanced integrated test suite. Note: tests all pass on AIX now. ========================================================================= Release Notes for PowerMan version 2.1 18 Jun 2008 ========================================================================= * Client overhaul. * [apcpdu3] Fix intermittent query failures. * Fixed off by one bug in server that allowed some delays in dev scripts to take longer than programmed. * Use raw mode in pipe (|&) connections to avoid local tty echo. * Run server in /var/run/powerman rather than /etc/powerman. Create this directory if it doesn't exist. * Enhanced integrated test suite. Note: all tests do not currently pass on AIX. ========================================================================= Release Notes for PowerMan version 2.0 01 Jun 2008 ========================================================================= * Autoconf/automake integration. * Integrated test suite. * Portability to Solaris, AIX, and OS/X. * Support for selecting power control targets using genders (-g option). * Cleanup and refactoring. ========================================================================= Release Notes for PowerMan version 1.0.32 24 Jan 2008 ========================================================================= * Support for new apc firmware (apcpdu3.dev) [Trent D'Hooge] * Added httppower utility for interfacing to power controllers that are exclusively web-based. * Support for Digital Loggers, Inc. power controllers. * Support for APPRO power controller. ========================================================================= Release Notes for PowerMan version 1.0.31 20 Oct 2007 ========================================================================= (Includes changes in 1.0.29 and 1.0.30) * Support SUN ILOM inline with serial console, i.e. device "ilom25" "ilom-inline" "/usr/bin/conman -Q -j ilc25 |&" * Handle config files with embedded carriage returns [Trent D'Hooge and Todd Heer]. * Ipmipower device script tuning [Al Chu]. * Minor build/packaging tweaks for building under mock, etc. ========================================================================= Release Notes for PowerMan version 1.0.28 07 May 2007 ========================================================================= * Increase "cycle" delays from 2s to 4s on all devices that implement cycle as an explicit on,delay,off. ========================================================================= Release Notes for PowerMan version 1.0.27 24 Apr 2007 ========================================================================= * Add heartbeat stonith module. * Fix bug in baytech-rpc28-nc device support that affected plugs > 10. ========================================================================= Release Notes for PowerMan version 1.0.26 21 Dec 2006 ========================================================================= * Support 8-port APC AP7900 and likely AP7901, AP7920, and AP7921. [Martin Petersen] * Work around a bug that causes baytech rpc3's to resturn some plugs as status "unknown" on login timeout/reconnect. * Add ranged power control support for faster power control w/ ipmipower. ========================================================================= Release Notes for PowerMan version 1.0.25 16 Aug 2006 ========================================================================= * Support newer baytech RPC-3 firmware. * Support icebox v4 [Jarod Wilson] ========================================================================= Release Notes for PowerMan version 1.0.24 30 May 2006 ========================================================================= * Telnet state machine now works with Digi terminal server in telnet mode and logs ignored telnet option requests. * Several powerman.conf examples are now included in the RPM doc area. * Handle expansion of suffixed host ranges, e.g. "[00-26]p" [Mark Grondona] * Fix minor memory leaks and unchecked function return values found by Coverity. * New powerman.dev(5) man page documenting device file syntax. * Support serial device baud rates up to 460800 baud if system does. * Minor tweaks to spec file for Fedora Extras [Ben Woodard]. * Fix for broken P0|P1 in Rackable Phantom 4.0 firmware (phantom4.dev). * Add support for IBM BladeCenter chassis (ibmbladecenter.dev) [Robin Goldstone]. * Add support for ComputerBoards CB7050 (cb-7050.dev). * Add support for Cyclades PM10 (cyclades-pm10.dev) [Trent D'Hooge]. ========================================================================= Release Notes for PowerMan version 1.0.23 16 Feb 2006 ========================================================================= * Fix for compilation on Fedora Core 4 [Ben Woodard]. * Spec file changes for Fedora Extras submission [Ben Woodard]. ========================================================================= PowerMan version 1.0.22 12 Oct 2005 ========================================================================= * Bug fix for powerman -T dumps core on x86_64 [Thayne Harbaugh] * Add support for 24-port APC Switched Rack PDU (apcpdu.dev) [Makia Minnich].